gbranden pushed a commit to branch master
in repository groff.
commit 8efd2f89ea5c9184fb32735814b42be9b74f2ed1
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu May 15 15:46:08 2025 -0500
[troff]: Slightly refactor (boolify) (2/2).
* src/roff/troff/node.cpp (class real_output_file): Demote member
variable `piped` from `int` to `bool`, and rename it to
`is_output_piped`.
(real_output_file::real_output_file): Track rename and boolification
in use of constant literals of Boolean type.
(real_output_file::~real_output_file): Track rename.
---
ChangeLog | 9 +++++++++
src/roff/troff/node.cpp | 10 +++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 180e50e21..3dfea0a80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-05-15 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/node.cpp (class real_output_file): Demote
+ member variable `piped` from `int` to `bool`, and rename it
+ to `is_output_piped`.
+ (real_output_file::real_output_file): Track rename and
+ boolification in use of constant literals of Boolean type.
+ (real_output_file::~real_output_file): Track rename.
+
2025-05-15 G. Branden Robinson <[email protected]>
* src/roff/troff/node.cpp (class real_output_file): Demote
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index eff60f1a6..aba7c4210 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -743,9 +743,9 @@ tfont::tfont(tfont_spec &spec) : tfont_spec(spec)
/* output_file */
class real_output_file : public output_file {
- int piped;
+ bool is_output_piped; // as with `pi` request
bool want_page_printed; // if selected with `troff -o`
- bool is_output_on; // controlled by \O[0], \O[1] escape sequences
+ bool is_output_on; // as by \O[0], \O[1] escape sequences
virtual void really_transparent_char(unsigned char) = 0;
virtual void really_print_line(hunits x, vunits y, node *n,
vunits before, vunits after,
@@ -1722,12 +1722,12 @@ real_output_file::real_output_file()
{
if (pipe_command) {
if ((fp = popen(pipe_command, POPEN_WT)) != 0 /* nullptr */) {
- piped = 1;
+ is_output_piped = true;
return;
}
error("pipe open failed: %1", strerror(errno));
}
- piped = 0;
+ is_output_piped = false;
fp = stdout;
}
@@ -1746,7 +1746,7 @@ real_output_file::~real_output_file()
fp = 0 /* nullptr */;
fatal("unable to flush output file: %1", strerror(errno));
}
- if (piped) {
+ if (is_output_piped) {
int result = pclose(fp);
fp = 0 /* nullptr */;
if (result < 0)
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit