groff-commit
[Top][All Lists]
Advanced

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

[groff] 06/37: src/roff/troff/input.cpp: Trivially refactor.


From: G. Branden Robinson
Subject: [groff] 06/37: src/roff/troff/input.cpp: Trivially refactor.
Date: Mon, 14 Mar 2022 01:59:07 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 0bad9758bcd41bf904e5b2c2199c218daca679bc
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Mar 7 11:23:30 2022 +1100

    src/roff/troff/input.cpp: Trivially refactor.
    
    * src/roff/troff/input.cpp: Trivially refactor.  Drop `#define` that was
      working around a GCC 2.95-era libstdc++ problem.  Shorten long line.
    
      (get_char_for_escape_parameter): Demote parameter from `int` to `bool`
      and use Boolean literal for default argument.  Annotate a null pointer
      constant.
---
 ChangeLog                |  9 +++++++++
 src/roff/troff/input.cpp | 10 ++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 700fc110..9c7ed9c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-03-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp: Trivially refactor.  Drop `#define`
+       that was working around a GCC 2.95-era libstdc++ problem.
+       Shorten long line.
+       (get_char_for_escape_parameter): Demote parameter from `int` to
+       `bool` and use Boolean literal for default argument.  Annotate a
+       null pointer constant.
+
 2022-03-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Rename some internal functions.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index ba6332f6..97c609d4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -153,15 +153,12 @@ static symbol get_delim_name();
 static void init_registers();
 static void trapping_blank_line();
 
-// this is for gcc 2.95 with old versions of libstdc++
-#define input_iterator my_input_iterator
-
 class input_iterator;
 input_iterator *make_temp_iterator(const char *);
 const char *input_char_description(int);
 
 void process_input_stack();
-void chop_macro();             // declare to avoid friend name injection
+void chop_macro();     // declare to avoid friend name injection
 
 
 void set_escape_char()
@@ -817,9 +814,10 @@ void shift()
   skip_line();
 }
 
-static char get_char_for_escape_parameter(int allow_space = 0)
+static char get_char_for_escape_parameter(bool allow_space = false)
 {
-  int c = get_copy(0, false /* is defining */, true /* handle \E */);
+  int c = get_copy(0 /* nullptr */, false /* is defining */,
+                  true /* handle \E */);
   switch (c) {
   case EOF:
     copy_mode_error("end of input in escape sequence");



reply via email to

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