gbranden pushed a commit to branch master
in repository groff.

commit 5ef9eb67ddb06090194e4ed8fa7bdcb70fe03ec5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Mar 25 22:15:07 2026 -0500

    [grodvi,post-grohtml,grops]: Improve declarations.
    
    * src/devices/grodvi/dvi.cpp (scale):
    * src/devices/grohtml/post-html.cpp (stop, replace_negate_str)
      (replace_str):
    * src/devices/grops/ps.cpp (degrees, radians, is_ascii):
    * src/devices/grops/psrm.cpp (read_one_of, skip_possible_newline):
      Declare functions as `static` since they do not require external
      linkage.
---
 ChangeLog                         | 12 ++++++++++++
 src/devices/grodvi/dvi.cpp        |  2 +-
 src/devices/grohtml/post-html.cpp |  8 ++++----
 src/devices/grops/ps.cpp          |  6 +++---
 src/devices/grops/psrm.cpp        |  5 +++--
 5 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e666de1d6..0d817af71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-03-25  G. Branden Robinson <[email protected]>
+
+       [grodvi,post-grohtml,grops]: Improve declarations.
+
+       * src/devices/grodvi/dvi.cpp (scale):
+       * src/devices/grohtml/post-html.cpp (stop, replace_negate_str)
+       (replace_str):
+       * src/devices/grops/ps.cpp (degrees, radians, is_ascii):
+       * src/devices/grops/psrm.cpp (read_one_of)
+       (skip_possible_newline): Declare functions as `static` since
+       they do not require external linkage.
+
 2026-03-26  G. Branden Robinson <[email protected]>
 
        * src/devices/grolbp/lbp.cpp: Rearrange and annotate header file
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp
index 151bf70f8..70673c410 100644
--- a/src/devices/grodvi/dvi.cpp
+++ b/src/devices/grodvi/dvi.cpp
@@ -308,7 +308,7 @@ void dvi_printer::possibly_begin_line()
   }
 }
 
-int scale(int x, int z)
+static int scale(int x, int z)
 {
   int sw;
   int a, b, c, d;
diff --git a/src/devices/grohtml/post-html.cpp 
b/src/devices/grohtml/post-html.cpp
index 43a716d98..a8a2a7e8f 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -122,7 +122,7 @@ static int charset_encoding = CHARSET_MIXED;/* The 
character set may be plain AS
  *  start with a few favorites
  */
 
-void stop () {}
+static void stop () {}
 
 static int min (int a, int b)
 {
@@ -1997,7 +1997,7 @@ void assert_state::close (const char *c)
            program_name, c);
 }
 
-const char *replace_negate_str (const char *before, char *after)
+static const char *replace_negate_str (const char *before, char *after)
 {
   if (before != 0 /* nullptr */)
     delete[] before;
@@ -2020,7 +2020,7 @@ const char *replace_negate_str (const char *before, char 
*after)
   return after;
 }
 
-const char *replace_str (const char *before, const char *after)
+static const char *replace_str (const char *before, const char *after)
 {
   if (before != 0 /* nullptr */)
     delete[] before;
@@ -5605,7 +5605,7 @@ static char *get_str (const char *s, char **n)
  *  make_val - creates a string from `v` if `s` is a null pointer.
  */
 
-char *make_val (char *s, int v, char *id, char *f, char *l)
+static char *make_val (char *s, int v, char *id, char *f, char *l)
 {
   assert(id != 0 /* nullptr */);
   assert(f != 0 /* nullptr */);
diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
index 65cd31e4a..c12631059 100644
--- a/src/devices/grops/ps.cpp
+++ b/src/devices/grops/ps.cpp
@@ -87,12 +87,12 @@ const char *const dict_name = "grops";
 const char *const defs_dict_name = "DEFS";
 const int DEFS_DICT_SPARE = 50;
 
-double degrees(double r)
+static double degrees(double r)
 {
   return r*180.0/PI;
 }
 
-double radians(double d)
+static double radians(double d)
 {
   return (d * PI) / 180.0;
 }
@@ -101,7 +101,7 @@ double radians(double d)
 // PostScript file using \nnn, so we really want the character to be
 // less than 0200.
 
-inline int is_ascii(char c)
+static inline int is_ascii(char c)
 {
   return (unsigned char)c < 0200;
 }
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index 284b617c2..d199935d6 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -36,6 +36,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 
 #define GROPS_PROLOGUE "prologue"
 
+// forward declaration
 static void print_ps_string(const string &s, FILE *outfp);
 
 cset white_space("\n\r \t\f");
@@ -726,7 +727,7 @@ int resource_manager::do_begin_preview(const char *, int, 
FILE *fp,
   return 0;
 }
 
-int read_one_of(const char **ptr, const char **s, int n)
+static int read_one_of(const char **ptr, const char **s, int n)
 {
   while (white_space(**ptr))
     *ptr += 1;
@@ -743,7 +744,7 @@ int read_one_of(const char **ptr, const char **s, int n)
   return -1;
 }
 
-void skip_possible_newline(FILE *fp, FILE *outfp)
+static void skip_possible_newline(FILE *fp, FILE *outfp)
 {
   int c = getc(fp);
   if (c == '\r') {

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

Reply via email to