[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 12/30: [grops]: Boolify `read_uint_arg()`.
From: |
G. Branden Robinson |
Subject: |
[groff] 12/30: [grops]: Boolify `read_uint_arg()`. |
Date: |
Sat, 12 Oct 2024 12:07:52 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 36e0cdebd00105c4b2a1e3009bab35b47da7d3dc
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 11 10:57:09 2024 -0500
[grops]: Boolify `read_uint_arg()`.
* src/devices/grops/psrm.cpp (read_uint_arg): Boolify.
---
ChangeLog | 4 ++++
src/devices/grops/psrm.cpp | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 075b7b895..22eee91ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-10-11 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/devices/grops/psrm.cpp (read_uint_arg): Boolify.
+
2024-10-11 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/devices/grops/psrm.cpp (read_uint_arg): Thirty years ago
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index eb260eab6..c5368f70e 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -79,22 +79,22 @@ const char *resource_table[] = {
const size_t NRESOURCES = array_length(resource_table);
-static int read_uint_arg(const char **pp, unsigned *res)
+static bool read_uint_arg(const char **pp, unsigned *res)
{
while (white_space(**pp))
*pp += 1;
if (**pp == '\0') {
error("missing argument");
- return 0;
+ return false;
}
const char *start = *pp;
unsigned long n = strtoul(start, (char **)pp, 10);
if (*pp == start) {
error("not an integer");
- return 0;
+ return false;
}
*res = unsigned(n);
- return 1;
+ return true;
}
struct resource {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 12/30: [grops]: Boolify `read_uint_arg()`.,
G. Branden Robinson <=