gbranden pushed a commit to branch master
in repository groff.
commit 68ec09e47441f221e8740f17a4bb03581dd51c73
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Oct 7 12:13:45 2025 -0500
[pic]: Boolify global variable.
* src/preproc/pic/pic.h: Demote global variable `safer_flag` from `int`
to `bool` and rename it to `want_safer_mode`.
* src/preproc/pic/main.cpp: Update its definition to match declaration.
Assign to it using Boolean, not integer, literals.
* src/preproc/pic/main.cpp (main):
* src/preproc/pic/pic.ypp (placeless_element): Update.
---
ChangeLog | 13 +++++++++++++
src/preproc/pic/main.cpp | 6 +++---
src/preproc/pic/pic.h | 2 +-
src/preproc/pic/pic.ypp | 2 +-
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c4c94e775..873c7bb3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2025-10-07 G. Branden Robinson <[email protected]>
+
+ [pic]: Boolify global variable.
+
+ * src/preproc/pic/pic.h: Demote global variable `safer_flag`
+ from `int` to `bool` and rename it to `want_safer_mode`.
+
+ * src/preproc/pic/main.cpp: Update its definition to match
+ declaration. Assign to it using Boolean, not integer, literals.
+
+ * src/preproc/pic/main.cpp (main):
+ * src/preproc/pic/pic.ypp (placeless_element): Update.
+
2025-10-07 G. Branden Robinson <[email protected]>
* src/preproc/pic/main.cpp (main): Sort _optstring_ argument to
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 46c2c0d38..c539b0154 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -46,7 +46,7 @@ int zero_length_line_flag = 0;
// Non-zero means we're using a groff driver.
int driver_extension_flag = 1;
int compatible_flag = 0;
-int safer_flag = 1;
+bool want_safer_mode = true;
int command_char = '.'; // the character that introduces lines
// that should be passed through transparently
static int lf_flag = 1; // non-zero if we should attempt to
understand
@@ -569,10 +569,10 @@ int main(int argc, char **argv)
case 'T':
break;
case 'S':
- safer_flag = 1;
+ want_safer_mode = true;
break;
case 'U':
- safer_flag = 0;
+ want_safer_mode = false;
break;
case 'f':
#ifdef FIG_SUPPORT
diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h
index dfaa3dce9..d69a4e55b 100644
--- a/src/preproc/pic/pic.h
+++ b/src/preproc/pic/pic.h
@@ -89,7 +89,7 @@ extern int command_char;
extern int zero_length_line_flag;
extern int driver_extension_flag;
extern int compatible_flag;
-extern int safer_flag;
+extern bool want_safer_mode;
extern char *graphname;
// Local Variables:
diff --git a/src/preproc/pic/pic.ypp b/src/preproc/pic/pic.ypp
index d9944be12..62b9d5dcc 100644
--- a/src/preproc/pic/pic.ypp
+++ b/src/preproc/pic/pic.ypp
@@ -399,7 +399,7 @@ placeless_element:
DELIMITED
{
delim_flag = 0;
- if (safer_flag)
+ if (want_safer_mode)
lex_error("unsafe to run command '%1'; ignoring",
$3);
else {
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit