diff --git a/benchmark/bench_queue.cpp b/benchmark/bench_queue.cpp index a0ca18a9..94139962 100644 --- a/benchmark/bench_queue.cpp +++ b/benchmark/bench_queue.cpp @@ -8,9 +8,10 @@ #include "td/utils/common.h" #include "td/utils/logging.h" #include "td/utils/MpscPollableQueue.h" +#include "td/utils/port/sleep.h" +#include "td/utils/port/thread.h" #include "td/utils/queue.h" #include "td/utils/Random.h" -#include "td/utils/port/sleep.h" // TODO: check system calls // TODO: all return values must be checked diff --git a/td/mtproto/PingConnection.cpp b/td/mtproto/PingConnection.cpp index ae126b5a..cb5c3664 100644 --- a/td/mtproto/PingConnection.cpp +++ b/td/mtproto/PingConnection.cpp @@ -6,8 +6,8 @@ // #include "td/mtproto/PingConnection.h" -#include "td/mtproto/AuthKey.h" #include "td/mtproto/AuthData.h" +#include "td/mtproto/AuthKey.h" #include "td/mtproto/mtproto_api.h" #include "td/mtproto/NoCryptoStorer.h" #include "td/mtproto/PacketInfo.h" diff --git a/td/mtproto/TlsInit.cpp b/td/mtproto/TlsInit.cpp index 8577003b..fc66a884 100644 --- a/td/mtproto/TlsInit.cpp +++ b/td/mtproto/TlsInit.cpp @@ -7,13 +7,15 @@ #include "td/mtproto/TlsInit.h" #include "td/utils/as.h" +#include "td/utils/common.h" #include "td/utils/crypto.h" -#include "td/utils/port/Clocks.h" +#include "td/utils/logging.h" #include "td/utils/Random.h" #include "td/utils/Span.h" +#include "td/utils/Time.h" #include -#include +#include namespace td { namespace mtproto { diff --git a/td/mtproto/TlsInit.h b/td/mtproto/TlsInit.h index ce6e7569..09b1f6b5 100644 --- a/td/mtproto/TlsInit.h +++ b/td/mtproto/TlsInit.h @@ -8,6 +8,10 @@ #include "td/net/TransparentProxy.h" +#include "td/actor/actor.h" + +#include "td/utils/port/IPAddress.h" +#include "td/utils/port/SocketFd.h" #include "td/utils/Slice.h" #include "td/utils/Status.h" diff --git a/td/mtproto/TlsReaderByteFlow.cpp b/td/mtproto/TlsReaderByteFlow.cpp index 0a656650..312c5fbe 100644 --- a/td/mtproto/TlsReaderByteFlow.cpp +++ b/td/mtproto/TlsReaderByteFlow.cpp @@ -6,6 +6,7 @@ // #include "td/mtproto/TlsReaderByteFlow.h" +#include "td/utils/Slice.h" #include "td/utils/Status.h" namespace td { diff --git a/td/mtproto/Transport.cpp b/td/mtproto/Transport.cpp index eaf37209..061700f2 100644 --- a/td/mtproto/Transport.cpp +++ b/td/mtproto/Transport.cpp @@ -13,6 +13,7 @@ #include "td/utils/crypto.h" #include "td/utils/format.h" #include "td/utils/logging.h" +#include "td/utils/misc.h" #include "td/utils/Random.h" #include "td/utils/Status.h" diff --git a/td/telegram/BackgroundManager.cpp b/td/telegram/BackgroundManager.cpp index 7bab4e2a..ffd4cdd9 100644 --- a/td/telegram/BackgroundManager.cpp +++ b/td/telegram/BackgroundManager.cpp @@ -29,8 +29,10 @@ #include "td/utils/buffer.h" #include "td/utils/common.h" +#include "td/utils/format.h" #include "td/utils/logging.h" #include "td/utils/misc.h" +#include "td/utils/Slice.h" #include "td/utils/tl_helpers.h" #include diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index c645962f..327ac00d 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -25,6 +25,7 @@ #include "td/mtproto/AuthKey.h" #include "td/mtproto/crypto.h" #include "td/mtproto/RawConnection.h" +#include "td/mtproto/TransportType.h" #if !TD_EMSCRIPTEN //FIXME #include "td/net/HttpQuery.h" @@ -42,6 +43,7 @@ #include "td/utils/JsonBuilder.h" #include "td/utils/logging.h" #include "td/utils/misc.h" +#include "td/utils/Parser.h" #include "td/utils/port/Clocks.h" #include "td/utils/Random.h" #include "td/utils/Time.h" @@ -53,8 +55,6 @@ #include #include -#include - namespace td { int VERBOSITY_NAME(config_recoverer) = VERBOSITY_NAME(INFO); diff --git a/td/telegram/Global.cpp b/td/telegram/Global.cpp index fc78d0b7..2fbfa7d6 100644 --- a/td/telegram/Global.cpp +++ b/td/telegram/Global.cpp @@ -118,7 +118,7 @@ double Global::get_dns_time_difference() const { return dns_flag ? dns_diff : server_diff; } if (dns_flag) { - return std::max(dns_diff, server_diff); + return max(dns_diff, server_diff); } if (td_db_) { return server_diff; diff --git a/td/telegram/Photo.h b/td/telegram/Photo.h index a0142b98..9c27726f 100644 --- a/td/telegram/Photo.h +++ b/td/telegram/Photo.h @@ -21,6 +21,7 @@ #include "td/utils/buffer.h" #include "td/utils/common.h" #include "td/utils/StringBuilder.h" +#include "td/utils/Variant.h" namespace td { diff --git a/td/telegram/PhotoSizeSource.hpp b/td/telegram/PhotoSizeSource.hpp index fc673459..6d2fad7f 100644 --- a/td/telegram/PhotoSizeSource.hpp +++ b/td/telegram/PhotoSizeSource.hpp @@ -6,7 +6,7 @@ // #pragma once -#include "td/telegram/Photo.h" +#include "td/telegram/PhotoSizeSource.h" #include "td/utils/tl_helpers.h" diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 0ed96fa3..2743095a 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -22,8 +22,8 @@ #include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileType.h" #include "td/telegram/Global.h" -#include "td/telegram/logevent/LogEvent.h" #include "td/telegram/LanguagePackManager.h" +#include "td/telegram/logevent/LogEvent.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/misc.h" #include "td/telegram/net/DcId.h" diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index a71ffdc0..afab8526 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -89,8 +89,12 @@ #include "td/db/binlog/BinlogEvent.h" +#include "td/mtproto/crypto.h" +#include "td/mtproto/DhHandshake.h" +#include "td/mtproto/Handshake.h" #include "td/mtproto/HandshakeActor.h" #include "td/mtproto/RawConnection.h" +#include "td/mtproto/TransportType.h" #include "td/mtproto/utils.h" // for create_storer, fetch_result, etc, TODO #include "td/utils/buffer.h" @@ -99,7 +103,9 @@ #include "td/utils/MimeType.h" #include "td/utils/misc.h" #include "td/utils/PathView.h" +#include "td/utils/port/IPAddress.h" #include "td/utils/port/path.h" +#include "td/utils/port/SocketFd.h" #include "td/utils/Random.h" #include "td/utils/Slice.h" #include "td/utils/Status.h" diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 772b416c..68be2446 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -6,11 +6,13 @@ // #pragma once +#include "td/telegram/ChannelId.h" +#include "td/telegram/ChatId.h" #include "td/telegram/DialogId.h" #include "td/telegram/PtsManager.h" - #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" +#include "td/telegram/UserId.h" #include "td/actor/actor.h" #include "td/actor/PromiseFuture.h" diff --git a/td/telegram/net/ConnectionCreator.cpp b/td/telegram/net/ConnectionCreator.cpp index 3d661caa..b07af293 100644 --- a/td/telegram/net/ConnectionCreator.cpp +++ b/td/telegram/net/ConnectionCreator.cpp @@ -20,6 +20,7 @@ #include "td/telegram/TdDb.h" #include "td/mtproto/Ping.h" +#include "td/mtproto/ProxySecret.h" #include "td/mtproto/RawConnection.h" #include "td/mtproto/TlsInit.h" diff --git a/td/telegram/net/MtprotoHeader.cpp b/td/telegram/net/MtprotoHeader.cpp index 6cd807d2..9d88e484 100644 --- a/td/telegram/net/MtprotoHeader.cpp +++ b/td/telegram/net/MtprotoHeader.cpp @@ -6,8 +6,8 @@ // #include "td/telegram/net/MtprotoHeader.h" -#include "td/telegram/LanguagePackManager.h" #include "td/telegram/JsonValue.h" +#include "td/telegram/LanguagePackManager.h" #include "td/tl/tl_object_store.h" diff --git a/td/telegram/net/Proxy.h b/td/telegram/net/Proxy.h index 55937626..497316c8 100644 --- a/td/telegram/net/Proxy.h +++ b/td/telegram/net/Proxy.h @@ -136,7 +136,7 @@ class Proxy { parse(port_, parser); secret_ = mtproto::ProxySecret::from_link(parser.template fetch_string()).move_as_ok(); } else { - LOG_CHECK(type_ == Proxy::Type::None) << static_cast(type_); + CHECK(type_ == Proxy::Type::None); } } diff --git a/td/tl/tl_json.h b/td/tl/tl_json.h index a740f18b..a90634da 100644 --- a/td/tl/tl_json.h +++ b/td/tl/tl_json.h @@ -7,6 +7,7 @@ #pragma once #include "td/utils/base64.h" +#include "td/utils/common.h" #include "td/utils/format.h" #include "td/utils/JsonBuilder.h" #include "td/utils/misc.h" @@ -17,6 +18,7 @@ #include "td/telegram/td_api.h" #include "td/telegram/td_api.hpp" +#include #include namespace td { diff --git a/tdutils/td/utils/ConcurrentHashTable.h b/tdutils/td/utils/ConcurrentHashTable.h index 6f890224..5b5cf335 100644 --- a/tdutils/td/utils/ConcurrentHashTable.h +++ b/tdutils/td/utils/ConcurrentHashTable.h @@ -8,6 +8,8 @@ #include "td/utils/common.h" #include "td/utils/HazardPointers.h" +#include "td/utils/logging.h" +#include "td/utils/port/thread_local.h" #include #include diff --git a/tdutils/td/utils/EpochBasedMemoryReclamation.h b/tdutils/td/utils/EpochBasedMemoryReclamation.h index 7b28b59b..ed93f2bf 100644 --- a/tdutils/td/utils/EpochBasedMemoryReclamation.h +++ b/tdutils/td/utils/EpochBasedMemoryReclamation.h @@ -9,7 +9,9 @@ #include "td/utils/common.h" #include "td/utils/logging.h" #include "td/utils/port/sleep.h" -#include "td/utils/port/thread.h" + +#include +#include namespace td { diff --git a/tdutils/td/utils/Gzip.cpp b/tdutils/td/utils/Gzip.cpp index 63f291b5..40e184d2 100644 --- a/tdutils/td/utils/Gzip.cpp +++ b/tdutils/td/utils/Gzip.cpp @@ -13,6 +13,7 @@ char disable_linker_warning_about_empty_file_gzip_cpp TD_UNUSED; #include #include +#include #include diff --git a/tdutils/td/utils/Hash.h b/tdutils/td/utils/Hash.h index 5a2f9284..72c0b837 100644 --- a/tdutils/td/utils/Hash.h +++ b/tdutils/td/utils/Hash.h @@ -12,6 +12,8 @@ #include #endif +#include + namespace td { // A simple wrapper for absl::flat_hash_map, std::unordered_map and probably some our implementaion of hash map in // the future diff --git a/tdutils/td/utils/MpmcWaiter.h b/tdutils/td/utils/MpmcWaiter.h index 3810627a..f71613fc 100644 --- a/tdutils/td/utils/MpmcWaiter.h +++ b/tdutils/td/utils/MpmcWaiter.h @@ -7,7 +7,6 @@ #pragma once #include "td/utils/common.h" -#include "td/utils/logging.h" #include "td/utils/port/thread.h" #include diff --git a/tdutils/td/utils/ThreadSafeCounter.h b/tdutils/td/utils/ThreadSafeCounter.h index 075a72c2..6d72f21a 100644 --- a/tdutils/td/utils/ThreadSafeCounter.h +++ b/tdutils/td/utils/ThreadSafeCounter.h @@ -6,8 +6,7 @@ // #pragma once -#include "td/utils/int_types.h" -#include "td/utils/port/thread.h" +#include "td/utils/common.h" #include "td/utils/port/thread_local.h" #include diff --git a/tdutils/td/utils/optional.h b/tdutils/td/utils/optional.h index 61117b03..6029d42c 100644 --- a/tdutils/td/utils/optional.h +++ b/tdutils/td/utils/optional.h @@ -6,6 +6,7 @@ // #pragma once +#include "td/utils/common.h" #include "td/utils/Status.h" #include diff --git a/tdutils/td/utils/port/MemoryMapping.cpp b/tdutils/td/utils/port/MemoryMapping.cpp index bdb9572b..808dc6bc 100644 --- a/tdutils/td/utils/port/MemoryMapping.cpp +++ b/tdutils/td/utils/port/MemoryMapping.cpp @@ -6,6 +6,7 @@ // #include "td/utils/port/MemoryMapping.h" +#include "td/utils/logging.h" #include "td/utils/misc.h" // TODO: diff --git a/tdutils/td/utils/port/SocketFd.cpp b/tdutils/td/utils/port/SocketFd.cpp index 80276b09..f9641be2 100644 --- a/tdutils/td/utils/port/SocketFd.cpp +++ b/tdutils/td/utils/port/SocketFd.cpp @@ -7,6 +7,7 @@ #include "td/utils/port/SocketFd.h" #include "td/utils/common.h" +#include "td/utils/format.h" #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/port/PollFlags.h" diff --git a/tdutils/td/utils/port/StdStreams.cpp b/tdutils/td/utils/port/StdStreams.cpp index 74b8c84c..ba56d9ae 100644 --- a/tdutils/td/utils/port/StdStreams.cpp +++ b/tdutils/td/utils/port/StdStreams.cpp @@ -8,8 +8,8 @@ #include "td/utils/logging.h" #include "td/utils/misc.h" -#include "td/utils/port/detail/NativeFd.h" #include "td/utils/port/detail/Iocp.h" +#include "td/utils/port/detail/NativeFd.h" #include "td/utils/port/PollFlags.h" #include "td/utils/port/thread.h" #include "td/utils/Slice.h" diff --git a/tdutils/td/utils/port/detail/Iocp.h b/tdutils/td/utils/port/detail/Iocp.h index 5a08e531..d8835033 100644 --- a/tdutils/td/utils/port/detail/Iocp.h +++ b/tdutils/td/utils/port/detail/Iocp.h @@ -13,9 +13,10 @@ #include "td/utils/common.h" #include "td/utils/Context.h" #include "td/utils/port/detail/NativeFd.h" -#include "td/utils/port/thread.h" #include "td/utils/Status.h" +#include + namespace td { namespace detail { diff --git a/tdutils/td/utils/port/signals.cpp b/tdutils/td/utils/port/signals.cpp index d02dae9d..c63c5190 100644 --- a/tdutils/td/utils/port/signals.cpp +++ b/tdutils/td/utils/port/signals.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/tdutils/td/utils/port/stacktrace.cpp b/tdutils/td/utils/port/stacktrace.cpp index 6463d478..18f0e372 100644 --- a/tdutils/td/utils/port/stacktrace.cpp +++ b/tdutils/td/utils/port/stacktrace.cpp @@ -58,7 +58,7 @@ void print_backtrace_gdb(void) { return; } #if defined(PR_SET_PTRACER) - // We can't use EventFd because we are in a signal handler + // We can't use event fd because we are in a signal handler int fds[2]; bool need_set_ptracer = true; if (pipe(fds) < 0) { diff --git a/tdutils/test/ConcurrentHashMap.cpp b/tdutils/test/ConcurrentHashMap.cpp index b2018352..f5d11709 100644 --- a/tdutils/test/ConcurrentHashMap.cpp +++ b/tdutils/test/ConcurrentHashMap.cpp @@ -6,14 +6,12 @@ // #include "td/utils/benchmark.h" #include "td/utils/ConcurrentHashTable.h" -#include "td/utils/HazardPointers.h" #include "td/utils/port/thread.h" #include "td/utils/SpinLock.h" #include "td/utils/tests.h" -#include #include -#include +#include #if !TD_THREAD_UNSUPPORTED @@ -29,8 +27,8 @@ #if TD_WITH_JUNCTION #include -#include #include +#include #endif namespace td { diff --git a/tdutils/test/EpochBasedMemoryReclamation.cpp b/tdutils/test/EpochBasedMemoryReclamation.cpp index 60673b93..021611e4 100644 --- a/tdutils/test/EpochBasedMemoryReclamation.cpp +++ b/tdutils/test/EpochBasedMemoryReclamation.cpp @@ -4,6 +4,7 @@ // 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/common.h" #include "td/utils/EpochBasedMemoryReclamation.h" #include "td/utils/logging.h" #include "td/utils/port/thread.h" diff --git a/tdutils/test/HazardPointers.cpp b/tdutils/test/HazardPointers.cpp index 5d79721c..45b214db 100644 --- a/tdutils/test/HazardPointers.cpp +++ b/tdutils/test/HazardPointers.cpp @@ -9,6 +9,7 @@ #include "td/utils/logging.h" #include "td/utils/port/thread.h" #include "td/utils/Random.h" +#include "td/utils/Slice.h" #include "td/utils/tests.h" #include diff --git a/tdutils/test/crypto.cpp b/tdutils/test/crypto.cpp index d665b765..f1362a4a 100644 --- a/tdutils/test/crypto.cpp +++ b/tdutils/test/crypto.cpp @@ -8,6 +8,7 @@ #include "td/utils/benchmark.h" #include "td/utils/common.h" #include "td/utils/crypto.h" +#include "td/utils/logging.h" #include "td/utils/Slice.h" #include "td/utils/tests.h" #include "td/utils/UInt.h" diff --git a/tdutils/test/misc.cpp b/tdutils/test/misc.cpp index e1446a43..2d390618 100644 --- a/tdutils/test/misc.cpp +++ b/tdutils/test/misc.cpp @@ -27,6 +27,7 @@ #include "td/utils/port/wstring_convert.h" #include "td/utils/Random.h" #include "td/utils/Slice.h" +#include "td/utils/Status.h" #include "td/utils/StringBuilder.h" #include "td/utils/tests.h" #include "td/utils/Time.h" diff --git a/tdutils/test/port.cpp b/tdutils/test/port.cpp index 99f8267e..03f45862 100644 --- a/tdutils/test/port.cpp +++ b/tdutils/test/port.cpp @@ -8,8 +8,11 @@ #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/port/FileFd.h" +#include "td/utils/port/IoSlice.h" #include "td/utils/port/path.h" #include "td/utils/port/signals.h" +#include "td/utils/port/thread.h" +#include "td/utils/port/thread_local.h" #include "td/utils/Slice.h" #include "td/utils/tests.h" diff --git a/test/mtproto.cpp b/test/mtproto.cpp index 83ced8f7..ac4d0760 100644 --- a/test/mtproto.cpp +++ b/test/mtproto.cpp @@ -34,9 +34,9 @@ #include "td/utils/base64.h" #include "td/utils/common.h" #include "td/utils/logging.h" +#include "td/utils/port/Clocks.h" #include "td/utils/port/IPAddress.h" #include "td/utils/port/SocketFd.h" -#include "td/utils/Parser.h" #include "td/utils/Random.h" #include "td/utils/Status.h" #include "td/utils/Time.h"