Browse Source

Use G_OPTION_ENTRY_NULL macro.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andrew Borodin 3 years ago
parent
commit
de16ae9180
3 changed files with 9 additions and 10 deletions
  1. 5 0
      lib/glibcompat.h
  2. 3 9
      src/args.c
  3. 1 1
      tests/src/vfs/extfs/helpers-list/mc_parse_ls_l.c

+ 5 - 0
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)*****************************************/

+ 3 - 9
src/args.c

@@ -194,9 +194,7 @@ static const GOptionEntry argument_main_table[] = {
      N_("<file> ...")
     },
 
-    {
-     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_("<string>")
     },
 
-    {
-     NULL, '\0', 0, 0, NULL, NULL, NULL /* Complete struct initialization */
-    }
+    G_OPTION_ENTRY_NULL
     /* *INDENT-ON* */
 };
 

+ 1 - 1
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.", "<ls|yaml>"},
-    {NULL, '\0', 0, 0, NULL, NULL, NULL}        /* Make the compiler shut up by initializing everything. */
+    G_OPTION_ENTRY_NULL
 };
 
 /*** file scope functions ************************************************************************/