groff-commit
[Top][All Lists]
Advanced

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

[groff] 11/23: [troff]: Boolify.


From: G. Branden Robinson
Subject: [groff] 11/23: [troff]: Boolify.
Date: Thu, 3 Oct 2024 07:22:31 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 30a6e21cde8cd4e9ee98f46d5ea4cfd787c8433c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Sep 27 16:53:00 2024 -0500

    [troff]: Boolify.
    
    * src/roff/troff/input.cpp (class input_iterator, class string_iterator)
      (class macro_iterator): Demote `get_break_flag()` member function from
      `int` to `bool`.  Return Boolean, not integer, literal from it.
    
      (class string_iterator, class macro_iterator): Demote member variable
      `with_break` from `int` to `bool`.
---
 ChangeLog                |  9 +++++++++
 src/roff/troff/input.cpp | 10 +++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0634adb4a..e5f8de458 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-09-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (class input_iterator)
+       (class string_iterator, class macro_iterator):
+       Demote `get_break_flag()` member function from `int` to `bool`.
+       Return Boolean, not integer, literal from it.
+       (class string_iterator, class macro_iterator): Demote member
+       variable `with_break` from `int` to `bool`.
+
 2024-09-26  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/input.cpp (do_write_request): Fix code style
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index f61b3c25f..fcba09c76 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -332,7 +332,7 @@ private:
   virtual arg_list *get_arg_list() { return 0 /* nullptr */; }
   virtual symbol get_macro_name() { return NULL_SYMBOL; }
   virtual bool space_follows_arg(int) { return false; }
-  virtual int get_break_flag() { return 0; }
+  virtual bool get_break_flag() { return false; }
   virtual bool get_location(bool /* allow_macro */,
                            const char ** /* filep */,
                            int * /* linep */) { return false; }
@@ -3687,7 +3687,7 @@ class string_iterator : public input_iterator {
   int count;                   // of characters remaining
   node *nd;
   bool att_compat;
-  int with_break;              // inherited from the caller
+  bool with_break;             // inherited from the caller
 protected:
   symbol nm;
   string_iterator();
@@ -3699,7 +3699,7 @@ public:
   bool get_location(bool /* allow_macro */, const char ** /* filep */,
                    int * /* linep */);
   void backtrace();
-  int get_break_flag() { return with_break; }
+  bool get_break_flag() { return with_break; }
   void set_att_compat(bool b) { att_compat = b; }
   bool get_att_compat() { return att_compat; }
   bool is_diversion();
@@ -3903,7 +3903,7 @@ arg_list::~arg_list()
 class macro_iterator : public string_iterator {
   arg_list *args;
   int argc;
-  int with_break;              // whether called as .foo or 'foo
+  bool with_break;             // whether called as .foo or 'foo
 public:
   macro_iterator(symbol, macro &,
                 const char * /* how_called */ = "macro",
@@ -3915,7 +3915,7 @@ public:
   arg_list *get_arg_list();
   symbol get_macro_name();
   bool space_follows_arg(int);
-  int get_break_flag() { return with_break; }
+  bool get_break_flag() { return with_break; }
   int nargs() { return argc; }
   void add_arg(const macro &, int);
   void shift(int);



reply via email to

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