From 0a2852c4cd8a8fb95b4a3ba84d768c774186adc1 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 12 Nov 2020 23:03:10 -0500 Subject: Include what I use Thanks to https://github.com/include-what-you-use/include-what-you-use --- bar.c | 1 + bftw.c | 4 ++-- bftw.h | 1 - color.c | 3 ++- color.h | 1 - ctx.c | 4 +++- ctx.h | 1 + diag.c | 2 -- eval.c | 2 ++ exec.c | 3 +-- fsade.c | 3 ++- fsade.h | 3 ++- main.c | 2 +- mtab.c | 2 +- mtab.h | 3 ++- opt.c | 2 ++ opt.h | 2 +- parse.c | 7 +++---- parse.h | 2 -- printf.c | 6 +++--- printf.h | 1 - pwcache.c | 1 + spawn.c | 1 - spawn.h | 2 -- stat.c | 1 - tests/mksock.c | 3 --- tests/trie.c | 1 - trie.h | 1 - util.c | 2 +- 29 files changed, 31 insertions(+), 36 deletions(-) diff --git a/bar.c b/bar.c index 9cb08d3..e1e2857 100644 --- a/bar.c +++ b/bar.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/bftw.c b/bftw.c index 8d561ff..5a38066 100644 --- a/bftw.c +++ b/bftw.c @@ -37,6 +37,7 @@ #include "bftw.h" #include "dstring.h" +#include "mtab.h" #include "stat.h" #include "trie.h" #include "util.h" @@ -44,11 +45,10 @@ #include #include #include -#include #include -#include #include #include +#include #include /** diff --git a/bftw.h b/bftw.h index 687a4c5..098d12c 100644 --- a/bftw.h +++ b/bftw.h @@ -21,7 +21,6 @@ #ifndef BFS_BFTW_H #define BFS_BFTW_H -#include "mtab.h" #include "stat.h" #include #include diff --git a/color.c b/color.c index 24c7f4b..206dc95 100644 --- a/color.c +++ b/color.c @@ -24,12 +24,13 @@ #include "util.h" #include #include +#include #include #include #include #include #include -#include +#include #include /** diff --git a/color.h b/color.h index e6ee49d..fabac13 100644 --- a/color.h +++ b/color.h @@ -21,7 +21,6 @@ #ifndef BFS_COLOR_H #define BFS_COLOR_H -#include "bftw.h" #include "util.h" #include #include diff --git a/ctx.c b/ctx.c index 2fc7cb1..26619d7 100644 --- a/ctx.c +++ b/ctx.c @@ -15,15 +15,17 @@ ****************************************************************************/ #include "ctx.h" +#include "color.h" #include "darray.h" #include "diag.h" #include "expr.h" #include "mtab.h" #include "pwcache.h" +#include "stat.h" #include "trie.h" -#include #include #include +#include #include struct bfs_ctx *bfs_ctx_new(void) { diff --git a/ctx.h b/ctx.h index 2046ce6..39b3330 100644 --- a/ctx.h +++ b/ctx.h @@ -23,6 +23,7 @@ #include "bftw.h" #include "trie.h" +#include /** * Various debugging flags. diff --git a/diag.c b/diag.c index 66609e1..bbf07e3 100644 --- a/diag.c +++ b/diag.c @@ -21,8 +21,6 @@ #include #include #include -#include -#include void bfs_perror(const struct bfs_ctx *ctx, const char *str) { bfs_error(ctx, "%s: %m.\n", str); diff --git a/eval.c b/eval.c index 6c15503..0503b14 100644 --- a/eval.c +++ b/eval.c @@ -22,6 +22,7 @@ #include "bar.h" #include "bftw.h" #include "color.h" +#include "ctx.h" #include "darray.h" #include "diag.h" #include "dstring.h" @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/exec.c b/exec.c index 625cdd5..71605e0 100644 --- a/exec.c +++ b/exec.c @@ -25,12 +25,11 @@ #include #include #include -#include #include +#include #include #include #include -#include #include #include diff --git a/fsade.c b/fsade.c index efe5092..b56a11d 100644 --- a/fsade.c +++ b/fsade.c @@ -18,8 +18,9 @@ #include "bftw.h" #include "dstring.h" #include "util.h" -#include #include +#include +#include #include #if BFS_CAN_CHECK_ACL diff --git a/fsade.h b/fsade.h index 3136608..e964112 100644 --- a/fsade.h +++ b/fsade.h @@ -22,7 +22,6 @@ #ifndef BFS_FSADE_H #define BFS_FSADE_H -#include "bftw.h" #include "util.h" #include @@ -37,6 +36,8 @@ #define BFS_CAN_CHECK_XATTRS (BFS_HAS_SYS_EXTATTR || BFS_HAS_SYS_XATTR) +struct BFTW; + /** * Check if a file has a non-trivial Access Control List. * diff --git a/main.c b/main.c index 2d6649e..56974e6 100644 --- a/main.c +++ b/main.c @@ -52,10 +52,10 @@ #include "ctx.h" #include "eval.h" #include "parse.h" -#include "util.h" #include #include #include +#include #include #include #include diff --git a/mtab.c b/mtab.c index 4f1b9be..91a40aa 100644 --- a/mtab.c +++ b/mtab.c @@ -16,6 +16,7 @@ #include "mtab.h" #include "darray.h" +#include "stat.h" #include "trie.h" #include "util.h" #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #if BFS_HAS_SYS_PARAM diff --git a/mtab.h b/mtab.h index 1f2f70f..807539d 100644 --- a/mtab.h +++ b/mtab.h @@ -21,9 +21,10 @@ #ifndef BFS_MTAB_H #define BFS_MTAB_H -#include "stat.h" #include +struct bfs_stat; + /** * A file system mount table. */ diff --git a/opt.c b/opt.c index f94e723..96b99da 100644 --- a/opt.c +++ b/opt.c @@ -46,9 +46,11 @@ #include "eval.h" #include "expr.h" #include "pwcache.h" +#include "util.h" #include #include #include +#include #include #include diff --git a/opt.h b/opt.h index a30cd17..5f8180d 100644 --- a/opt.h +++ b/opt.h @@ -21,7 +21,7 @@ #ifndef BFS_OPT_H #define BFS_OPT_H -#include "ctx.h" +struct bfs_ctx; /** * Apply optimizations to the command line. diff --git a/parse.c b/parse.c index 458d736..85bd232 100644 --- a/parse.c +++ b/parse.c @@ -23,15 +23,15 @@ #include "parse.h" #include "bfs.h" +#include "bftw.h" +#include "color.h" #include "ctx.h" #include "darray.h" #include "diag.h" -#include "dstring.h" #include "eval.h" #include "exec.h" #include "expr.h" #include "fsade.h" -#include "mtab.h" #include "opt.h" #include "printf.h" #include "pwcache.h" @@ -41,7 +41,6 @@ #include "typo.h" #include "util.h" #include -#include #include #include #include @@ -50,11 +49,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/parse.h b/parse.h index 337b5b9..7e29a03 100644 --- a/parse.h +++ b/parse.h @@ -21,8 +21,6 @@ #ifndef BFS_PARSE_H #define BFS_PARSE_H -#include "ctx.h" - /** * Parse the command line. * diff --git a/printf.c b/printf.c index e07feb4..5f04ad3 100644 --- a/printf.c +++ b/printf.c @@ -15,11 +15,10 @@ ****************************************************************************/ #include "printf.h" -#include "color.h" +#include "bftw.h" #include "ctx.h" #include "diag.h" #include "dstring.h" -#include "expr.h" #include "mtab.h" #include "pwcache.h" #include "stat.h" @@ -29,9 +28,10 @@ #include #include #include -#include +#include #include #include +#include #include #include diff --git a/printf.h b/printf.h index a02c73b..91cf187 100644 --- a/printf.h +++ b/printf.h @@ -21,7 +21,6 @@ #ifndef BFS_PRINTF_H #define BFS_PRINTF_H -#include #include struct BFTW; diff --git a/pwcache.c b/pwcache.c index c6e4b5d..7812b50 100644 --- a/pwcache.c +++ b/pwcache.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/spawn.c b/spawn.c index 8c360d3..1aeabc1 100644 --- a/spawn.c +++ b/spawn.c @@ -17,7 +17,6 @@ #include "spawn.h" #include "util.h" #include -#include #include #include #include diff --git a/spawn.h b/spawn.h index 974a069..0225ed8 100644 --- a/spawn.h +++ b/spawn.h @@ -21,8 +21,6 @@ #ifndef BFS_SPAWN_H #define BFS_SPAWN_H -#include -#include #include /** diff --git a/stat.c b/stat.c index 55aece0..91cf765 100644 --- a/stat.c +++ b/stat.c @@ -23,7 +23,6 @@ #include #include #include -#include #ifdef STATX_BASIC_STATS # define HAVE_STATX true diff --git a/tests/mksock.c b/tests/mksock.c index a996d58..d1776b3 100644 --- a/tests/mksock.c +++ b/tests/mksock.c @@ -20,14 +20,11 @@ */ #include -#include #include #include #include #include #include -#include -#include #include #include diff --git a/tests/trie.c b/tests/trie.c index 7182a03..70e2414 100644 --- a/tests/trie.c +++ b/tests/trie.c @@ -2,7 +2,6 @@ #include "../trie.h" #include -#include #include #include diff --git a/trie.h b/trie.h index 7b073f1..2d29ac7 100644 --- a/trie.h +++ b/trie.h @@ -17,7 +17,6 @@ #ifndef BFS_TRIE_H #define BFS_TRIE_H -#include #include #include diff --git a/util.c b/util.c index e3bea4c..51336ff 100644 --- a/util.c +++ b/util.c @@ -19,8 +19,8 @@ #include #include #include +#include #include -#include #include #include #include -- cgit v1.2.3