gbranden pushed a commit to branch master
in repository groff.
commit 715b199cf62973d60a3d228c6e858e120d5a4055
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Apr 14 07:54:36 2026 -0500
src/roff/troff/div.cpp: Drop unused code (1/5).
...introduced in commit 0216fc85d3, 2001-05-05. Since the (now-named)
`.ns` register is interpolated only by its `get_string()` member
function and never `get_value()` (and nothing internally to the
formatter attempts to get at it by that means, since accessing the datum
via `curdiv->is_in_no_space_mode` is more straightforward), we can drop
the latter.
* src/roff/troff/div.cpp (class no_space_mode_reg): Drop `get_value()`
declaration.
(no_space_mode_reg::get_value): Delete.
---
ChangeLog | 13 +++++++++++++
src/roff/troff/div.cpp | 7 -------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 89c700cb1..c70d2b7d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-04-14 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/div.cpp: Drop unused code introduced in commit
+ 0216fc85d3, 2001-05-05. Since the (now-named) `.ns` register is
+ interpolated only by its `get_string()` member function and
+ never `get_value()` (and nothing internally to the formatter
+ attempts to get at it by that means, since accessing the datum
+ via `curdiv->is_in_no_space_mode` is more straightforward), we
+ can drop the latter.
+
+ (class no_space_mode_reg): Drop `get_value()` declaration.
+ (no_space_mode_reg::get_value): Delete.
+
2026-04-14 G. Branden Robinson <[email protected]>
[groff]: Unit-test `.ns` register.
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 1562c8b85..af7cda934 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -1268,16 +1268,9 @@ void nl_reg::set_value(units n)
class no_space_mode_reg : public reg {
public:
- bool get_value(units *);
const char *get_string();
};
-bool no_space_mode_reg::get_value(units *val)
-{
- *val = curdiv->is_in_no_space_mode;
- return true;
-}
-
const char *no_space_mode_reg::get_string()
{
return curdiv->is_in_no_space_mode ? "1" : "0";
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit