groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/08: [troff]: Trivially refactor (staticification).


From: G. Branden Robinson
Subject: [groff] 03/08: [troff]: Trivially refactor (staticification).
Date: Mon, 6 Nov 2023 13:25:49 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit ad3ad94d445bddc529ddb71ac7603077480e4878
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Nov 6 09:50:27 2023 -0600

    [troff]: Trivially refactor (staticification).
    
    * src/roff/troff/input.cpp: Mark `suppression_level`,
      `have_formattable_input`, `old_have_formattable_input`, and
      `want_unsafe_requests` as `static` to give them internal visibility
      only.
---
 ChangeLog                |  7 +++++++
 src/roff/troff/input.cpp | 10 +++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a6b3fdeb8..705cfb5d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-11-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp: Mark `suppression_level`,
+       `have_formattable_input`, `old_have_formattable_input`, and
+       `want_unsafe_requests` as `static` to give them internal
+       visibility only.
+
 2023-11-06  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Make `in_nroff_mode` visible to other translation
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 73fae2c05..89812a84d 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -102,25 +102,25 @@ static int do_old_compatible_flag = -1;   // for .do 
request
 bool want_abstract_output = false;
 int suppress_output_flag = 0;
 int is_html = 0;
-int suppression_level = 0;     // depth of nested \O escapes
+static int suppression_level = 0;      // depth of nested \O escapes
 
 bool in_nroff_mode = false;
 
 // Keep track of whether \f, \F, \D'F...', \H, \m, \M, \O[345], \R, \s,
 // or \S has been processed in token::next().
-bool have_formattable_input = false;
+static bool have_formattable_input = false;
 // `have_formattable_input` is reset immediately upon reading a new
 // input line, but we need more state information because the input line
 // might have been continued/interrupted with `\c`.
 // Consider:
 //   \f[TB]\m[red]hello\c
 //   \f[]\m[]
-bool old_have_formattable_input = false;
+static bool old_have_formattable_input = false;
 
 bool device_has_tcommand = false;      // 't' output command supported
-bool want_unsafe_requests = false;     // be safer by default
+static bool want_unsafe_requests = false;      // be safer by default
 
-bool have_multiple_params = false;     // e.g., \[e aa], \*[foo bar]
+static bool have_multiple_params = false;      // \[e aa], \*[foo bar]
 
 double spread_limit = -3.0 - 1.0;      // negative means deactivated
 



reply via email to

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