gbranden pushed a commit to branch master
in repository groff.

commit 633ad465b9146ee9e41db80ee5579dcc44e85b71
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Aug 17 16:14:27 2024 -0500

    [troff]: Boolify `get_line_arg()`.
    
    [troff]: Slightly refactor; boolify a static function.
    
    * src/roff/troff/input.cpp (get_line_arg): Demote return type from `int`
      to `bool`.  Return Boolean, not integer, literals.
---
 ChangeLog                |  7 +++++++
 src/roff/troff/input.cpp | 10 +++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 71794ad5d..68d621624 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-17  G. Branden Robinson <[email protected]>
+
+       [troff]: Slightly refactor; boolify a static function.
+
+       * src/roff/troff/input.cpp (get_line_arg): Demote return type
+       from `int` to `bool`.  Return Boolean, not integer, literals.
+
 2024-08-17  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/reg.cpp (define_register): Warn when garbage
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index efeb6eb93..1caf3cc01 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -162,7 +162,7 @@ static request_or_macro *lookup_request(symbol);
 static bool read_delimited_number(units *, unsigned char);
 static bool read_delimited_number(units *, unsigned char, units);
 static symbol do_get_long_name(bool, char);
-static int get_line_arg(units *res, unsigned char si, charinfo **cp);
+static bool get_line_arg(units *res, unsigned char si, charinfo **cp);
 static bool read_size(int *);
 static symbol get_delimited_name();
 static void init_registers();
@@ -5208,13 +5208,13 @@ static bool read_delimited_number(units *n, unsigned 
char si)
   return false;
 }
 
-static int get_line_arg(units *n, unsigned char si, charinfo **cp)
+static bool get_line_arg(units *n, unsigned char si, charinfo **cp)
 {
   token start_token;
   start_token.next();
   int start_level = input_stack::get_level();
   if (!start_token.is_usable_as_delimiter(true /* report error */))
-    return 0;
+    return false;
   tok.next();
   if (read_measurement(n, si)) {
     if (tok.is_dummy() || tok.is_transparent_dummy())
@@ -5227,9 +5227,9 @@ static int get_line_arg(units *n, unsigned char si, 
charinfo **cp)
     if (!(start_token == tok
          && input_stack::get_level() == start_level))
       warning(WARN_DELIM, "closing delimiter does not match");
-    return 1;
+    return true;
   }
-  return 0;
+  return false;
 }
 
 static bool read_size(int *x)

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

Reply via email to