From 01a92476e6d1e41bd5e7dbe039c861280059abfe Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 28 Jul 2022 23:38:38 +0900 Subject: [PATCH] Remove unneeded headers identified by IWYU (#2007) --- src/addhead.cpp | 5 ++++- src/autolock.cpp | 4 +--- src/common_auth.cpp | 3 --- src/curl.cpp | 1 + src/curl.h | 4 +--- src/curl_handlerpool.cpp | 1 - src/curl_multi.cpp | 1 + src/fdcache_auto.cpp | 1 - src/fdcache_fdinfo.cpp | 5 +---- src/fdcache_page.cpp | 1 - src/fdcache_pseudofd.cpp | 1 - src/fdcache_stat.cpp | 2 -- src/fdcache_stat.h | 2 ++ src/fdcache_untreated.cpp | 2 -- src/metaheader.cpp | 2 -- src/metaheader.h | 1 - src/s3fs.cpp | 3 +-- src/s3fs_cred.cpp | 1 + src/s3fs_help.cpp | 1 - src/s3fs_logger.h | 1 + src/s3fs_xml.cpp | 2 ++ src/s3fs_xml.h | 5 ++--- src/s3objlist.cpp | 4 +--- src/s3objlist.h | 4 ++++ src/sighandlers.cpp | 1 - src/sighandlers.h | 2 +- src/string_util.cpp | 1 - src/test_page_list.cpp | 4 ---- src/test_string_util.cpp | 2 -- src/threadpoolman.cpp | 1 - 30 files changed, 24 insertions(+), 44 deletions(-) diff --git a/src/addhead.cpp b/src/addhead.cpp index 23e62b8..5e6db28 100644 --- a/src/addhead.cpp +++ b/src/addhead.cpp @@ -20,13 +20,16 @@ #include #include +#include #include #include +#include +#include -#include "common.h" #include "s3fs.h" #include "addhead.h" #include "curl_util.h" +#include "s3fs_logger.h" //------------------------------------------------------------------- // Symbols diff --git a/src/autolock.cpp b/src/autolock.cpp index a4bb593..b8c4371 100644 --- a/src/autolock.cpp +++ b/src/autolock.cpp @@ -18,13 +18,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include #include -#include "common.h" -#include "s3fs.h" #include "autolock.h" +#include "s3fs_logger.h" //------------------------------------------------------------------- // Class AutoLock diff --git a/src/common_auth.cpp b/src/common_auth.cpp index c604fe9..7b6ad5b 100644 --- a/src/common_auth.cpp +++ b/src/common_auth.cpp @@ -18,10 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include -#include -#include #include #include "common.h" diff --git a/src/curl.cpp b/src/curl.cpp index b73e3c6..a778d80 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/src/curl.h b/src/curl.h index 15659cb..9988003 100644 --- a/src/curl.h +++ b/src/curl.h @@ -21,17 +21,14 @@ #ifndef S3FS_CURL_H_ #define S3FS_CURL_H_ -#include #include #include #include -#include #include #include "common.h" #include "curl_handlerpool.h" #include "bodydata.h" -#include "psemaphore.h" #include "metaheader.h" #include "fdcache_page.h" #include "s3fs_cred.h" @@ -80,6 +77,7 @@ typedef std::map curlprogress_t; // class S3fsCurl //---------------------------------------------- class S3fsCurl; +class Semaphore; // Prototype function for lazy setup options for curl handle typedef bool (*s3fscurl_lazy_setup)(S3fsCurl* s3fscurl); diff --git a/src/curl_handlerpool.cpp b/src/curl_handlerpool.cpp index 61d9aa9..58cb522 100644 --- a/src/curl_handlerpool.cpp +++ b/src/curl_handlerpool.cpp @@ -19,7 +19,6 @@ */ #include -#include #include "common.h" #include "s3fs.h" diff --git a/src/curl_multi.cpp b/src/curl_multi.cpp index faabdbf..76f2c24 100644 --- a/src/curl_multi.cpp +++ b/src/curl_multi.cpp @@ -27,6 +27,7 @@ #include "curl_multi.h" #include "curl.h" #include "autolock.h" +#include "psemaphore.h" //------------------------------------------------------------------- // Class S3fsMultiCurl diff --git a/src/fdcache_auto.cpp b/src/fdcache_auto.cpp index dad2f85..935a927 100644 --- a/src/fdcache_auto.cpp +++ b/src/fdcache_auto.cpp @@ -19,7 +19,6 @@ */ #include -#include #include "common.h" #include "s3fs.h" diff --git a/src/fdcache_fdinfo.cpp b/src/fdcache_fdinfo.cpp index 288a920..273c656 100644 --- a/src/fdcache_fdinfo.cpp +++ b/src/fdcache_fdinfo.cpp @@ -20,11 +20,8 @@ #include #include +#include #include -#include -#include -#include -#include #include "common.h" #include "s3fs.h" diff --git a/src/fdcache_page.cpp b/src/fdcache_page.cpp index 1ce02ce..3d44be4 100644 --- a/src/fdcache_page.cpp +++ b/src/fdcache_page.cpp @@ -19,7 +19,6 @@ */ #include -#include #include #include #include diff --git a/src/fdcache_pseudofd.cpp b/src/fdcache_pseudofd.cpp index 5c1bd4e..d6af2f1 100644 --- a/src/fdcache_pseudofd.cpp +++ b/src/fdcache_pseudofd.cpp @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include #include diff --git a/src/fdcache_stat.cpp b/src/fdcache_stat.cpp index 960139b..0f82ec1 100644 --- a/src/fdcache_stat.cpp +++ b/src/fdcache_stat.cpp @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include #include #include #include diff --git a/src/fdcache_stat.h b/src/fdcache_stat.h index ab62b50..a41431d 100644 --- a/src/fdcache_stat.h +++ b/src/fdcache_stat.h @@ -21,6 +21,8 @@ #ifndef S3FS_FDCACHE_STAT_H_ #define S3FS_FDCACHE_STAT_H_ +#include + //------------------------------------------------ // CacheFileStat //------------------------------------------------ diff --git a/src/fdcache_untreated.cpp b/src/fdcache_untreated.cpp index 433c156..53517dc 100644 --- a/src/fdcache_untreated.cpp +++ b/src/fdcache_untreated.cpp @@ -18,9 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include -#include #include "common.h" #include "s3fs.h" diff --git a/src/metaheader.cpp b/src/metaheader.cpp index 2b50fb0..f60e6b3 100644 --- a/src/metaheader.cpp +++ b/src/metaheader.cpp @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include #include #include diff --git a/src/metaheader.h b/src/metaheader.h index 586b7c0..93dcfcf 100644 --- a/src/metaheader.h +++ b/src/metaheader.h @@ -23,7 +23,6 @@ #include #include -#include //------------------------------------------------------------------- // headers_t diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 34dcc8e..5fba324 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -20,14 +20,13 @@ #include #include +#include #include #include #include #include #include -#include - #include "common.h" #include "s3fs.h" #include "metaheader.h" diff --git a/src/s3fs_cred.cpp b/src/s3fs_cred.cpp index d9370ca..2a94280 100644 --- a/src/s3fs_cred.cpp +++ b/src/s3fs_cred.cpp @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include #include #include #include diff --git a/src/s3fs_help.cpp b/src/s3fs_help.cpp index a674364..e7ccecf 100644 --- a/src/s3fs_help.cpp +++ b/src/s3fs_help.cpp @@ -19,7 +19,6 @@ */ #include -#include #include diff --git a/src/s3fs_logger.h b/src/s3fs_logger.h index b60b937..670b930 100644 --- a/src/s3fs_logger.h +++ b/src/s3fs_logger.h @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/src/s3fs_xml.cpp b/src/s3fs_xml.cpp index 9b7e0da..dee930c 100644 --- a/src/s3fs_xml.cpp +++ b/src/s3fs_xml.cpp @@ -20,11 +20,13 @@ #include #include +#include #include "common.h" #include "s3fs.h" #include "s3fs_xml.h" #include "s3fs_util.h" +#include "s3objlist.h" #include "autolock.h" //------------------------------------------------------------------- diff --git a/src/s3fs_xml.h b/src/s3fs_xml.h index a9ef17e..34b82c3 100644 --- a/src/s3fs_xml.h +++ b/src/s3fs_xml.h @@ -22,14 +22,13 @@ #define S3FS_S3FS_XML_H_ #include -#include -#include #include -#include "s3objlist.h" #include "mpu_util.h" +class S3ObjList; + //------------------------------------------------------------------- // Functions //------------------------------------------------------------------- diff --git a/src/s3objlist.cpp b/src/s3objlist.cpp index cde89d3..7bacb50 100644 --- a/src/s3objlist.cpp +++ b/src/s3objlist.cpp @@ -19,10 +19,8 @@ */ #include -#include +#include -#include "common.h" -#include "s3fs.h" #include "s3objlist.h" //------------------------------------------------------------------- diff --git a/src/s3objlist.h b/src/s3objlist.h index c256bdf..26257bb 100644 --- a/src/s3objlist.h +++ b/src/s3objlist.h @@ -21,6 +21,10 @@ #ifndef S3FS_S3OBJLIST_H_ #define S3FS_S3OBJLIST_H_ +#include +#include +#include + //------------------------------------------------------------------- // Structure / Typedef //------------------------------------------------------------------- diff --git a/src/sighandlers.cpp b/src/sighandlers.cpp index 4a8c1a7..f3aa161 100644 --- a/src/sighandlers.cpp +++ b/src/sighandlers.cpp @@ -19,7 +19,6 @@ */ #include -#include #include #include diff --git a/src/sighandlers.h b/src/sighandlers.h index 11ede73..338ce4c 100644 --- a/src/sighandlers.h +++ b/src/sighandlers.h @@ -21,7 +21,7 @@ #ifndef S3FS_SIGHANDLERS_H_ #define S3FS_SIGHANDLERS_H_ -#include "psemaphore.h" +class Semaphore; //---------------------------------------------- // class S3fsSignals diff --git a/src/string_util.cpp b/src/string_util.cpp index 1f9ce7e..1c71dcb 100644 --- a/src/string_util.cpp +++ b/src/string_util.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include "common.h" diff --git a/src/test_page_list.cpp b/src/test_page_list.cpp index 3c449cd..234adfe 100644 --- a/src/test_page_list.cpp +++ b/src/test_page_list.cpp @@ -18,10 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include -#include -#include - #include "fdcache.h" #include "test_util.h" diff --git a/src/test_string_util.cpp b/src/test_string_util.cpp index a16423c..5382324 100644 --- a/src/test_string_util.cpp +++ b/src/test_string_util.cpp @@ -21,9 +21,7 @@ #include #include #include -#include #include -#include #include "common.h" #include "s3fs.h" diff --git a/src/threadpoolman.cpp b/src/threadpoolman.cpp index ed1d9f8..ebce944 100644 --- a/src/threadpoolman.cpp +++ b/src/threadpoolman.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include "common.h"