groff-commit
[Top][All Lists]
Advanced

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

[groff] 43/60: [troff]: Boolify `retain_size`.


From: G. Branden Robinson
Subject: [groff] 43/60: [troff]: Boolify `retain_size`.
Date: Wed, 11 Sep 2024 03:38:33 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit e8728b11905a57e04620f87dc1547ae3e0e56661
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Sep 10 00:14:53 2024 -0500

    [troff]: Boolify `retain_size`.
    
    * src/roff/troff/div.h (class diversion, class macro_diversion)
      (class top_level_diversion): Boolify `output()` member function
      argument, demoting `retain_size` from `int` to `bool`.  Comment formal
      argument names as a compromise with the Stroustrup-style C++ used in
      most of groff.
    
    * src/roff/troff/div.cpp (macro_diversion::output)
      (top_level_diversion::output): Boolify at definition sites.  This
      variable seems to be coupled to `suppress_filling` in "env.cpp".
---
 ChangeLog              | 10 ++++++++++
 src/roff/troff/div.cpp |  4 ++--
 src/roff/troff/div.h   | 15 ++++++++-------
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4c50a2b6d..d03743b5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-09-10  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/div.h (class diversion, class macro_diversion)
+       (class top_level_diversion): Boolify `output()` member function
+       argument, demoting `retain_size` from `int` to `bool`.
+       * src/roff/troff/div.cpp (macro_diversion::output)
+       (top_level_diversion::output): Boolify at definition sites.
+       This variable seems to be coupled to `suppress_filling` in
+       "env.cpp".
+
 2024-09-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/div.h (do_divert): Boolify function arguments.
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index cbccf9a59..e7ab295a3 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -281,7 +281,7 @@ void macro_diversion::transparent_output(node *n)
   mac->append(n);
 }
 
-void macro_diversion::output(node *nd, int retain_size,
+void macro_diversion::output(node *nd, bool retain_size,
                             vunits vs, vunits post_vs, hunits width)
 {
   is_in_no_space_mode = false;
@@ -419,7 +419,7 @@ const char *top_level_diversion::get_next_trap_name()
 }
 
 // This is used by more than just top-level diversions.
-void top_level_diversion::output(node *nd, int retain_size,
+void top_level_diversion::output(node *nd, bool retain_size,
                                 vunits vs, vunits post_vs,
                                 hunits width)
 {
diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h
index ca769b178..590fe95af 100644
--- a/src/roff/troff/div.h
+++ b/src/roff/troff/div.h
@@ -29,7 +29,7 @@ class diversion {
   int saved_space_total;
   hunits saved_saved_indent;
   hunits saved_target_text_length;
-  int saved_prev_line_interrupted;
+  int saved_prev_line_interrupted; // three-valued Boolean :-|
 protected:
   symbol nm;
   vunits vertical_position;
@@ -44,8 +44,9 @@ public:
   vunits marked_place;
   diversion(symbol s = NULL_SYMBOL);
   virtual ~diversion();
-  virtual void output(node *nd, int retain_size, vunits vs,
-                     vunits post_vs, hunits width) = 0;
+  virtual void output(node * /* nd */, bool /* retain_size */,
+                     vunits /* vs */, vunits /* post_vs */,
+                     hunits /* width */) = 0;
   virtual void transparent_output(unsigned char) = 0;
   virtual void transparent_output(node *) = 0;
   virtual void space(vunits distance, int forced = 0) = 0;
@@ -74,8 +75,8 @@ class macro_diversion : public diversion {
 public:
   macro_diversion(symbol, bool /* appending */);
   ~macro_diversion();
-  void output(node *nd, int retain_size, vunits vs, vunits post_vs,
-             hunits width);
+  void output(node * /* nd */, bool /* retain_size */, vunits /* vs */,
+             vunits /* post_vs */, hunits /* width */);
   void transparent_output(unsigned char);
   void transparent_output(node *);
   void space(vunits distance, int forced = 0);
@@ -114,8 +115,8 @@ class top_level_diversion : public diversion {
 public:
   int before_first_page;
   top_level_diversion();
-  void output(node *nd, int retain_size, vunits vs, vunits post_vs,
-             hunits width);
+  void output(node * /* nd */, bool /* retain_size */, vunits /* vs */,
+             vunits /* post_vs */, hunits /* width */);
   void transparent_output(unsigned char);
   void transparent_output(node *);
   void space(vunits distance, int forced = 0);



reply via email to

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