gbranden pushed a commit to branch master
in repository groff.

commit 5fdcea8c9567f1eb0bc035ba9d1d90ae4c870bb8
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Sun Mar 16 11:06:16 2025 -0500

    [libgroff]: Fix code style nit.
    
    * src/libs/libgroff/font.cpp (glyph_to_ucs_codepoint, glyph_to_unicode):
      Explicitly compare return value of pointer type to null pointer
      literal instead of letting it pun down to a Boolean.
---
 ChangeLog                  | 7 +++++++
 src/libs/libgroff/font.cpp | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ece453852..be2460620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-03-16  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * src/libs/libgroff/font.cpp (glyph_to_ucs_codepoint)
+       (glyph_to_unicode): Fix code style nit; explicitly compare
+       return value of pointer type to null pointer literal instead of
+       letting it pun down to a Boolean.
+
 2025-03-16  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        * src/libs/libgroff/unicode.cpp (valid_unicode_code_sequence):
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index 0e89ecfc8..1be3bf625 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -172,7 +172,8 @@ static int glyph_to_ucs_codepoint(glyph *g)
 {
   const char *nm = glyph_to_name(g);
   if (nm != 0 /* nullptr */) {
-    if (valid_unicode_code_sequence(nm) && (strchr(nm, '_') == 0)) {
+    if ((valid_unicode_code_sequence(nm) != 0 /* nullptr */)
+       && (strchr(nm, '_') == 0)) {
       char *ignore;
       return static_cast<int>(strtol(nm + 1, &ignore, 16));
     }
@@ -202,7 +203,7 @@ int glyph_to_unicode(glyph *g)
       }
     }
     // Unicode character?
-    if (valid_unicode_code_sequence(nm)) {
+    if (valid_unicode_code_sequence(nm) != 0 /* nullptr */) {
       char *ignore;
       return (int)strtol(nm + 1, &ignore, 16);
     }

_______________________________________________
groff-commit mailing list
groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to