gbranden pushed a commit to branch master
in repository groff.
commit bd1884d70ccf998c3129985294ed80cc914726d0
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Nov 4 02:10:49 2025 -0600
Fix code style nits.
* src/devices/grodvi/dvi.cpp:
* src/devices/grohtml/post-html.cpp:
* src/devices/grolbp/lbp.cpp:
* src/devices/grolj4/lj4.cpp:
* src/devices/grops/ps.cpp:
* src/devices/grotty/tty.cpp:
* src/include/searchpath.h:
* src/preproc/eqn/main.cpp:
* src/preproc/html/pre-html.cpp:
* src/preproc/pic/main.cpp:
* src/preproc/preconv/preconv.cpp:
* src/preproc/soelim/soelim.cpp:
* src/preproc/tbl/main.cpp:
* src/roff/groff/groff.cpp:
* src/roff/troff/input.cpp:
* src/utils/hpftodit/hpftodit.cpp:
* src/utils/indxbib/indxbib.cpp:
* src/utils/lkbib/lkbib.cpp:
* src/utils/lookbib/lookbib.cpp:
* src/utils/tfmtodit/tfmtodit.cpp: Annotate null pointers with `nullptr`
comment to ease any future transition to C++11, which defines it as a
keyword. Update indentation; break lines at 72 columns. Indent
continued lines by 4 columns when no opening parenthesis is on the
foregoing line with which to align, or there isn't room to do so.
Write `switch` with space after it like a C language keyword, not a
function (a Thompsonism[1]). Drop braces when unnecessary for
statement grouping; that's the predominant code style in groff.
[1] https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/nsys/ken/fio.c
---
src/devices/grodvi/dvi.cpp | 5 +++--
src/devices/grohtml/post-html.cpp | 12 ++++++------
src/devices/grolbp/lbp.cpp | 5 ++---
src/devices/grolj4/lj4.cpp | 5 +++--
src/devices/grops/ps.cpp | 9 +++++----
src/devices/grotty/tty.cpp | 13 +++++++------
src/include/searchpath.h | 3 ++-
src/preproc/eqn/main.cpp | 9 +++++----
src/preproc/html/pre-html.cpp | 10 +++++-----
src/preproc/pic/main.cpp | 9 +++++----
src/preproc/preconv/preconv.cpp | 6 +++---
src/preproc/soelim/soelim.cpp | 22 ++++++++++++----------
src/preproc/tbl/main.cpp | 9 +++++----
src/roff/groff/groff.cpp | 15 +++++++--------
src/roff/troff/input.cpp | 11 ++++++-----
src/utils/hpftodit/hpftodit.cpp | 20 ++++++++++----------
src/utils/indxbib/indxbib.cpp | 8 ++++----
src/utils/lkbib/lkbib.cpp | 9 +++++----
src/utils/lookbib/lookbib.cpp | 9 +++++----
src/utils/tfmtodit/tfmtodit.cpp | 9 +++++----
20 files changed, 105 insertions(+), 93 deletions(-)
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp
index d92048b64..4d46da10a 100644
--- a/src/devices/grodvi/dvi.cpp
+++ b/src/devices/grodvi/dvi.cpp
@@ -945,8 +945,9 @@ int main(int argc, char **argv)
{ 0 /* nullptr */, 0, 0, 0 }
};
while ((c = getopt_long(argc, argv, ":dF:I:lp:vw:", long_options,
- 0 /* nullptr */)) != EOF)
- switch(c) {
+ 0 /* nullptr */))
+ != EOF)
+ switch (c) {
case 'd':
draw_flag = 0;
break;
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index 7ce3616f1..26d5d2591 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -5858,15 +5858,15 @@ int main(int argc, char **argv)
setbuf(stderr, stderr_buf);
int c;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
{ 0 /* nullptr */, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv,
- ":a:bCdD:eF:g:Ghi:I:j:k:lno:prs:S:vVx:y", long_options,
- 0 /* nullptr */))
+ while ((c = getopt_long(argc, argv, ":a:bCdD:eF:g:Ghi:I:j:k:l"
+ "no:prs:S:vVx:y",
+ long_options, 0 /* nullptr */))
!= EOF)
- switch(c) {
+ switch (c) {
case 'a':
/* text antialiasing bits - handled by pre-html */
break;
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index da2f0f781..22fcab587 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -642,7 +642,7 @@ static struct option long_options[] = {
{ "linewidth", required_argument, 0 /* nullptr */, 'w' },
{ "fontdir", required_argument, 0 /* nullptr */, 'F' },
{ "help", no_argument, 0 /* nullptr */, 'h' },
- { 0 /* nullptr */, 0, 0, 0 }
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
static void usage(FILE *stream)
@@ -670,7 +670,7 @@ int main(int argc, char **argv)
int c;
while ((c = getopt_long(argc, argv, ":c:F:hI:lo:p:vw:", long_options,
0 /* nullptr */))
- != EOF) {
+ != EOF)
switch (c) {
case 'F':
font::command_line_font_dir(optarg);
@@ -748,7 +748,6 @@ int main(int argc, char **argv)
default:
assert(0 == "unhandled getopt_long return value");
}
- }
if (optind >= argc)
do_file("-");
while (optind < argc)
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp
index eb6f9274a..44362c826 100644
--- a/src/devices/grolj4/lj4.cpp
+++ b/src/devices/grolj4/lj4.cpp
@@ -640,8 +640,9 @@ int main(int argc, char **argv)
{ 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((c = getopt_long(argc, argv, ":c:d:F:I:lp:vw:", long_options,
- 0 /* nullptr */)) != EOF)
- switch(c) {
+ 0 /* nullptr */))
+ != EOF)
+ switch (c) {
case 'l':
landscape_flag = 1;
break;
diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
index ba42ad2b0..747b30359 100644
--- a/src/devices/grops/ps.cpp
+++ b/src/devices/grops/ps.cpp
@@ -62,8 +62,8 @@ extern "C" {
extern "C" const char *Version_string;
-// search path defaults to the current directory
-search_path include_search_path(0, 0, 0, 1);
+// Initialize inclusion search path with only the current directory.
+search_path include_search_path(0 /* nullptr */, 0 /* nullptr */, 0, 1);
static int landscape_flag = 0;
static int manual_feed_flag = 0;
@@ -1878,8 +1878,9 @@ int main(int argc, char **argv)
{ 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((c = getopt_long(argc, argv, ":b:c:F:gI:lmp:P:vw:",
- long_options, 0 /* nullptr */)) != EOF)
- switch(c) {
+ long_options, 0 /* nullptr */))
+ != EOF)
+ switch (c) {
case 'b':
// XXX check this
broken_flags = atoi(optarg);
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 9848a66c8..987f9fb70 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -984,13 +984,14 @@ int main(int argc, char **argv)
setlocale(LC_CTYPE, "");
int c;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
- while ((c = getopt_long(argc, argv, ":bBcdfF:hiI:ortuUv", long_options,
- 0)) != EOF)
- switch(c) {
+ while ((c = getopt_long(argc, argv, ":bBcdfF:hiI:ortuUv",
+ long_options, 0 /* nullptr */))
+ != EOF)
+ switch (c) {
case 'v':
printf("GNU grotty (groff) version %s\n", Version_string);
exit(EXIT_SUCCESS);
diff --git a/src/include/searchpath.h b/src/include/searchpath.h
index c6e97757e..01f7f1ab5 100644
--- a/src/include/searchpath.h
+++ b/src/include/searchpath.h
@@ -25,7 +25,8 @@ public:
~search_path();
void command_line_dir(const char *);
FILE *open_file(const char *, char **);
- FILE *open_file_cautiously(const char *, char ** = 0, const char * = 0);
+ FILE *open_file_cautiously(const char *, char ** = 0 /* nullptr */,
+ const char * = 0 /* nullptr */);
};
// Local Variables:
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index 9a4306d14..691059ee9 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -336,12 +336,13 @@ int main(int argc, char **argv)
int opt;
bool want_startup_file = true;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((opt = getopt_long(argc, argv, ":CNrRd:f:m:M:p:s:T:v",
- long_options, 0)) != EOF)
+ long_options, 0 /* nullptr */))
+ != EOF)
switch (opt) {
case 'C':
compatible_flag = 1;
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 78fbb2cbe..ff15a950f 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -1613,15 +1613,15 @@ static int scanArguments(int argc, char **argv)
strcpy(s, "troff");
int c, i;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
{ 0 /* nullptr */, 0, 0, 0 }
};
while ((c = getopt_long(argc, argv,
- "+:a:bCdD:eF:g:Ghi:I:j:k:lno:prs:S:vVx:y", long_options,
- 0 /* nullptr */))
+ "+:a:bCdD:eF:g:Ghi:I:j:k:lno:prs:S:vVx:y",
+ long_options, 0 /* nullptr */))
!= EOF)
- switch(c) {
+ switch (c) {
case 'a':
textAlphaBits = min(max(MIN_ALPHA_BITS, atoi(optarg)),
MAX_ALPHA_BITS);
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 5e7fa6211..7ff1349fc 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -556,12 +556,13 @@ int main(int argc, char **argv)
int fig_flag = 0;
#endif
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((opt = getopt_long(argc, argv, ":cCDfnpStT:Uvxz", long_options,
- 0)) != EOF)
+ 0 /* nullptr */))
+ != EOF)
switch (opt) {
case 'C':
compatible_flag = 1;
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index 0ca91a62d..08431d0da 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -1275,9 +1275,9 @@ main(int argc, char **argv)
{ 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
// Parse the command-line options.
- while ((opt = getopt_long(argc, argv,
- ":dD:e:hrv", long_options,
- 0 /* nullptr */)) != EOF)
+ while ((opt = getopt_long(argc, argv, ":dD:e:hrv", long_options,
+ 0 /* nullptr */))
+ != EOF)
switch (opt) {
case 'v':
printf("GNU preconv (groff) version %s %s iconv support and %s"
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 508433e97..acc7aa0f9 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -36,8 +36,9 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include "searchpath.h"
#include "lf.h"
-// The include search path initially contains only the current directory.
-static search_path include_search_path(0, 0, 0, 1);
+// Initialize inclusion search path with only the current directory.
+static search_path include_search_path(0 /* nullptr */, 0 /* nullptr */,
+ 0, 1);
bool want_att_compat = false;
bool want_raw_output = false;
@@ -72,12 +73,12 @@ int main(int argc, char **argv)
program_name = argv[0];
int opt;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((opt = getopt_long(argc, argv, ":CI:rtv", long_options,
- 0))
+ 0 /* nullptr */))
!= EOF)
switch (opt) {
case 'v':
@@ -189,16 +190,16 @@ void do_so(const char *line)
static bool do_file(const char *filename)
{
- char *file_name_in_path = 0;
+ char *file_name_in_path = 0 /* nullptr */;
FILE *fp = include_search_path.open_file_cautiously(filename,
- &file_name_in_path);
+ &file_name_in_path);
int err = errno;
string whole_filename(filename);
if (strcmp(filename, "-") && file_name_in_path != 0 /* nullptr */)
whole_filename = file_name_in_path;
whole_filename += '\0';
free(file_name_in_path);
- if (0 == fp) {
+ if (0 /* nullptr */ == fp) {
error("cannot open '%1': %2", whole_filename.contents(),
strerror(err));
return false;
@@ -207,7 +208,8 @@ static bool do_file(const char *filename)
current_filename = whole_filename.contents();
current_lineno = 1;
set_location();
- enum { START, MIDDLE, HAD_DOT, HAD_s, HAD_so, HAD_l, HAD_lf } state = START;
+ enum { START, MIDDLE, HAD_DOT, HAD_s, HAD_so, HAD_l, HAD_lf } state
+ = START;
for (;;) {
int c = getc(fp);
if (c == EOF)
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index 59ded3f32..ce4d93fb6 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1665,11 +1665,12 @@ int main(int argc, char **argv)
setbuf(stderr, stderr_buf);
int opt;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
- while ((opt = getopt_long(argc, argv, ":vC", long_options, 0))
+ while ((opt = getopt_long(argc, argv, ":vC", long_options,
+ 0 /* nullptr */))
!= EOF)
switch (opt) {
case 'C':
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index fd86a5feb..69d9058a1 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -179,15 +179,14 @@ int main(int argc, char **argv)
command_prefix = PROG_PREFIX;
commands[TROFF_INDEX].set_name(command_prefix, "troff");
static const struct option long_options[] = {
- { "help", no_argument, 0, 'h' },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, 'h' },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 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, 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, 0 /* nullptr */))
!= EOF) {
char buf[3];
buf[0] = '-';
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index b2788a1aa..0d0e3dcdc 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -156,8 +156,8 @@ bool want_html_debugging = true; // enable more
diagnostics
search_path *mac_path = &safer_macro_path;
-// Defaults to the current directory.
-search_path include_search_path(0, 0, 0, 1);
+// Initialize inclusion search path with only the current directory.
+search_path include_search_path(0 /* nullptr */, 0 /* nullptr */, 0, 1);
static int get_copy(node**, bool = false, bool = false);
static void copy_mode_error(const char *,
@@ -9510,8 +9510,8 @@ int main(int argc, char **argv)
}
setlocale(LC_CTYPE, "");
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
{ 0, 0, 0, 0 }
};
#if defined(DEBUGGING)
@@ -9521,7 +9521,8 @@ int main(int argc, char **argv)
#endif
while ((c = getopt_long(argc, argv,
":abcCd:Ef:F:iI:m:M:n:o:qr:Rs:StT:Uvw:W:z"
- DEBUG_OPTION, long_options, 0))
+ DEBUG_OPTION,
+ long_options, 0 /* nullptr */))
!= EOF)
switch (c) {
case 'v':
diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp
index 2f7525d84..617a76abe 100644
--- a/src/utils/hpftodit/hpftodit.cpp
+++ b/src/utils/hpftodit/hpftodit.cpp
@@ -290,19 +290,20 @@ main(int argc, char **argv)
program_name = argv[0];
int opt;
- int res = 1200; // PCL unit of measure for cursor moves
- int scalesize = 4; // LaserJet 4 only allows 1/4 point increments
+ int res = 1200; // PCL unit of measure for cursor moves
+ int scalesize = 4; // LaserJet 4 only allows 1/4 point increments
int unitwidth = 6350;
- double ppi; // points per inch
- double upem; // design units per em
+ double ppi; // points per inch
+ double upem; // design units per em
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
- while ((opt = getopt_long(argc, argv, ":adsqvi:", long_options, 0))
- != EOF) {
+ while ((opt = getopt_long(argc, argv, ":adsqvi:", long_options,
+ 0 /* nullptr */))
+ != EOF)
switch (opt) {
case 'a':
all_flag = YES;
@@ -341,7 +342,6 @@ main(int argc, char **argv)
default:
assert(0);
}
- }
if (debug_flag && argc - optind < 1)
usage();
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index 0c3b51ce3..be3570cc7 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -137,12 +137,12 @@ int main(int argc, char **argv)
const char *foption = 0;
int opt;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((opt = getopt_long(argc, argv, ":c:o:h:i:k:l:t:n:c:d:f:vw",
- long_options, 0))
+ long_options, 0 /* nullptr */))
!= EOF)
switch (opt) {
case 'c':
diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp
index f413ae8ed..419972cbf 100644
--- a/src/utils/lkbib/lkbib.cpp
+++ b/src/utils/lkbib/lkbib.cpp
@@ -64,12 +64,13 @@ int main(int argc, char **argv)
search_list list;
int opt;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
while ((opt = getopt_long(argc, argv, ":nvVi:t:p:", long_options,
- 0)) != EOF)
+ 0 /* nullptr */))
+ != EOF)
switch (opt) {
case 'V':
do_verify = true;
diff --git a/src/utils/lookbib/lookbib.cpp b/src/utils/lookbib/lookbib.cpp
index 8c899b696..6e2be5002 100644
--- a/src/utils/lookbib/lookbib.cpp
+++ b/src/utils/lookbib/lookbib.cpp
@@ -71,11 +71,12 @@ int main(int argc, char **argv)
setbuf(stderr, stderr_buf);
int opt;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
- while ((opt = getopt_long(argc, argv, ":vVi:t:", long_options, 0))
+ while ((opt = getopt_long(argc, argv, ":vVi:t:", long_options,
+ 0 /* nullptr */))
!= EOF)
switch (opt) {
case 'V':
diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp
index fc8d5e216..ec6fb89ed 100644
--- a/src/utils/tfmtodit/tfmtodit.cpp
+++ b/src/utils/tfmtodit/tfmtodit.cpp
@@ -701,11 +701,12 @@ int main(int argc, char **argv)
int opt;
const char *gf_file = 0;
static const struct option long_options[] = {
- { "help", no_argument, 0, CHAR_MAX + 1 },
- { "version", no_argument, 0, 'v' },
- { 0, 0, 0, 0 }
+ { "help", no_argument, 0 /* nullptr */, CHAR_MAX + 1 },
+ { "version", no_argument, 0 /* nullptr */, 'v' },
+ { 0 /* nullptr */, 0, 0 /* nullptr */, 0 }
};
- while ((opt = getopt_long(argc, argv, ":svg:k:", long_options, 0))
+ while ((opt = getopt_long(argc, argv, ":svg:k:", long_options,
+ 0 /* nullptr */))
!= EOF)
switch (opt) {
case 'g':
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit