groff-commit
[Top][All Lists]
Advanced

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

[groff] 13/48: [troff]: Boolify env.cpp (4/25).


From: G. Branden Robinson
Subject: [groff] 13/48: [troff]: Boolify env.cpp (4/25).
Date: Sun, 28 Apr 2024 23:06:19 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8ad02c04150f5dcc30cfc78251411dc2cac8ae70
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Apr 26 21:55:45 2024 -0500

    [troff]: Boolify env.cpp (4/25).
    
    [troff]: Boolify more `environment` class member variables, member
    function parameters, and local variables.
    
    * src/roff/troff/env.cpp (class pending_output_line)
      (pending_output_line::output): Demote member function's return type
      from `int` to `bool`.  Return Boolean, not integer, literals from
      functions returning `bool`.
---
 ChangeLog              |  5 +++++
 src/roff/troff/env.cpp | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ba4903936..d9cfd576d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,11 @@
        [WIDOW_CONTROL]: Rename `last_line` to `is_last_line` and demote
        it from `int` to `bool`.
 
+       * src/roff/troff/env.cpp (class pending_output_line)
+       (pending_output_line::output): Demote member function's return
+       type from `int` to `bool`.  Return Boolean, not integer,
+       literals from functions returning `bool`.
+
 2024-04-24  G. Branden Robinson <g.branden.robinson@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 8f3fb5dd7..ec912eaaf 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -93,7 +93,7 @@ public:
   pending_output_line(node *, bool, vunits, vunits, hunits, int,
                      pending_output_line * = 0);
   ~pending_output_line();
-  int output();
+  bool output();
 
 #ifdef WIDOW_CONTROL
   friend void environment::mark_last_line();
@@ -119,23 +119,23 @@ pending_output_line::~pending_output_line()
   delete_node_list(nd);
 }
 
-int pending_output_line::output()
+bool pending_output_line::output()
 {
   if (was_trap_sprung)
-    return 0;
+    return false;
 #ifdef WIDOW_CONTROL
   if (next && next->is_last_line && !suppress_filling) {
     curdiv->need(vs + post_vs + vunits(vresolution));
     if (was_trap_sprung) {
       next->is_last_line = false;      // Try to avoid infinite loops.
-      return 0;
+      return false;
     }
   }
 #endif
   curenv->construct_format_state(nd, was_centered, !suppress_filling);
   curdiv->output(nd, suppress_filling, vs, post_vs, width);
   nd = 0;
-  return 1;
+  return true;
 }
 
 void environment::output(node *nd, bool suppress_filling,



reply via email to

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