From: Joel Rosdahl Date: Sat, 17 Feb 2024 08:46:41 +0000 (+0100) Subject: chore: Clean up usage of #include in headers X-Git-Tag: v4.10~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81d4e568c4be6e1a44087b478ce7d88098859b2a;p=thirdparty%2Fccache.git chore: Clean up usage of #include in headers --- diff --git a/src/Args.hpp b/src/Args.hpp index 0370d09f5..dffdffd9c 100644 --- a/src/Args.hpp +++ b/src/Args.hpp @@ -18,8 +18,6 @@ #pragma once -#include - #include #include #include diff --git a/src/Config.cpp b/src/Config.cpp index 55c44b292..a244fd587 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 Joel Rosdahl and other contributors +// Copyright (C) 2019-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -37,8 +37,6 @@ #include #include -#include - #ifdef HAVE_PWD_H # include #endif diff --git a/src/Config.hpp b/src/Config.hpp index 17015526e..b3c28a41c 100644 --- a/src/Config.hpp +++ b/src/Config.hpp @@ -20,14 +20,13 @@ #include #include -#include #include #include #include +#include #include -#include #include #include #include diff --git a/src/Context.hpp b/src/Context.hpp index e06da471a..bfc312216 100644 --- a/src/Context.hpp +++ b/src/Context.hpp @@ -21,7 +21,9 @@ #include "Args.hpp" #include "ArgsInfo.hpp" #include "Config.hpp" -#include "MiniTrace.hpp" +#ifdef MTR_ENABLED +# include "MiniTrace.hpp" +#endif #include #include @@ -33,12 +35,15 @@ #include #include #include +#include #include +#include + #include +#include #include #include -#include #include #include diff --git a/src/Depfile.hpp b/src/Depfile.hpp index a58bc37f4..85393cd0a 100644 --- a/src/Depfile.hpp +++ b/src/Depfile.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -19,7 +19,6 @@ #pragma once class Context; -class Hash; #include #include diff --git a/src/Hash.hpp b/src/Hash.hpp index 5fa9f034f..7fe8386e7 100644 --- a/src/Hash.hpp +++ b/src/Hash.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -25,6 +25,7 @@ #include #include #include +#include #include // This class represents a hash state. diff --git a/src/InodeCache.hpp b/src/InodeCache.hpp index 0e10b83ec..48bedcbc5 100644 --- a/src/InodeCache.hpp +++ b/src/InodeCache.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include @@ -32,7 +34,6 @@ #include class Config; -class Context; class InodeCache { diff --git a/src/Util.hpp b/src/Util.hpp index 8fe54f83a..77c4653c2 100644 --- a/src/Util.hpp +++ b/src/Util.hpp @@ -18,19 +18,10 @@ #pragma once -#include - -#include #include -#include -#include -#include #include #include -#include -#include -class Config; class Context; namespace Util { diff --git a/src/ccache.hpp b/src/ccache.hpp index 771031a0f..d5ed96070 100644 --- a/src/ccache.hpp +++ b/src/ccache.hpp @@ -1,5 +1,5 @@ // Copyright (C) 2002-2007 Andrew Tridgell -// Copyright (C) 2009-2023 Joel Rosdahl and other contributors +// Copyright (C) 2009-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -25,7 +25,6 @@ #include #include #include -#include #include class Context; diff --git a/src/core/CacheEntry.cpp b/src/core/CacheEntry.cpp index 1e519d6b2..0009ecc7f 100644 --- a/src/core/CacheEntry.cpp +++ b/src/core/CacheEntry.cpp @@ -25,8 +25,10 @@ #include #include #include +#include #include #include +#include #include #include #include diff --git a/src/core/CacheEntry.hpp b/src/core/CacheEntry.hpp index 74b109bbe..ce0ebf724 100644 --- a/src/core/CacheEntry.hpp +++ b/src/core/CacheEntry.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include diff --git a/src/core/FileRecompressor.hpp b/src/core/FileRecompressor.hpp index 0c341a094..7b047f49b 100644 --- a/src/core/FileRecompressor.hpp +++ b/src/core/FileRecompressor.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022-2023 Joel Rosdahl and other contributors +// Copyright (C) 2022-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -22,9 +22,7 @@ #include #include -#include #include -#include namespace core { diff --git a/src/core/Manifest.hpp b/src/core/Manifest.hpp index 9ffa65ea3..18f7ef403 100644 --- a/src/core/Manifest.hpp +++ b/src/core/Manifest.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2023 Joel Rosdahl and other contributors +// Copyright (C) 2009-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,11 +20,13 @@ #include #include +#include #include #include #include +#include #include #include #include diff --git a/src/core/Result.hpp b/src/core/Result.hpp index 3c732f94e..6ec343d5a 100644 --- a/src/core/Result.hpp +++ b/src/core/Result.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2022 Joel Rosdahl and other contributors +// Copyright (C) 2019-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -19,7 +19,7 @@ #pragma once #include -#include +#include #include diff --git a/src/core/ResultExtractor.hpp b/src/core/ResultExtractor.hpp index 33e91a3f2..325ec4f0c 100644 --- a/src/core/ResultExtractor.hpp +++ b/src/core/ResultExtractor.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,6 +20,9 @@ #include +#include + +#include #include #include #include diff --git a/src/core/ResultInspector.hpp b/src/core/ResultInspector.hpp index 9fdd9d32f..374240d17 100644 --- a/src/core/ResultInspector.hpp +++ b/src/core/ResultInspector.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2022 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,6 +20,8 @@ #include +#include + #include #include diff --git a/src/core/ResultRetriever.hpp b/src/core/ResultRetriever.hpp index 5632a19b5..74e5e102f 100644 --- a/src/core/ResultRetriever.hpp +++ b/src/core/ResultRetriever.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -22,7 +22,11 @@ #include #include +#include + +#include #include +#include class Context; diff --git a/src/core/Statistics.hpp b/src/core/Statistics.hpp index ab0a1f184..54f7641fa 100644 --- a/src/core/Statistics.hpp +++ b/src/core/Statistics.hpp @@ -18,11 +18,11 @@ #pragma once +#include #include #include #include -#include #include #include #include diff --git a/src/execute.hpp b/src/execute.hpp index df5668e31..653b19181 100644 --- a/src/execute.hpp +++ b/src/execute.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // diff --git a/src/storage/Storage.hpp b/src/storage/Storage.hpp index 793662f80..d709065c2 100644 --- a/src/storage/Storage.hpp +++ b/src/storage/Storage.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -22,15 +22,15 @@ #include #include #include -#include #include #include +#include #include #include -#include #include +#include #include namespace storage { diff --git a/src/storage/local/LocalStorage.hpp b/src/storage/local/LocalStorage.hpp index 26dc828b7..64036864c 100644 --- a/src/storage/local/LocalStorage.hpp +++ b/src/storage/local/LocalStorage.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,13 +20,15 @@ #include #include +#include #include #include #include #include -#include #include +#include #include +#include #include #include @@ -34,7 +36,9 @@ #include #include #include +#include #include +#include #include class Config; diff --git a/src/storage/remote/FileStorage.hpp b/src/storage/remote/FileStorage.hpp index c1d72961a..6dee11dd0 100644 --- a/src/storage/remote/FileStorage.hpp +++ b/src/storage/remote/FileStorage.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,6 +20,11 @@ #include +#include + +#include +#include + namespace storage::remote { class FileStorage : public RemoteStorage diff --git a/src/storage/remote/HttpStorage.hpp b/src/storage/remote/HttpStorage.hpp index 9b1aaf4b5..0e721ec41 100644 --- a/src/storage/remote/HttpStorage.hpp +++ b/src/storage/remote/HttpStorage.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,6 +20,11 @@ #include +#include + +#include +#include + namespace storage::remote { class HttpStorage : public RemoteStorage diff --git a/src/storage/remote/RedisStorage.hpp b/src/storage/remote/RedisStorage.hpp index 11e21a366..6989782e9 100644 --- a/src/storage/remote/RedisStorage.hpp +++ b/src/storage/remote/RedisStorage.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,6 +20,11 @@ #include +#include + +#include +#include + namespace storage::remote { class RedisStorage : public RemoteStorage diff --git a/src/storage/remote/RemoteStorage.hpp b/src/storage/remote/RemoteStorage.hpp index 9c14d6313..5a393ff3f 100644 --- a/src/storage/remote/RemoteStorage.hpp +++ b/src/storage/remote/RemoteStorage.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -19,7 +19,6 @@ #pragma once #include -#include #include #include @@ -29,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/src/util/DirEntry.hpp b/src/util/DirEntry.hpp index bd16e45c7..138263b40 100644 --- a/src/util/DirEntry.hpp +++ b/src/util/DirEntry.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 Joel Rosdahl and other contributors +// Copyright (C) 2019-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -22,10 +22,8 @@ #include #include -#include #include -#include #include namespace util { diff --git a/src/util/MemoryMap.hpp b/src/util/MemoryMap.hpp index 91025b14c..538b2f123 100644 --- a/src/util/MemoryMap.hpp +++ b/src/util/MemoryMap.hpp @@ -22,6 +22,7 @@ #include +#include #include namespace util { diff --git a/src/util/TextTable.hpp b/src/util/TextTable.hpp index d435603f0..5602d6a68 100644 --- a/src/util/TextTable.hpp +++ b/src/util/TextTable.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -18,6 +18,7 @@ #pragma once +#include #include #include #include diff --git a/src/util/ThreadPool.hpp b/src/util/ThreadPool.hpp index 32b85e877..3e82ab495 100644 --- a/src/util/ThreadPool.hpp +++ b/src/util/ThreadPool.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2023 Joel Rosdahl and other contributors +// Copyright (C) 2019-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -19,11 +19,13 @@ #pragma once #include +#include #include #include #include #include #include +#include namespace util { diff --git a/src/util/TimePoint.hpp b/src/util/TimePoint.hpp index 98a3cc800..530bd124b 100644 --- a/src/util/TimePoint.hpp +++ b/src/util/TimePoint.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022-2023 Joel Rosdahl and other contributors +// Copyright (C) 2022-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // diff --git a/src/util/Tokenizer.hpp b/src/util/Tokenizer.hpp index 247babaa4..ba69e18fe 100644 --- a/src/util/Tokenizer.hpp +++ b/src/util/Tokenizer.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,6 +20,7 @@ #include +#include #include namespace util { diff --git a/src/util/error.hpp b/src/util/error.hpp index de77b77c7..a4713842b 100644 --- a/src/util/error.hpp +++ b/src/util/error.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2023 Joel Rosdahl and other contributors +// Copyright (C) 2023-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -18,16 +18,16 @@ #pragma once -#include -#include +#ifdef _WIN32 -namespace util { +# include +# include -#ifdef _WIN32 +namespace util { // Return the error message corresponding to `error_code`. std::string win32_error_message(uint32_t error_code); -#endif - } // namespace util + +#endif diff --git a/src/util/file.hpp b/src/util/file.hpp index a7942d67e..463813c5c 100644 --- a/src/util/file.hpp +++ b/src/util/file.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2023 Joel Rosdahl and other contributors +// Copyright (C) 2021-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/src/util/filesystem.hpp b/src/util/filesystem.hpp index f137c4a6c..6cd0476db 100644 --- a/src/util/filesystem.hpp +++ b/src/util/filesystem.hpp @@ -20,6 +20,7 @@ #include +#include #include #include diff --git a/src/util/logging.hpp b/src/util/logging.hpp index 9ecf5b66f..2e4300fa1 100644 --- a/src/util/logging.hpp +++ b/src/util/logging.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2020-2023 Joel Rosdahl and other contributors +// Copyright (C) 2020-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -47,8 +46,6 @@ } \ } while (false) -class Config; - namespace util::logging { // Initialize global logging state. Must be called once before using the other diff --git a/src/util/path.hpp b/src/util/path.hpp index 4e9484339..31dbcbc59 100644 --- a/src/util/path.hpp +++ b/src/util/path.hpp @@ -18,12 +18,12 @@ #pragma once -#include - #include #include #include -#include +#ifdef _WIN32 +# include +#endif namespace util { diff --git a/src/util/string.cpp b/src/util/string.cpp index 24c14b6b2..af419cf47 100644 --- a/src/util/string.cpp +++ b/src/util/string.cpp @@ -23,7 +23,6 @@ #include #include -#include namespace { diff --git a/src/util/string.hpp b/src/util/string.hpp index 07f111f00..c61514d93 100644 --- a/src/util/string.hpp +++ b/src/util/string.hpp @@ -18,7 +18,6 @@ #pragma once -#include #include #include diff --git a/src/util/zstd.hpp b/src/util/zstd.hpp index 9640b33b8..5c47a5307 100644 --- a/src/util/zstd.hpp +++ b/src/util/zstd.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2022-2023 Joel Rosdahl and other contributors +// Copyright (C) 2022-2024 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -23,6 +23,7 @@ #include #include +#include #include #include #include