gbranden pushed a commit to branch master
in repository groff.
commit 4180033ec99310038aec2dbffb205835c429dad7
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jun 24 17:08:41 2026 -0500
[pic]: Slightly refactor.
* src/preproc/pic/lex.cpp (interpolate_macro_with_args): Boolify.
Demote local variable `ignore` from `int` to `bool` and rename it to
`is_ignoring_arguments`. Assign to it using Boolean, not integer,
literals.
---
ChangeLog | 7 +++++++
src/preproc/pic/lex.cpp | 8 ++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f3613e382..0013ce9b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-06-24 G. Branden Robinson <[email protected]>
+
+ * src/preproc/pic/lex.cpp (interpolate_macro_with_args):
+ Boolify. Demote local variable `ignore` from `int` to `bool`
+ and rename it to `is_ignoring_arguments`. Assign to it using
+ Boolean, not integer, literals.
+
2026-06-24 G. Branden Robinson <[email protected]>
* src/preproc/pic/lex.cpp: Slightly refactor. Replace
diff --git a/src/preproc/pic/lex.cpp b/src/preproc/pic/lex.cpp
index 0711d91a3..ed374e928 100644
--- a/src/preproc/pic/lex.cpp
+++ b/src/preproc/pic/lex.cpp
@@ -400,7 +400,7 @@ static void interpolate_macro_with_args(const char *body)
{
char *argv[pic_macro_maximum_arg_count];
size_t argc = 0;
- int ignore = 0;
+ bool is_ignoring_arguments = false;
size_t i;
for (i = 0; i < pic_macro_maximum_arg_count; i++)
argv[i] = 0;
@@ -416,11 +416,11 @@ static void interpolate_macro_with_args(const char *body)
break;
}
if (state == NORMAL && level == 0 && (c == ',' || c == ')')) {
- if (!ignore) {
+ if (!is_ignoring_arguments) {
if (argc == pic_macro_maximum_arg_count) {
lex_warning("pic supports at most %1 macro arguments",
pic_macro_maximum_arg_count);
- ignore = 1;
+ is_ignoring_arguments = true;
}
else if (token_buffer.length() > 0) {
token_buffer += '\0';
@@ -429,7 +429,7 @@ static void interpolate_macro_with_args(const char *body)
}
// for 'foo()', argc = 0
if (argc > 0 || c != ')' || i > 0)
- if (!ignore)
+ if (!is_ignoring_arguments)
argc++;
break;
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit