gbranden pushed a commit to branch master
in repository groff.

commit 20574aeaffb980cf4fef1a96d9de842e9a44c529
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 22 18:35:15 2026 -0600

    src/roff/troff/node.cpp: Fix code style nits.
    
    * src/roff/troff/node.cpp (make_glyph_node): Explicitly compare variable
      of pointer type to ISO C++98 null pointer literal, instead of punning
      it down to a Boolean.
    
      (make_glyph_node, set_ligature_mode_request): Parenthesize formally
      complex expressions.
---
 ChangeLog               | 9 +++++++++
 src/roff/troff/node.cpp | 8 ++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 08f603506..cdea22f1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-11-22  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/node.cpp: Fix code style nits.
+       (make_glyph_node): Explicitly compare variable of pointer type
+       to ISO C++98 null pointer literal, instead of punning it down to
+       a Boolean.
+       (make_glyph_node, set_ligature_mode_request): Parenthesize
+       formally complex expressions.
+
 2026-11-22  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.cpp: Rename `static` global array
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index a75a751ca..f3f092bc5 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -5615,7 +5615,7 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
     special_font_list *sf = mounted_font[fontno]->sf;
     while ((sf != 0 /* nullptr */) && !found) {
       fn = sf->n;
-      if (mounted_font[fn])
+      if (mounted_font[fn] != 0 /* nullptr*/)
        found = mounted_font[fn]->contains(s);
       sf = sf->next;
     }
@@ -5633,7 +5633,7 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
       sf = global_special_fonts;
       while ((sf != 0 /* nullptr */) && !found) {
        fn = sf->n;
-       if (mounted_font[fn])
+       if (mounted_font[fn] != 0 /* nullptr*/)
          found = mounted_font[fn]->contains(s);
        sf = sf->next;
       }
@@ -5643,7 +5643,7 @@ static node *make_glyph_node(charinfo *s, environment 
*env,
        return make_composite_node(s, env);
     if (!found) {
       for (fn = 0; fn < mounted_font_size; fn++)
-       if (mounted_font[fn]
+       if ((mounted_font[fn] != 0 /* nullptr*/)
            && mounted_font[fn]->is_special()
            && mounted_font[fn]->contains(s)) {
          found = true;
@@ -7615,7 +7615,7 @@ static void constantly_space_font_request() // .cs
 static void set_ligature_mode_request() // .lg
 {
   int lig;
-  if (has_arg() && read_integer(&lig) && lig >= 0 && lig <= 2)
+  if (has_arg() && read_integer(&lig) && (lig >= 0) && (lig <= 2))
     global_ligature_mode = lig;
   else
     global_ligature_mode = 1;

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

Reply via email to