diff options
author | tobo <tobo@yandex-team.ru> | 2022-04-07 08:59:43 +0300 |
---|---|---|
committer | tobo <tobo@yandex-team.ru> | 2022-04-07 08:59:43 +0300 |
commit | 8d0bed04edbd809859fe349779c07ef122fdeca2 (patch) | |
tree | 5637277bc2da6afb261b990047079e132f5b8d2b | |
parent | 3bd25da701a5b6de40acbea240354462348803d6 (diff) | |
download | ydb-8d0bed04edbd809859fe349779c07ef122fdeca2.tar.gz |
remove unused includes
ref:f8c119cf3a796a59ab5be4424e5364ba6a201d40
50 files changed, 18 insertions, 111 deletions
diff --git a/util/datetime/cputimer.cpp b/util/datetime/cputimer.cpp index 516d372c37..a032dbd3df 100644 --- a/util/datetime/cputimer.cpp +++ b/util/datetime/cputimer.cpp @@ -9,9 +9,6 @@ #if defined(_unix_) #include <unistd.h> #include <sched.h> - #include <sys/types.h> - #include <sys/resource.h> - #include <sys/param.h> #elif defined(_win_) #include <util/system/winint.h> #endif diff --git a/util/folder/dirut_ut.cpp b/util/folder/dirut_ut.cpp index 45ebfc842c..027cf86b47 100644 --- a/util/folder/dirut_ut.cpp +++ b/util/folder/dirut_ut.cpp @@ -6,7 +6,6 @@ #include <util/generic/string.h> #include <util/memory/tempbuf.h> #include <util/stream/file.h> -#include <util/system/platform.h> Y_UNIT_TEST_SUITE(TDirutTest) { Y_UNIT_TEST(TestRealPath) { diff --git a/util/generic/ptr_ut.cpp b/util/generic/ptr_ut.cpp index c2dcff23f6..0ccb3f5e6d 100644 --- a/util/generic/ptr_ut.cpp +++ b/util/generic/ptr_ut.cpp @@ -6,7 +6,6 @@ #include <util/generic/hash_set.h> #include <util/generic/is_in.h> -#include <util/stream/output.h> #include <util/system/thread.h> class TPointerTest: public TTestBase { diff --git a/util/generic/store_policy_ut.cpp b/util/generic/store_policy_ut.cpp index c9722203aa..e3bdcd61b2 100644 --- a/util/generic/store_policy_ut.cpp +++ b/util/generic/store_policy_ut.cpp @@ -1,7 +1,6 @@ #include "store_policy.h" #include <library/cpp/testing/unittest/registar.h> -#include <util/generic/algorithm.h> #include <util/generic/vector.h> Y_UNIT_TEST_SUITE(StorePolicy) { diff --git a/util/generic/strbuf.cpp b/util/generic/strbuf.cpp index 668602ca16..896dbf0651 100644 --- a/util/generic/strbuf.cpp +++ b/util/generic/strbuf.cpp @@ -1,6 +1,5 @@ #include "strbuf.h" -#include <util/stream/output.h> #include <ostream> std::ostream& operator<<(std::ostream& os, TStringBuf buf) { diff --git a/util/generic/string.cpp b/util/generic/string.cpp index 3c655f1f66..a2b303f260 100644 --- a/util/generic/string.cpp +++ b/util/generic/string.cpp @@ -6,7 +6,6 @@ #include <util/charset/wide.h> #include <iostream> -#include <cctype> alignas(32) const char NULL_STRING_REPR[128] = {0}; diff --git a/util/generic/typelist_ut.cpp b/util/generic/typelist_ut.cpp index eeabfa97b1..955ebb1f1b 100644 --- a/util/generic/typelist_ut.cpp +++ b/util/generic/typelist_ut.cpp @@ -3,7 +3,6 @@ #include "typelist.h" #include "vector.h" -#include "map.h" class TTypeListTest: public TTestBase { UNIT_TEST_SUITE(TTypeListTest); diff --git a/util/generic/ylimits_ut.cpp b/util/generic/ylimits_ut.cpp index f1b3c6858c..7b339ba80c 100644 --- a/util/generic/ylimits_ut.cpp +++ b/util/generic/ylimits_ut.cpp @@ -3,7 +3,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <util/string/cast.h> #include <util/system/valgrind.h> class TLimitTest: public TTestBase { diff --git a/util/network/address.cpp b/util/network/address.cpp index a81a9e6994..140ad0d3d0 100644 --- a/util/network/address.cpp +++ b/util/network/address.cpp @@ -3,7 +3,6 @@ #include "address.h" #if defined(_unix_) - #include <sys/types.h> #include <sys/un.h> #endif diff --git a/util/network/init.cpp b/util/network/init.cpp index 366e65682c..430b25c2fc 100644 --- a/util/network/init.cpp +++ b/util/network/init.cpp @@ -1,13 +1,8 @@ #include "init.h" -#include <util/system/compat.h> -#include <util/system/yassert.h> #include <util/system/defaults.h> #include <util/generic/singleton.h> -#include <cstdio> -#include <cstdlib> - namespace { class TNetworkInit { public: diff --git a/util/stream/direct_io_ut.cpp b/util/stream/direct_io_ut.cpp index 01d09db232..1fada06ecb 100644 --- a/util/stream/direct_io_ut.cpp +++ b/util/stream/direct_io_ut.cpp @@ -2,7 +2,6 @@ #include <util/generic/string.h> #include <util/generic/array_size.h> -#include <util/system/env.h> #include "buffered.h" #include "direct_io.h" diff --git a/util/stream/ios_ut.cpp b/util/stream/ios_ut.cpp index 139f4296e5..81d6bdf9b3 100644 --- a/util/stream/ios_ut.cpp +++ b/util/stream/ios_ut.cpp @@ -11,7 +11,6 @@ #include <util/charset/wide.h> #include <string> -#include <iostream> class TStreamsTest: public TTestBase { UNIT_TEST_SUITE(TStreamsTest); diff --git a/util/stream/multi_ut.cpp b/util/stream/multi_ut.cpp index fc2553b533..61869cdf1c 100644 --- a/util/stream/multi_ut.cpp +++ b/util/stream/multi_ut.cpp @@ -1,6 +1,5 @@ #include "mem.h" #include "multi.h" -#include "str.h" #include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TestMultiInput) { diff --git a/util/stream/output.cpp b/util/stream/output.cpp index d84b3ad4d0..40948fe925 100644 --- a/util/stream/output.cpp +++ b/util/stream/output.cpp @@ -18,7 +18,6 @@ #include <cerrno> #include <cstdio> #include <filesystem> -#include <string> #include <string_view> #if defined(_win_) diff --git a/util/stream/printf.cpp b/util/stream/printf.cpp index f3eeca7afc..0bc3aae988 100644 --- a/util/stream/printf.cpp +++ b/util/stream/printf.cpp @@ -3,7 +3,6 @@ #include <util/generic/scope.h> #include <util/memory/tempbuf.h> -#include <util/generic/yexception.h> size_t Printf(IOutputStream& out, const char* fmt, ...) { va_list lst; diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 8e9d2036fc..06f181ee53 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -6,7 +6,6 @@ #include <zlib.h> -#include <cstdio> #include <cstring> namespace { diff --git a/util/stream/zlib_ut.cpp b/util/stream/zlib_ut.cpp index 2290b4a9de..2fef18cf0b 100644 --- a/util/stream/zlib_ut.cpp +++ b/util/stream/zlib_ut.cpp @@ -5,7 +5,6 @@ #include "file.h" #include <util/system/tempfile.h> #include <util/random/entropy.h> -#include <util/random/random.h> #define ZDATA "./zdata" diff --git a/util/string/vector_ut.cpp b/util/string/vector_ut.cpp index 817120f268..628f5e2eed 100644 --- a/util/string/vector_ut.cpp +++ b/util/string/vector_ut.cpp @@ -1,5 +1,4 @@ #include <library/cpp/testing/unittest/registar.h> -#include <util/charset/wide.h> #include "cast.h" #include "vector.h" diff --git a/util/system/condvar.cpp b/util/system/condvar.cpp index 62f3d22356..a2031a89b8 100644 --- a/util/system/condvar.cpp +++ b/util/system/condvar.cpp @@ -9,8 +9,6 @@ #include <util/generic/intrlist.h> #include <util/generic/yexception.h> -#include <cstdlib> - #if defined(_unix_) #include <sys/time.h> #include <pthread.h> diff --git a/util/system/daemon.cpp b/util/system/daemon.cpp index 130e6c8f45..13e739f385 100644 --- a/util/system/daemon.cpp +++ b/util/system/daemon.cpp @@ -1,7 +1,6 @@ #include <util/generic/yexception.h> #include <cerrno> -#include <cstdlib> #include <util/system/info.h> #if defined(_win_) diff --git a/util/system/error.cpp b/util/system/error.cpp index f778ec42cb..b5fd974812 100644 --- a/util/system/error.cpp +++ b/util/system/error.cpp @@ -1,19 +1,15 @@ -#include "tls.h" #include "error.h" -#include <util/string/strip.h> #include <util/generic/strfcpy.h> #include <cerrno> -#include <cstdio> #include <cstring> #if defined(_win_) + #include <util/string/strip.h> #include <util/network/socket.h> #include <util/generic/singleton.h> #include "winint.h" -#elif defined(_unix_) - #include <unistd.h> #endif void ClearLastSystemError() { diff --git a/util/system/event.cpp b/util/system/event.cpp index 79b3cdb291..ceb9134a3d 100644 --- a/util/system/event.cpp +++ b/util/system/event.cpp @@ -1,8 +1,5 @@ -#include "datetime.h" #include "defaults.h" -#include <cstdio> - #include "atomic.h" #include "event.h" #include "mutex.h" diff --git a/util/system/execpath.cpp b/util/system/execpath.cpp index 33198af58b..9e1b5cec93 100644 --- a/util/system/execpath.cpp +++ b/util/system/execpath.cpp @@ -1,16 +1,14 @@ #include "platform.h" -#include <stdlib.h> - #if defined(_solaris_) #include <stdlib.h> #elif defined(_darwin_) #include <mach-o/dyld.h> + #include <util/generic/function.h> #elif defined(_win_) #include "winint.h" #include <io.h> #elif defined(_linux_) - #include <unistd.h> #elif defined(_freebsd_) #include <string.h> #include <sys/types.h> // for u_int not defined in sysctl.h @@ -18,16 +16,8 @@ #include <unistd.h> #endif -#include <util/folder/dirut.h> #include <util/generic/singleton.h> -#include <util/generic/function.h> -#include <util/generic/yexception.h> -#include <util/memory/tempbuf.h> -#include <util/stream/file.h> -#include <util/stream/pipe.h> -#include <util/string/cast.h> - -#include "filemap.h" + #include "execpath.h" #include "fs.h" diff --git a/util/system/execpath_ut.cpp b/util/system/execpath_ut.cpp index 16b01466f5..f8ca86d9cf 100644 --- a/util/system/execpath_ut.cpp +++ b/util/system/execpath_ut.cpp @@ -2,7 +2,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include "platform.h" #include <util/folder/dirut.h> Y_UNIT_TEST_SUITE(TExecPathTest) { diff --git a/util/system/fs_ut.cpp b/util/system/fs_ut.cpp index de071ebf55..ddee6670a8 100644 --- a/util/system/fs_ut.cpp +++ b/util/system/fs_ut.cpp @@ -3,9 +3,7 @@ #include <library/cpp/testing/unittest/registar.h> #include "file.h" -#include "sysstat.h" #include "fstat.h" -#include <util/folder/dirut.h> #include <util/folder/path.h> //WARNING: on windows the test must be run with administative rules diff --git a/util/system/getpid.cpp b/util/system/getpid.cpp index b9615f0dfa..31d995fed7 100644 --- a/util/system/getpid.cpp +++ b/util/system/getpid.cpp @@ -10,7 +10,6 @@ #include <processthreadsapi.h> #endif #else - #include <sys/types.h> #include <unistd.h> #endif diff --git a/util/system/interrupt_signals.cpp b/util/system/interrupt_signals.cpp index 96b723f2b8..b6751342af 100644 --- a/util/system/interrupt_signals.cpp +++ b/util/system/interrupt_signals.cpp @@ -1,8 +1,5 @@ #include "interrupt_signals.h" -#include "compiler.h" -#include "error.h" - #include <util/generic/yexception.h> #include <csignal> diff --git a/util/system/madvise.cpp b/util/system/madvise.cpp index 58c894e3ef..ad24ac0f1d 100644 --- a/util/system/madvise.cpp +++ b/util/system/madvise.cpp @@ -7,7 +7,6 @@ #if defined(_win_) #include <util/system/winint.h> #else - #include <sys/types.h> #include <sys/mman.h> #endif diff --git a/util/system/mem_info.cpp b/util/system/mem_info.cpp index aa51ae3b16..90ed353a59 100644 --- a/util/system/mem_info.cpp +++ b/util/system/mem_info.cpp @@ -1,8 +1,6 @@ #include "mem_info.h" #include <util/generic/strbuf.h> -#include <util/generic/utility.h> -#include <util/generic/yexception.h> #include <util/stream/file.h> #include <util/string/cast.h> #include <util/string/builder.h> @@ -10,8 +8,6 @@ #include "info.h" #if defined(_unix_) - #include <errno.h> - #include <unistd.h> #if defined(_freebsd_) #include <sys/sysctl.h> #include <sys/types.h> diff --git a/util/system/mincore.cpp b/util/system/mincore.cpp index 8cbae72586..b9a7251551 100644 --- a/util/system/mincore.cpp +++ b/util/system/mincore.cpp @@ -1,5 +1,4 @@ #include "align.h" -#include "compiler.h" #include "info.h" #include "mincore.h" @@ -8,7 +7,6 @@ #include <cstring> #if defined(_unix_) - #include <sys/unistd.h> #include <sys/mman.h> #if defined(_android_) #include <sys/syscall.h> diff --git a/util/system/mincore_ut.cpp b/util/system/mincore_ut.cpp index fc46cb1632..ae4a10c517 100644 --- a/util/system/mincore_ut.cpp +++ b/util/system/mincore_ut.cpp @@ -1,9 +1,5 @@ #include <library/cpp/testing/unittest/registar.h> -#ifdef _unix_ - #include <sys/resource.h> -#endif - #include "filemap.h" #include "info.h" #include "mincore.h" @@ -11,10 +7,6 @@ #include "tempfile.h" #include <util/generic/size_literals.h> -#include <util/system/fs.h> - -#include <cstring> -#include <cstdio> Y_UNIT_TEST_SUITE(MincoreSuite) { static const char* FileName_("./mappped_file"); diff --git a/util/system/mktemp.cpp b/util/system/mktemp.cpp index 505b7b4a4b..801451263e 100644 --- a/util/system/mktemp.cpp +++ b/util/system/mktemp.cpp @@ -2,9 +2,7 @@ #include <util/folder/dirut.h> #include <util/generic/yexception.h> -#include <util/stream/file.h> -#include <cerrno> #include <cstring> #ifdef _win32_ @@ -12,7 +10,6 @@ #include <io.h> #else #include <unistd.h> - #include <stdlib.h> #endif extern "C" int mkstemps(char* path, int slen); diff --git a/util/system/mktemp_system.cpp b/util/system/mktemp_system.cpp index 32bea2987c..4ee3bab799 100644 --- a/util/system/mktemp_system.cpp +++ b/util/system/mktemp_system.cpp @@ -33,19 +33,13 @@ #include "defaults.h" -#include <sys/types.h> #include <fcntl.h> #include <errno.h> -#include <stdio.h> -#include <stdlib.h> #include <string.h> -#include <ctype.h> #ifdef _win32_ #include "winint.h" #include <util/folder/dirut.h> -#else - #include <unistd.h> #endif #include <util/random/random.h> diff --git a/util/system/pipe.cpp b/util/system/pipe.cpp index a543bd7472..5def63898f 100644 --- a/util/system/pipe.cpp +++ b/util/system/pipe.cpp @@ -1,6 +1,5 @@ #include "pipe.h" -#include <util/stream/output.h> #include <util/generic/yexception.h> ssize_t TPipeHandle::Read(void* buffer, size_t byteCount) const noexcept { diff --git a/util/system/protect.cpp b/util/system/protect.cpp index bbb8d410df..af8faf1bb1 100644 --- a/util/system/protect.cpp +++ b/util/system/protect.cpp @@ -2,7 +2,6 @@ #include <util/generic/yexception.h> #include <util/generic/string.h> -#include <util/stream/output.h> #include "yassert.h" diff --git a/util/system/rusage.cpp b/util/system/rusage.cpp index 2befeca875..8bcaade7e3 100644 --- a/util/system/rusage.cpp +++ b/util/system/rusage.cpp @@ -1,5 +1,3 @@ -#include "platform.h" - #if defined(__APPLE__) && defined(__MACH__) #include <mach/mach.h> @@ -13,7 +11,6 @@ #else - #include <sys/time.h> #include <sys/resource.h> #endif diff --git a/util/system/rwlock.cpp b/util/system/rwlock.cpp index bb3dcbf188..60b0743acf 100644 --- a/util/system/rwlock.cpp +++ b/util/system/rwlock.cpp @@ -1,6 +1,4 @@ #include "rwlock.h" -#include "mutex.h" -#include "condvar.h" #include <util/generic/yexception.h> @@ -10,6 +8,9 @@ #endif #if defined(_win_) || defined(_darwin_) + #include "mutex.h" + #include "condvar.h" + //darwin rwlocks not recursive class TRWMutex::TImpl { public: diff --git a/util/system/sem.cpp b/util/system/sem.cpp index 4a93b903b5..ace53ddcff 100644 --- a/util/system/sem.cpp +++ b/util/system/sem.cpp @@ -6,14 +6,11 @@ #include <alloca.h> #endif -#include <cerrno> #include <cstring> #ifdef _win_ #include "winint.h" #else - #include <signal.h> - #include <unistd.h> #include <semaphore.h> #if defined(_bionic_) || defined(_darwin_) && defined(_arm_) @@ -42,9 +39,12 @@ union semun arg; #include <util/digest/city.h> #include <util/string/cast.h> -#include <util/random/random.h> #include <util/random/fast.h> +#if !defined(_unix_) || defined(_darwin_) + #include <util/random/random.h> +#endif + namespace { class TSemaphoreImpl { private: diff --git a/util/system/shellcommand_ut.cpp b/util/system/shellcommand_ut.cpp index 9d849279d2..13a5fad75f 100644 --- a/util/system/shellcommand_ut.cpp +++ b/util/system/shellcommand_ut.cpp @@ -9,7 +9,6 @@ #include <library/cpp/testing/unittest/env.h> #include <library/cpp/testing/unittest/registar.h> -#include <util/folder/dirut.h> #include <util/random/random.h> #include <util/stream/file.h> #include <util/stream/str.h> diff --git a/util/system/spin_wait.cpp b/util/system/spin_wait.cpp index e27045e74f..caac8d5f1f 100644 --- a/util/system/spin_wait.cpp +++ b/util/system/spin_wait.cpp @@ -1,7 +1,6 @@ #include "spin_wait.h" #include "yield.h" #include "compat.h" -#include "thread.h" #include "spinlock.h" #include <util/digest/numeric.h> diff --git a/util/system/src_location.cpp b/util/system/src_location.cpp index 13ff1f24b3..d8b1f1ef4a 100644 --- a/util/system/src_location.cpp +++ b/util/system/src_location.cpp @@ -2,8 +2,6 @@ #include <util/stream/output.h> -#include <algorithm> - template <> void Out<TSourceLocation>(IOutputStream& o, const TSourceLocation& t) { #if defined(_win_) diff --git a/util/system/thread.cpp b/util/system/thread.cpp index 6236746c2d..aa2a4fc9dd 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -1,4 +1,6 @@ -#include "tls.h" +#if defined(_win_) + #include "tls.h" +#endif #include "thread.h" #include "thread.i" @@ -9,6 +11,10 @@ #include "yassert.h" #include <utility> +#if defined(_linux_) + #include <sys/prctl.h> +#endif + #if defined(_glibc_) #if !__GLIBC_PREREQ(2, 30) #include <sys/syscall.h> diff --git a/util/system/thread.i b/util/system/thread.i index 8cba505473..bb90661402 100644 --- a/util/system/thread.i +++ b/util/system/thread.i @@ -9,17 +9,12 @@ typedef HANDLE THREADHANDLE; #else #include <pthread.h> - #include <sched.h> - #include <errno.h> - #include <string.h> typedef pthread_t THREADHANDLE; #endif #if defined(_freebsd_) #include <pthread_np.h> -#elif defined(_linux_) - #include <sys/prctl.h> #endif #include <util/digest/numeric.h> diff --git a/util/system/tls.cpp b/util/system/tls.cpp index c2f1a04a14..8e892a6d32 100644 --- a/util/system/tls.cpp +++ b/util/system/tls.cpp @@ -1,8 +1,5 @@ #include "tls.h" -#include "mutex.h" -#include "thread.h" -#include <util/generic/set.h> #include <util/generic/hash.h> #include <util/generic/intrlist.h> #include <util/generic/singleton.h> diff --git a/util/system/type_name.cpp b/util/system/type_name.cpp index 0377da4212..52f47a1ddd 100644 --- a/util/system/type_name.cpp +++ b/util/system/type_name.cpp @@ -2,7 +2,6 @@ #include "demangle_impl.h" #ifdef __GNUC__ - #include <stdexcept> #include <cxxabi.h> #endif diff --git a/util/system/user.cpp b/util/system/user.cpp index 83e89ea0a8..05439f8939 100644 --- a/util/system/user.cpp +++ b/util/system/user.cpp @@ -1,6 +1,4 @@ #include "user.h" -#include "platform.h" -#include "defaults.h" #include "env.h" #include <util/generic/yexception.h> @@ -8,7 +6,7 @@ #ifdef _win_ #include "winint.h" #else - #include <errno.h> + #include <cerrno> #include <pwd.h> #include <unistd.h> #endif diff --git a/util/system/utime.cpp b/util/system/utime.cpp index c7bfc4bf3d..a52f84a80c 100644 --- a/util/system/utime.cpp +++ b/util/system/utime.cpp @@ -4,7 +4,6 @@ #include <sys/utime.h> #else #define HDR <../include/utime.h> - #include <sys/types.h> #include HDR #endif diff --git a/util/system/yield.cpp b/util/system/yield.cpp index b327b37b1a..f9033bb281 100644 --- a/util/system/yield.cpp +++ b/util/system/yield.cpp @@ -4,7 +4,6 @@ #include "winint.h" #include <process.h> #else - #include <pthread.h> #include <sched.h> #endif diff --git a/util/thread/pool_ut.cpp b/util/thread/pool_ut.cpp index 893770d0c4..85cbcdf6c9 100644 --- a/util/thread/pool_ut.cpp +++ b/util/thread/pool_ut.cpp @@ -2,7 +2,6 @@ #include <library/cpp/testing/unittest/registar.h> -#include <util/stream/output.h> #include <util/random/fast.h> #include <util/system/spinlock.h> #include <util/system/thread.h> diff --git a/util/ysaveload_ut.cpp b/util/ysaveload_ut.cpp index 723c68f391..4dcb005860 100644 --- a/util/ysaveload_ut.cpp +++ b/util/ysaveload_ut.cpp @@ -7,7 +7,6 @@ #include <util/memory/blob.h> #include <util/generic/list.h> #include <util/generic/map.h> -#include <util/generic/set.h> #include <util/generic/hash.h> #include <util/generic/deque.h> #include <util/generic/string.h> @@ -15,7 +14,6 @@ #include <util/generic/buffer.h> #include <util/generic/hash_set.h> #include <util/generic/maybe.h> -#include <util/generic/variant.h> static inline char* AllocateFromPool(TMemoryPool& pool, size_t len) { return (char*)pool.Allocate(len); |