gbranden pushed a commit to branch master
in repository groff.

commit 07bfa9b333bab9d9e26ab84db961403eec7886eb
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Nov 4 07:01:09 2025 -0600

    Trivially refactor.
    
    [eqn, groff, grotty, hpftodit, indxbib, lkbib, lookbib, pic, soelim,
    tbl, tfmtodit]: Use idiomatic C++98 null pointer constant literal.
    
    * src/devices/grotty/tty.cpp (main):
    * src/preproc/eqn/main.cpp (main):
    * src/preproc/pic/main.cpp (main):
    * src/preproc/soelim/soelim.cpp (main):
    * src/preproc/tbl/main.cpp (main):
    * src/roff/groff/groff.cpp (main):
    * src/utils/hpftodit/hpftodit.cpp (main):
    * src/utils/indxbib/indxbib.cpp (main):
    * src/utils/lkbib/lkbib.cpp (main):
    * src/utils/lookbib/lookbib.cpp (main):
    * src/utils/tfmtodit/tfmtodit.cpp (main): Do it.
---
 ChangeLog                       | 18 ++++++++++++++++++
 src/devices/grotty/tty.cpp      |  4 ++--
 src/preproc/eqn/main.cpp        |  4 ++--
 src/preproc/pic/main.cpp        |  4 ++--
 src/preproc/soelim/soelim.cpp   |  5 +++--
 src/preproc/tbl/main.cpp        |  4 ++--
 src/roff/groff/groff.cpp        |  4 ++--
 src/utils/hpftodit/hpftodit.cpp |  4 ++--
 src/utils/indxbib/indxbib.cpp   |  4 ++--
 src/utils/lkbib/lkbib.cpp       |  4 ++--
 src/utils/lookbib/lookbib.cpp   |  4 ++--
 src/utils/tfmtodit/tfmtodit.cpp |  4 ++--
 12 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fbddf5251..edc573c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2025-11-04  G. Branden Robinson <[email protected]>
+
+       [eqn, groff, grotty, hpftodit, indxbib, lkbib, lookbib, pic,
+       soelim, tbl, tfmtodit]: Trivially refactor; use idiomatic C++98
+       null pointer constant literal.
+
+       * src/devices/grotty/tty.cpp (main):
+       * src/preproc/eqn/main.cpp (main):
+       * src/preproc/pic/main.cpp (main):
+       * src/preproc/soelim/soelim.cpp (main):
+       * src/preproc/tbl/main.cpp (main):
+       * src/roff/groff/groff.cpp (main):
+       * src/utils/hpftodit/hpftodit.cpp (main):
+       * src/utils/indxbib/indxbib.cpp (main):
+       * src/utils/lkbib/lkbib.cpp (main):
+       * src/utils/lookbib/lookbib.cpp (main):
+       * src/utils/tfmtodit/tfmtodit.cpp (main): Do it.
+
 2025-11-04  G. Branden Robinson <[email protected]>
 
        * src/preproc/soelim/soelim.cpp (do_file): Slightly refactor.
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index a3449c64c..9848a66c8 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -986,10 +986,10 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
   while ((c = getopt_long(argc, argv, ":bBcdfF:hiI:ortuUv", long_options,
-         NULL)) != EOF)
+         0)) != EOF)
     switch(c) {
     case 'v':
       printf("GNU grotty (groff) version %s\n", Version_string);
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index 5d69b0792..9a4306d14 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -338,10 +338,10 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
   while ((opt = getopt_long(argc, argv, ":CNrRd:f:m:M:p:s:T:v",
-                           long_options, NULL)) != EOF)
+                           long_options, 0)) != EOF)
     switch (opt) {
     case 'C':
       compatible_flag = 1;
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 94e1616ac..5e7fa6211 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -558,10 +558,10 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
   while ((opt = getopt_long(argc, argv, ":cCDfnpStT:Uvxz", long_options,
-         NULL)) != EOF)
+         0)) != EOF)
     switch (opt) {
     case 'C':
       compatible_flag = 1;
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 5fddd79ee..508433e97 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -74,9 +74,10 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
-  while ((opt = getopt_long(argc, argv, ":CI:rtv", long_options, NULL))
+  while ((opt = getopt_long(argc, argv, ":CI:rtv", long_options,
+                           0))
         != EOF)
     switch (opt) {
     case 'v':
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index 99ba66b09..59ded3f32 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1667,9 +1667,9 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
-  while ((opt = getopt_long(argc, argv, ":vC", long_options, NULL))
+  while ((opt = getopt_long(argc, argv, ":vC", long_options, 0))
          != EOF)
     switch (opt) {
     case 'C':
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index a4f3a84c5..fd86a5feb 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -181,13 +181,13 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, 'h' },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
   while ((opt = getopt_long(
                  argc, argv,
                  ":abcCd:D:eEf:F:gGhiI:jJkK:lL:m:M:"
                  "n:No:pP:r:RsStT:UvVw:W:XzZ",
-                 long_options, NULL))
+                 long_options, 0))
         != EOF) {
     char buf[3];
     buf[0] = '-';
diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp
index 2b52156d8..2f7525d84 100644
--- a/src/utils/hpftodit/hpftodit.cpp
+++ b/src/utils/hpftodit/hpftodit.cpp
@@ -299,9 +299,9 @@ main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
-  while ((opt = getopt_long(argc, argv, ":adsqvi:", long_options, NULL))
+  while ((opt = getopt_long(argc, argv, ":adsqvi:", long_options, 0))
         != EOF) {
     switch (opt) {
     case 'a':
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index 584c136b6..0c3b51ce3 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -139,10 +139,10 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
   while ((opt = getopt_long(argc, argv, ":c:o:h:i:k:l:t:n:c:d:f:vw",
-                           long_options, NULL))
+                           long_options, 0))
         != EOF)
     switch (opt) {
     case 'c':
diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp
index be5962fe4..f413ae8ed 100644
--- a/src/utils/lkbib/lkbib.cpp
+++ b/src/utils/lkbib/lkbib.cpp
@@ -66,10 +66,10 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
   while ((opt = getopt_long(argc, argv, ":nvVi:t:p:", long_options,
-         NULL)) != EOF)
+         0)) != EOF)
     switch (opt) {
     case 'V':
       do_verify = true;
diff --git a/src/utils/lookbib/lookbib.cpp b/src/utils/lookbib/lookbib.cpp
index 25171e257..8c899b696 100644
--- a/src/utils/lookbib/lookbib.cpp
+++ b/src/utils/lookbib/lookbib.cpp
@@ -73,9 +73,9 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
-  while ((opt = getopt_long(argc, argv, ":vVi:t:", long_options, NULL))
+  while ((opt = getopt_long(argc, argv, ":vVi:t:", long_options, 0))
         != EOF)
     switch (opt) {
     case 'V':
diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp
index b8183f635..fc8d5e216 100644
--- a/src/utils/tfmtodit/tfmtodit.cpp
+++ b/src/utils/tfmtodit/tfmtodit.cpp
@@ -703,9 +703,9 @@ int main(int argc, char **argv)
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
-    { NULL, 0, 0, 0 }
+    { 0, 0, 0, 0 }
   };
-  while ((opt = getopt_long(argc, argv, ":svg:k:", long_options, NULL))
+  while ((opt = getopt_long(argc, argv, ":svg:k:", long_options, 0))
         != EOF)
     switch (opt) {
     case 'g':

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

Reply via email to