Merge branch 'fix_more_warnings' into 'master'

Fix more warnings

See merge request GNOME/glib!2038
This commit is contained in:
Philip Withnall 2021-04-08 14:20:07 +00:00
commit ee242bb54f
5 changed files with 77 additions and 74 deletions

View File

@ -151,7 +151,7 @@ strv_strv_cmp (gchar **a, gchar **b)
static gboolean
strv_set_equal (gchar **strv, ...)
{
gint count;
guint count;
va_list list;
const gchar *str;
gboolean res;
@ -372,10 +372,10 @@ static void
test_entries (void)
{
const GActionEntry entries[] = {
{ "foo", activate_foo },
{ "bar", activate_bar, "s" },
{ "toggle", NULL, NULL, "false" },
{ "volume", NULL, NULL, "0", change_volume_state }
{ "foo", activate_foo, NULL, NULL, NULL, { 0 } },
{ "bar", activate_bar, "s", NULL, NULL, { 0 } },
{ "toggle", NULL, NULL, "false", NULL, { 0 } },
{ "volume", NULL, NULL, "0", change_volume_state, { 0 } },
};
GSimpleActionGroup *actions;
GVariant *state;
@ -399,10 +399,10 @@ test_entries (void)
if (g_test_undefined ())
{
const GActionEntry bad_type = {
"bad-type", NULL, "ss"
"bad-type", NULL, "ss", NULL, NULL, { 0 }
};
const GActionEntry bad_state = {
"bad-state", NULL, NULL, "flse"
"bad-state", NULL, NULL, "flse", NULL, { 0 }
};
g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
@ -468,7 +468,7 @@ test_parse_detailed (void)
{ "abc(42, 4)", "abc", "(42, 4)", "expected end of input", NULL },
{ "abc(42,)", "abc", "(42,)", "expected end of input", NULL }
};
gint i;
gsize i;
for (i = 0; i < G_N_ELEMENTS (testcases); i++)
{
@ -638,13 +638,13 @@ stop_loop (gpointer data)
}
static GActionEntry exported_entries[] = {
{ "undo", activate_action, NULL, NULL, NULL },
{ "redo", activate_action, NULL, NULL, NULL },
{ "cut", activate_action, NULL, NULL, NULL },
{ "copy", activate_action, NULL, NULL, NULL },
{ "paste", activate_action, NULL, NULL, NULL },
{ "bold", activate_toggle, NULL, "true", NULL },
{ "lang", activate_radio, "s", "'latin'", NULL },
{ "undo", activate_action, NULL, NULL, NULL, { 0 } },
{ "redo", activate_action, NULL, NULL, NULL, { 0 } },
{ "cut", activate_action, NULL, NULL, NULL, { 0 } },
{ "copy", activate_action, NULL, NULL, NULL, { 0 } },
{ "paste", activate_action, NULL, NULL, NULL, { 0 } },
{ "bold", activate_toggle, NULL, "true", NULL, { 0 } },
{ "lang", activate_radio, "s", "'latin'", NULL, { 0 } },
};
static void
@ -920,8 +920,8 @@ test_dbus_threaded (void)
GSimpleActionGroup *group[10];
GThread *export[10];
static GActionEntry entries[] = {
{ "a", activate_action, NULL, NULL, NULL },
{ "b", activate_action, NULL, NULL, NULL },
{ "a", activate_action, NULL, NULL, NULL, { 0 } },
{ "b", activate_action, NULL, NULL, NULL, { 0 } },
};
gint i;

View File

@ -111,21 +111,21 @@ test_g_file_new_for_path (void)
{
const struct TestPathsWithOper cmp_paths[] =
{
{"/", TRUE, 0, "/./"},
{"//", TRUE, 0, "//"},
{"//", TRUE, 0, "//./"},
{"/", TRUE, 0, "/.//"},
{"/", TRUE, 0, "/././"},
{"/tmp", TRUE, 0, "/tmp/d/../"},
{"/", TRUE, 0, "/somedir/../"},
{"/", FALSE, 0, "/somedir/.../"},
{"//tmp/dir1", TRUE, 0, "//tmp/dir1"},
{"/tmp/dir1", TRUE, 0, "///tmp/dir1"},
{"/tmp/dir1", TRUE, 0, "////tmp/dir1"},
{"/tmp/dir1", TRUE, 0, "/tmp/./dir1"},
{"/tmp/dir1", TRUE, 0, "/tmp//dir1"},
{"/tmp/dir1", TRUE, 0, "/tmp///dir1///"},
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", TRUE, 0, "/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88/"}
{"/", TRUE, 0, "/./", NULL },
{"//", TRUE, 0, "//", NULL },
{"//", TRUE, 0, "//./", NULL },
{"/", TRUE, 0, "/.//", NULL },
{"/", TRUE, 0, "/././", NULL },
{"/tmp", TRUE, 0, "/tmp/d/../", NULL },
{"/", TRUE, 0, "/somedir/../", NULL },
{"/", FALSE, 0, "/somedir/.../", NULL },
{"//tmp/dir1", TRUE, 0, "//tmp/dir1", NULL },
{"/tmp/dir1", TRUE, 0, "///tmp/dir1", NULL },
{"/tmp/dir1", TRUE, 0, "////tmp/dir1", NULL },
{"/tmp/dir1", TRUE, 0, "/tmp/./dir1", NULL },
{"/tmp/dir1", TRUE, 0, "/tmp//dir1", NULL },
{"/tmp/dir1", TRUE, 0, "/tmp///dir1///", NULL },
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", TRUE, 0, "/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88/", NULL }
};
guint i;
@ -142,19 +142,19 @@ static void
test_g_file_new_for_uri (void)
{
const struct TestPathsWithOper cmp_uris[] = {
{"file:///", TRUE, 0, "file:///./"},
{"file:////", TRUE, 0, "file:////"},
{"file:////", TRUE, 0, "file:////./"},
{"file:///", TRUE, 0, "file:///.//"},
{"file:///", TRUE, 0, "file:///././"},
{"file:///tmp", TRUE, 0, "file:///tmp/d/../"},
{"file:///", TRUE, 0, "file:///somedir/../"},
{"file:///", FALSE, 0, "file:///somedir/.../"},
{"file:////tmp/dir1", TRUE, 0, "file:////tmp/dir1"},
{"file:///tmp/dir1", TRUE, 0, "file:///tmp/./dir1"},
{"file:///tmp/dir1", TRUE, 0, "file:///tmp//dir1"},
{"file:///tmp/dir1", TRUE, 0, "file:///tmp///dir1///"},
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88", TRUE, 0, "file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/"}
{"file:///", TRUE, 0, "file:///./", NULL },
{"file:////", TRUE, 0, "file:////", NULL },
{"file:////", TRUE, 0, "file:////./", NULL },
{"file:///", TRUE, 0, "file:///.//", NULL },
{"file:///", TRUE, 0, "file:///././", NULL },
{"file:///tmp", TRUE, 0, "file:///tmp/d/../", NULL },
{"file:///", TRUE, 0, "file:///somedir/../", NULL },
{"file:///", FALSE, 0, "file:///somedir/.../", NULL },
{"file:////tmp/dir1", TRUE, 0, "file:////tmp/dir1", NULL },
{"file:///tmp/dir1", TRUE, 0, "file:///tmp/./dir1", NULL },
{"file:///tmp/dir1", TRUE, 0, "file:///tmp//dir1", NULL },
{"file:///tmp/dir1", TRUE, 0, "file:///tmp///dir1///", NULL },
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88", TRUE, 0, "file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", NULL }
};
guint i;
@ -198,11 +198,11 @@ test_g_file_dup (void)
{
const struct TestPathsWithOper dup_paths[] =
{
{"/", 0, FALSE, ""},
{"file:///", 0, TRUE, ""},
{"totalnonsense", 0, FALSE, ""},
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", 0, FALSE, ""},
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88", 0, TRUE, ""},
{"/", 0, FALSE, "", NULL },
{"file:///", 0, TRUE, "", NULL },
{"totalnonsense", 0, FALSE, "", NULL },
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", 0, FALSE, "", NULL },
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88", 0, TRUE, "", NULL },
};
guint i;
@ -261,11 +261,11 @@ test_g_file_get_parse_name_utf8 (void)
{
const struct TestPathsWithOper strings[] =
{
{G_DIR_SEPARATOR_S, 0, FALSE, G_DIR_SEPARATOR_S},
{"file:///", 0, TRUE, G_DIR_SEPARATOR_S},
{"totalnonsense", 0, FALSE, NULL},
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", 0, FALSE, NULL /* Depends on local file encoding */},
{"file:///invalid%08/UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", 0, TRUE, "file:///invalid%08/UTF-8%20p\xc5\x99\xc3\xadli\xc5\xa1%20\xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd%20k\xc5\xaf\xc5\x88"},
{G_DIR_SEPARATOR_S, 0, FALSE, G_DIR_SEPARATOR_S, NULL },
{"file:///", 0, TRUE, G_DIR_SEPARATOR_S, NULL },
{"totalnonsense", 0, FALSE, NULL, NULL },
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", 0, FALSE, NULL, NULL /* Depends on local file encoding */},
{"file:///invalid%08/UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", 0, TRUE, "file:///invalid%08/UTF-8%20p\xc5\x99\xc3\xadli\xc5\xa1%20\xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd%20k\xc5\xaf\xc5\x88", NULL },
};
guint i;
@ -315,14 +315,14 @@ test_g_file_new_for_commandline_arg (void)
/* TestPathsWithOper.use_uri represents IsURIOnly here */
const struct TestPathsWithOper arg_data[] =
{
{"./", 0, FALSE, "file"},
{"../", 0, FALSE, "file"},
{"/tmp", 0, FALSE, "file"},
{"//UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", 0, FALSE, "file"},
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", 0, FALSE, "file"},
{"./", 0, FALSE, "file", NULL },
{"../", 0, FALSE, "file", NULL },
{"/tmp", 0, FALSE, "file", NULL },
{"//UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", 0, FALSE, "file", NULL },
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", 0, FALSE, "file", NULL },
#if 0
{"http://www.gtk.org/", 0, TRUE, "http"},
{"ftp://user:pass@ftp.gimp.org/", 0, TRUE, "ftp"},
{"http://www.gtk.org/", 0, TRUE, "http", NULL },
{"ftp://user:pass@ftp.gimp.org/", 0, TRUE, "ftp", NULL },
#endif
};
GFile *file;
@ -486,15 +486,15 @@ test_g_file_get_parent_child (void)
const struct TestPathsWithOper paths[] =
{
/* path root_desc uri dir_holder */
{"/dir1/dir", FALSE, FALSE, "dir"},
{"/dir", FALSE, FALSE, "dir"},
{"/", TRUE, FALSE, "dir"},
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88/", FALSE, FALSE, "UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88"},
{"file:///dir1/dir", FALSE, TRUE, "dir"},
{"file:///dir", FALSE, TRUE, "dir"},
{"file:///", TRUE, TRUE, "dir"},
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", FALSE, TRUE, "UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88"},
{"dav://www.gtk.org/plan/meetings", FALSE, TRUE, "meetings"},
{"/dir1/dir", FALSE, FALSE, "dir", NULL },
{"/dir", FALSE, FALSE, "dir", NULL },
{"/", TRUE, FALSE, "dir", NULL },
{"/UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88/", FALSE, FALSE, "UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", NULL },
{"file:///dir1/dir", FALSE, TRUE, "dir", NULL },
{"file:///dir", FALSE, TRUE, "dir", NULL },
{"file:///", TRUE, TRUE, "dir", NULL },
{"file:///UTF-8%20p%C5%99%C3%ADli%C5%A1%20%C5%BElu%C5%A5ou%C4%8Dk%C3%BD%20k%C5%AF%C5%88/", FALSE, TRUE, "UTF-8 p\xc5\x99\xc3\xadli\xc5\xa1 \xc5\xbelu\xc5\xa5ou\xc4\x8dk\xc3\xbd k\xc5\xaf\xc5\x88", NULL },
{"dav://www.gtk.org/plan/meetings", FALSE, TRUE, "meetings", NULL },
};
guint i;

View File

@ -108,6 +108,7 @@ mock_interface_get_vtable (GDBusInterfaceSkeleton *interface)
NULL,
mock_interface_get_property,
NULL,
{ 0 }
};
return &vtable;

View File

@ -258,7 +258,8 @@ static const GDBusInterfaceVTable test_interface_vtable =
{
test_interface_method_call,
test_interface_get_property,
NULL /* set_property */
NULL, /* set_property */
{ 0 }
};
static void
@ -1436,7 +1437,8 @@ static const GDBusInterfaceVTable dmp_interface_vtable =
{
dmp_on_method_call,
NULL, /* get_property */
NULL /* set_property */
NULL, /* set_property */
{ 0 }
};

View File

@ -1207,7 +1207,7 @@ g_date_prepare_to_parse (const gchar *str,
}
static guint
convert_twodigit_year (gint y)
convert_twodigit_year (guint y)
{
if (using_twodigit_years && y < 100)
{