gbranden pushed a commit to branch master
in repository groff.
commit 19fd8082bcc427358272e1160b9ca0d1ba889284
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 9 06:36:05 2026 -0600
src/preproc/tbl/main.cpp: Fix code style nits.
* src/preproc/tbl/main.cpp (free_input_entry_format_list)
(process_format): Explicitly compare variable `list` of pointer type
to ISO C++98 null pointer literal, instead of punning it down to a
Boolean. Arrange equality comparisons to avoid inadvertent assignment
to lvalue.
---
ChangeLog | 8 ++++++++
src/preproc/tbl/main.cpp | 6 +++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 806171940..a7a936008 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-11-09 G. Branden Robinson <[email protected]>
+
+ * src/preproc/tbl/main.cpp (free_input_entry_format_list)
+ (process_format): Fix code style nits. Explicitly compare
+ variable `list` of pointer type to ISO C++98 null pointer
+ literal, instead of punning it down to a Boolean. Arrange
+ equality comparisons to avoid inadvertent assignment to lvalue.
+
2026-11-09 G. Branden Robinson <[email protected]>
* src/preproc/tbl/main.cpp (process format): In error messages,
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index d30786cad..ca6e62df7 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -752,7 +752,7 @@ input_entry_format::~input_entry_format()
static void free_input_entry_format_list(input_entry_format *list)
{
- while (list) {
+ while (list != 0 /* nullptr */) {
input_entry_format *tem = list;
list = list->next;
delete tem;
@@ -1205,7 +1205,7 @@ static format *process_format(table_input &in, options
*opt,
return 0 /* nullptr */;
}
}
- if (!list) {
+ if (0 /* nullptr */ == list) {
error("table description is empty");
free_input_entry_format_list(list);
list = 0 /* nullptr */;
@@ -1214,7 +1214,7 @@ static format *process_format(table_input &in, options
*opt,
list->is_last_column = true;
// now reverse the list so that the first row is at the beginning
input_entry_format *rev = 0;
- while (list != 0) {
+ while (list != 0 /* nullptr */) {
input_entry_format *tem = list->next;
list->next = rev;
rev = list;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit