groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/10: src/roff/troff/env.cpp: Refactor slightly.


From: G. Branden Robinson
Subject: [groff] 05/10: src/roff/troff/env.cpp: Refactor slightly.
Date: Mon, 6 Sep 2021 15:01:24 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit a82a81be76da6186185ffa7383818d3da63d776e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Sep 6 01:36:37 2021 +1000

    src/roff/troff/env.cpp: Refactor slightly.
    
    * src/roff/troff/env.cpp (do_hyphenation_patterns_file): Refactor
      slightly.  Demote `append` from `int` to `bool`.
    
      (hyphenation_patterns_file, hyphenation_patterns_file_append): Update
      call sites to use Boolean, not integer, literals.
---
 ChangeLog              | 7 +++++++
 src/roff/troff/env.cpp | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4da047e..10012ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-09-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/env.cpp (do_hyphenation_patterns_file):
+       Refactor slightly.  Demote `append` from `int` to `bool`.
+       (hyphenation_patterns_file, hyphenation_patterns_file_append):
+       Update call sites to use Boolean, not integer, literals.
+
 2021-09-05  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/hvunits.h:
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index da4ed6e..68d0dc2 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -4052,7 +4052,7 @@ void hyphenate(hyphen_list *h, unsigned flags)
   }
 }
 
-static void do_hyphenation_patterns_file(int append)
+static void do_hyphenation_patterns_file(bool append)
 {
   symbol name = get_long_name(true /* required */);
   if (!name.is_null()) {
@@ -4068,12 +4068,12 @@ static void do_hyphenation_patterns_file(int append)
 
 static void hyphenation_patterns_file()
 {
-  do_hyphenation_patterns_file(0);
+  do_hyphenation_patterns_file(false /* append */);
 }
 
 static void hyphenation_patterns_file_append()
 {
-  do_hyphenation_patterns_file(1);
+  do_hyphenation_patterns_file(true /* append */);
 }
 
 class hyphenation_language_reg : public reg {



reply via email to

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