gbranden pushed a commit to branch master
in repository groff.

commit c3c11f0e04470dd5dc28fb204b341261934416d9
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Jul 14 19:53:21 2025 -0500

    [grolj4]: Trivially refactor.
    
    * src/devices/grolj4/lj4.cpp: Relocate definition of
      `lookup_paper_size()`, eliminating need for forward declaration.
---
 ChangeLog                  |  5 +++++
 src/devices/grolj4/lj4.cpp | 23 ++++++++++-------------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8f0609265..82cfb8c18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-07-14  G. Branden Robinson <[email protected]>
+
+       * src/devices/grolj4/lj4.cpp: Relocate definition of
+       `lookup_paper_size()`, eliminating need for forward declaration.
+
 2025-07-10  G. Branden Robinson <[email protected]>
 
        * src/devices/grolj4/lj4.cpp: Fix code style nits.  Give the
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp
index bd4afcb9c..eedcc0025 100644
--- a/src/devices/grolj4/lj4.cpp
+++ b/src/devices/grolj4/lj4.cpp
@@ -92,8 +92,6 @@ const int DEFAULT_HPGL_UNITS = 1016;
 int line_width_factor = DEFAULT_LINE_WIDTH_FACTOR;
 unsigned ncopies = 0;          // 0 means don't send ncopies command
 
-static ssize_t lookup_paper_size(const char *);
-
 class lj4_font : public font {
 public:
   ~lj4_font();
@@ -178,6 +176,16 @@ void lj4_font::handle_unknown_font_command(const char 
*command,
   }
 }
 
+static ssize_t lookup_paper_size(const char *s)
+{
+  for (size_t i = 0; i < array_length(paper_table); i++) {
+    // FIXME Perhaps allow unique prefix.
+    if (strcasecmp(s, paper_table[i].name) == 0)
+      return int(i);
+  }
+  return -1;
+}
+
 class lj4_printer : public printer {
 public:
   lj4_printer(int);
@@ -609,17 +617,6 @@ printer *make_printer()
   return new lj4_printer(user_paper_size);
 }
 
-static
-ssize_t lookup_paper_size(const char *s)
-{
-  for (size_t i = 0; i < array_length(paper_table); i++) {
-    // FIXME Perhaps allow unique prefix.
-    if (strcasecmp(s, paper_table[i].name) == 0)
-      return int(i);
-  }
-  return -1;
-}
-
 static void usage(FILE *stream);
 
 extern "C" int optopt, optind;

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

Reply via email to