gbranden pushed a commit to branch master
in repository groff.
commit 77d8f728dba1c483b2fbbbe64017c0668c5b8450
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 4 01:39:31 2025 -0500
[troff]: Trivially refactor.
Rename `charinfo` class's member function `get_unicode_code()` to
`get_unicode_mapping()`.
* src/roff/troff/charinfo.h (class charinfo): Do it.
* src/roff/troff/input.cpp (charinfo::get_unicode_code): Rename this...
(charinfo::get_unicode_mapping): ...to this.
(define_class, charinfo::get_flags): Update call sites.
---
ChangeLog | 11 +++++++++++
src/roff/troff/charinfo.h | 2 +-
src/roff/troff/input.cpp | 12 ++++++------
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e099e26c8..79e719d77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-09-04 G. Branden Robinson <[email protected]>
+
+ [troff]: Trivially refactor. Rename `charinfo` class's member
+ function `get_unicode_code()` to `get_unicode_mapping()`.
+
+ * src/roff/troff/charinfo.h (class charinfo): Do it.
+ * src/roff/troff/input.cpp (charinfo::get_unicode_code): Rename
+ this...
+ (charinfo::get_unicode_mapping): ...to this.
+ (define_class, charinfo::get_flags): Update call sites.
+
2025-09-04 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp: Trivially refactor.
diff --git a/src/roff/troff/charinfo.h b/src/roff/troff/charinfo.h
index 97358184b..0a38c8398 100644
--- a/src/roff/troff/charinfo.h
+++ b/src/roff/troff/charinfo.h
@@ -88,7 +88,7 @@ public:
unsigned char get_hyphenation_code();
unsigned char get_ascii_code();
unsigned char get_asciify_code();
- int get_unicode_code();
+ int get_unicode_mapping();
void set_hyphenation_code(unsigned char);
void set_ascii_code(unsigned char);
void set_asciify_code(unsigned char);
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 4f6c83d63..fe36a2f7e 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8233,8 +8233,8 @@ void define_class()
skip_line();
return;
}
- int u1 = child1->get_unicode_code();
- int u2 = child2->get_unicode_code();
+ int u1 = child1->get_unicode_mapping();
+ int u2 = child2->get_unicode_mapping();
if (u1 < 0) {
warning(WARN_SYNTAX,
"invalid start value in character range");
@@ -8260,7 +8260,7 @@ void define_class()
ci->add_to_class(child1);
}
else {
- int u1 = child1->get_unicode_code();
+ int u1 = child1->get_unicode_mapping();
if (u1 < 0) {
warning(WARN_SYNTAX,
"invalid character value in class '%1'",
@@ -8290,7 +8290,7 @@ void define_class()
ci->add_to_class(child1);
}
else {
- int u1 = child1->get_unicode_code();
+ int u1 = child1->get_unicode_mapping();
if (u1 < 0) {
warning(WARN_SYNTAX,
"invalid character value in class '%1'",
@@ -10198,7 +10198,7 @@ charinfo::charinfo(symbol s)
get_flags();
}
-int charinfo::get_unicode_code()
+int charinfo::get_unicode_mapping()
{
if (ascii_code != 0U)
return ascii_code;
@@ -10251,7 +10251,7 @@ void charinfo::get_flags()
// troff's dictionary types use a pre-STL approach to containers.
while (iter.get(&s, reinterpret_cast<void **>(&ci))) {
assert(!s.is_null());
- if (ci->contains(get_unicode_code())) {
+ if (ci->contains(get_unicode_mapping() >= 0)) {
#if defined(DEBUGGING)
if (want_html_debugging)
fprintf(stderr, "charinfo::get_flags %p %s %d\n",
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit