Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!2088
This commit is contained in:
Sebastian Dröge 2021-05-07 06:49:26 +00:00
commit 0c259e9fbb
7 changed files with 19 additions and 14 deletions

View File

@ -51,7 +51,8 @@ incoming_method_call (GDBusConnection *connection,
static const GDBusInterfaceVTable interface_vtable = {
incoming_method_call,
NULL,
NULL
NULL,
{ 0 }
};
static void

View File

@ -125,7 +125,11 @@ void g_thread_foreach (GFunc thread_func,
#endif
#define g_static_mutex_get_mutex g_static_mutex_get_mutex_impl GLIB_DEPRECATED_MACRO_IN_2_32
#ifndef G_OS_WIN32
#define G_STATIC_MUTEX_INIT { NULL, PTHREAD_MUTEX_INITIALIZER } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
#else
#define G_STATIC_MUTEX_INIT { NULL } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_mutex_init)
#endif
typedef struct
{
GMutex *mutex;

View File

@ -1678,7 +1678,7 @@ g_scanner_get_token_i (GScanner *scanner,
case G_TOKEN_SYMBOL:
if (scanner->config->symbol_2_token)
*token_p = (GTokenType) value_p->v_symbol;
*token_p = (GTokenType) ((size_t) value_p->v_symbol);
break;
case G_TOKEN_BINARY:

View File

@ -49,7 +49,7 @@ static guint mem_chunk_recursion = 0;
/* --- old memchunk prototypes --- */
GMemChunk* old_mem_chunk_new (const gchar *name,
gint atom_size,
gulong atom_size,
gulong area_size,
gint type);
void old_mem_chunk_destroy (GMemChunk *mem_chunk);
@ -129,7 +129,7 @@ static GMemChunk *mem_chunks = NULL;
GMemChunk*
old_mem_chunk_new (const gchar *name,
gint atom_size,
gulong atom_size,
gulong area_size,
gint type)
{

View File

@ -211,7 +211,7 @@ test_g_static_private (void)
test_g_static_private_ready = 0;
for (i = 0; i < THREADS; i++)
g_assert (GPOINTER_TO_INT (g_thread_join (threads[i])) == i * 3);
g_assert (GPOINTER_TO_UINT (g_thread_join (threads[i])) == i * 3);
g_assert (test_g_static_private_counter == 0);
}

View File

@ -248,7 +248,7 @@ test_thread_sort (gboolean sort)
GThreadPool *pool;
guint limit;
guint max_threads;
gint i;
guint i;
limit = MAX_THREADS * 10;
@ -293,8 +293,8 @@ test_thread_sort (gboolean sort)
g_thread_pool_unprocessed (pool)));
}
g_assert (g_thread_pool_get_max_threads (pool) == max_threads);
g_assert (g_thread_pool_get_num_threads (pool) == g_thread_pool_get_max_threads (pool));
g_assert (g_thread_pool_get_max_threads (pool) == (gint) max_threads);
g_assert (g_thread_pool_get_num_threads (pool) == (guint) g_thread_pool_get_max_threads (pool));
g_thread_pool_free (pool, TRUE, TRUE);
}
@ -337,7 +337,7 @@ test_thread_idle_time (void)
{
guint limit = 50;
guint interval = 10000;
gint i;
guint i;
idle_pool = g_thread_pool_new (test_thread_idle_time_entry_func,
NULL,

View File

@ -137,7 +137,7 @@ process (gint line,
ucs4_result = g_utf8_to_ucs4 (utf8, -1, &items_read, NULL, &error);
if (!ucs4_result || items_read == strlen (utf8))
if (!ucs4_result || items_read == (glong) strlen (utf8))
{
fail ("line %d: incomplete input not properly detected\n", line);
return;
@ -158,7 +158,7 @@ process (gint line,
}
if (!ucs4_equal (ucs4_result, ucs4) ||
items_read != strlen (utf8) ||
items_read != (glong) strlen (utf8) ||
items_written != ucs4_len)
{
fail ("line %d: results of conversion with status %d to ucs4 do not match expected.\n", line, status);
@ -195,7 +195,7 @@ process (gint line,
if (strcmp (utf8_result, utf8) != 0 ||
items_read != ucs4_len ||
items_written != strlen (utf8))
items_written != (glong) strlen (utf8))
{
fail ("line %d: conversion back to utf8 did not match original\n", line);
return;
@ -257,7 +257,7 @@ process (gint line,
return;
}
if (items_read != strlen (utf8) ||
if (items_read != (glong) strlen (utf8) ||
utf16_count (utf16_from_utf8) != items_written)
{
fail ("line %d: length error in conversion to ucs16\n", line);
@ -291,7 +291,7 @@ process (gint line,
}
if (items_read != utf16_count (utf16_from_utf8) ||
items_written != strlen (utf8))
items_written != (glong) strlen (utf8))
{
fail ("line %d: length error in conversion from ucs16 to utf8\n", line);
return;