gbranden pushed a commit to branch master
in repository groff.

commit 51a38a9728cf5fdbaf41434e0c6f5e10d31a9e5f
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 16 09:29:16 2026 -0600

    [tbl]: Boolify AT&T compatibility flag.
    
    Demote `compatible_flag` from `int` to `bool` and rename it to
    `want_att_compat`.
    
    * src/preproc/tbl/table.h: Update declaration.
    
    * src/preproc/tbl/main.cpp: Initialize it with Boolean, not integer,
      literal.
    
      (main): Assign to it with Boolean, not integer, literal.
    
    * src/preproc/tbl/main.cpp (table_input::get)
      (process_input_file, process_data):
    * src/preproc/tbl/table.cpp (table::init_output): Update dereference
      sites.
    
    Continues the long process of fixing Savannah #66672.
---
 ChangeLog                 | 18 ++++++++++++++++++
 src/preproc/tbl/main.cpp  | 14 +++++++-------
 src/preproc/tbl/table.cpp |  2 +-
 src/preproc/tbl/table.h   |  2 +-
 4 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e0c1e0e6f..d6a786d9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2026-11-16  G. Branden Robinson <[email protected]>
+
+       [tbl]: Boolify AT&T compatibility flag.
+
+       Demote `compatible_flag` from `int` to `bool` and rename it to
+       `want_att_compat`.
+
+       * src/preproc/tbl/table.h: Update declaration.
+       * src/preproc/tbl/main.cpp: Initialize it with Boolean, not
+       integer, literal.
+       (main): Assign to it with Boolean, not integer, literal.
+       * src/preproc/tbl/main.cpp (table_input::get)
+       (process_input_file, process_data):
+       * src/preproc/tbl/table.cpp (table::init_output): Update
+       dereference sites.
+
+       Continues the long process of fixing Savannah #66672.
+
 2026-11-15  G. Branden Robinson <[email protected]>
 
        * src/libs/libgroff/searchpath.cpp (search_path::search_path):
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index 1c365ef71..0951342f7 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -43,7 +43,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 extern "C" const char *Version_string;
 
-int compatible_flag = 0;
+bool want_att_compat = false;
 
 class table_input {
   FILE *fp;
@@ -89,7 +89,7 @@ int table_input::get()
       if ((c = getc(fp)) == '.') {
        if ((c = getc(fp)) == 'T') {
          if ((c = getc(fp)) == 'E') {
-           if (compatible_flag) {
+           if (want_att_compat) {
              state = END;
              return EOF;
            }
@@ -144,7 +144,7 @@ int table_input::get()
          current_lineno++;
          c = getc(fp);
        }
-       else if (c == 'a' && compatible_flag) {
+       else if (c == 'a' && want_att_compat) {
          state = LEADER_1;
          return '\\';
        }
@@ -257,7 +257,7 @@ void process_input_file(FILE *fp)
       }
       break;
     case HAD_TS:
-      if (c == ' ' || c == '\n' || compatible_flag) {
+      if (c == ' ' || c == '\n' || want_att_compat) {
        putchar('.');
        putchar('T');
        putchar('S');
@@ -312,7 +312,7 @@ void process_input_file(FILE *fp)
       }
       break;
     case HAD_lf:
-      if (c == ' ' || c == '\n' || compatible_flag) {
+      if (c == ' ' || c == '\n' || want_att_compat) {
        string line;
        while (c != EOF) {
          line += c;
@@ -1541,7 +1541,7 @@ static table *process_data(table_input &in, format *f, 
options *opt)
                  }
                  break;
                case GOT_lf:
-                 if (c == ' ' || c == '\n' || compatible_flag) {
+                 if (c == ' ' || c == '\n' || want_att_compat) {
                    string args;
                    input_entry += ".lf";
                    while (c != EOF) {
@@ -1763,7 +1763,7 @@ int main(int argc, char **argv)
          != EOF)
     switch (opt) {
     case 'C':
-      compatible_flag = 1;
+      want_att_compat = true;
       break;
     case 'v':
       {
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index a532fe7d8..66cf74a5e 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1886,7 +1886,7 @@ void table::init_output()
     prints(".nr " LINESIZE_REG " \\n[.s]\n");
   if (!(flags & CENTER))
     prints(".nr " SAVED_CENTER_REG " \\n[.ce]\n");
-  if (compatible_flag)
+  if (want_att_compat)
     prints(".ds " LEADER_REG " \\a\n");
   if (!(flags & NOKEEP))
     prints(".if !r " USE_KEEPS_REG " .nr " USE_KEEPS_REG " 1\n");
diff --git a/src/preproc/tbl/table.h b/src/preproc/tbl/table.h
index 0313a5a4d..c27e1c272 100644
--- a/src/preproc/tbl/table.h
+++ b/src/preproc/tbl/table.h
@@ -170,7 +170,7 @@ public:
 
 void set_troff_location(const char *, int);
 
-extern int compatible_flag;
+extern bool want_att_compat;
 
 // Local Variables:
 // fill-column: 72

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

Reply via email to