mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-13 04:34:04 +02:00
Merge branch 'fixing_warnings' into 'master'
Fixing warnings See merge request GNOME/glib!622
This commit is contained in:
@@ -171,7 +171,7 @@ struct _GStaticRecMutex
|
|||||||
} unused;
|
} unused;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT }
|
#define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } }
|
||||||
GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
|
GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
|
||||||
void g_static_rec_mutex_init (GStaticRecMutex *mutex);
|
void g_static_rec_mutex_init (GStaticRecMutex *mutex);
|
||||||
|
|
||||||
|
@@ -907,7 +907,7 @@ struct _GRealPtrArray
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void g_ptr_array_maybe_expand (GRealPtrArray *array,
|
static void g_ptr_array_maybe_expand (GRealPtrArray *array,
|
||||||
gint len);
|
guint len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_ptr_array_new:
|
* g_ptr_array_new:
|
||||||
@@ -1166,7 +1166,7 @@ ptr_array_free (GPtrArray *array,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
g_ptr_array_maybe_expand (GRealPtrArray *array,
|
g_ptr_array_maybe_expand (GRealPtrArray *array,
|
||||||
gint len)
|
guint len)
|
||||||
{
|
{
|
||||||
/* Detect potential overflow */
|
/* Detect potential overflow */
|
||||||
if G_UNLIKELY ((G_MAXUINT - array->len) < len)
|
if G_UNLIKELY ((G_MAXUINT - array->len) < len)
|
||||||
@@ -1519,7 +1519,7 @@ g_ptr_array_insert (GPtrArray *array,
|
|||||||
if (index_ < 0)
|
if (index_ < 0)
|
||||||
index_ = rarray->len;
|
index_ = rarray->len;
|
||||||
|
|
||||||
if (index_ < rarray->len)
|
if ((guint) index_ < rarray->len)
|
||||||
memmove (&(rarray->pdata[index_ + 1]),
|
memmove (&(rarray->pdata[index_ + 1]),
|
||||||
&(rarray->pdata[index_]),
|
&(rarray->pdata[index_]),
|
||||||
(rarray->len - index_) * sizeof (gpointer));
|
(rarray->len - index_) * sizeof (gpointer));
|
||||||
|
@@ -177,8 +177,7 @@ static gchar *
|
|||||||
digest_to_string (guint8 *digest,
|
digest_to_string (guint8 *digest,
|
||||||
gsize digest_len)
|
gsize digest_len)
|
||||||
{
|
{
|
||||||
gint len = digest_len * 2;
|
gsize i, len = digest_len * 2;
|
||||||
gint i;
|
|
||||||
gchar *retval;
|
gchar *retval;
|
||||||
|
|
||||||
retval = g_new (gchar, len + 1);
|
retval = g_new (gchar, len + 1);
|
||||||
|
@@ -222,7 +222,7 @@ static void
|
|||||||
g_datalist_clear_i (GData **datalist)
|
g_datalist_clear_i (GData **datalist)
|
||||||
{
|
{
|
||||||
GData *data;
|
GData *data;
|
||||||
gint i;
|
guint i;
|
||||||
|
|
||||||
data = G_DATALIST_GET_POINTER (datalist);
|
data = G_DATALIST_GET_POINTER (datalist);
|
||||||
G_DATALIST_SET_POINTER (datalist, NULL);
|
G_DATALIST_SET_POINTER (datalist, NULL);
|
||||||
@@ -254,7 +254,7 @@ void
|
|||||||
g_datalist_clear (GData **datalist)
|
g_datalist_clear (GData **datalist)
|
||||||
{
|
{
|
||||||
GData *data;
|
GData *data;
|
||||||
gint i;
|
guint i;
|
||||||
|
|
||||||
g_return_if_fail (datalist != NULL);
|
g_return_if_fail (datalist != NULL);
|
||||||
|
|
||||||
@@ -1119,7 +1119,7 @@ g_datalist_foreach (GData **datalist,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GData *d;
|
GData *d;
|
||||||
int i, j, len;
|
guint i, j, len;
|
||||||
GQuark *keys;
|
GQuark *keys;
|
||||||
|
|
||||||
g_return_if_fail (datalist != NULL);
|
g_return_if_fail (datalist != NULL);
|
||||||
|
@@ -1729,7 +1729,7 @@ g_date_add_months (GDate *d,
|
|||||||
years = nmonths/12;
|
years = nmonths/12;
|
||||||
months = nmonths%12;
|
months = nmonths%12;
|
||||||
|
|
||||||
g_return_if_fail (years <= G_MAXUINT16 - d->year);
|
g_return_if_fail (years <= (guint) (G_MAXUINT16 - d->year));
|
||||||
|
|
||||||
d->month = months + 1;
|
d->month = months + 1;
|
||||||
d->year += years;
|
d->year += years;
|
||||||
@@ -1813,7 +1813,7 @@ g_date_add_years (GDate *d,
|
|||||||
g_date_update_dmy (d);
|
g_date_update_dmy (d);
|
||||||
|
|
||||||
g_return_if_fail (d->dmy != 0);
|
g_return_if_fail (d->dmy != 0);
|
||||||
g_return_if_fail (nyears <= G_MAXUINT16 - d->year);
|
g_return_if_fail (nyears <= (guint) (G_MAXUINT16 - d->year));
|
||||||
|
|
||||||
d->year += nyears;
|
d->year += nyears;
|
||||||
|
|
||||||
|
@@ -1134,7 +1134,8 @@ g_date_time_new_from_timeval_utc (const GTimeVal *tv)
|
|||||||
static gboolean
|
static gboolean
|
||||||
get_iso8601_int (const gchar *text, gsize length, gint *value)
|
get_iso8601_int (const gchar *text, gsize length, gint *value)
|
||||||
{
|
{
|
||||||
gint i, v = 0;
|
gsize i;
|
||||||
|
guint v = 0;
|
||||||
|
|
||||||
if (length < 1 || length > 4)
|
if (length < 1 || length > 4)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1155,7 +1156,7 @@ get_iso8601_int (const gchar *text, gsize length, gint *value)
|
|||||||
static gboolean
|
static gboolean
|
||||||
get_iso8601_seconds (const gchar *text, gsize length, gdouble *value)
|
get_iso8601_seconds (const gchar *text, gsize length, gdouble *value)
|
||||||
{
|
{
|
||||||
gint i;
|
gsize i;
|
||||||
gdouble divisor = 1, v = 0;
|
gdouble divisor = 1, v = 0;
|
||||||
|
|
||||||
if (length < 2)
|
if (length < 2)
|
||||||
@@ -2803,7 +2804,7 @@ initialize_alt_digits (void)
|
|||||||
if (digit == NULL)
|
if (digit == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
g_assert (digit_len < buffer + sizeof (buffer) - buffer_end);
|
g_assert (digit_len < (gsize) (buffer + sizeof (buffer) - buffer_end));
|
||||||
|
|
||||||
alt_digits[i] = buffer_end;
|
alt_digits[i] = buffer_end;
|
||||||
buffer_end = g_stpcpy (buffer_end, digit);
|
buffer_end = g_stpcpy (buffer_end, digit);
|
||||||
|
@@ -69,7 +69,7 @@ static const char*
|
|||||||
sindent (guint n)
|
sindent (guint n)
|
||||||
{
|
{
|
||||||
static const char spaces[] = " ";
|
static const char spaces[] = " ";
|
||||||
int l = sizeof (spaces) - 1;
|
gsize l = sizeof (spaces) - 1;
|
||||||
n = MIN (n, l);
|
n = MIN (n, l);
|
||||||
return spaces + l - n;
|
return spaces + l - n;
|
||||||
}
|
}
|
||||||
|
@@ -355,6 +355,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
|||||||
# Due to pervasive use of things like GPOINTER_TO_UINT(), we do not support
|
# Due to pervasive use of things like GPOINTER_TO_UINT(), we do not support
|
||||||
# building with -Wbad-function-cast.
|
# building with -Wbad-function-cast.
|
||||||
'-Wno-bad-function-cast',
|
'-Wno-bad-function-cast',
|
||||||
|
'-Wno-cast-function-type',
|
||||||
# Due to function casts through (void*) we cannot support -Wpedantic:
|
# Due to function casts through (void*) we cannot support -Wpedantic:
|
||||||
# https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
|
# https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
|
||||||
'-Wno-pedantic',
|
'-Wno-pedantic',
|
||||||
|
Reference in New Issue
Block a user