gbranden pushed a commit to branch master
in repository groff.
commit aac3ce21122c288caba88569310dbf5dc30ae6b2
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Jul 2 00:51:23 2026 -0500
src/roff/troff/env.cpp: Fix code style nits.
* src/roff/troff/env.cpp (environment::add_node): Delete blank line
within function definition (JJC style). Arrange equality comparisons
to avoid inadvertent assignment to lvalue (GBR style).
---
ChangeLog | 7 +++++++
src/roff/troff/env.cpp | 7 +++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e07181678..84d3a539a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-07-02 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (environment::add_node): Fix code style
+ nits. Delete blank line within function definition (JJC style).
+ Arrange equality comparisons to avoid inadvertent assignment to
+ lvalue (GBR style).
+
2026-07-01 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp: Move declarations of
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index bf1acb538..d82a2f6f1 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -424,14 +424,13 @@ node *environment::make_char_node(charinfo *ci)
void environment::add_node(node *nd)
{
assert(nd != 0 /* nullptr */);
- if (nd == 0 /* nullptr */)
+ if (0 /* nullptr */ == nd)
return;
if (!suppress_push) {
- if (nd->is_special && nd->state == 0 /* nullptr */)
+ if (nd->is_special && (0 /* nullptr */ == nd->state))
nd->state = construct_state(false);
nd->push_state = get_diversion_state();
}
-
if ((current_tab != TAB_NONE) || has_current_field)
nd->freeze_space();
if (was_line_interrupted) {
@@ -443,7 +442,7 @@ void environment::add_node(node *nd)
tab_width += nd->width();
}
else {
- if (line == 0 /* nullptr */) {
+ if (0 /* nullptr */ == line) {
if (is_discarding && nd->discardable()) {
// XXX possibly: input_line_start -= nd->width();
delete nd;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit