diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-09 17:25:27 -0600 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2023-02-09 18:30:01 -0600 |
commit | 70a683d6733713181b8f9ae25a8bfad133d5ba68 (patch) | |
tree | bf35a2d4b1dd27e2be905c104087f40ff81236fa /src | |
parent | ccc63e65c723e235fafc5099b383959c92664c38 (diff) | |
download | groff-git-70a683d6733713181b8f9ae25a8bfad133d5ba68.tar.gz |
[src]: Group and order standard libc inclusions.
Inclusion order is not supposed to matter for standard C header files,
so treating this as a code style issue.
* src/devices/grodvi/dvi.cpp:
* src/devices/grolj4/lj4.cpp:
* src/include/stringclass.h:
* src/libs/libbib/linear.cpp:
* src/libs/libbib/search.cpp:
* src/libs/libdriver/printer.cpp:
* src/libs/libgroff/assert.cpp:
* src/libs/libgroff/color.cpp:
* src/libs/libgroff/errarg.cpp:
* src/libs/libgroff/font.cpp:
* src/libs/libgroff/nametoindex.cpp:
* src/libs/libgroff/prime.cpp:
* src/libs/libgroff/relocate.cpp:
* src/libs/libgroff/searchpath.cpp:
* src/preproc/eqn/box.cpp:
* src/preproc/eqn/delim.cpp:
* src/preproc/eqn/pile.cpp:
* src/preproc/eqn/script.cpp:
* src/preproc/html/pre-html.cpp:
* src/preproc/pic/pic.h:
* src/preproc/preconv/preconv.cpp:
* src/preproc/soelim/soelim.cpp:
* src/roff/groff/groff.cpp:
* src/roff/troff/troff.h:
* 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: Do it.
Diffstat (limited to 'src')
29 files changed, 54 insertions, 56 deletions
diff --git a/src/devices/grodvi/dvi.cpp b/src/devices/grodvi/dvi.cpp index 3ac788faf..f9e8a5769 100644 --- a/src/devices/grodvi/dvi.cpp +++ b/src/devices/grodvi/dvi.cpp @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> + #include "driver.h" #include "nonposix.h" #include "paper.h" diff --git a/src/devices/grolj4/lj4.cpp b/src/devices/grolj4/lj4.cpp index 3c92d1597..a429a7d06 100644 --- a/src/devices/grolj4/lj4.cpp +++ b/src/devices/grolj4/lj4.cpp @@ -31,6 +31,7 @@ X command to include bitmap graphics */ #include <assert.h> + #include "driver.h" #include "nonposix.h" diff --git a/src/include/stringclass.h b/src/include/stringclass.h index 2ba106bf6..ca0bf854a 100644 --- a/src/include/stringclass.h +++ b/src/include/stringclass.h @@ -16,11 +16,10 @@ for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <assert.h> #include <string.h> #include <stdio.h> -#include <assert.h> - // Ensure that the first declaration of functions that are later // declared as inline declares them as inline. diff --git a/src/libs/libbib/linear.cpp b/src/libs/libbib/linear.cpp index d679b21c9..22e11d8e7 100644 --- a/src/libs/libbib/linear.cpp +++ b/src/libs/libbib/linear.cpp @@ -18,11 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <stdlib.h> #include <errno.h> -#include <assert.h> - #include "posix.h" #include "errarg.h" #include "error.h" diff --git a/src/libs/libbib/search.cpp b/src/libs/libbib/search.cpp index d345a9f7a..10867b6d5 100644 --- a/src/libs/libbib/search.cpp +++ b/src/libs/libbib/search.cpp @@ -18,11 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <stdlib.h> #include <errno.h> -#include <assert.h> - #include "posix.h" #include "errarg.h" #include "error.h" diff --git a/src/libs/libdriver/printer.cpp b/src/libs/libdriver/printer.cpp index e8f0cbccc..f89b2e922 100644 --- a/src/libs/libdriver/printer.cpp +++ b/src/libs/libdriver/printer.cpp @@ -18,6 +18,7 @@ */ #include <assert.h> + #include "driver.h" /* If we are sending output to an onscreen pager (as is the normal case diff --git a/src/libs/libgroff/assert.cpp b/src/libs/libgroff/assert.cpp index 0761235fd..9da3d4660 100644 --- a/src/libs/libgroff/assert.cpp +++ b/src/libs/libgroff/assert.cpp @@ -20,9 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #endif +#include <assert.h> #include <stdio.h> #include <stdlib.h> -#include <assert.h> extern "C" const char *program_name; diff --git a/src/libs/libgroff/color.cpp b/src/libs/libgroff/color.cpp index b91030a38..388c2ee9e 100644 --- a/src/libs/libgroff/color.cpp +++ b/src/libs/libgroff/color.cpp @@ -19,15 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" #include "color.h" #include "cset.h" -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#include <stdio.h> +#include <assert.h> #include <fcntl.h> +#include <stdio.h> #include <stdlib.h> - -#include <assert.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include "errarg.h" #include "error.h" diff --git a/src/libs/libgroff/errarg.cpp b/src/libs/libgroff/errarg.cpp index f4c6dcb1f..99fc0fa68 100644 --- a/src/libs/libgroff/errarg.cpp +++ b/src/libs/libgroff/errarg.cpp @@ -20,8 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #endif -#include <stdio.h> #include <assert.h> +#include <stdio.h> + #include "errarg.h" errarg::errarg(const char *p) : type(STRING) diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp index 3f0226a4b..c1af12ca9 100644 --- a/src/libs/libgroff/font.cpp +++ b/src/libs/libgroff/font.cpp @@ -18,13 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <ctype.h> #include <math.h> #include <stdlib.h> #include <wchar.h> -#include <assert.h> - #include "errarg.h" #include "error.h" #include "cset.h" diff --git a/src/libs/libgroff/nametoindex.cpp b/src/libs/libgroff/nametoindex.cpp index 686a69197..095a432ef 100644 --- a/src/libs/libgroff/nametoindex.cpp +++ b/src/libs/libgroff/nametoindex.cpp @@ -18,11 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <ctype.h> #include <stdlib.h> -#include <assert.h> - #include "errarg.h" #include "error.h" #include "font.h" diff --git a/src/libs/libgroff/prime.cpp b/src/libs/libgroff/prime.cpp index 54ce5eb7b..5ae068df4 100644 --- a/src/libs/libgroff/prime.cpp +++ b/src/libs/libgroff/prime.cpp @@ -18,9 +18,9 @@ internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include <math.h> #include <assert.h> +#include <math.h> bool is_prime(unsigned n) { diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp index 3c1cd073f..32a0e2ef3 100644 --- a/src/libs/libgroff/relocate.cpp +++ b/src/libs/libgroff/relocate.cpp @@ -18,10 +18,10 @@ #include "lib.h" +#include <assert.h> #include <errno.h> #include <stdlib.h> -#include <assert.h> #include "defs.h" #include "posix.h" #include "nonposix.h" diff --git a/src/libs/libgroff/searchpath.cpp b/src/libs/libgroff/searchpath.cpp index 7718c42c6..6062e8d4e 100644 --- a/src/libs/libgroff/searchpath.cpp +++ b/src/libs/libgroff/searchpath.cpp @@ -18,10 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" -#include <stdlib.h> -#include <errno.h> - #include <assert.h> +#include <errno.h> +#include <stdlib.h> #include "searchpath.h" #include "nonposix.h" diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp index 23ce99916..5f6343eeb 100644 --- a/src/preproc/eqn/box.cpp +++ b/src/preproc/eqn/box.cpp @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> + #include "eqn.h" #include "pbox.h" diff --git a/src/preproc/eqn/delim.cpp b/src/preproc/eqn/delim.cpp index f066da7da..01557c52b 100644 --- a/src/preproc/eqn/delim.cpp +++ b/src/preproc/eqn/delim.cpp @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> + #include "eqn.h" #include "pbox.h" diff --git a/src/preproc/eqn/pile.cpp b/src/preproc/eqn/pile.cpp index cd38b89c6..fcc2e925f 100644 --- a/src/preproc/eqn/pile.cpp +++ b/src/preproc/eqn/pile.cpp @@ -15,9 +15,11 @@ for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ + // piles and matrices #include <assert.h> + #include "eqn.h" #include "pbox.h" diff --git a/src/preproc/eqn/script.cpp b/src/preproc/eqn/script.cpp index 9d4e05f9f..f485eb93a 100644 --- a/src/preproc/eqn/script.cpp +++ b/src/preproc/eqn/script.cpp @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <assert.h> + #include "eqn.h" #include "pbox.h" diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp index 9f2439be3..fecfb0539 100644 --- a/src/preproc/html/pre-html.cpp +++ b/src/preproc/html/pre-html.cpp @@ -23,12 +23,11 @@ #include "lib.h" -#include <signal.h> +#include <assert.h> #include <ctype.h> -#include <stdlib.h> #include <errno.h> - -#include <assert.h> +#include <signal.h> +#include <stdlib.h> #include "errarg.h" #include "error.h" diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h index 11825780d..1a99498a4 100644 --- a/src/preproc/pic/pic.h +++ b/src/preproc/pic/pic.h @@ -18,9 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> +#include <errno.h> #include <math.h> #include <stdlib.h> -#include <errno.h> #ifdef NEED_DECLARATION_RAND #undef rand @@ -46,7 +47,6 @@ extern "C" { } #endif -#include <assert.h> #include "cset.h" #include "stringclass.h" #include "lf.h" diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp index a08f3d483..d403425ee 100644 --- a/src/preproc/preconv/preconv.cpp +++ b/src/preproc/preconv/preconv.cpp @@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <stdlib.h> #include <errno.h> #include <sys/stat.h> @@ -25,8 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <uchardet/uchardet.h> #endif -#include <assert.h> - #include "errarg.h" #include "error.h" #include "localcharset.h" diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp index 8793e0e8e..bafc5cd02 100644 --- a/src/preproc/soelim/soelim.cpp +++ b/src/preproc/soelim/soelim.cpp @@ -18,11 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <ctype.h> -#include <stdlib.h> #include <errno.h> - -#include <assert.h> +#include <stdlib.h> #include "errarg.h" #include "error.h" diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp index 535a533b4..4eb732969 100644 --- a/src/roff/groff/groff.cpp +++ b/src/roff/groff/groff.cpp @@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" -#include <stdlib.h> -#include <signal.h> +#include <assert.h> #include <errno.h> +#include <signal.h> +#include <stdlib.h> -#include <assert.h> #include "errarg.h" #include "error.h" #include "stringclass.h" diff --git a/src/roff/troff/troff.h b/src/roff/troff/troff.h index 4ffec1062..8cef74460 100644 --- a/src/roff/troff/troff.h +++ b/src/roff/troff/troff.h @@ -20,13 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" +#include <assert.h> #include <ctype.h> -#include <time.h> +#include <errno.h> #include <stddef.h> #include <stdlib.h> -#include <errno.h> +#include <time.h> -#include <assert.h> #include "color.h" #include "device.h" #include "searchpath.h" diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp index 74c6c899f..4982e1988 100644 --- a/src/utils/hpftodit/hpftodit.cpp +++ b/src/utils/hpftodit/hpftodit.cpp @@ -25,13 +25,14 @@ put filename in error messages (or fix lib) #include "lib.h" +#include <assert.h> +#include <ctype.h> +#include <errno.h> +#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> -#include <math.h> -#include <errno.h> -#include <assert.h> + #include "posix.h" #include "errarg.h" #include "error.h" diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp index 77041d555..ad8bb0ecd 100644 --- a/src/utils/indxbib/indxbib.cpp +++ b/src/utils/indxbib/indxbib.cpp @@ -18,10 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" -#include <stdlib.h> -#include <errno.h> - #include <assert.h> +#include <errno.h> +#include <stdlib.h> #include "posix.h" #include "errarg.h" diff --git a/src/utils/lkbib/lkbib.cpp b/src/utils/lkbib/lkbib.cpp index c8b984f24..946bd7dc7 100644 --- a/src/utils/lkbib/lkbib.cpp +++ b/src/utils/lkbib/lkbib.cpp @@ -18,10 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" -#include <stdlib.h> -#include <errno.h> - #include <assert.h> +#include <errno.h> +#include <stdlib.h> #include "errarg.h" #include "error.h" diff --git a/src/utils/lookbib/lookbib.cpp b/src/utils/lookbib/lookbib.cpp index da5218dd9..d8556c629 100644 --- a/src/utils/lookbib/lookbib.cpp +++ b/src/utils/lookbib/lookbib.cpp @@ -18,10 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "lib.h" -#include <stdlib.h> -#include <errno.h> - #include <assert.h> +#include <errno.h> +#include <stdlib.h> #include "errarg.h" #include "error.h" diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp index 54505fda0..300373379 100644 --- a/src/utils/tfmtodit/tfmtodit.cpp +++ b/src/utils/tfmtodit/tfmtodit.cpp @@ -48,12 +48,13 @@ both be zero. */ #include "lib.h" -#include <stdlib.h> -#include <math.h> +#include <assert.h> #include <errno.h> +#include <math.h> +#include <stdlib.h> + #include "errarg.h" #include "error.h" -#include <assert.h> #include "cset.h" #include "nonposix.h" |