From c65ec0bfbf4e07681672acc5780696ffc065c6fb Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Wed, 28 Apr 2021 22:59:04 +0200 Subject: [PATCH] Fix many missing initializers warnings in glib/tests/option-context.c glib/tests/option-context.c:36:10: warning: missing field 'short_name' initializer { NULL } ^ glib/tests/option-context.c:43:10: warning: missing field 'short_name' initializer { NULL } ^ glib/tests/option-context.c:319:14: warning: missing field 'short_name' initializer { NULL } }; ^ ... ^ glib/tests/option-context.c:2538:12: warning: missing field 'short_name' initializer { NULL } ^ glib/tests/option-context.c:2576:14: warning: missing field 'short_name' initializer { NULL } }; ^ --- glib/tests/option-context.c | 118 ++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c index 1c588d742..50770e704 100644 --- a/glib/tests/option-context.c +++ b/glib/tests/option-context.c @@ -33,14 +33,14 @@ static GOptionEntry main_entries[] = { { "main-switch", 0, 0, G_OPTION_ARG_NONE, NULL, "A switch that is in the main group", NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; static GOptionEntry group_entries[] = { { "test-switch", 0, 0, G_OPTION_ARG_NONE, NULL, "A switch that is in the test group", NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; static GOptionContext * @@ -316,7 +316,7 @@ error_test1 (void) GOptionGroup *main_group; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_INT, &error_test1_int, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; error_test1_int = 0x12345678; @@ -384,7 +384,7 @@ error_test2 (void) GOptionGroup *main_group; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_STRING, &error_test2_string, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; error_test2_string = "foo"; @@ -450,7 +450,7 @@ error_test3 (void) GOptionGroup *main_group; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &error_test3_boolean, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; error_test3_boolean = FALSE; @@ -490,7 +490,7 @@ arg_test1 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_INT, &arg_test1_int, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -525,7 +525,7 @@ arg_test2 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_STRING, &arg_test2_string, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -559,7 +559,7 @@ arg_test3 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_FILENAME, &arg_test3_filename, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -593,7 +593,7 @@ arg_test4 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_DOUBLE, &arg_test4_double, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -627,7 +627,7 @@ arg_test5 (void) const char *locale = "de_DE.UTF-8"; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_DOUBLE, &arg_test5_double, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -674,7 +674,7 @@ arg_test6 (void) GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_INT64, &arg_test6_int64, NULL, NULL }, { "test2", 0, 0, G_OPTION_ARG_INT64, &arg_test6_int64_2, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -715,7 +715,7 @@ callback_test1 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_CALLBACK, callback_parse1, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -756,7 +756,7 @@ callback_test2 (void) int argc; GOptionEntry entries [] = { { "test", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, callback_parse2, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -800,7 +800,7 @@ callback_test_optional_1 (void) GOptionEntry entries [] = { { "test", 0, G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -836,7 +836,7 @@ callback_test_optional_2 (void) GOptionEntry entries [] = { { "test", 0, G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -872,7 +872,7 @@ callback_test_optional_3 (void) GOptionEntry entries [] = { { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -909,7 +909,7 @@ callback_test_optional_4 (void) GOptionEntry entries [] = { { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -947,7 +947,7 @@ callback_test_optional_5 (void) { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL, NULL }, { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -985,7 +985,7 @@ callback_test_optional_6 (void) { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL, NULL }, { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -1023,7 +1023,7 @@ callback_test_optional_7 (void) { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL, NULL }, { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -1061,7 +1061,7 @@ callback_test_optional_8 (void) { { "dummy", 'd', 0, G_OPTION_ARG_NONE, &dummy, NULL, NULL }, { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_parse_optional, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -1105,7 +1105,7 @@ callback_remaining_test1 (void) int argc; GOptionEntry entries [] = { { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_CALLBACK, callback_remaining_test1_callback, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; callback_remaining_args = g_ptr_array_new (); context = g_option_context_new (NULL); @@ -1152,7 +1152,7 @@ callback_returns_false (void) { { "error", 0, 0, G_OPTION_ARG_CALLBACK, callback_error, NULL, NULL }, { "error-no-arg", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, callback_error, NULL, NULL }, { "error-optional-arg", 0, G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, callback_error, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -1235,7 +1235,7 @@ ignore_test1 (void) gchar *arg; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_set_ignore_unknown_options (context, TRUE); @@ -1271,7 +1271,7 @@ ignore_test2 (void) gchar *arg; GOptionEntry entries [] = { { "test", 't', 0, G_OPTION_ARG_NONE, &ignore_test2_boolean, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_set_ignore_unknown_options (context, TRUE); @@ -1306,7 +1306,7 @@ ignore_test3 (void) gchar *arg; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_STRING, &ignore_test3_string, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_set_ignore_unknown_options (context, TRUE); @@ -1344,7 +1344,7 @@ array_test1 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_STRING_ARRAY, &array_test1_array, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -1376,10 +1376,10 @@ add_test1 (void) GOptionEntry entries1 [] = { { "test1", 0, 0, G_OPTION_ARG_STRING_ARRAY, NULL, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; GOptionEntry entries2 [] = { { "test2", 0, 0, G_OPTION_ARG_STRING_ARRAY, NULL, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries1, NULL); @@ -1427,7 +1427,7 @@ rest_test1 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1465,7 +1465,7 @@ rest_test2 (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1504,7 +1504,7 @@ rest_test2a (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1541,7 +1541,7 @@ rest_test2b (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1579,7 +1579,7 @@ rest_test2c (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1616,7 +1616,7 @@ rest_test2d (void) int argc; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1656,7 +1656,7 @@ rest_test3 (void) GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &array_test1_array, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1697,7 +1697,7 @@ rest_test4 (void) GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &array_test1_array, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1737,7 +1737,7 @@ rest_test5 (void) GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_NONE, &ignore_test1_boolean, NULL, NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &array_test1_array, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1773,7 +1773,7 @@ unknown_short_test (void) gchar **argv; gchar **argv_copy; int argc; - GOptionEntry entries [] = { { NULL } }; + GOptionEntry entries [] = { G_OPTION_ENTRY_NULL }; g_test_bug ("166609"); @@ -1838,11 +1838,11 @@ triple_dash_test (void) gint arg1, arg2; GOptionEntry entries [] = { { "foo", 0, 0, G_OPTION_ARG_INT, &arg1, NULL, NULL}, - { NULL } + G_OPTION_ENTRY_NULL }; GOptionEntry group_entries [] = { { "test", 0, 0, G_OPTION_ARG_INT, &arg2, NULL, NULL}, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); @@ -1879,7 +1879,7 @@ missing_arg_test (void) gchar *arg = NULL; GOptionEntry entries [] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; g_test_bug ("305576"); @@ -1945,7 +1945,7 @@ dash_arg_test (void) GOptionEntry entries [] = { { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, cb, NULL, NULL }, { "three", '3', 0, G_OPTION_ARG_NONE, &argb, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; g_test_bug ("577638"); @@ -1990,7 +1990,7 @@ test_basic (void) gchar *arg = NULL; GOptionEntry entries [] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL); @@ -2051,7 +2051,7 @@ test_translate (void) gchar *arg = NULL; GOptionEntry entries [] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; TranslateData data = { 0, }; gchar *str; @@ -2085,12 +2085,12 @@ test_help (void) { "test2", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, NULL, "Tests also", NULL }, { "frob", 0, 0, G_OPTION_ARG_NONE, NULL, "Main frob", NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &sarr, "Rest goes here", "REST" }, - { NULL } + G_OPTION_ENTRY_NULL }; GOptionEntry group_entries[] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, "Group test", "Group test arg" }, { "frob", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, NULL, "Group frob", NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; context = g_option_context_new ("blabla"); @@ -2134,7 +2134,7 @@ test_help_no_options (void) gchar **sarr = NULL; GOptionEntry entries[] = { { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &sarr, "Rest goes here", "REST" }, - { NULL } + G_OPTION_ENTRY_NULL }; gchar *str; @@ -2164,12 +2164,12 @@ test_help_no_help_options (void) { "test2", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, NULL, "Tests also", NULL }, { "frob", 0, 0, G_OPTION_ARG_NONE, NULL, "Main frob", NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &sarr, "Rest goes here", "REST" }, - { NULL } + G_OPTION_ENTRY_NULL }; GOptionEntry group_entries[] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, "Group test", "Group test arg" }, { "frob", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, NULL, "Group frob", NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; g_test_bug ("697652"); @@ -2260,7 +2260,7 @@ test_error_hook (void) gchar *arg = NULL; GOptionEntry entries [] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; GOptionGroup *group; gchar **argv; gchar **argv_copy; @@ -2305,13 +2305,13 @@ test_group_parse (void) GOptionEntry entries[] = { { "test", 't', 0, G_OPTION_ARG_STRING, &arg1, NULL, NULL }, { "faz", 'f', 0, G_OPTION_ARG_STRING, &arg2, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; GOptionEntry group_entries[] = { { "test", 0, 0, G_OPTION_ARG_STRING, &arg3, NULL, NULL }, { "frob", 'f', 0, G_OPTION_ARG_STRING, &arg4, NULL, NULL }, { "faz", 'z', 0, G_OPTION_ARG_STRING, &arg5, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; gchar **argv, **orig_argv; gint argc; @@ -2375,7 +2375,7 @@ test_strict_posix (void) GOptionEntry entries[] = { { "foo", 'f', 0, G_OPTION_ARG_NONE, &foo, NULL, NULL }, { "bar", 'b', 0, G_OPTION_ARG_NONE, &bar, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; gint n_parsed; @@ -2420,7 +2420,7 @@ flag_reverse_string (void) gchar *arg = NULL; GOptionEntry entries [] = { { "test", 't', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_STRING, &arg, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; gchar **argv; gint argc; gboolean retval; @@ -2453,7 +2453,7 @@ flag_optional_int (void) gint arg = 0; GOptionEntry entries [] = { { "test", 't', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_INT, &arg, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; gchar **argv; gint argc; gboolean retval; @@ -2494,7 +2494,7 @@ short_remaining (void) { "number", 'n', 0, G_OPTION_ARG_INT, &number, NULL, NULL }, { "text", 't', 0, G_OPTION_ARG_STRING, &text, NULL, NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &files, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; GOptionContext* context; gchar **argv, **argv_copy; @@ -2535,7 +2535,7 @@ double_free (void) GOptionEntry entries[] = { { "known", 0, 0, G_OPTION_ARG_STRING, &text, NULL, NULL }, - { NULL } + G_OPTION_ENTRY_NULL }; GOptionContext* context; gchar **argv; @@ -2573,7 +2573,7 @@ double_zero (void) double test_val = NAN; GOptionEntry entries [] = { { "test", 0, 0, G_OPTION_ARG_DOUBLE, &test_val, NULL, NULL }, - { NULL } }; + G_OPTION_ENTRY_NULL }; context = g_option_context_new (NULL); g_option_context_add_main_entries (context, entries, NULL);