gbranden pushed a commit to branch master
in repository groff.

commit e22ce67b29647363954e63213dfc6360ccc471ad
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Nov 4 07:02:19 2025 -0600

    [pfbtops,xtotroff]: Trivially refactor.
    
    * src/utils/pfbtops/pfbtops.c (main):
    * src/utils/xtotroff/xtotroff.c (main): Use idiomatic ISO C99 null
      pointer constant literal.
    
    getopt_long(3):
             struct option {
                 const char *name;
                 int         has_arg;
                 int        *flag;
                 int         val;
             };
    
    I don't know why you'd spell one null pointer in this struct as `NULL`
    and the other as `0`, but that's what groff's been doing for decades.
    
    squash [pfbtops,xtotroff]: Trivially refactor.
---
 ChangeLog                     | 6 ++++++
 src/utils/pfbtops/pfbtops.c   | 6 +++---
 src/utils/xtotroff/xtotroff.c | 6 +++---
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 591a22bff..eff1ed3f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-11-04  G. Branden Robinson <[email protected]>
+
+       * src/utils/pfbtops/pfbtops.c (main):
+       * src/utils/xtotroff/xtotroff.c (main): Trivially refactor; use
+       idiomatic ISO C99 null pointer constant literal.
+
 2025-11-04  G. Branden Robinson <[email protected]>
 
        * src/devices/grolbp/lbp.cpp (main): Eliminate dead store.
diff --git a/src/utils/pfbtops/pfbtops.c b/src/utils/pfbtops/pfbtops.c
index f3b85f2cd..9010eb210 100644
--- a/src/utils/pfbtops/pfbtops.c
+++ b/src/utils/pfbtops/pfbtops.c
@@ -178,9 +178,9 @@ int main(int argc, char **argv)
 {
   int opt;
   static const struct option long_options[] = {
-    { "help", no_argument, 0, CHAR_MAX + 1 },
-    { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { "help", no_argument, NULL, CHAR_MAX + 1 },
+    { "version", no_argument, NULL, 'v' },
+    { NULL, 0, NULL, 0 }
   };
 
   program_name = argv[0];
diff --git a/src/utils/xtotroff/xtotroff.c b/src/utils/xtotroff/xtotroff.c
index adff7da6b..ee5ccb501 100644
--- a/src/utils/xtotroff/xtotroff.c
+++ b/src/utils/xtotroff/xtotroff.c
@@ -286,9 +286,9 @@ int main(int argc, char **argv)
   FILE *map;
   int opt;
   static const struct option long_options[] = {
-    { "help", no_argument, 0, CHAR_MAX + 1 },
-    { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { "help", no_argument, NULL, CHAR_MAX + 1 },
+    { "version", no_argument, NULL, 'v' },
+    { NULL, 0, NULL, 0 }
   };
 
   program_name = argv[0];

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to