Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!2040
This commit is contained in:
Sebastian Dröge 2021-04-15 07:24:57 +00:00
commit 55d18fd3dc
6 changed files with 22 additions and 13 deletions

View File

@ -86,7 +86,8 @@ static const GDBusInterfaceVTable boo_vtable =
{
NULL, /* _method_call */
NULL, /* _get_property */
NULL /* _set_property */
NULL, /* _set_property */
{ 0 }
};
/* Runs in a worker thread. */

View File

@ -127,6 +127,8 @@ static const GDBusInterfaceInfo foo2_interface_info =
"org.example.Foo2",
(GDBusMethodInfo **) &foo_method_info_pointers,
(GDBusSignalInfo **) &foo_signal_info_pointers,
NULL,
NULL
};
static void
@ -198,7 +200,8 @@ static const GDBusInterfaceVTable foo_vtable =
{
foo_method_call,
foo_get_property,
foo_set_property
foo_set_property,
{ 0 },
};
/* -------------------- */
@ -311,7 +314,8 @@ static const GDBusInterfaceVTable dyna_interface_vtable =
{
dyna_cyber,
NULL,
NULL
NULL,
{ 0 }
};
/* ---------------------------------------------------------------------------------------------------- */
@ -693,7 +697,8 @@ static const GDBusSubtreeVTable subtree_vtable =
{
subtree_enumerate,
subtree_introspect,
subtree_dispatch
subtree_dispatch,
{ 0 }
};
/* -------------------- */
@ -747,7 +752,8 @@ static const GDBusSubtreeVTable dynamic_subtree_vtable =
{
dynamic_subtree_enumerate,
dynamic_subtree_introspect,
dynamic_subtree_dispatch
dynamic_subtree_dispatch,
{ 0 }
};
/* -------------------- */
@ -1729,7 +1735,7 @@ test_async_properties (void)
GError *error = NULL;
guint registration_id, registration_id2;
static const GDBusInterfaceVTable vtable = {
test_async_method_call, NULL, NULL
test_async_method_call, NULL, NULL, { 0 }
};
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);

View File

@ -1920,7 +1920,7 @@ check_object_manager (void)
GError *error;
GMainLoop *loop;
OMData *om_data = NULL;
guint om_signal_id = -1;
guint om_signal_id = 0;
GDBusObjectManager *pm = NULL;
GList *object_proxies;
GList *proxies;
@ -2356,7 +2356,7 @@ check_object_manager (void)
if (loop != NULL)
g_main_loop_unref (loop);
if (om_signal_id != -1)
if (om_signal_id != 0)
g_dbus_connection_signal_unsubscribe (c, om_signal_id);
g_clear_object (&o3);
g_clear_object (&o2);

View File

@ -1694,7 +1694,8 @@ test_get_available (gconstpointer user_data)
for (tries = 0; tries < 100; tries++)
{
if (g_socket_get_available_bytes (server) > sizeof (data))
gssize res = g_socket_get_available_bytes (server);
if ((res == -1) || ((gsize) res > sizeof (data)))
break;
g_usleep (100000);
}

View File

@ -120,7 +120,8 @@ check_expected_events (RecordedEvent *expected,
GList *recorded,
Environment env)
{
gint i, li;
gsize i;
gint li;
GList *l;
for (i = 0, li = 0, l = recorded; i < n_expected && l != NULL;)
@ -219,7 +220,7 @@ check_expected_events (RecordedEvent *expected,
e2->event_type == G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT)
{
g_test_message ("Event CHANGES_DONE_HINT ignored at "
"expected index %d, recorded index %d", i, li);
"expected index %" G_GSIZE_FORMAT ", recorded index %d", i, li);
li++, l = l->next;
continue;
}
@ -227,7 +228,7 @@ check_expected_events (RecordedEvent *expected,
* the event doesn't match, it means the expected event has lost. */
else if (env & e1->optional)
{
g_test_message ("Event %d at expected index %d skipped because "
g_test_message ("Event %d at expected index %" G_GSIZE_FORMAT " skipped because "
"it is marked as optional", e1->event_type, i);
i++;
continue;

View File

@ -978,7 +978,7 @@ g_string_replace (GString *string,
{
gsize f_len, r_len, pos;
gchar *cur, *next;
gint n = 0;
guint n = 0;
g_return_val_if_fail (string != NULL, 0);
g_return_val_if_fail (find != NULL, 0);