gbranden pushed a commit to branch master
in repository groff.
commit 914c17449146a25d1a08261a0941b8dd6d6c3703
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 16 14:16:32 2026 -0600
[pic]: Boolify `read_line()` member function.
* src/preproc/pic/pic.h (class file_input): Demote declaration of
`read_line()` from `int` to `bool`.
* src/preproc/pic/lex.cpp (file_input::read_line): Return Boolean rather
than integer literals.
Continues the long process of fixing Savannah #66672.
---
ChangeLog | 11 +++++++++++
src/preproc/pic/lex.cpp | 6 +++---
src/preproc/pic/pic.h | 2 +-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c461d2142..8678f8feb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2026-11-16 G. Branden Robinson <[email protected]>
+
+ [pic]: Boolify `read_line()` member function.
+
+ * src/preproc/pic/pic.h (class file_input): Demote declaration
+ of `read_line()` from `int` to `bool`.
+ * src/preproc/pic/lex.cpp (file_input::read_line): Return
+ Boolean rather than integer literals.
+
+ Continues the long process of fixing Savannah #66672.
+
2026-11-16 G. Branden Robinson <[email protected]>
[pic]: Boolify `get_location()` member functions.
diff --git a/src/preproc/pic/lex.cpp b/src/preproc/pic/lex.cpp
index ed11cd082..6673a47c7 100644
--- a/src/preproc/pic/lex.cpp
+++ b/src/preproc/pic/lex.cpp
@@ -94,7 +94,7 @@ file_input::~file_input()
fclose(fp);
}
-int file_input::read_line()
+bool file_input::read_line()
{
for (;;) {
line.clear();
@@ -117,14 +117,14 @@ int file_input::read_line()
}
}
if (line.length() == 0)
- return 0;
+ return false;
if (!(line.length() >= 3 && line[0] == '.' && line[1] == 'P'
&& (line[2] == 'S' || line[2] == 'E' || line[2] == 'F')
&& (line.length() == 3 || line[3] == ' ' || line[3] == '\n'
|| compatible_flag))) {
line += '\0';
ptr = line.contents();
- return 1;
+ return true;
}
}
}
diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h
index 2bb1a6d8f..99df80ce4 100644
--- a/src/preproc/pic/pic.h
+++ b/src/preproc/pic/pic.h
@@ -66,7 +66,7 @@ class file_input : public input {
int lineno;
string line;
const char *ptr;
- int read_line();
+ bool read_line();
public:
file_input(FILE *, const char *);
~file_input();
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit