gbranden pushed a commit to branch master
in repository groff.
commit d3710803e46284185e2516afc68bcf74007960b6
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Nov 7 05:20:33 2025 -0600
[troff]: Fix code style nit.
* src/roff/troff/input.cpp (transparent_translate): Align type of local
variable with that returned by the function we call to populate it;
demote `int` to `unsigned char`. Compare this value to an unsigned
literal, not a character literal of implementation-defined signedness.
---
ChangeLog | 8 ++++++++
src/roff/troff/input.cpp | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 92b8a313f..175a81a5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-11-07 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/input.cpp (transparent_translate): Fix code
+ style nit. Align type of local variable with that returned by
+ the function we call to populate it; demote `int` to `unsigned
+ char`. Compare this value to an unsigned literal, not a
+ character literal of implementation-defined signedness.
+
2025-11-06 G. Branden Robinson <[email protected]>
* src/roff/groff/groff.cpp (main): Tweak wording of notice about
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 6278e1fff..3a92b966b 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3225,8 +3225,8 @@ static int transparent_translate(int cc)
// This is really ugly.
ci = ci->get_translation(1);
if (ci != 0 /* nullptr */) {
- int c = ci->get_ascii_code();
- if (c != '\0')
+ unsigned char c = ci->get_ascii_code();
+ if (c != 0U)
return c;
error("cannot translate %1 to special character '%2' in"
" device-independent output", input_char_description(cc),
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit