gbranden pushed a commit to branch master
in repository groff.

commit 42f88c06c9c5f3269de0f18eac4e5f096527b7f4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 21 07:39:30 2025 -0500

    [troff]: Slighty refactor (boolify, rename) (4/5).
    
    * src/roff/troff/node.cpp (class tfont_spec): Demote return type of
      `operator==` from `int` to `bool`.
    
      (tfont_spec::operator==): Same for function definition.
---
 ChangeLog               | 8 ++++++++
 src/roff/troff/node.cpp | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ae6d114db..9679e0ba6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-04-21  G. Branden Robinson <[email protected]>
+
+       [troff]: Slighty refactor (boolify, rename).
+
+       * src/roff/troff/node.cpp (class tfont_spec): Demote return type
+       of `operator==` from `int` to `bool`.
+       (tfont_spec::operator==): Same for function definition.
+
 2025-04-21  G. Branden Robinson <[email protected]>
 
        [troff]: Slighty refactor (boolify, rename).
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 55cd695c5..4f26bee4c 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -197,7 +197,7 @@ protected:
 public:
   tfont_spec(symbol, int, font *, font_size, int, int);
   tfont_spec plain();
-  int operator==(const tfont_spec &);
+  bool operator==(const tfont_spec &);
   friend tfont *font_info::get_tfont(font_size fs, int, int, int);
 };
 
@@ -496,7 +496,7 @@ tfont_spec::tfont_spec(symbol nm, int n, font *f,
     height = 0;
 }
 
-int tfont_spec::operator==(const tfont_spec &spec)
+bool tfont_spec::operator==(const tfont_spec &spec)
 {
   if (fm == spec.fm
       && size == spec.size
@@ -514,9 +514,9 @@ int tfont_spec::operator==(const tfont_spec &spec)
          : !spec.is_constant_spaced)
       && ligature_mode == spec.ligature_mode
       && kern_mode == spec.kern_mode)
-    return 1;
+    return true;
   else
-    return 0;
+    return false;
 }
 
 tfont_spec tfont_spec::plain()

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

Reply via email to