gbranden pushed a commit to branch master
in repository groff.
commit ab054646f14d02c129b96e80e61ebc9823ecfceb
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Oct 4 01:50:46 2025 -0500
[troff]: Slightly refactor.
Nothing outside of "env.cpp" calls the global function `hyphenate()`.
In fact, it has only one call site.
* src/roff/troff/env.cpp: Add forward declaration.
(hyphenation): Mark function as `static`.
* src/roff/troff/node.h: Drop declaration.
---
ChangeLog | 11 +++++++++++
src/roff/troff/env.cpp | 5 ++++-
src/roff/troff/node.h | 2 --
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6751b4937..e09770b72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-10-04 G. Branden Robinson <[email protected]>
+
+ [troff]: Slightly refactor.
+
+ Nothing outside of "env.cpp" calls the global function
+ `hyphenate()`. In fact, it has only one call site.
+
+ * src/roff/troff/env.cpp: Add forward declaration.
+ (hyphenation): Mark function as `static`.
+ * src/roff/troff/node.h: Drop declaration.
+
2025-10-04 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (environment::hyphenate_line): Add
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 134f328a0..2f6f779ac 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -86,6 +86,9 @@ charinfo *padding_indicator_char;
bool translate_space_to_dummy = false;
+// forward declaration
+static void hyphenate(hyphen_list *h, unsigned int flags);
+
class pending_output_line {
node *nd;
bool suppress_filling;
@@ -4444,7 +4447,7 @@ void init_env_requests()
// Appendix H of _The TeXbook_ is useful background for the following.
-void hyphenate(hyphen_list *h, unsigned int flags)
+static void hyphenate(hyphen_list *h, unsigned int flags)
{
if (0 /* nullptr */ == current_language)
return;
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 42fa96d97..d1ff588cd 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -25,8 +25,6 @@ struct hyphen_list {
hyphen_list * /* p */ = 0 /* nullptr */);
};
-void hyphenate(hyphen_list *, unsigned);
-
enum hyphenation_type {
HYPHEN_MIDDLE,
HYPHEN_BOUNDARY,
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit