gbranden pushed a commit to branch master
in repository groff.

commit 57b85f572a46d6a8116bd6a309d3e5c40feb39db
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri May 30 18:58:23 2025 -0500

    src/roff/troff/node.cpp: Fix code style nit.
    
    * src/roff/troff/node.cpp (set_soft_hyphen_character): Explicitly
      compare value of pointer type to null pointer literal instead of
      letting it pun down to a Boolean.
    
    Also annotate null pointers with `nullptr` comment to ease any future
    transition to C++11, which defines it as a keyword.
---
 ChangeLog               | 6 ++++++
 src/roff/troff/node.cpp | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 80b817df0..43bf17b2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-05-30  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/node.cpp (set_soft_hyphen_character):
+       Explicitly compare value of pointer type to null pointer literal
+       instead of letting it pun down to a Boolean.
+
 2025-05-30  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (warn_request): Disclose value of
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 41f99ea10..074d14b81 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -2896,7 +2896,7 @@ node *node::add_italic_correction(hunits *wd)
     return this;
   else {
     node *next1 = next;
-    next = 0;
+    next = 0 /* nullptr */;
     *wd += ic;
     return new italic_corrected_node(this, ic, state, div_nest_level,
                                     next1);
@@ -5632,7 +5632,7 @@ node *node::add_char(charinfo *ci, environment *env,
     break_code |= IS_INTERWORD_SPACE;
   if (break_code) {
     node *next1 = res->next;
-    res->next = 0;
+    res->next = 0 /* nullptr */;
     res = new break_char_node(res, break_code, get_break_code(),
                              env->get_fill_color(), next1);
   }
@@ -6918,7 +6918,7 @@ static void read_special_fonts(special_font_list **sp)
     else {
       special_font_list *tem = new special_font_list;
       tem->n = finfo.position;
-      tem->next = 0;
+      tem->next = 0 /* nullptr */;
       *p = tem;
       p = &(tem->next);
     }
@@ -7317,7 +7317,7 @@ static void set_kerning_mode()
 static void set_soft_hyphen_character()
 {
   soft_hyphen_char = get_optional_char();
-  if (!soft_hyphen_char)
+  if (0 /* nullptr */ == soft_hyphen_char)
     soft_hyphen_char = get_charinfo(HYPHEN_SYMBOL);
   skip_line();
 }

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

Reply via email to