From de16ae91807d0065b2c1a4693f2999f6dcfdc4bb Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 16 May 2021 11:21:40 +0300 Subject: [PATCH] Use G_OPTION_ENTRY_NULL macro. Signed-off-by: Andrew Borodin --- lib/glibcompat.h | 5 +++++ src/args.c | 12 +++--------- tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/glibcompat.h b/lib/glibcompat.h index c83bdc096..cb409662c 100644 --- a/lib/glibcompat.h +++ b/lib/glibcompat.h @@ -3,6 +3,11 @@ /*** typedefs(not structures) and defined constants **********************************************/ +#ifndef G_OPTION_ENTRY_NULL +#define G_OPTION_ENTRY_NULL \ + { NULL, '\0', 0, 0, NULL, NULL, NULL } +#endif /* G_OPTION_ENTRY_NULL */ + /*** enums ***************************************************************************************/ /*** structures declarations (and typedefs of structures)*****************************************/ diff --git a/src/args.c b/src/args.c index 397dd992e..0e932b570 100644 --- a/src/args.c +++ b/src/args.c @@ -194,9 +194,7 @@ static const GOptionEntry argument_main_table[] = { N_(" ...") }, - { - NULL, '\0', 0, 0, NULL, NULL, NULL /* Complete struct initialization */ - } + G_OPTION_ENTRY_NULL /* *INDENT-ON* */ }; @@ -279,9 +277,7 @@ static const GOptionEntry argument_terminal_table[] = { NULL }, - { - NULL, '\0', 0, 0, NULL, NULL, NULL /* Complete struct initialization */ - } + G_OPTION_ENTRY_NULL /* *INDENT-ON* */ }; @@ -321,9 +317,7 @@ static const GOptionEntry argument_color_table[] = { N_("") }, - { - NULL, '\0', 0, 0, NULL, NULL, NULL /* Complete struct initialization */ - } + G_OPTION_ENTRY_NULL /* *INDENT-ON* */ }; diff --git a/tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c b/tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c index 89b5445ff..f56e5636e 100644 --- a/tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c +++ b/tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c @@ -83,7 +83,7 @@ static GOptionEntry entries[] = { NULL}, {"format", 'f', 0, G_OPTION_ARG_CALLBACK, parse_format_name_argument, "Output format. Default: ls.", ""}, - {NULL, '\0', 0, 0, NULL, NULL, NULL} /* Make the compiler shut up by initializing everything. */ + G_OPTION_ENTRY_NULL }; /*** file scope functions ************************************************************************/