groff-commit
[Top][All Lists]
Advanced

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

[groff] 112/115: [eqn]: Boolify tab_box member variable `disabled`.


From: G. Branden Robinson
Subject: [groff] 112/115: [eqn]: Boolify tab_box member variable `disabled`.
Date: Thu, 1 Jun 2023 10:46:19 -0400 (EDT)

gbranden pushed a commit to branch branden-2022-06-01
in repository groff.

commit 2adf40e10df235add73c32f10ef2237bb173dcde
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu May 25 12:55:40 2023 -0500

    [eqn]: Boolify tab_box member variable `disabled`.
    
    [eqn]: Trivially refactor.  Boolify `tab_box` member variable
    `disabled`.
    
    * src/preproc/eqn/box.cpp (tab_box::tab_box, tab_box::check_tabs):
    * src/preproc/eqn/box.h (class tab_box): Do it.
    
    * src/preproc/eqn/box.cpp (tab_box::check_tabs): Also recast diagnostic
      message to clarify what "level" we're talking about: it's lexical.
      Which, sadly, probably won't help any but CS/SWeng people...
---
 ChangeLog               | 14 ++++++++++++++
 src/preproc/eqn/box.cpp |  6 +++---
 src/preproc/eqn/box.h   |  2 +-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 424bd44d1..b8e196a82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2023-05-25  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [eqn]: Trivially refactor.  Boolify `tab_box` member variable
+       `disabled`.
+
+       * src/preproc/eqn/box.cpp (tab_box::tab_box)
+       (tab_box::check_tabs):
+       * src/preproc/eqn/box.h (class tab_box): Do it.
+
+       * src/preproc/eqn/box.cpp (tab_box::check_tabs): Also recast
+       diagnostic message to clarify what "level" we're talking about:
+       it's lexical.  Which, sadly, probably won't help any but
+       CS/SWeng people...
+
 2023-05-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Validate a font family before trying to use it.
diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp
index 4519bcd48..459e24ef6 100644
--- a/src/preproc/eqn/box.cpp
+++ b/src/preproc/eqn/box.cpp
@@ -573,7 +573,7 @@ void quoted_text_box::output()
   }
 }
 
-tab_box::tab_box() : disabled(0)
+tab_box::tab_box() : disabled(false)
 {
 }
 
@@ -588,8 +588,8 @@ void tab_box::output()
 void tab_box::check_tabs(int level)
 {
   if (level > 0) {
-    error("tabs allowed only at outermost level");
-    disabled = 1;
+    error("tabs allowed only at outermost lexical level");
+    disabled = true;
   }
 }
 
diff --git a/src/preproc/eqn/box.h b/src/preproc/eqn/box.h
index 93277f3c0..079fd03cd 100644
--- a/src/preproc/eqn/box.h
+++ b/src/preproc/eqn/box.h
@@ -197,7 +197,7 @@ public:
 };
 
 class tab_box : public box {
-  int disabled;
+  bool disabled;
 public:
   tab_box();
   void output();



reply via email to

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