gbranden pushed a commit to branch master
in repository groff.

commit 6cbf40bbcd3b110f8e3c1cee266acbaaa6be25be
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Sat Apr 27 00:51:23 2024 -0500

    [troff]: Boolify env.cpp (12/25).
    
    [troff]: Boolify more `environment` class member variables, member
    function parameters, and local variables.
    
    * src/roff/troff/env.h (class environment):
    * src/roff/troff/env.cpp (environment::possibly_break_line): Rename
      parameter `forced` to `must_adjust` and demote it from `int` to
      `bool`.
---
 ChangeLog              | 5 +++++
 src/roff/troff/env.cpp | 5 +++--
 src/roff/troff/env.h   | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 95463f71e..c31e7db71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,11 @@
        Demote local variable `best_bp_fits` from `int` to `bool`.
        Assign Boolean literals to it.
 
+       * src/roff/troff/env.h (class environment):
+       * src/roff/troff/env.cpp (environment::possibly_break_line):
+       Rename parameter `forced` to `must_adjust` and demote it from
+       `int` to `bool`.
+
 2024-04-24  G. Branden Robinson <g.branden.robin...@gmail.com>
 
        * src/roff/troff/env.cpp (tab_stops::to_string)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index d28c89634..436c70fcd 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2198,13 +2198,14 @@ static void distribute_space(node *n, int nspaces, 
hunits desired_space,
     do_reverse_node_list = !do_reverse_node_list;
 }
 
-void environment::possibly_break_line(bool must_break_here, int forced)
+void environment::possibly_break_line(bool must_break_here,
+                                     bool must_adjust)
 {
   bool was_centered = center_lines > 0;
   if (!fill || current_tab || current_field || dummy)
     return;
   while (line != 0
-        && (forced
+        && (must_adjust
             // When a macro follows a paragraph in fill mode, the
             // current line should not be empty.
             || (width_total - line->width()) > target_text_length)) {
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index 8558f30b0..31b2a8078 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -344,7 +344,7 @@ public:
   void interrupt();
   void spread() { spreading = true; }
   void possibly_break_line(bool /* must_break_here */ = false,
-                          int forced = 0);
+                          bool /* must_adjust */ = false);
   void do_break(bool /* want_adjustment */ = false);   // .br, .brp
   void final_break();
   node *make_tag(const char *name, int i);

_______________________________________________
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to