groff-commit
[Top][All Lists]
Advanced

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

[groff] 28/48: [troff]: Boolify env.cpp (19/25).


From: G. Branden Robinson
Subject: [groff] 28/48: [troff]: Boolify env.cpp (19/25).
Date: Sun, 28 Apr 2024 23:06:32 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 869cdcb7ff429d2c8b0a786456cdf920d207ce32
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Apr 27 04:53:13 2024 -0500

    [troff]: Boolify env.cpp (19/25).
    
    [troff]: Boolify more `environment` class member variables, member
    function parameters, and local variables.
    
    * src/roff/troff/env.cpp (temporary_indent): Rename local variable `err`
      to `is_valid`, invert its sense, and demote it from `int` to `bool`.
      Assign Boolean literals to it.
---
 ChangeLog              | 4 ++++
 src/roff/troff/env.cpp | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 54c95513e..0b29021d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,10 @@
        * src/roff/troff/env.h (environment::is_composite): Return a
        `bool`, not an `int`.
 
+       * src/roff/troff/env.cpp (temporary_indent): Rename local
+       variable `err` to `is_valid`, invert its sense, and demote it
+       from `int` to `bool`.  Assign Boolean literals to it.
+
 2024-04-24  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/env.cpp (tab_stops::to_string)
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index ec29abbdf..e6806ac47 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1560,10 +1560,10 @@ void indent()
 
 void temporary_indent()
 {
-  int err = 0;
+  bool is_valid = true;
   hunits temp;
   if (!get_hunits(&temp, 'm', curenv->get_indent()))
-    err = 1;
+    is_valid = false;
   while (!tok.is_newline() && !tok.is_eof())
     tok.next();
   if (want_break)
@@ -1572,7 +1572,7 @@ void temporary_indent()
     warning(WARN_RANGE, "total indent cannot be negative");
     temp = H0;
   }
-  if (!err) {
+  if (is_valid) {
     curenv->temporary_indent = temp;
     curenv->have_temporary_indent = true;
     curdiv->modified_tag.incl(MTSM_TI);



reply via email to

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