gbranden pushed a commit to branch master
in repository groff.
commit 57462a90a9e0a63470ead09186679fa714811b45
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jan 3 18:30:26 2024 -0600
src/libs/libgroff/glyphuni.cpp: Trivial refactor.
* src/libs/libgroff/glyphuni.cpp: Trivially refactor.
(struct glyph_to_unicode): Rename this...
(struct glyph_to_unicode_map): ...to this. We already have a
_function_ called `glyph_to_unicode` in the code base and apparently
it's not a name space conflict (despite groff making little use of any
but the default name space), but it's definitely confusing when
searching the code.
Also update editor aid comments; drop old-style Emacs file-local
variable setting.
---
ChangeLog | 10 ++++++++++
src/libs/libgroff/glyphuni.cpp | 19 ++++++++++++-------
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4fb73ad4a..4b0f30bae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
* src/utils/grog/grog.pl: Trivially refactor; simplify code.
+2024-01-03 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/glyphuni.cpp: Trivially refactor.
+ (struct glyph_to_unicode): Rename this...
+ (struct glyph_to_unicode_map): ...to this. We already have a
+ _function_ called `glyph_to_unicode` in the code base and
+ apparently it's not a name space conflict (despite groff making
+ little use of any but the default name space), but it's
+ definitely confusing when searching the code.
+
2024-01-03 G. Branden Robinson <[email protected]>
[libgroff, troff]: Refactor.
diff --git a/src/libs/libgroff/glyphuni.cpp b/src/libs/libgroff/glyphuni.cpp
index 0d5a217e0..a4ff3a746 100644
--- a/src/libs/libgroff/glyphuni.cpp
+++ b/src/libs/libgroff/glyphuni.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
Written by Werner Lemberg <[email protected]>
@@ -23,14 +22,14 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include "unicode.h"
-struct glyph_to_unicode {
+struct glyph_to_unicode_map {
char *value;
};
-declare_ptable(glyph_to_unicode)
-implement_ptable(glyph_to_unicode)
+declare_ptable(glyph_to_unicode_map)
+implement_ptable(glyph_to_unicode_map)
-PTABLE(glyph_to_unicode) glyph_to_unicode_table;
+PTABLE(glyph_to_unicode_map) glyph_to_unicode_table;
// The entries commented out in the table below can't be used in glyph
// names.
@@ -510,7 +509,7 @@ glyph_to_unicode_init::glyph_to_unicode_init()
for (unsigned int i = 0;
i < sizeof(glyph_to_unicode_list)/sizeof(glyph_to_unicode_list[0]);
i++) {
- glyph_to_unicode *gtu = new glyph_to_unicode[1];
+ glyph_to_unicode_map *gtu = new glyph_to_unicode_map[1];
gtu->value = (char *)glyph_to_unicode_list[i].value;
glyph_to_unicode_table.define(glyph_to_unicode_list[i].key, gtu);
}
@@ -518,6 +517,12 @@ glyph_to_unicode_init::glyph_to_unicode_init()
const char *glyph_name_to_unicode(const char *s)
{
- glyph_to_unicode *result = glyph_to_unicode_table.lookup(s);
+ glyph_to_unicode_map *result = glyph_to_unicode_table.lookup(s);
return result ? result->value : 0;
}
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit