gbranden pushed a commit to branch master
in repository groff.

commit 4c775de75400b3afc243ffeee76aa20db073aa51
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Mar 6 19:37:16 2026 -0600

    src/roff/troff/input.cpp: Fix code style nit.
    
    * src/roff/troff/input.cpp (do_expr_test)
      (string_iterator::fill): Fix code style nit: assign to variable of
      unsigned integral type with explicitly unsigned integer literal.
    
    Also add code annotations.
---
 ChangeLog                |  7 +++++++
 src/roff/troff/input.cpp | 12 +++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 150941f84..cb4d69f67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-03-06  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (do_expr_test)
+       (string_iterator::fill): Fix code style nit: assign to variable
+       of unsigned integral type with explicitly unsigned integer
+       literal.
+
 2026-03-06  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/node.cpp: Fix typoed variable name; rename
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index bef670fd4..bc9119f14 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -358,7 +358,7 @@ protected:
   const unsigned char *endptr;
   input_iterator *next;
 private:
-  virtual int fill(node **);
+  virtual int fill(node **); // returns an unsigned char or `EOF`
   virtual int peek();
   virtual bool has_args() { return false; }
   virtual int nargs() { return 0; }
@@ -429,7 +429,7 @@ class file_iterator : public input_iterator {
 public:
   file_iterator(FILE *, const char *, bool = false);
   ~file_iterator();
-  int fill(node **);
+  int fill(node **); // returns an unsigned char or `EOF`
   int peek();
   bool get_location(bool /* allow_macro */, const char ** /* filep */,
                    int * /* linep */);
@@ -479,6 +479,7 @@ bool file_iterator::next_file(FILE *f, const char *s)
   return true;
 }
 
+// Returns an unsigned char or `EOF`.
 int file_iterator::fill(node **)
 {
   if (seen_newline)
@@ -1849,7 +1850,7 @@ static const char *do_expr_test() // \B
   // disable all warning and error messages temporarily
   unsigned int saved_warning_mask = warning_mask;
   bool saved_want_errors_inhibited = want_errors_inhibited;
-  warning_mask = 0;
+  warning_mask = 0U;
   want_errors_inhibited = true;
   int dummy;
   // TODO: grochar
@@ -4273,7 +4274,7 @@ protected:
 public:
   string_iterator(const macro &, const char * = 0 /* nullptr */,
                  symbol = NULL_SYMBOL);
-  int fill(node **);
+  int fill(node **); // returns an unsigned char or `EOF`
   int peek();
   bool get_location(bool /* allow_macro */, const char ** /* filep */,
                    int * /* linep */);
@@ -4320,6 +4321,7 @@ bool string_iterator::is_diversion()
   return mac.is_diversion();
 }
 
+// Returns an unsigned char or `EOF`.
 int string_iterator::fill(node **np)
 {
   if (seen_newline)
@@ -4343,7 +4345,7 @@ int string_iterator::fill(node **np)
     nd = nd->next;
     endptr = ptr = p + 1;
     count--;
-    return 0;
+    return 0U;
   }
   const unsigned char *e = bp->s + char_block::SIZE;
   if (e - p > count)

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

Reply via email to