groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 22/60: src/roff/troff/env.cpp: Fix source style nits.


From: G. Branden Robinson
Subject: [groff] 22/60: src/roff/troff/env.cpp: Fix source style nits.
Date: Wed, 11 Sep 2024 03:38:30 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 4049377a884b93d2f934a0bbe592ee260ec62ed7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Sep 9 15:23:53 2024 -0500

    src/roff/troff/env.cpp: Fix source style nits.
    
    * Break long lines.
    * Add whitespace around binary operators.
---
 src/roff/troff/env.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index de09d554b..6e546d0ee 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1909,7 +1909,8 @@ void environment::output_line(node *nd, hunits width, 
bool was_centered)
 {
   prev_text_length = width;
   if (margin_character_flags) {
-    hunits d = line_length + margin_character_distance - saved_indent - width;
+    hunits d = line_length + margin_character_distance - saved_indent
+              - width;
     if (d > 0) {
       nd = new hmotion_node(d, get_fill_color(), nd);
       width += d;
@@ -1940,17 +1941,19 @@ void environment::output_line(node *nd, hunits width, 
bool was_centered)
     --no_number_count;
   else if (numbering_nodes) {
     hunits w = (line_number_digit_width
-               *(3+line_number_indent+number_text_separation));
-    if (next_line_number % line_number_multiple != 0)
+               * (3 + line_number_indent + number_text_separation));
+    if ((next_line_number % line_number_multiple) != 0)
       nn = new hmotion_node(w, get_fill_color(), nn);
     else {
       hunits x = w;
-      nn = new hmotion_node(number_text_separation * line_number_digit_width,
+      nn = new hmotion_node(number_text_separation
+                           * line_number_digit_width,
                            get_fill_color(), nn);
       x -= number_text_separation*line_number_digit_width;
       char buf[30];
       sprintf(buf, "%3d", next_line_number);
-      for (char *p = strchr(buf, '\0') - 1; p >= buf && *p != ' '; --p) {
+      for (char *p = strchr(buf, '\0') - 1; p >= buf && *p != ' '; --p)
+      {
        node *gn = numbering_nodes;
        for (int count = *p - '0'; count > 0; count--)
          gn = gn->next;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]