gbranden pushed a commit to branch master
in repository groff.
commit 43addffd572c0047e2785b01cb4a58e2da3ed55f
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 9 06:03:41 2026 -0600
src/preproc/tbl/main.cpp: Fix code style nit.
* src/preproc/tbl/main.cpp (process_format): Explicitly compare variable
`current_format` of pointer type to ISO C++98 null pointer literal,
instead of punning it down to a Boolean.
---
ChangeLog | 7 +++++++
src/preproc/tbl/main.cpp | 8 ++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4388c964a..a5ff19ecb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-11-09 G. Branden Robinson <[email protected]>
+
+ * src/preproc/tbl/main.cpp (process_format): Fix code style nit.
+ Explicitly compare variable `current_format` of pointer type to
+ ISO C++98 null pointer literal, instead of punning it down to a
+ Boolean.
+
2026-11-09 G. Branden Robinson <[email protected]>
[groff]: Unit-test `shift` request.
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index e43f90f57..84b2d45d8 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1246,7 +1246,7 @@ static format *process_format(table_input &in, options
*opt,
}
int row;
format *f;
- if (current_format) {
+ if (current_format != 0 /* nullptr */) {
if (ncolumns > current_format->ncolumns) {
error("cannot increase the number of columns in a continued format");
free_input_entry_format_list(list);
@@ -1267,7 +1267,7 @@ static format *process_format(table_input &in, options
*opt,
if (col < ncolumns - 1) {
// use the greatest separation
if (tem->separation > f->separation[col]) {
- if (current_format)
+ if (current_format != 0 /* nullptr */)
error("cannot change column separation in continued format");
else
f->separation[col] = tem->separation;
@@ -1276,13 +1276,13 @@ static format *process_format(table_input &in, options
*opt,
else if (tem->separation >= 0)
error("column separation specified for last column");
if (tem->is_equal_width && !f->equal[col]) {
- if (current_format)
+ if (current_format != 0 /* nullptr */)
error("cannot change which columns are equal in continued format");
else
f->equal[col] = 1;
}
if (tem->expand && !f->expand[col]) {
- if (current_format)
+ if (current_format != 0 /* nullptr */)
error("cannot change which columns are expanded in continued format");
else {
f->expand[col] = 1;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit