gbranden pushed a commit to branch master
in repository groff.

commit 7ca4fca64f4ea04686ee5a495eaff58f9e6e90b8
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Sep 1 20:40:54 2024 -0500

    [troff]: Fix code style nits.
    
    * src/roff/troff/env.cpp (hyphenate): Explicitly compare variable of
      pointer type to null pointer constant instead of letting it pun down
      to a Boolean.  Also parenthesize complex expression.
---
 ChangeLog              | 6 ++++++
 src/roff/troff/env.cpp | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d2372d660..6b5cf6b35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-09-01  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/env.cpp (hyphenate): Explicitly compare
+       variable of pointer type to null pointer constant instead of
+       letting it pun down to a Boolean.
+
 2024-09-01  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (family_change): Ignore `fam` request
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 75df196f4..49ba0b726 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -4260,8 +4260,8 @@ void hyphenate(hyphen_list *h, unsigned flags)
 {
   if (!current_language)
     return;
-  while (h) {
-    while (h && (0 == h->hyphenation_code))
+  while (h != 0 /* nullptr */) {
+    while ((h != 0 /* nullptr */) && (0 == h->hyphenation_code))
       h = h->next;
     int len = 0;
     // Locate hyphenable points within a (subset of) an input word.

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

Reply via email to