gbranden pushed a commit to branch master
in repository groff.

commit 1c07490ffb33ffd3cd61f054823a6462a4cc1d8b
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Mon Mar 17 12:58:51 2025 -0500

    [troff]: Fix code style nit.
    
    * src/roff/troff/input.cpp (set_hyphenation_codes): Use character, not
      integer, literals when assigning and comparing to local variables of
      `char` type.
---
 ChangeLog                | 6 ++++++
 src/roff/troff/input.cpp | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index eaa9eacad..7e5ad6ad8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-03-17  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * src/roff/troff/input.cpp (set_hyphenation_codes): Use
+       character, not integer, literals when assigning and comparing to
+       local variables of `char` type.
+
 2025-03-17  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        [troff]: Slightly refactor.  Boolify and rename global and
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index c1b29a41d..0bf7533c5 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8024,7 +8024,7 @@ static void set_hyphenation_codes()
       break;
     }
     charinfo *cidst = tok.get_char();
-    if (0 == cdst) {
+    if ('\0' == cdst) {
       if (0 /* nullptr */ == cidst) {
        error("expected ordinary, special, or indexed character,"
              " got %1", tok.description());
@@ -8041,13 +8041,13 @@ static void set_hyphenation_codes()
       error("cannot use the hyphenation code of a numeral");
       break;
     }
-    unsigned char new_code = 0;
+    unsigned char new_code = '\0';
     charinfo *cisrc = tok.get_char();
     if (cisrc != 0 /* nullptr */)
       // Common case: assign destination character the hyphenation code
       // of the source character.
       new_code = cisrc->get_hyphenation_code();
-    if (0 == csrc) {
+    if ('\0' == csrc) {
       if (0 /* nullptr */ == cisrc) {
        error("expected ordinary, special, or indexed character,"
              " got %1", tok.description());

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

Reply via email to