groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/24: Reduce header file inclusion spam.


From: G. Branden Robinson
Subject: [groff] 03/24: Reduce header file inclusion spam.
Date: Mon, 2 Dec 2024 22:52:26 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit f4911fd3a35948482823cf8fa6671c18d3e87b8d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Nov 30 03:34:07 2024 -0600

    Reduce header file inclusion spam.
    
    * src/include/lib.h: Drop inclusion of "<getopt.h>" header file, a GNU
      extension.  This header file itself uses none of its facilities.
      Instead...
    
    * src/devices/grodvi/dvi.cpp:
    * src/devices/grohtml/post-html.cpp:
    * src/devices/grolbp/lbp.cpp:
    * src/devices/grolj4/lj4.cpp:
    * src/devices/grops/ps.cpp:
    * src/devices/grotty/tty.cpp:
    * src/preproc/eqn/main.cpp:
    * src/preproc/html/pre-html.cpp:
    * src/preproc/pic/main.cpp:
    * src/preproc/preconv/preconv.cpp:
    * src/preproc/soelim/soelim.cpp:
    * src/preproc/tbl/main.cpp:
    * src/roff/groff/groff.cpp:
    * src/roff/troff/input.cpp:
    * src/utils/hpftodit/hpftodit.cpp:
    * src/utils/indxbib/indxbib.cpp:
    * src/utils/lkbib/lkbib.cpp:
    * src/utils/lookbib/lookbib.cpp:
    * src/utils/tfmtodit/tfmtodit.cpp: ...`#include` "<getopt.h>" in files
      that directly use the symbols it exposes.
---
 ChangeLog                         | 28 ++++++++++++++++++++++++++++
 src/devices/grodvi/dvi.cpp        |  2 ++
 src/devices/grohtml/post-html.cpp |  2 ++
 src/devices/grolbp/lbp.cpp        |  2 ++
 src/devices/grolj4/lj4.cpp        |  2 ++
 src/devices/grops/ps.cpp          |  2 ++
 src/devices/grotty/tty.cpp        |  2 ++
 src/include/lib.h                 |  2 --
 src/preproc/eqn/main.cpp          |  2 ++
 src/preproc/html/pre-html.cpp     |  2 ++
 src/preproc/pic/main.cpp          |  2 ++
 src/preproc/preconv/preconv.cpp   |  2 ++
 src/preproc/soelim/soelim.cpp     |  2 ++
 src/preproc/tbl/main.cpp          |  2 ++
 src/roff/groff/groff.cpp          |  2 ++
 src/roff/troff/input.cpp          |  2 ++
 src/utils/hpftodit/hpftodit.cpp   |  2 ++
 src/utils/indxbib/indxbib.cpp     |  2 ++
 src/utils/lkbib/lkbib.cpp         |  2 ++
 src/utils/lookbib/lookbib.cpp     |  2 ++
 src/utils/tfmtodit/tfmtodit.cpp   |  2 ++
 21 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index db07d5794..7ac4c9d33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2024-11-30  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Reduce header file inclusion spam.
+
+       * src/include/lib.h: Drop inclusion of "<getopt.h>" header file,
+       a GNU extension.  This header file itself uses none of its
+       facilities.  Instead...
+       * src/devices/grodvi/dvi.cpp:
+       * src/devices/grohtml/post-html.cpp:
+       * src/devices/grolbp/lbp.cpp:
+       * src/devices/grolj4/lj4.cpp:
+       * src/devices/grops/ps.cpp:
+       * src/devices/grotty/tty.cpp:
+       * src/preproc/eqn/main.cpp:
+       * src/preproc/html/pre-html.cpp:
+       * src/preproc/pic/main.cpp:
+       * src/preproc/preconv/preconv.cpp:
+       * src/preproc/soelim/soelim.cpp:
+       * src/preproc/tbl/main.cpp:
+       * src/roff/groff/groff.cpp:
+       * src/roff/troff/input.cpp:
+       * src/utils/hpftodit/hpftodit.cpp:
+       * src/utils/indxbib/indxbib.cpp:
+       * src/utils/lkbib/lkbib.cpp:
+       * src/utils/lookbib/lookbib.cpp:
+       * src/utils/tfmtodit/tfmtodit.cpp: ...`#include` "<getopt.h>" in
+       files that directly use the symbols it exposes.
+
 2024-11-30  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/include/lib.h:
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp
index f91f4a9f4..b37d547e5 100644
--- a/src/devices/grodvi/dvi.cpp
+++ b/src/devices/grodvi/dvi.cpp
@@ -27,6 +27,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
                   // sprintf(), stderr, stdout
 #include <stdlib.h> // exit(), EXIT_SUCCESS, strtol()
 
+#include <getopt.h> // getopt_long()
+
 #include "driver.h"
 #include "nonposix.h"
 #include "paper.h"
diff --git a/src/devices/grohtml/post-html.cpp 
b/src/devices/grohtml/post-html.cpp
index 530c9c42a..401280ebb 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -33,6 +33,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
                    // strncmp()
 #include <time.h> // asctime(), tm
 
+#include <getopt.h> // getopt_long()
+
 #include "cset.h"
 #include "curtime.h"
 #include "driver.h"
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index 111285f4c..019800261 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -29,6 +29,8 @@ TODO
 
 #include <assert.h>
 
+#include <getopt.h> // getopt_long()
+
 #include "driver.h"
 #include "lbp.h"
 #include "charset.h"
diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp
index e0aeb4816..a84c9c0d3 100644
--- a/src/devices/grolj4/lj4.cpp
+++ b/src/devices/grolj4/lj4.cpp
@@ -41,6 +41,8 @@ X command to include bitmap graphics
                   // setbuf(), stderr, stdout
 #include <stdlib.h> // exit(), EXIT_SUCCESS, strtol()
 
+#include <getopt.h> // getopt_long()
+
 #include "driver.h"
 #include "nonposix.h"
 
diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
index 31c054b23..46028da7a 100644
--- a/src/devices/grops/ps.cpp
+++ b/src/devices/grops/ps.cpp
@@ -38,6 +38,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
                    // strlen(), strncmp(), strstr(), strtok()
 #include <time.h> // asctime()
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h" // PI
 
 #include "cset.h"
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 177f9a0c7..3cbfc8414 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -26,6 +26,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
                   // putchar(), setbuf(), stderr, stdout
 #include <stdlib.h> // exit(), EXIT_SUCCESS, getenv(), strtol()
 
+#include <getopt.h> // getopt_long()
+
 #include "driver.h"
 #include "device.h"
 #include "ptable.h"
diff --git a/src/include/lib.h b/src/include/lib.h
index 845763a07..46d6e2c27 100644
--- a/src/include/lib.h
+++ b/src/include/lib.h
@@ -33,8 +33,6 @@ extern "C" {
 }
 #endif
 
-#include <getopt.h>
-
 #ifdef HAVE_SETLOCALE
 #include <locale.h>
 #define getlocale(category) setlocale(category, NULL)
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index 97ffb35ea..59067a854 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -20,6 +20,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <config.h>
 #endif
 
+#include <getopt.h> // getopt_long()
+
 #include "eqn.h"
 #include "stringclass.h"
 #include "device.h"
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index b25be380d..ad4c5abed 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -33,6 +33,8 @@
 #include <unistd.h> // unlink()
 #endif
 
+#include <getopt.h> // getopt_long()
+
 #define PREHTMLC
 
 #include "lib.h"
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index f3f72512d..1fa94741c 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -29,6 +29,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <stdlib.h> // exit(), EXIT_FAILURE, EXIT_SUCCESS, free()
 #include <string.h> // strerror()
 
+#include <getopt.h> // getopt_long()
+
 #include "pic.h"
 
 extern int yyparse();
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index f69f70063..b3c3f5351 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -42,6 +42,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <uchardet/uchardet.h>
 #endif
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 #include "errarg.h"
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index e2bb8b2a4..3f578d885 100644
--- a/src/preproc/soelim/soelim.cpp
+++ b/src/preproc/soelim/soelim.cpp
@@ -25,6 +25,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <errno.h>
 #include <stdlib.h>
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 #include "errarg.h"
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index e67ba9243..d0766c0c5 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -20,6 +20,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <config.h>
 #endif
 
+#include <getopt.h> // getopt_long()
+
 #include "table.h"
 
 #define MAX_POINT_SIZE 99
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index ef11bdfd4..1367dafd2 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -28,6 +28,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <stdlib.h> // exit(), EXIT_SUCCESS, free(), getenv(), putenv()
 #include <string.h> // strerror()
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 #include "errarg.h"
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index b99bab992..42555c3ed 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -32,6 +32,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
                    // free(), getenv(), putenv(), strtol(), system()
 #include <string.h> // strdup(), strerror()
 
+#include <getopt.h> // getopt_long()
+
 #include <stack>
 
 #include "troff.h"
diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp
index d765fd780..9ffa560f3 100644
--- a/src/utils/hpftodit/hpftodit.cpp
+++ b/src/utils/hpftodit/hpftodit.cpp
@@ -37,6 +37,8 @@ put filename in error messages (or fix lib)
 #include <string.h> // strchr(), strcmp(), strerror(), strlen(),
                    // strrchr(), strtok()
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 #include "posix.h"
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index 7c9f87ff2..bf9c515c3 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -32,6 +32,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <unistd.h> // unlink()
 #endif
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 // needed for getcwd()
diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp
index fcc67a614..8a486ab7e 100644
--- a/src/utils/lkbib/lkbib.cpp
+++ b/src/utils/lkbib/lkbib.cpp
@@ -25,6 +25,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <stdlib.h> // exit(), EXIT_FAILURE, EXIT_SUCCESS, getenv(),
                    // strtol()
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 #include "errarg.h"
diff --git a/src/utils/lookbib/lookbib.cpp b/src/utils/lookbib/lookbib.cpp
index cd261af4b..1ccb4ae95 100644
--- a/src/utils/lookbib/lookbib.cpp
+++ b/src/utils/lookbib/lookbib.cpp
@@ -28,6 +28,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #include <stdlib.h> // exit(), EXIT_SUCCESS, strtol()
 #include <string.h> // strerror()
 
+#include <getopt.h> // getopt_long()
+
 #include "lib.h"
 
 #include "errarg.h"
diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp
index 155e5e160..8e4bf8d6e 100644
--- a/src/utils/tfmtodit/tfmtodit.cpp
+++ b/src/utils/tfmtodit/tfmtodit.cpp
@@ -57,6 +57,8 @@ both be zero. */
 #include <math.h> // atan2()
 #include <stdlib.h> // exit(), EXIT_SUCCESS, strtol()
 
+#include <getopt.h> // getopt_long()
+
 #include "errarg.h"
 #include "error.h"
 #include "cset.h"



reply via email to

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