gbranden pushed a commit to branch master
in repository groff.
commit 5c9346a2850f50c44f0eb2150e65f0be9e708bc7
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Apr 8 23:50:38 2026 -0500
src/roff/troff/number.cpp: Slightly refactor.
* src/roff/troff/number.cpp (is_valid_term): Compare local
`scaling_unit` and return value of `token::char()` to literals of type
`unsigned char` instead of signed literals for conceptual clarity.
"groff characters" are, for now, unsigned bytes.
Continues the long process of fixing Savannah #67735.
---
ChangeLog | 10 ++++++++++
src/roff/troff/number.cpp | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a4c107d19..96ca3b707 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-04-08 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/number.cpp (is_valid_term): Compare local
+ `scaling_unit` and return value of `token::char()` to literals
+ of type `unsigned char` instead of signed literals for
+ conceptual clarity. "groff characters" are, for now, unsigned
+ bytes.
+
+ Continues the long process of fixing Savannah #67735.
+
2026-04-08 G. Branden Robinson <[email protected]>
* src/roff/troff/number.cpp: Refactor. Migrate
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index ac91fce64..39ae7ed43 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -540,9 +540,9 @@ static bool is_valid_term(units *u, int scaling_unit,
}
unsigned char si = scaling_unit; // TODO: grochar
bool do_next = false;
- if (((c = tok.ch()) != 0) && valid_scaling_units.contains(c)) {
+ if (((c = tok.ch()) != 0U) && valid_scaling_units.contains(c)) {
switch (scaling_unit) {
- case int(0): // TODO: grochar; null character, not digit zero
+ case int(0U): // TODO: grochar; null character, not digit zero
// We know it's a recognized scaling unit because it matched the
// `strchr()` above, so we don't use `tok.description()`.
warning(WARN_SCALE, "a scaling unit is not valid in this context"
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit