gbranden pushed a commit to branch master
in repository groff.

commit 5d407f89678a488353d16e6eb23e3384b13c15d0
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 26 23:57:52 2024 -0500

    [troff]: Boolify env.cpp (9/25).
    
    [troff]: Boolify more `environment` class member variables, member
    function parameters, and local variables.
    
    * src/roff/troff/env.h (class environment): Demote `fill` member
      variable from `int` to `bool`.
    * src/roff/troff/env.cpp (environment::environment, fill, no_fill):
      Assign Boolean literals to it.
---
 ChangeLog              | 5 +++++
 src/roff/troff/env.cpp | 6 +++---
 src/roff/troff/env.h   | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9cfe11e60..9ae463d88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,6 +70,11 @@
        * src/roff/troff/input.cpp (process_input_stack):
        - Pass Boolean, not integer, literals to it.
 
+       * src/roff/troff/env.h (class environment): Demote `fill` member
+       variable from `int` to `bool`.
+       * src/roff/troff/env.cpp (environment::environment, fill)
+       (no_fill): 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 7bb7d3fa7..2c2869f4b 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -698,7 +698,7 @@ environment::environment(symbol nm)
   space_size(12),
   sentence_space_size(12),
   adjust_mode(ADJUST_BOTH),
-  fill(1),
+  fill(true),
   interrupted(0),
   prev_line_interrupted(0),
   center_lines(0),
@@ -1401,7 +1401,7 @@ void fill()
     tok.next();
   if (want_break)
     curenv->do_break();
-  curenv->fill = 1;
+  curenv->fill = true;
   tok.next();
 }
 
@@ -1411,7 +1411,7 @@ void no_fill()
     tok.next();
   if (want_break)
     curenv->do_break();
-  curenv->fill = 0;
+  curenv->fill = false;
   curenv->suppress_next_eol = 1;
   tok.next();
 }
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index a8d5f2ebb..61609c97a 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -158,7 +158,7 @@ class environment {
   int space_size;              // in 36ths of an em
   int sentence_space_size;     // same but for spaces at the end of sentences
   int adjust_mode;
-  int fill;
+  bool fill;
   int interrupted;
   int prev_line_interrupted;
   int center_lines;

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

Reply via email to