gbranden pushed a commit to branch master
in repository groff.
commit 91dfa8f9132b540220920488ddeeeb319043af23
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Aug 18 07:25:23 2024 -0500
[troff]: Do more `macro_diversion` initialization.
* src/roff/troff/div.cpp (macro_diversion::macro_diversion): Handle
member variables `diversion_trap` and `diversion_trap_post` in
constructor's initializer list, for clarity and to ensure that they
don't contain garbage.
Also wrap long source line.
---
ChangeLog | 7 +++++++
src/roff/troff/div.cpp | 9 +++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 64cae1dfa..c21f37ce7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-18 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/div.cpp (macro_diversion::macro_diversion):
+ Handle member variables `diversion_trap` and
+ `diversion_trap_post` in constructor's initializer list, for
+ clarity and to ensure that they don't contain garbage.
+
2024-08-17 G. Branden Robinson <[email protected]>
* tmac/e.tmac (@M, $c): If the formatter is GNU troff,
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index f79aabb6e..806328aa1 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -50,9 +50,9 @@ static vunits needed_space;
diversion::diversion(symbol s)
: prev(0), nm(s), vertical_position(V0), high_water_mark(V0),
- any_chars_added(0), no_space_mode(0), needs_push(0), saved_seen_break(0),
- saved_seen_space(0), saved_seen_eol(0), saved_suppress_next_eol(0),
- marked_place(V0)
+ any_chars_added(0), no_space_mode(0), needs_push(0),
+ saved_seen_break(0), saved_seen_space(0), saved_seen_eol(0),
+ saved_suppress_next_eol(0), marked_place(V0)
{
}
@@ -173,7 +173,8 @@ void diversion::need(vunits n)
}
macro_diversion::macro_diversion(symbol s, int append)
-: diversion(s), max_width(H0)
+: diversion(s), max_width(H0), diversion_trap(0 /* nullptr */),
+ diversion_trap_pos(0)
{
#if 0
if (append) {
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit