gbranden pushed a commit to branch master
in repository groff.

commit 85ea8405a03e88d515af1aaa930ad7855eee3782
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Jul 13 12:00:22 2024 -0500

    [libgroff,troff]: Trivially refactor (3/5).
    
    * src/libs/libgroff/font.cpp (glyph_to_unicode):
    * src/roff/troff/input.cpp (open_macro_package): Add parentheses to
      complex expressions.
---
 ChangeLog                  | 3 +++
 src/libs/libgroff/font.cpp | 2 +-
 src/roff/troff/input.cpp   | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7c32f92cb..e4e232ede 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
        (font::get_width, font::alloc_ch_index, font::load_desc): Do the
        same for comparisons to integral zeroes.
 
+       * src/libs/libgroff/font.cpp (glyph_to_unicode): Add parentheses
+       to complex expression.
+
 2024-07-13  G. Branden Robinson <[email protected]>
 
        * src/libs/libgroff/font.cpp (font::load, font::load_desc):
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index 7d54bff39..591da14f7 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -195,7 +195,7 @@ int glyph_to_unicode(glyph *g)
     }
     // groff glyphs that map to Unicode?
     const char *unicode = glyph_name_to_unicode(nm);
-    if (unicode != 0 && strchr(unicode, '_') == 0) {
+    if ((unicode != 0) && (strchr(unicode, '_') == 0)) {
       char *ignore;
       return (int)strtol(unicode, &ignore, 16);
     }
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 9a3e51d65..d1fa4f45b 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8028,7 +8028,7 @@ static FILE *open_macro_package(const char *mac, char 
**path)
   strcpy(s1, mac);
   strcat(s1, MACRO_POSTFIX);
   FILE *fp = mac_path->open_file(s1, path);
-  if (!fp && ENOENT != errno)
+  if ((!fp) && (ENOENT != errno))
     error("unable to open macro file '%1': %2", s1, strerror(errno));
   delete[] s1;
   if (!fp) {
@@ -8036,7 +8036,7 @@ static FILE *open_macro_package(const char *mac, char 
**path)
     strcpy(s2, MACRO_PREFIX);
     strcat(s2, mac);
     fp = mac_path->open_file(s2, path);
-    if (!fp && ENOENT != errno)
+    if ((!fp) && (ENOENT != errno))
       error("unable to open macro file '%1': %2", s2, strerror(errno));
     delete[] s2;
   }

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

Reply via email to