gbranden pushed a commit to branch master
in repository groff.
commit dbb015889438bb2c29c9963bce9ead4b8d908980
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 21 17:19:48 2024 -0500
[troff]: Trivially refactor.
* src/roff/troff/env.cpp (environment::possibly_break_line): Explicitly
handle adjustment modes that had been handled by falling completely
through a `switch` statement. Throw assertion if an unhandled case is
encountered.
---
ChangeLog | 7 +++++++
src/roff/troff/env.cpp | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 26f55dd55..cec91f58e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-06-21 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (environment::possibly_break_line):
+ Trivially refactor. Explicitly handle adjustment modes that had
+ been handled by falling completely through a `switch` statement.
+ Throw assertion if an unhandled case is encountered.
+
2024-06-21 G. Branden Robinson <[email protected]>
[mdoc]: Recognize new POSIX.1-2024 standard.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index f0be0bfa9..7e315c70d 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2220,6 +2220,12 @@ void environment::possibly_break_line(bool
must_break_here,
case ADJUST_RIGHT:
saved_indent += target_text_length - bp->width;
break;
+ case ADJUST_LEFT:
+ case ADJUST_CENTER - 1:
+ case ADJUST_RIGHT - 1:
+ break;
+ default:
+ assert(0 == "unhandled case of `adjust_mode`");
}
distribute_space(pre, bp->nspaces, extra_space_width);
hunits output_width = bp->width + extra_space_width;
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit