gbranden pushed a commit to branch master
in repository groff.
commit 3699f5298485274162514d3e8ea1fb332113458d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Nov 27 02:21:34 2025 -0600
[troff]: Modestly refactor (1/8).
Perform more careful comparisons of the `unsigned char` values the
formatter reads from input (or a token sequence) by promoting either the
token or a character literal to which it is compared to `int` to (A)
explicitly avoid issues with the implementation-defined signedness of
unqualified `char`, and (B) lay foundation for future migration of GNU
troff's internal character type to a custom, wider type.
* src/roff/troff/div.cpp (return_request): Construct integer from
character literal.
---
ChangeLog | 13 +++++++++++++
src/roff/troff/div.cpp | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index fbdf44027..077553c9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2025-11-26 G. Branden Robinson <[email protected]>
+
+ [troff]: Perform more careful comparisons of the `unsigned char`
+ values the formatter reads from input (or a token sequence) by
+ promoting either the token or a character literal to which it is
+ compared to `int` to (A) explicitly avoid issues with the
+ implementation-defined signedness of unqualified `char`, and (B)
+ lay foundation for future migration of GNU troff's internal
+ character type to a custom, wider type.
+
+ * src/roff/troff/div.cpp (return_request): Construct integer
+ from character literal.
+
2025-11-27 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (read_size): Fix code style nit;
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index fcd657b68..bde7d8c0f 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -1024,7 +1024,7 @@ void return_request()
{
vunits dist = curdiv->marked_place - curdiv->get_vertical_position();
if (has_arg()) {
- if (tok.ch() == '-') {
+ if (tok.ch() == int('-')) { // TODO: grochar
tok.next();
vunits x;
if (get_vunits(&x, 'v'))
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit