gbranden pushed a commit to branch master in repository groff. commit b4e9cff3bbb196b55ff9e07303a634ebb6a41514 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Sat Apr 27 02:01:26 2024 -0500
[troff]: Boolify `suppress_push` global variable. [troff]: Boolify `suppress_push` global variable, and declare it in a header file. * src/roff/troff/env.cpp: Move `extern` declaration from here... * src/roff/troff/input.h: ...to here. * src/roff/troff/input.cpp: Demote it from `int` to `bool` and assign Boolean, not integer, literals to it. --- ChangeLog | 11 +++++++++++ src/roff/troff/env.cpp | 1 - src/roff/troff/input.cpp | 6 +++--- src/roff/troff/input.h | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27192903f..115be45de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-04-27 G. Branden Robinson <g.branden.robin...@gmail.com> + + [troff]: Boolify `suppress_push` global variable, and declare it + in a header file. + + * src/roff/troff/env.cpp: Move `extern` declaration from here... + * src/roff/troff/input.h: ...to here. + + * src/roff/troff/input.cpp: Demote it from `int` to `bool` and + assign Boolean, not integer, literals to it. + 2024-04-27 G. Branden Robinson <g.branden.robin...@gmail.com> [troff]: Boolify `translate_space_to_dummy` global variable. diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index 4d1a87c1c..c2e018708 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -69,7 +69,6 @@ env_list_node *env_stack; dictionary env_dictionary(10); environment *curenv; static int next_line_number = 0; -extern int suppress_push; extern statem *get_diversion_state(); charinfo *field_delimiter_char; diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp index 28278f846..82fb477b3 100644 --- a/src/roff/troff/input.cpp +++ b/src/roff/troff/input.cpp @@ -570,7 +570,7 @@ int input_stack::level = 0; int input_stack::limit = DEFAULT_INPUT_STACK_LIMIT; int input_stack::div_level = 0; statem *input_stack::diversion_state = 0 /* nullptr */; -int suppress_push=0; +bool suppress_push = false; inline int input_stack::get_level() @@ -6043,7 +6043,7 @@ static bool do_if_request() environment env2(curenv); environment *oldenv = curenv; curenv = &env1; - suppress_push = 1; + suppress_push = true; for (int i = 0; i < 2; i++) { for (;;) { tok.next(); @@ -6068,7 +6068,7 @@ static bool do_if_request() delete_node_list(n2); curenv = oldenv; have_formattable_input = false; - suppress_push = 0; + suppress_push = false; tok.next(); } else { diff --git a/src/roff/troff/input.h b/src/roff/troff/input.h index 179feabd3..b328ca387 100644 --- a/src/roff/troff/input.h +++ b/src/roff/troff/input.h @@ -114,6 +114,8 @@ extern void do_glyph_color(symbol); extern void do_fill_color(symbol); extern bool is_codepoint_composite(const char *n); +extern bool suppress_push; + // Local Variables: // fill-column: 72 // mode: C++ _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit