gbranden pushed a commit to branch master
in repository groff.

commit 944c687f5dcea3d82c7be45043058dc36c997e07
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Apr 27 04:03:19 2024 -0500

    [troff]: Boolify env.cpp (16/25).
    
    [troff]: Boolify more `environment` class member variables, member
    function parameters, and local variables.
    
    * src/roff/troff/env.h (class environment): Demote member variable
      `underline_spaces` from `int` to `bool`.
    * src/roff/troff/env.cpp (environment::environment, (environment::copy)
      (do_underline, environment::newline): Assign Boolean literals to it.
---
 ChangeLog              |  6 ++++++
 src/roff/troff/env.cpp | 12 ++++++------
 src/roff/troff/env.h   |  2 +-
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6b08ab1b5..772b55527 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,12 @@
        Assign Boolean literals to them.  Simplify conditional
        expressions.
 
+       * src/roff/troff/env.h (class environment): Demote member
+       variable `underline_spaces` from `int` to `bool`.
+       * src/roff/troff/env.cpp (environment::environment)
+       (environment::copy, do_underline, environment::newline): Assign
+       Boolean literals to it.
+
 2024-04-24  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (tab_stops::to_string)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index ad0af7292..a30f7c4cd 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -714,7 +714,7 @@ environment::environment(symbol nm)
   temporary_indent(0),
   have_temporary_indent(false),
   underline_lines(0),
-  underline_spaces(0),
+  underline_spaces(false),
   input_trap_count(-1),
   continued_input_trap(false),
   line(0),
@@ -808,7 +808,7 @@ environment::environment(const environment *e)
   temporary_indent(0),
   have_temporary_indent(false),
   underline_lines(0),
-  underline_spaces(0),
+  underline_spaces(false),
   input_trap_count(-1),
   continued_input_trap(false),
   line(0),
@@ -890,7 +890,7 @@ void environment::copy(const environment *e)
   have_temporary_indent = false;
   temporary_indent = 0;
   underline_lines = 0;
-  underline_spaces = 0;
+  underline_spaces = false;
   input_trap_count = -1;
   continued_input_trap = false;
   prev_text_length = e->prev_text_length;
@@ -1590,7 +1590,7 @@ void do_underline(int underline_spaces)
       curenv->prev_fontno = curenv->fontno;
       curenv->fontno = curenv->pre_underline_fontno;
       if (underline_spaces) {
-       curenv->underline_spaces = 0;
+       curenv->underline_spaces = false;
        curenv->add_node(do_underline_special(false));
       }
     }
@@ -1601,7 +1601,7 @@ void do_underline(int underline_spaces)
     curenv->pre_underline_fontno = curenv->fontno;
     curenv->fontno = get_underline_fontno();
     if (underline_spaces) {
-      curenv->underline_spaces = 1;
+      curenv->underline_spaces = true;
       curenv->add_node(do_underline_special(true));
     }
   }
@@ -1802,7 +1802,7 @@ void environment::newline()
       prev_fontno = fontno;
       fontno = pre_underline_fontno;
       if (underline_spaces) {
-       underline_spaces = 0;
+       underline_spaces = false;
        add_node(do_underline_special(false));
       }
     }
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index 2d9f0ebc9..47c2b7781 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -177,7 +177,7 @@ class environment {
   hunits target_text_length;
   int pre_underline_fontno;
   int underline_lines;
-  int underline_spaces;
+  bool underline_spaces;
   symbol input_trap;
   int input_trap_count;
   bool continued_input_trap;

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

Reply via email to