gbranden pushed a commit to branch master
in repository groff.

commit 25269904b8f10d63c7f9f427750a2d7a0f0bd4d1
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Apr 11 13:29:15 2026 -0500

    src/devices/grotty/tty.cpp: Fix code style nit.
    
    * src/devices/grotty/tty.cpp: Correctly type-annotate zero literals in
      comparisons.
    
    Also annotate null pointer with `nullptr` comment to ease any future
    transition to C++11, which defines it as a keyword.
---
 ChangeLog                  |  5 +++++
 src/devices/grotty/tty.cpp | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ead260f74..cbf4b1971 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -95,6 +95,11 @@
        (add_hyphenation_exception_words_request): Slightly refactor.
        Revise loop style.
 
+2026-04-11  G. Branden Robinson <[email protected]>
+
+       * src/devices/grotty/tty.cpp: Fix code style nit.  Correctly
+       type-annotate zero literals in comparisons.
+
 2026-04-11  G. Branden Robinson <[email protected]>
 
        * src/devices/grotty/tty.cpp: Fix code style nit.  Parenthesize
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 09d6e7126..e287fdd46 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -140,7 +140,7 @@ tty_font *tty_font::load_tty_font(const char *s)
   const char *num = f->get_internal_name();
   long n;
   if ((num != 0 /* nullptr */)
-      && (n = strtol(num, 0 /* nullptr */, 0)) != 0)
+      && (n = strtol(num, 0 /* nullptr */, 0)) != 0L)
     f->mode = (unsigned char)(n & (BOLD_MODE|UNDERLINE_MODE));
   if (!do_underline)
     f->mode &= ~UNDERLINE_MODE;
@@ -153,7 +153,7 @@ tty_font *tty_font::load_tty_font(const char *s)
 }
 
 tty_font::tty_font(const char *nm)
-: font(nm), mode(0)
+: font(nm), mode(0U)
 {
 }
 
@@ -438,7 +438,7 @@ void tty_printer::add_char(output_character c, int w,
 void tty_printer::simple_add_char(const output_character c,
                                  const environment *env)
 {
-  add_char(c, 0, env->hpos, env->vpos, env->col, env->fill, 0);
+  add_char(c, 0, env->hpos, env->vpos, env->col, env->fill, 0U);
 }
 
 void tty_printer::special(char *arg, const environment *env, char type)
@@ -524,10 +524,10 @@ void tty_printer::special_link(const char *arg, const 
environment *env)
     arg--;
     ptrdiff_t uri_len = arg - uri;
     // Any remaining arguments are "key=value" pairs.
-    const char *pair = 0;
+    const char *pair = 0 /* nullptr */;
     bool done = false;
     do {
-      if (pair != 0)
+      if (pair != 0 /* nullptr */)
        simple_add_char(':', env);
       pair = arg;
       bool in_pair = true;

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

Reply via email to