gbranden pushed a commit to branch master
in repository groff.

commit d2dceabb8398c2ba79a3303483add9ff197a48ea
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Aug 30 03:54:22 2024 -0500

    [troff]: Fix code style nit.
    
    * src/roff/troff/env.cpp (environment::choose_breakpoint): Fix code
      style nit: parenthesize complex expressions.
---
 ChangeLog              |  5 +++++
 src/roff/troff/env.cpp | 23 +++++++++++++----------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dffa072fb..8416b88d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-08-30  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/env.cpp (environment::choose_breakpoint): Fix
+       code style nit: parenthesize complex expressions.
+
 2024-08-30  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (encode_character_for_device_output):
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index f4fb34440..0ea46efb0 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2001,22 +2001,25 @@ breakpoint *environment::choose_breakpoint()
          }
          if (best_bp_fits
              // Decide whether to use the hyphenated breakpoint.
-             && (hyphen_line_max < 0
-                 // Only choose the hyphenated breakpoint if it would not
-                 // exceed the maximum number of consecutive hyphenated
-                 // lines.
-                 || hyphen_line_count + 1 <= hyphen_line_max)
-             && !(adjust_mode == ADJUST_BOTH
+             && ((hyphen_line_max < 0)
+                 // Only choose the hyphenated breakpoint if it would
+                 // not exceed the maximum number of consecutive
+                 // hyphenated lines.
+                 || (hyphen_line_count + 1 <= hyphen_line_max))
+             && !((adjust_mode == ADJUST_BOTH)
                   // Don't choose the hyphenated breakpoint if the line
                   // can be justified by adding no more than
                   // hyphenation_space to any word space.
                   ? (bp->nspaces > 0
-                     && (((target_text_length - bp->width
-                           + (bp->nspaces - 1)*hresolution)/bp->nspaces)
+                     && ((((target_text_length - bp->width)
+                           + ((bp->nspaces - 1) * hresolution)
+                              / bp->nspaces))
                          <= hyphenation_space))
                   // Don't choose the hyphenated breakpoint if the line
-                  // is no more than hyphenation_margin short.
-                  : target_text_length - bp->width <= hyphenation_margin)) {
+                  // is no more than hyphenation_margin short of the
+                  // line length.
+                  : ((target_text_length - bp->width)
+                     <= hyphenation_margin))) {
            delete bp;
            return best_bp;
          }

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to