mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-23 22:16:16 +01:00
Use G_OPTION_ENTRY_NULL to avoid missing initializer warnings
This commit is contained in:
parent
53834ee319
commit
e952248dc2
@ -543,7 +543,7 @@ g_application_parse_command_line (GApplication *application,
|
||||
GOptionEntry entries[] = {
|
||||
{ "gapplication-service", '\0', 0, G_OPTION_ARG_NONE, &become_service,
|
||||
N_("Enter GApplication service mode (use from D-Bus service files)"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
g_option_group_add_entries (gapplication_group, entries);
|
||||
@ -555,7 +555,7 @@ g_application_parse_command_line (GApplication *application,
|
||||
GOptionEntry entries[] = {
|
||||
{ "gapplication-app-id", '\0', 0, G_OPTION_ARG_STRING, &app_id,
|
||||
N_("Override the application’s ID"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
g_option_group_add_entries (gapplication_group, entries);
|
||||
@ -567,7 +567,7 @@ g_application_parse_command_line (GApplication *application,
|
||||
GOptionEntry entries[] = {
|
||||
{ "gapplication-replace", '\0', 0, G_OPTION_ARG_NONE, &replace,
|
||||
N_("Replace the running instance"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
g_option_group_add_entries (gapplication_group, entries);
|
||||
@ -729,7 +729,11 @@ g_application_add_main_option_entries (GApplication *application,
|
||||
|
||||
for (i = 0; entries[i].long_name; i++)
|
||||
{
|
||||
GOptionEntry my_entries[2] = { { NULL }, { NULL } };
|
||||
GOptionEntry my_entries[2] =
|
||||
{
|
||||
G_OPTION_ENTRY_NULL,
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
my_entries[0] = entries[i];
|
||||
|
||||
if (!my_entries[0].arg_data)
|
||||
@ -778,7 +782,7 @@ g_application_add_main_option (GApplication *application,
|
||||
gchar *dup_string;
|
||||
GOptionEntry my_entry[2] = {
|
||||
{ NULL, short_name, flags, arg, NULL, NULL, NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
g_return_if_fail (G_IS_APPLICATION (application));
|
||||
|
@ -403,7 +403,7 @@ static const GOptionEntry connection_entries[] =
|
||||
{ "system", 'y', 0, G_OPTION_ARG_NONE, &opt_connection_system, N_("Connect to the system bus"), NULL},
|
||||
{ "session", 'e', 0, G_OPTION_ARG_NONE, &opt_connection_session, N_("Connect to the session bus"), NULL},
|
||||
{ "address", 'a', 0, G_OPTION_ARG_STRING, &opt_connection_address, N_("Connect to given D-Bus address"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static GOptionGroup *
|
||||
@ -593,7 +593,7 @@ static const GOptionEntry emit_entries[] =
|
||||
{ "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_emit_dest, N_("Optional destination for signal (unique name)"), NULL},
|
||||
{ "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_emit_object_path, N_("Object path to emit signal on"), NULL},
|
||||
{ "signal", 's', 0, G_OPTION_ARG_STRING, &opt_emit_signal, N_("Signal and interface name"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gboolean
|
||||
@ -894,7 +894,7 @@ static const GOptionEntry call_entries[] =
|
||||
{ "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_call_object_path, N_("Object path to invoke method on"), NULL},
|
||||
{ "method", 'm', 0, G_OPTION_ARG_STRING, &opt_call_method, N_("Method and interface name"), NULL},
|
||||
{ "timeout", 't', 0, G_OPTION_ARG_INT, &opt_call_timeout, N_("Timeout in seconds"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gboolean
|
||||
@ -1688,7 +1688,7 @@ static const GOptionEntry introspect_entries[] =
|
||||
{ "xml", 'x', 0, G_OPTION_ARG_NONE, &opt_introspect_xml, N_("Print XML"), NULL},
|
||||
{ "recurse", 'r', 0, G_OPTION_ARG_NONE, &opt_introspect_recurse, N_("Introspect children"), NULL},
|
||||
{ "only-properties", 'p', 0, G_OPTION_ARG_NONE, &opt_introspect_only_properties, N_("Only print properties"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gboolean
|
||||
@ -1984,7 +1984,7 @@ static const GOptionEntry monitor_entries[] =
|
||||
{
|
||||
{ "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_monitor_dest, N_("Destination name to monitor"), NULL},
|
||||
{ "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_monitor_object_path, N_("Object path to monitor"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gboolean
|
||||
@ -2195,7 +2195,7 @@ static const GOptionEntry wait_entries[] =
|
||||
{ "timeout", 't', 0, G_OPTION_ARG_INT64, &opt_wait_timeout_secs,
|
||||
N_("Timeout to wait for before exiting with an error (seconds); 0 for "
|
||||
"no timeout (default)"), "SECS" },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "gio-tool.h"
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -39,7 +39,7 @@ static const GOptionEntry entries[] = {
|
||||
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Don’t follow symbolic links"), NULL},
|
||||
{ "print-display-names", 'd', 0, G_OPTION_ARG_NONE, &print_display_names, N_("Print display names"), NULL },
|
||||
{ "print-uris", 'u', 0, G_OPTION_ARG_NONE, &print_uris, N_("Print full URIs"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "gio-tool.h"
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static GAppInfo *
|
||||
|
@ -29,7 +29,7 @@ static gboolean parent = FALSE;
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{ "parent", 'p', 0, G_OPTION_ARG_NONE, &parent, N_("Create parent directories"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -47,7 +47,7 @@ static const GOptionEntry entries[] = {
|
||||
N_("Watch for mount events"), NULL },
|
||||
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &watch_default,
|
||||
NULL, NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -75,7 +75,7 @@ static const GOptionEntry entries[] =
|
||||
{ "tcrypt-pim", 0, 0, G_OPTION_ARG_INT, &tcrypt_pim, N_("The numeric PIM when unlocking a VeraCrypt volume"), N_("PIM")},
|
||||
{ "tcrypt-hidden", 0, 0, G_OPTION_ARG_NONE, &tcrypt_hidden, N_("Mount a TCRYPT hidden volume"), NULL},
|
||||
{ "tcrypt-system", 0, 0, G_OPTION_ARG_NONE, &tcrypt_system, N_("Mount a TCRYPT system volume"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static char *
|
||||
|
@ -40,7 +40,7 @@ static const GOptionEntry entries[] = {
|
||||
{ "interactive", 'i', 0, G_OPTION_ARG_NONE, &interactive, N_("Prompt before overwrite"), NULL },
|
||||
{ "backup", 'b', 0, G_OPTION_ARG_NONE, &backup, N_("Backup existing destination files"), NULL },
|
||||
{ "no-copy-fallback", 'C', 0, G_OPTION_ARG_NONE, &no_copy_fallback, N_("Don’t use copy and delete fallback"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gint64 start_time;
|
||||
|
@ -33,7 +33,7 @@ static int n_outstanding = 0;
|
||||
static gboolean success = TRUE;
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -29,7 +29,7 @@ static gboolean force = FALSE;
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{"force", 'f', 0, G_OPTION_ARG_NONE, &force, N_("Ignore nonexistent files, never prompt"), NULL},
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
static const GOptionEntry entries[] = {
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -55,7 +55,7 @@ static const GOptionEntry entries[] =
|
||||
{ "print-etag", 'v', 0, G_OPTION_ARG_NONE, &print_etag, N_("Print new etag at end"), NULL },
|
||||
/* Translators: The "etag" is a token allowing to verify whether a file has been modified */
|
||||
{ "etag", 'e', 0, G_OPTION_ARG_STRING, &etag, N_("The etag of the file being overwritten"), N_("ETAG") },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
/* 256k minus malloc overhead */
|
||||
|
@ -32,7 +32,7 @@ static gboolean nofollow_symlinks = FALSE;
|
||||
static const GOptionEntry entries[] = {
|
||||
{ "type", 't', 0, G_OPTION_ARG_STRING, &attr_type, N_("Type of the attribute"), N_("TYPE") },
|
||||
{ "nofollow-symlinks", 'n', 0, G_OPTION_ARG_NONE, &nofollow_symlinks, N_("Don’t follow symbolic links"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static char *
|
||||
|
@ -35,7 +35,7 @@ static const GOptionEntry entries[] = {
|
||||
{ "list", 0, 0, G_OPTION_ARG_NONE, &list, N_("List files in the trash with their original locations"), NULL },
|
||||
{ "restore", 0, 0, G_OPTION_ARG_NONE, &restore, N_("Restore a file from trash to its original location (possibly "
|
||||
"recreating the directory)"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -31,7 +31,7 @@ static gboolean follow_symlinks = FALSE;
|
||||
static const GOptionEntry entries[] = {
|
||||
{ "hidden", 'h', 0, G_OPTION_ARG_NONE, &show_hidden, N_("Show hidden files"), NULL },
|
||||
{ "follow-symlinks", 'l', 0, G_OPTION_ARG_NONE, &follow_symlinks, N_("Follow symbolic links, mounts and shortcuts"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gint
|
||||
|
@ -747,7 +747,7 @@ main (int argc, char **argv)
|
||||
{ "internal", 0, 0, G_OPTION_ARG_NONE, &internal, N_("Don’t export functions; declare them G_GNUC_INTERNAL"), NULL },
|
||||
{ "external-data", 0, 0, G_OPTION_ARG_NONE, &external_data, N_("Don’t embed resource data in the C file; assume it's linked externally instead"), NULL },
|
||||
{ "c-name", 0, 0, G_OPTION_ARG_STRING, &c_name, N_("C identifier name used for the generated source code"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
@ -7,7 +7,7 @@ int port = 7777;
|
||||
static GOptionEntry cmd_entries[] = {
|
||||
{"port", 'p', 0, G_OPTION_ARG_INT, &port,
|
||||
"Local port to bind to", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ static GOptionEntry entries[] = {
|
||||
{"to-charset", 0, 0, G_OPTION_ARG_STRING, &to_charset, "to charset", NULL},
|
||||
{"fallback", 0, 0, G_OPTION_ARG_NONE, &fallback, "use fallback", NULL},
|
||||
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &locations, "locations", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -17,7 +17,7 @@ my_cmdline_handler (gpointer data)
|
||||
{ "arg1", 0, 0, G_OPTION_ARG_INT, &arg1, NULL, NULL },
|
||||
{ "arg2", 0, 0, G_OPTION_ARG_NONE, &arg2, NULL, NULL },
|
||||
{ "help", '?', 0, G_OPTION_ARG_NONE, &help, NULL, NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
GError *error;
|
||||
gint i;
|
||||
|
@ -53,7 +53,7 @@ main (int argc, char **argv)
|
||||
/* A dummy flag option, to be handled in primary */
|
||||
{ "flag", 'f', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, "A flag argument", NULL },
|
||||
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
app = g_application_new ("org.gtk.TestApplication",
|
||||
|
@ -19,7 +19,7 @@ main (int argc, char *argv[])
|
||||
{ "config-file", 0, 0, G_OPTION_ARG_STRING, &config_file, N_("Ignored, for compat with GTestDbus"), NULL },
|
||||
{ "print-address", 0, 0, G_OPTION_ARG_NONE, &print_address, N_("Print address"), NULL },
|
||||
{ "print-env", 0, 0, G_OPTION_ARG_NONE, &print_env, N_("Print address in shell mode"), NULL },
|
||||
{ NULL }
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
context = g_option_context_new ("");
|
||||
|
@ -40,7 +40,7 @@ main (int argc, char *argv[])
|
||||
{ "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace existing name if possible", NULL },
|
||||
{ "allow-replacement", 'a', 0, G_OPTION_ARG_NONE, &opt_allow_replacement, "Allow replacement", NULL },
|
||||
{ "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name to acquire", NULL },
|
||||
{ NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
error = NULL;
|
||||
|
@ -252,7 +252,7 @@ main (int argc, char *argv[])
|
||||
{ "server", 's', 0, G_OPTION_ARG_NONE, &opt_server, "Start a server instead of a client", NULL },
|
||||
{ "address", 'a', 0, G_OPTION_ARG_STRING, &opt_address, "D-Bus address to use", NULL },
|
||||
{ "allow-anonymous", 'n', 0, G_OPTION_ARG_NONE, &opt_allow_anonymous, "Allow anonymous authentication", NULL },
|
||||
{ NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
ret = 1;
|
||||
|
@ -9,7 +9,7 @@ static GOptionEntry opt_entries[] =
|
||||
{ "name", 'n', 0, G_OPTION_ARG_STRING, &opt_name, "Name to watch", NULL },
|
||||
{ "system-bus", 's', 0, G_OPTION_ARG_NONE, &opt_system_bus, "Use the system-bus instead of the session-bus", NULL },
|
||||
{ "auto-start", 'a', 0, G_OPTION_ARG_NONE, &opt_auto_start, "Instruct the bus to launch an owner for the name", NULL},
|
||||
{ NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -15,7 +15,7 @@ static GOptionEntry opt_entries[] =
|
||||
{ "system-bus", 's', 0, G_OPTION_ARG_NONE, &opt_system_bus, "Use the system-bus instead of the session-bus", NULL },
|
||||
{ "no-auto-start", 'a', 0, G_OPTION_ARG_NONE, &opt_no_auto_start, "Don't instruct the bus to launch an owner for the name", NULL},
|
||||
{ "no-properties", 'p', 0, G_OPTION_ARG_NONE, &opt_no_properties, "Do not load properties", NULL},
|
||||
{ NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static GMainLoop *loop = NULL;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#endif
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -6,7 +6,7 @@ static char *root = NULL;
|
||||
static GOptionEntry cmd_entries[] = {
|
||||
{"port", 'p', 0, G_OPTION_ARG_INT, &port,
|
||||
"Local port to bind to", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -1371,7 +1371,7 @@ main (int argc, char *argv[])
|
||||
{"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL},
|
||||
{"posix", 'x', 0, G_OPTION_ARG_NONE, &posix_compat,
|
||||
"Test POSIX-specific features (unix permissions, symlinks)", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
test_suite = FALSE;
|
||||
|
@ -672,7 +672,7 @@ static const GOptionEntry option_entries[] = {
|
||||
{ "synchronous", 's', 0, G_OPTION_ARG_NONE, &synchronous, "Synchronous connections", NULL },
|
||||
{ "connectable", 'c', 0, G_OPTION_ARG_INT, &connectable_count, "Connectable count", "C" },
|
||||
{ "special-type", 't', 0, G_OPTION_ARG_CALLBACK, record_type_arg, "Record type like MX, TXT, NS or SOA", "RR" },
|
||||
{ NULL },
|
||||
G_OPTION_ENTRY_NULL,
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -20,7 +20,7 @@ static GOptionEntry cmd_entries[] = {
|
||||
"Time out socket I/O after the specified number of seconds", NULL},
|
||||
{"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
|
||||
"Verbose debugging output", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gpointer
|
||||
|
@ -210,7 +210,7 @@ static GOptionEntry cmd_entries[] = {
|
||||
"Time to run each test in seconds", NULL},
|
||||
{"list", 'l', 0, G_OPTION_ARG_NONE, &list,
|
||||
"List all available tests and exit", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
static gpointer
|
||||
|
@ -37,7 +37,7 @@ static GOptionEntry cmd_entries[] = {
|
||||
"Print extra information", NULL},
|
||||
{"seconds", 's', 0, G_OPTION_ARG_INT, &test_length,
|
||||
"Time to run each test in seconds", NULL},
|
||||
{NULL}
|
||||
G_OPTION_ENTRY_NULL
|
||||
};
|
||||
|
||||
typedef struct _PerformanceTest PerformanceTest;
|
||||
|
Loading…
Reference in New Issue
Block a user