gbranden pushed a commit to branch master in repository groff. commit c8ac431a180ee1e720f7a8edbaca75899701e87b Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Sat Apr 27 04:21:21 2024 -0500
src/roff/troff/env.cpp: Fix code style nit. * src/roff/troff/env.cpp (environment::add_italic_correction): Fix code style nit (in de-configured code); explicitly compare variable of pointer type to null pointer constant instead of letting it pun down to a Boolean. (environment::output) [WIDOW_CONTROL]: Same, in deconfigured code. Annotate null pointer with `nullptr` comment to ease any future transition to C++11, which defines it as a keyword. --- ChangeLog | 7 +++++++ src/roff/troff/env.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 191afe401..79b3c0174 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-04-27 G. Branden Robinson <g.branden.robin...@gmail.com> + + * src/roff/troff/env.cpp (environment::output) [WIDOW_CONTROL]: + Fix code style nit (in de-configured code); explicitly compare + variable of pointer type to null pointer constant instead of + letting it pun down to a Boolean. + 2024-04-27 G. Branden Robinson <g.branden.robin...@gmail.com> [troff]: Trivially refactor. Rename member functions and diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index 23ab6c115..46362e27c 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -142,7 +142,7 @@ void environment::output(node *nd, bool suppress_filling, hunits width, bool was_centered) { #ifdef WIDOW_CONTROL - while (pending_lines) { + while (pending_lines != 0 /* nullptr */) { if (want_widow_control && !pending_lines->suppress_filling && !pending_lines->next) break; @@ -453,7 +453,7 @@ const char *environment::get_input_trap_macro() void environment::add_italic_correction() { if (current_tab) { - if (tab_contents) + if (tab_contents != 0 /* nullptr */) tab_contents = tab_contents->add_italic_correction(&tab_width); } else if (line) _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit