groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 40/60: [troff]: Boolify more of the `diversion` class.


From: G. Branden Robinson
Subject: [groff] 40/60: [troff]: Boolify more of the `diversion` class.
Date: Wed, 11 Sep 2024 03:38:33 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 3acd30f06ee6ef59a351f1311a1381592e50e58b
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Sep 9 23:53:10 2024 -0500

    [troff]: Boolify more of the `diversion` class.
    
    * src/roff/troff/div.h (class diversion): Boolify member variables that
      cache values of Boolean member variables of `environment` class.  Mark
      them as possibly nilpotent; when I experimentally deleted each of
      them, no automated tests failed, and even Peter's fearfully complex
      mom(7) documents looked fine.  Possibly a task for groff 1.25.
---
 ChangeLog              | 9 +++++++++
 src/roff/troff/div.cpp | 5 +++--
 src/roff/troff/div.h   | 8 ++++----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 666951e52..1afd5f222 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-09-09  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/div.h (class diversion): Boolify member
+       variables that cache values of Boolean member variables of
+       `environment` class.  Mark them as possibly nilpotent; when I
+       experimentally deleted each of them, no automated tests failed,
+       and even Peter's fearfully complex mom(7) documents looked fine.
+       Possibly a task for groff 1.25.
+
 2024-09-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/div.h (class diversion): Boolify and rename
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index e9ff7c53e..df1c912a4 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -51,8 +51,9 @@ static vunits needed_space;
 diversion::diversion(symbol s)
 : prev(0 /* nullptr */), nm(s), vertical_position(V0),
   high_water_mark(V0), is_in_no_space_mode(false),
-  saved_seen_break(0), saved_seen_space(0),
-  saved_seen_eol(0), saved_suppress_next_eol(0), marked_place(V0)
+  saved_seen_break(false), saved_seen_space(false),
+  saved_seen_eol(false), saved_suppress_next_eol(false),
+  marked_place(V0)
 {
 }
 
diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h
index 7ff5649ce..13c1a8f07 100644
--- a/src/roff/troff/div.h
+++ b/src/roff/troff/div.h
@@ -36,10 +36,10 @@ protected:
   vunits high_water_mark;
 public:
   bool is_in_no_space_mode;
-  int saved_seen_break;
-  int saved_seen_space;
-  int saved_seen_eol;
-  int saved_suppress_next_eol;
+  bool saved_seen_break; // XXX: nilpotent?
+  bool saved_seen_space; // XXX: nilpotent?
+  bool saved_seen_eol; // XXX: nilpotent?
+  bool saved_suppress_next_eol; // XXX: nilpotent?
   state_set modified_tag;
   vunits marked_place;
   diversion(symbol s = NULL_SYMBOL);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]