gbranden pushed a commit to branch master
in repository groff.
commit 751d7797a1ed7dc088362524fef3489694f178c8
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jan 15 21:54:29 2025 -0600
Further rationalize header file inclusions (1/2).
* src/devices/grodvi/dvi.cpp:
* src/devices/grohtml/html-table.cpp:
* src/devices/grohtml/output.cpp:
* src/devices/grohtml/post-html.cpp:
* src/devices/grolbp/lbp.cpp:
* src/devices/grolj4/lj4.cpp:
* src/devices/grops/psrm.cpp:
* src/devices/grotty/tty.cpp:
* src/libs/libdriver/input.cpp:
* src/libs/libdriver/printer.cpp: Include (only) the standard libc and
groff internal header files we need, so that "driver.h", "font.h", and
"symbol.h" needn't do this job.
---
ChangeLog | 18 ++++++++++++++++++
src/devices/grodvi/dvi.cpp | 4 +++-
src/devices/grohtml/html-table.cpp | 1 +
src/devices/grohtml/output.cpp | 4 +++-
src/devices/grohtml/post-html.cpp | 1 +
src/devices/grolbp/lbp.cpp | 10 +++++++---
src/devices/grolj4/lj4.cpp | 3 +++
src/devices/grops/psrm.cpp | 3 ++-
src/devices/grotty/tty.cpp | 5 +++--
src/libs/libdriver/input.cpp | 3 ++-
src/libs/libdriver/printer.cpp | 3 ++-
11 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d01c61414..c62db5cb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2025-01-15 G. Branden Robinson <[email protected]>
+
+ [grodvi,grohtml,grolbp,grolj4,grops,grotty,libdriver]: Further
+ rationalize header file inclusions.
+
+ * src/devices/grodvi/dvi.cpp:
+ * src/devices/grohtml/html-table.cpp:
+ * src/devices/grohtml/output.cpp:
+ * src/devices/grohtml/post-html.cpp:
+ * src/devices/grolbp/lbp.cpp:
+ * src/devices/grolj4/lj4.cpp:
+ * src/devices/grops/psrm.cpp:
+ * src/devices/grotty/tty.cpp:
+ * src/libs/libdriver/input.cpp:
+ * src/libs/libdriver/printer.cpp: Include (only) the standard
+ libc and groff internal header files we need, so that
+ "driver.h", "font.h", and "symbol.h" needn't do this job.
+
2025-01-15 G. Branden Robinson <[email protected]>
Reduce header file inclusion spam.
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp
index 4a0f9d0ef..185b8e56a 100644
--- a/src/devices/grodvi/dvi.cpp
+++ b/src/devices/grodvi/dvi.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2025 Free Software Foundation, Inc.
Written by James Clark ([email protected])
This file is part of groff.
@@ -21,11 +21,13 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#endif
#include <assert.h>
+#include <limits.h> // CHAR_MAX
#include <locale.h> // setlocale()
#include <math.h> // atan2(), sqrt()
#include <stdio.h> // EOF, FILE, fprintf(), printf(), putc(), setbuf(),
// sprintf(), stderr, stdout
#include <stdlib.h> // exit(), EXIT_SUCCESS, strtol()
+#include <string.h> // strcmp(), strlen()
#include <getopt.h> // getopt_long()
diff --git a/src/devices/grohtml/html-table.cpp
b/src/devices/grohtml/html-table.cpp
index f1a3c3dce..31fed3d36 100644
--- a/src/devices/grohtml/html-table.cpp
+++ b/src/devices/grohtml/html-table.cpp
@@ -28,6 +28,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <config.h>
#endif
+#include <stdio.h> // FILE
#include <stdlib.h> // atoi()
#include "driver.h"
diff --git a/src/devices/grohtml/output.cpp b/src/devices/grohtml/output.cpp
index 773a75ccc..06f0262c2 100644
--- a/src/devices/grohtml/output.cpp
+++ b/src/devices/grohtml/output.cpp
@@ -33,9 +33,11 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
// getc(), putc(), sprintf()
#include <string.h> // strlen(), strncpy()
+#include "cset.h"
#include "driver.h"
+#include "lib.h" // INT_DIGITS
#include "stringclass.h"
-#include "cset.h"
+
#include "html.h"
#if !defined(TRUE)
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index d07f684dd..d3d4f4256 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -39,6 +39,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include "cset.h" // csspace()
#include "curtime.h"
#include "driver.h"
+#include "lib.h" // strsave(), xtmpfile()
#include "stringclass.h"
#include "unicode.h"
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index cd16473a5..53c703ab4 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -29,18 +29,22 @@ TODO
#include <assert.h>
#include <errno.h>
+#include <limits.h> // INT_MAX
#include <math.h> // fabs(), sqrt()
#include <stdlib.h> // abs(), EXIT_SUCCESS, exit(), strtol()
+#include <string.h> // strcmp(), strcpy(), strlen(), strncpy()
+#include <strings.h> // strcasecmp()
#include <getopt.h> // getopt_long()
+#include "nonposix.h"
+
+#include "charset.h"
#include "driver.h"
#include "lbp.h"
-#include "charset.h"
+#include "lib.h" // strsave()
#include "paper.h"
-#include "nonposix.h"
-
extern "C" const char *Version_string;
static int user_papersize = -1;
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp
index af174343f..09da09dc6 100644
--- a/src/devices/grolj4/lj4.cpp
+++ b/src/devices/grolj4/lj4.cpp
@@ -40,6 +40,8 @@ X command to include bitmap graphics
#include <stdio.h> // EOF, FILE, fflush(), fprintf(), printf(),
// setbuf(), stderr, stdout
#include <stdlib.h> // exit(), EXIT_SUCCESS, strtol()
+#include <string.h> // strcmp()
+#include <strings.h> // strcasecmp()
#include <getopt.h> // getopt_long()
@@ -47,6 +49,7 @@ X command to include bitmap graphics
#include "cset.h" // csdigit()
#include "driver.h"
+#include "lib.h" // array_size(), PI
extern "C" const char *Version_string;
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index 3677f4580..5957d0dd9 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2025 Free Software Foundation, Inc.
Written by James Clark ([email protected])
This file is part of groff.
@@ -27,6 +27,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include "cset.h"
#include "driver.h"
+#include "lib.h" // array_length(), strsave()
#include "stringclass.h"
#include "ps.h"
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index f7fca4ebf..ffe5d329b 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2025 Free Software Foundation, Inc.
Written by James Clark ([email protected])
OSC 8 support by G. Branden Robinson
@@ -21,6 +21,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <config.h>
#endif
+#include <limits.h> // CHAR_MAX
#include <locale.h> // setlocale()
#include <stdio.h> // EOF, FILE, fprintf(), fputs(), printf(),
// putchar(), setbuf(), stderr, stdout
@@ -28,8 +29,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <getopt.h> // getopt_long()
-#include "driver.h"
#include "device.h"
+#include "driver.h"
#include "ptable.h"
typedef signed char schar;
diff --git a/src/libs/libdriver/input.cpp b/src/libs/libdriver/input.cpp
index c5ef0671c..9df863ee5 100644
--- a/src/libs/libdriver/input.cpp
+++ b/src/libs/libdriver/input.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2025 Free Software Foundation, Inc.
Written by James Clark ([email protected])
Major rewrite 2001 by Bernd Warken <[email protected]>
@@ -241,6 +241,7 @@
#include <stdio.h> // EOF, FILE, fclose(), fopen(), getc(), stdin,
// ungetc()
#include <stdlib.h> // strtol()
+#include <string.h> // strcmp(), strlen(), strncmp(), strncpy()
#include "driver.h"
#include "device.h"
diff --git a/src/libs/libdriver/printer.cpp b/src/libs/libdriver/printer.cpp
index f8c99a4e7..981aec99a 100644
--- a/src/libs/libdriver/printer.cpp
+++ b/src/libs/libdriver/printer.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2025 Free Software Foundation, Inc.
Written by James Clark ([email protected])
This file is part of groff.
@@ -24,6 +24,7 @@
#include <assert.h>
#include <errno.h> // EINVAL, errno
#include <stdio.h> // clearerr(), ferror(), fflush(), stdout
+#include <string.h> // strcmp()
#include "driver.h"
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit