groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/06: [tbl]: Use `\n[.R]`, not INT_MAX literal.


From: G. Branden Robinson
Subject: [groff] 04/06: [tbl]: Use `\n[.R]`, not INT_MAX literal.
Date: Fri, 4 Oct 2024 06:49:36 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 496530512d152615bc9c7f8ba1bff773b2c54be7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 4 05:05:45 2024 -0500

    [tbl]: Use `\n[.R]`, not INT_MAX literal.
    
    * src/preproc/tbl/table.cpp (table::init_output): Migrate to use of `.R`
      register for a huge value in generated groff language, instead of
      hard-coding (2^31)-1 as a numeric literal.
---
 ChangeLog                 | 6 ++++++
 src/preproc/tbl/table.cpp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index eb4d70e5c..63a1fb07f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-04  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/tbl/table.cpp (table::init_output): Migrate to use
+       of `.R` register for a huge value in generated groff language,
+       instead of hard-coding (2^31)-1 as a numeric literal.
+
 2024-10-04  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/tbl/table.cpp: Add C preprocessor macro storing
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index a3cbf4b4a..4a3b30b03 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -2021,7 +2021,7 @@ void table::init_output()
         ".nr ln 0\n"
         ".nr " SAVED_NUMBERING_ENABLED " \\n[.nm]\n"
         ".nr " SAVED_NUMBERING_SUPPRESSION_COUNT " \\n[.nn]\n"
-        ".nn 2147483647\n"); // 2^31-1; inelegant but effective
+        ".nn \\n[.R]\n"); // INT_MAX as of groff 1.24
   prints(".nf\n");
 }
 



reply via email to

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