gbranden pushed a commit to branch master
in repository groff.

commit 807a3410b1743fb2e61e05d38b3a7dae184e7a98
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 30 06:51:45 2025 -0600

    [troff]: Mark more functions static.
    
    * src/roff/troff/column.cpp [COLUMN] (column_justify)
      (column_start, column_output, column_trim, column_reset)
      (no_vjustify, restore_vjustify):
    * src/roff/troff/div.cpp (divert, divert_append, box)
      (box_append, page_length, when_request, begin_page, no_space)
      (restore_spacing, space_request, need_space, page_number)
      (save_vertical_space, output_saved_vertical_space)
      (diversion_trap, change_trap, print_traps, mark, return_request)
      (vertical_position_traps): Mark functions `static` since they do not
      require external linkage.
---
 ChangeLog                 | 13 +++++++++++++
 src/roff/troff/column.cpp | 18 +++++++++---------
 src/roff/troff/div.cpp    | 40 ++++++++++++++++++++--------------------
 3 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b831aeae1..3b912300e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2025-11-30  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/column.cpp [COLUMN] (column_justify)
+       (column_start, column_output, column_trim, column_reset)
+       (no_vjustify, restore_vjustify):
+       * src/roff/troff/div.cpp (divert, divert_append, box)
+       (box_append, page_length, when_request, begin_page, no_space)
+       (restore_spacing, space_request, need_space, page_number)
+       (save_vertical_space, output_saved_vertical_space)
+       (diversion_trap, change_trap, print_traps, mark, return_request)
+       (vertical_position_traps): Mark functions `static` since they do
+       not require external linkage.
+
 2025-11-30  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/div.h: Drop unnecessary declaration of
diff --git a/src/roff/troff/column.cpp b/src/roff/troff/column.cpp
index 20bd4265a..d49bae47f 100644
--- a/src/roff/troff/column.cpp
+++ b/src/roff/troff/column.cpp
@@ -538,7 +538,7 @@ void justification_spec::justify(output_line *col, vunits 
*bottomp) const
   assert(total == V0);
   *bottomp = height - gap;
 }
-  
+
 void column::justify(const justification_spec &js)
 {
   check_bottom();
@@ -546,7 +546,7 @@ void column::justify(const justification_spec &js)
   check_bottom();
 }
 
-void column_justify()
+static void column_justify()
 {
   vunits height;
   if (!the_column->is_active())
@@ -579,7 +579,7 @@ void column_justify()
   skip_line();
 }
 
-void column_start()
+static void column_start()
 {
   if (the_column->is_active())
     error("can't start column - column already active");
@@ -588,7 +588,7 @@ void column_start()
   skip_line();
 }
 
-void column_output()
+static void column_output()
 {
   if (!the_column->is_active())
     error("can't output column - column not active");
@@ -597,7 +597,7 @@ void column_output()
   skip_line();
 }
 
-void column_trim()
+static void column_trim()
 {
   if (!the_column->is_active())
     error("can't trim column - column not active");
@@ -606,7 +606,7 @@ void column_trim()
   skip_line();
 }
 
-void column_reset()
+static void column_reset()
 {
   if (!the_column->is_active())
     error("can't reset column - column not active");
@@ -698,13 +698,13 @@ void top_level_diversion::vjustify(symbol type)
   the_output->vjustify(vertical_position, type);
 }
 
-void no_vjustify()
+static void no_vjustify()
 {
   skip_line();
   no_vjustify_mode = 1;
 }
 
-void restore_vjustify()
+static void restore_vjustify()
 {
   skip_line();
   no_vjustify_mode = 0;
@@ -724,7 +724,7 @@ void init_column_requests()
   register_dictionary.define(".colx", new column_extra_space_reg);
   register_dictionary.define(".cola", new column_active_reg);
   register_dictionary.define(".nvj",
-                              new readonly_register(&no_vjustify_mode));
+                            new readonly_register(&no_vjustify_mode));
 }
 
 #endif /* COLUMN */
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index bde7d8c0f..09777137f 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -156,22 +156,22 @@ void do_divert(bool appending, bool boxing)
   skip_line();
 }
 
-void divert()
+static void divert()
 {
   do_divert(false /* appending */, false /* boxing */);
 }
 
-void divert_append()
+static void divert_append()
 {
   do_divert(true /* appending */, false /* boxing */);
 }
 
-void box()
+static void box()
 {
   do_divert(false /* appending */, true /* boxing */);
 }
 
-void box_append()
+static void box_append()
 {
   do_divert(true /* appending */, true /* boxing */);
 }
@@ -747,7 +747,7 @@ void page_offset()
   skip_line();
 }
 
-void page_length()
+static void page_length()
 {
   vunits temp;
   if (has_arg() && get_vunits(&temp, 'v', topdiv->get_page_length())) {
@@ -764,7 +764,7 @@ void page_length()
   skip_line();
 }
 
-void when_request()
+static void when_request()
 {
   vunits n;
   if (get_vunits(&n, 'v')) {
@@ -777,7 +777,7 @@ void when_request()
   skip_line();
 }
 
-void begin_page()
+static void begin_page()
 {
   bool got_arg = false;
   int n = 0;
@@ -831,13 +831,13 @@ void begin_page()
   tok.next();
 }
 
-void no_space()
+static void no_space()
 {
   curdiv->is_in_no_space_mode = true;
   skip_line();
 }
 
-void restore_spacing()
+static void restore_spacing()
 {
   curdiv->is_in_no_space_mode = false;
   skip_line();
@@ -854,7 +854,7 @@ outputting of the line forced out by the break till after 
we have read
 the argument to the request.  If the break did cause a trap to be
 sprung, then we don't actually do the space. */
 
-void space_request()
+static void space_request()
 {
   postpone_traps();
   if (want_break)
@@ -885,7 +885,7 @@ void blank_line()
 /* need_space might spring a trap and so we must be careful that the
 BEGIN_TRAP token is not skipped over. */
 
-void need_space()
+static void need_space()
 {
   vunits n;
   if (!has_arg() || !get_vunits(&n, 'v'))
@@ -896,7 +896,7 @@ void need_space()
   tok.next();
 }
 
-void page_number()
+static void page_number()
 {
   if (!has_arg()) {
     warning(WARN_MISSING, "page number assignment request expects an"
@@ -918,7 +918,7 @@ void page_number()
 
 vunits saved_space;
 
-void save_vertical_space()
+static void save_vertical_space()
 {
   vunits x;
   if (!has_arg() || !get_vunits(&x, 'v'))
@@ -930,7 +930,7 @@ void save_vertical_space()
   skip_line();
 }
 
-void output_saved_vertical_space()
+static void output_saved_vertical_space()
 {
   while (!tok.is_newline() && !tok.is_eof())
     tok.next();
@@ -972,7 +972,7 @@ void top_level_diversion::clear_diversion_trap()
   error("cannot clear diversion trap when not diverting output");
 }
 
-void diversion_trap()
+static void diversion_trap()
 {
   vunits n;
   if (has_arg() && get_vunits(&n, 'v')) {
@@ -987,7 +987,7 @@ void diversion_trap()
   skip_line();
 }
 
-void change_trap()
+static void change_trap()
 {
   symbol s = read_identifier(true /* required */);
   if (!s.is_null()) {
@@ -1000,13 +1000,13 @@ void change_trap()
   skip_line();
 }
 
-void print_traps()
+static void print_traps()
 {
   topdiv->print_traps();
   skip_line();
 }
 
-void mark()
+static void mark()
 {
   symbol s = read_identifier();
   if (s.is_null())
@@ -1020,7 +1020,7 @@ void mark()
 
 // This is truly bizarre.  It is documented in the SQ manual.
 
-void return_request()
+static void return_request()
 {
   vunits dist = curdiv->marked_place - curdiv->get_vertical_position();
   if (has_arg()) {
@@ -1041,7 +1041,7 @@ void return_request()
   skip_line();
 }
 
-void vertical_position_traps()
+static void vertical_position_traps()
 {
   int n = 0;
   if (has_arg() && read_integer(&n))

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

Reply via email to