diff --git a/benchmark/bench_log.cpp b/benchmark/bench_log.cpp index 80f3d4022..724186cca 100644 --- a/benchmark/bench_log.cpp +++ b/benchmark/bench_log.cpp @@ -4,6 +4,9 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include "td/utils/benchmark.h" +#include "td/utils/logging.h" + #include #include #include @@ -14,9 +17,6 @@ #include -#include "td/utils/benchmark.h" -#include "td/utils/logging.h" - std::string create_tmp_file() { #if TD_ANDROID std::string name = "/data/local/tmp/large_file.txt"; diff --git a/benchmark/bench_queue.cpp b/benchmark/bench_queue.cpp index 9625eee5e..13288e6cd 100644 --- a/benchmark/bench_queue.cpp +++ b/benchmark/bench_queue.cpp @@ -4,6 +4,12 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // +#include "td/utils/benchmark.h" +#include "td/utils/common.h" +#include "td/utils/logging.h" +#include "td/utils/MpscPollableQueue.h" +#include "td/utils/queue.h" + // TODO: check system calls // TODO: all return values must be checked @@ -18,12 +24,6 @@ #include #include -#include "td/utils/benchmark.h" -#include "td/utils/common.h" -#include "td/utils/logging.h" -#include "td/utils/MpscPollableQueue.h" -#include "td/utils/queue.h" - #if TD_LINUX #include #endif diff --git a/td/generate/tl_json_converter.h b/td/generate/tl_json_converter.h index 22f9edc4a..719ff451f 100644 --- a/td/generate/tl_json_converter.h +++ b/td/generate/tl_json_converter.h @@ -6,10 +6,10 @@ // #pragma once -#include - #include "td/tl/tl_config.h" +#include + namespace td { void gen_json_converter(const tl::tl_config &config, const std::string &file_name); diff --git a/td/telegram/net/PublicRsaKeyShared.cpp b/td/telegram/net/PublicRsaKeyShared.cpp index f3194e90d..050e36845 100644 --- a/td/telegram/net/PublicRsaKeyShared.cpp +++ b/td/telegram/net/PublicRsaKeyShared.cpp @@ -6,13 +6,14 @@ // #include "td/telegram/net/PublicRsaKeyShared.h" -#include - #include "td/utils/logging.h" #include "td/utils/Slice.h" #include "td/utils/Status.h" +#include + namespace td { + PublicRsaKeyShared::PublicRsaKeyShared(DcId dc_id) : dc_id_(dc_id) { if (!dc_id_.is_empty()) { return; @@ -140,4 +141,5 @@ void PublicRsaKeyShared::notify() { auto it = remove_if(listeners_.begin(), listeners_.end(), [&](auto &listener) { return !listener->notify(); }); listeners_.erase(it, listeners_.end()); } + } // namespace td diff --git a/td/telegram/net/PublicRsaKeyShared.h b/td/telegram/net/PublicRsaKeyShared.h index b38c52a83..453bb7bda 100644 --- a/td/telegram/net/PublicRsaKeyShared.h +++ b/td/telegram/net/PublicRsaKeyShared.h @@ -17,6 +17,7 @@ #include namespace td { + class PublicRsaKeyShared : public PublicRsaKeyInterface { public: explicit PublicRsaKeyShared(DcId dc_id); diff --git a/td/telegram/net/SessionProxy.cpp b/td/telegram/net/SessionProxy.cpp index 856334ae6..df1e1d84f 100644 --- a/td/telegram/net/SessionProxy.cpp +++ b/td/telegram/net/SessionProxy.cpp @@ -11,11 +11,11 @@ #include "td/telegram/net/NetQueryDispatcher.h" #include "td/telegram/net/Session.h" -#include - #include "td/utils/logging.h" #include "td/utils/Slice.h" +#include + namespace td { namespace mtproto { class RawConnection; diff --git a/td/tl/tl_object_parse.h b/td/tl/tl_object_parse.h index 774c6994f..953e0940b 100644 --- a/td/tl/tl_object_parse.h +++ b/td/tl/tl_object_parse.h @@ -6,15 +6,15 @@ // #pragma once +#include "td/tl/TlObject.h" + +#include "td/utils/int_types.h" + #include #include #include #include -#include "td/tl/TlObject.h" - -#include "td/utils/int_types.h" - namespace td { template diff --git a/td/tl/tl_object_store.h b/td/tl/tl_object_store.h index 69810bee6..f6cd37669 100644 --- a/td/tl/tl_object_store.h +++ b/td/tl/tl_object_store.h @@ -6,15 +6,15 @@ // #pragma once +#include "td/tl/TlObject.h" + +#include "td/utils/misc.h" + #include #include #include #include -#include "td/tl/TlObject.h" - -#include "td/utils/misc.h" - namespace td { template diff --git a/tdutils/td/utils/BigNum.cpp b/tdutils/td/utils/BigNum.cpp index 66d4c68f0..f553661d4 100644 --- a/tdutils/td/utils/BigNum.cpp +++ b/tdutils/td/utils/BigNum.cpp @@ -10,12 +10,12 @@ char disable_linker_warning_about_empty_file_bignum_cpp TD_UNUSED; #if TD_HAVE_OPENSSL -#include -#include - #include "td/utils/logging.h" #include "td/utils/misc.h" +#include +#include + namespace td { class BigNumContext::Impl { diff --git a/tdutils/td/utils/MpscLinkQueue.h b/tdutils/td/utils/MpscLinkQueue.h index bf50ce24e..4398c7503 100644 --- a/tdutils/td/utils/MpscLinkQueue.h +++ b/tdutils/td/utils/MpscLinkQueue.h @@ -6,11 +6,11 @@ // #pragma once -#include - #include "td/utils/common.h" #include "td/utils/logging.h" +#include + namespace td { //NB: holder of the queue holds all responsibility of freeing its nodes class MpscLinkQueueImpl { diff --git a/tdutils/td/utils/SpinLock.h b/tdutils/td/utils/SpinLock.h index 7b4c30201..d726b0b2f 100644 --- a/tdutils/td/utils/SpinLock.h +++ b/tdutils/td/utils/SpinLock.h @@ -6,10 +6,10 @@ // #pragma once -#include - #include "td/utils/port/thread.h" +#include + namespace td { class SpinLock { diff --git a/tdutils/td/utils/Status.cpp b/tdutils/td/utils/Status.cpp index c2659faa7..b8bb169e6 100644 --- a/tdutils/td/utils/Status.cpp +++ b/tdutils/td/utils/Status.cpp @@ -6,6 +6,10 @@ // #include "td/utils/Status.h" +#if TD_PORT_WINDOWS +#include "td/utils/port/wstring_convert.h" +#endif + #if TD_PORT_POSIX #include "td/utils/port/thread_local.h" @@ -14,10 +18,6 @@ #include #endif -#if TD_PORT_WINDOWS -#include "td/utils/port/wstring_convert.h" -#endif - namespace td { #if TD_PORT_POSIX diff --git a/tdutils/td/utils/StringBuilder.h b/tdutils/td/utils/StringBuilder.h index e01c28b68..68b5c3c46 100644 --- a/tdutils/td/utils/StringBuilder.h +++ b/tdutils/td/utils/StringBuilder.h @@ -6,16 +6,16 @@ // #pragma once +#include "td/utils/common.h" +#include "td/utils/Slice-decl.h" +#include "td/utils/StackAllocator.h" + #include #include #include #include #include -#include "td/utils/common.h" -#include "td/utils/Slice-decl.h" -#include "td/utils/StackAllocator.h" - namespace td { class StringBuilder { diff --git a/tdutils/td/utils/Time.h b/tdutils/td/utils/Time.h index 1b69327d1..862c6fcf7 100644 --- a/tdutils/td/utils/Time.h +++ b/tdutils/td/utils/Time.h @@ -6,12 +6,12 @@ // #pragma once -#include -#include - #include "td/utils/common.h" #include "td/utils/port/Clocks.h" +#include +#include + namespace td { class Time { diff --git a/tdutils/td/utils/port/path.cpp b/tdutils/td/utils/port/path.cpp index f0962976a..1c25c82d4 100644 --- a/tdutils/td/utils/port/path.cpp +++ b/tdutils/td/utils/port/path.cpp @@ -6,6 +6,12 @@ // #include "td/utils/port/path.h" +#include "td/utils/port/Fd.h" + +#if TD_WINDOWS +#include "td/utils/Random.h" +#endif + #if TD_PORT_POSIX #include @@ -26,12 +32,6 @@ #endif -#include "td/utils/port/Fd.h" - -#if TD_WINDOWS -#include "td/utils/Random.h" -#endif - #include namespace td { diff --git a/tdutils/td/utils/port/signals.cpp b/tdutils/td/utils/port/signals.cpp index ae0fe65ca..8627474d6 100644 --- a/tdutils/td/utils/port/signals.cpp +++ b/tdutils/td/utils/port/signals.cpp @@ -8,6 +8,9 @@ #include "td/utils/port/config.h" +#include "td/utils/format.h" +#include "td/utils/logging.h" + #if TD_PORT_POSIX #include #include @@ -23,9 +26,6 @@ #include #include -#include "td/utils/format.h" -#include "td/utils/logging.h" - namespace td { #if TD_PORT_POSIX && !TD_DARWIN_TV_OS && !TD_DARWIN_WATCH_OS diff --git a/tdutils/td/utils/tl_storers.h b/tdutils/td/utils/tl_storers.h index 8ab96ad61..f389451d8 100644 --- a/tdutils/td/utils/tl_storers.h +++ b/tdutils/td/utils/tl_storers.h @@ -6,14 +6,14 @@ // #pragma once -#include - #include "td/utils/int_types.h" #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/Slice.h" #include "td/utils/StorerBase.h" +#include + namespace td { class TlStorerUnsafe { diff --git a/test/secret.cpp b/test/secret.cpp index 0f7d0a382..6d4a61687 100644 --- a/test/secret.cpp +++ b/test/secret.cpp @@ -19,6 +19,9 @@ #include "td/telegram/secret_api.h" #include "td/telegram/telegram_api.h" +#include "td/tl/tl_object_parse.h" +#include "td/tl/tl_object_store.h" + #include "td/utils/base64.h" #include "td/utils/buffer.h" #include "td/utils/crypto.h" @@ -40,9 +43,6 @@ #include #include -#include "td/tl/tl_object_parse.h" -#include "td/tl/tl_object_store.h" - REGISTER_TESTS(secret); namespace my_api {