gbranden pushed a commit to branch master
in repository groff.

commit 21e493ca6ef4029ca380c0246cdb28297e05aacc
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Aug 19 11:33:14 2024 -0500

    [troff]: Boolify and rename `ignoring`.
    
    ...demoting it from `int` to `bool` and calling it `want_input_ignored`.
    Initialize and assign to it using Boolean, not integer, literals.
    
    * src/roff/troff/input.cpp (do_define_macro)
      (append_indirect_nocomp_macro, copy_mode_error): Do it.
---
 ChangeLog                |  9 +++++++++
 src/roff/troff/input.cpp | 10 +++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 790fe1f16..9efba09f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-08-19  G. Branden Robinson <[email protected]>
+
+       [troff]: Boolify and rename `ignoring`, demoting it from
+       `int` to `bool` and calling it `want_input_ignored`.  Initialize
+       and assign to it using Boolean, not integer, literals.
+
+       * src/roff/troff/input.cpp (do_define_macro)
+       (append_indirect_nocomp_macro, copy_mode_error): Do it.
+
 2024-08-19  G. Branden Robinson <[email protected]>
 
        [troff]: Boolify and rename `inhibit_errors`, demoting it from
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 9b10f8ba7..c6fe01c89 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -96,7 +96,7 @@ unsigned char hpf_code_table[256];
 
 static int warning_mask = DEFAULT_WARNING_MASK;
 static bool want_errors_inhibited = false;
-static int ignoring = 0;
+static bool want_input_ignored = false;
 
 static void enable_warning(const char *);
 static void disable_warning(const char *);
@@ -4771,7 +4771,7 @@ void do_define_macro(define_mode mode, calling_mode 
calling, comp_mode comp)
          *mm = mac;
        }
        if (term != dot_symbol) {
-         ignoring = 0;
+         want_input_ignored = false;
          interpolate_macro(term);
        }
        else
@@ -4861,9 +4861,9 @@ void append_indirect_nocomp_macro()
 
 void ignore()
 {
-  ignoring = 1;
+  want_input_ignored = true;
   do_define_macro(DEFINE_IGNORE, CALLING_NORMAL, COMP_IGNORE);
-  ignoring = 0;
+  want_input_ignored = false;
 }
 
 void remove_macro()
@@ -9134,7 +9134,7 @@ static void copy_mode_error(const char *format,
                            const errarg &arg2,
                            const errarg &arg3)
 {
-  if (ignoring) {
+  if (want_input_ignored) {
     static const char prefix[] = "(in ignored input) ";
     // C++03: new char[sizeof prefix + strlen(format)]();
     char *s = new char[sizeof prefix + strlen(format)];

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

Reply via email to