[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 03/10: [troff]: Boolify `in_output_page_list()`.
From: |
G. Branden Robinson |
Subject: |
[groff] 03/10: [troff]: Boolify `in_output_page_list()`. |
Date: |
Thu, 17 Oct 2024 20:39:41 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 1260e9d76629fd6d35da97a4c3f13820350a02c3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Oct 17 10:22:51 2024 -0500
[troff]: Boolify `in_output_page_list()`.
* src/roff/troff/input.cpp (in_output_page_list): Demote return type
from `int` to `bool`. Return Boolean, not integer, literals.
* src/roff/troff/node.h: Boolify declaration.
---
ChangeLog | 7 +++++++
src/roff/troff/input.cpp | 8 ++++----
src/roff/troff/node.h | 2 +-
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5ba8f8732..51311f5f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/roff/troff/input.cpp (in_output_page_list): Demote return
+ type from `int` to `bool`. Return Boolean, not integer,
+ literals.
+ * src/roff/troff/node.h: Boolify declaration.
+
2024-10-17 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp (parse_output_page_list): `const`ify
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 5594c5075..48e2707f7 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8586,14 +8586,14 @@ int page_range::contains(int n)
page_range *output_page_list = 0 /* nullptr */;
-int in_output_page_list(int n)
+bool in_output_page_list(int n)
{
if (!output_page_list)
- return 1;
+ return true;
for (page_range *p = output_page_list; p; p = p->next)
if (p->contains(n))
- return 1;
- return 0;
+ return true;
+ return false;
}
static void parse_output_page_list(const char *p)
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 078bf37bf..39ea004a9 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -688,7 +688,7 @@ extern char *pipe_command;
extern output_file *the_output;
extern void init_output();
-int in_output_page_list(int);
+bool in_output_page_list(int);
class font_family {
int *map;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 03/10: [troff]: Boolify `in_output_page_list()`.,
G. Branden Robinson <=