Merge branch 'fix_more_warnings' into 'master'

Fix more warnings (clang)

See merge request GNOME/glib!2091
This commit is contained in:
Philip Withnall 2021-05-13 12:04:42 +00:00
commit 53834ee319
13 changed files with 88 additions and 69 deletions

View File

@ -1649,6 +1649,7 @@ GOptionArg
GOptionFlags
G_OPTION_REMAINING
GOptionEntry
G_OPTION_ENTRY_NULL
g_option_context_add_main_entries
GOptionGroup
g_option_context_add_group

View File

@ -39,7 +39,7 @@
static const GOptionEntry entries[] = {
{ NULL }
G_OPTION_ENTRY_NULL
};
/* 256k minus malloc overhead */

View File

@ -47,7 +47,7 @@ static const GOptionEntry entries[] = {
{ "backup", 'b', 0, G_OPTION_ARG_NONE, &backup, N_("Backup existing destination files"), NULL },
{ "no-dereference", 'P', 0, G_OPTION_ARG_NONE, &no_dereference, N_("Never follow symbolic links"), NULL },
{ "default-permissions", 0, 0, G_OPTION_ARG_NONE, &default_permissions, N_("Use default permissions for the destination"), NULL },
{ NULL }
G_OPTION_ENTRY_NULL
};
static gint64 start_time;

View File

@ -38,7 +38,7 @@ static const GOptionEntry entries[] = {
{ "filesystem", 'f', 0, G_OPTION_ARG_NONE, &filesystem, N_("Get file system info"), NULL },
{ "attributes", 'a', 0, G_OPTION_ARG_STRING, &attributes, N_("The attributes to get"), N_("ATTRIBUTES") },
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Dont follow symbolic links"), NULL },
{ NULL }
G_OPTION_ENTRY_NULL
};
static char *

View File

@ -2178,7 +2178,7 @@ main (int argc, char **argv)
/* These options are only for use in the gschema-compile tests */
{ "schema-file", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME_ARRAY, &schema_files, NULL, NULL },
{ "override-file", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME_ARRAY, &override_files, NULL, NULL },
{ NULL }
G_OPTION_ENTRY_NULL
};
#ifdef G_OS_WIN32

View File

@ -34,7 +34,7 @@ static GOptionEntry cmd_entries[] = {
"Time out reads after the specified number of seconds", NULL},
{"tls", 'T', 0, G_OPTION_ARG_NONE, &tls,
"Use TLS (SSL)", NULL},
{NULL}
G_OPTION_ENTRY_NULL
};
#include "socket-common.c"

View File

@ -40,7 +40,7 @@ static GOptionEntry cmd_entries[] = {
"Time out reads after the specified number of seconds", NULL},
{"tls", 'T', 0, G_OPTION_ARG_STRING, &tls_cert_file,
"Use TLS (SSL) with indicated server certificate", "CERTFILE"},
{NULL}
G_OPTION_ENTRY_NULL
};
#include "socket-common.c"

View File

@ -102,7 +102,7 @@
* { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
* { "beep", 'b', 0, G_OPTION_ARG_NONE, &beep, "Beep when done", NULL },
* { "rand", 0, 0, G_OPTION_ARG_NONE, &randomize, "Randomize the data", NULL },
* { NULL }
* G_OPTION_ENTRY_NULL
* };
*
* int

View File

@ -286,6 +286,24 @@ struct _GOptionEntry
*/
#define G_OPTION_REMAINING ""
/**
* G_OPTION_ENTRY_NULL:
*
* A #GOptionEntry array requires a %NULL terminator, this macro can
* be used as terminator instead of an explicit `{ 0 }` but it cannot
* be assigned to a variable.
*
* |[
* GOptionEntry option[] = { G_OPTION_ENTRY_NULL };
* ]|
*
* Since: 2.70
*/
#define G_OPTION_ENTRY_NULL \
GLIB_AVAILABLE_MACRO_IN_2_70 \
{ NULL, 0, 0, 0, NULL, NULL, NULL }
GLIB_AVAILABLE_IN_ALL
GOptionContext *g_option_context_new (const gchar *parameter_string);
GLIB_AVAILABLE_IN_ALL

View File

@ -35,7 +35,7 @@ test_platform_argv0 (void)
gboolean arg;
GOptionEntry entries [] =
{ { "test", 't', 0, G_OPTION_ARG_STRING, &arg, NULL, NULL },
{ NULL } };
G_OPTION_ENTRY_NULL };
const gchar * const expected_prgnames[] =
{
"option-argv0",

View File

@ -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);

View File

@ -79,7 +79,7 @@ main (int argc,
{ "slow-path", '\0',
G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &slow_path,
"Use a child-setup function to avoid the posix_spawn fast path", NULL },
{ NULL }
G_OPTION_ENTRY_NULL
};
GError *error = NULL;
int ret = 1;

View File

@ -268,7 +268,7 @@ Test test[] = {
{ "\x20\xed\xaf\xbf\xed\xb0\x80\x20", -1, 1, FALSE },
{ "\x20\xed\xaf\xbf\xed\xbf\xbf\x20", -1, 1, FALSE },
{ NULL, }
{ NULL, 0, 0, 0 }
};
static void