From c10ac96cc9ff8edec5be6f086b5d46b522286119 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 14 Mar 2018 17:43:00 +0300 Subject: [PATCH] Various fixes. GitOrigin-RevId: 3880e2fc5b8704f163817699ec1043f2f7a39b83 --- example/uwp/app/TdApp.csproj | 2 +- example/uwp/build.ps1 | 2 +- td/telegram/cli.cpp | 1 - td/telegram/net/NetQueryDispatcher.cpp | 2 +- td/telegram/net/NetQueryDispatcher.h | 1 + tdutils/td/utils/ScopeGuard.h | 10 +++++----- tdutils/td/utils/port/thread_local.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/uwp/app/TdApp.csproj b/example/uwp/app/TdApp.csproj index b2b2901e..76ac8f65 100644 --- a/example/uwp/app/TdApp.csproj +++ b/example/uwp/app/TdApp.csproj @@ -134,7 +134,7 @@ Visual C++ 2015 Runtime for Universal Windows Platform Apps - TDLib for Universal Windows Platfrom + TDLib for Universal Windows Platform diff --git a/example/uwp/build.ps1 b/example/uwp/build.ps1 index 3cfbea71..5ecb14f1 100644 --- a/example/uwp/build.ps1 +++ b/example/uwp/build.ps1 @@ -105,7 +105,7 @@ function export { cd vsix - if ($compress -eq "zip") { + if ($compress -eq "zip") { zip -r tdlib.vsix * } elseif ($compress -eq "winrar") { WinRAR.exe a -afzip -r -ep1 tdlib.vsix * diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index aed087c2..fec70869 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -27,7 +27,6 @@ #include "td/utils/port/signals.h" #include "td/utils/port/Stat.h" #include "td/utils/port/thread_local.h" -#include "td/utils/Random.h" #include "td/utils/ScopeGuard.h" #include "td/utils/Slice.h" #include "td/utils/Status.h" diff --git a/td/telegram/net/NetQueryDispatcher.cpp b/td/telegram/net/NetQueryDispatcher.cpp index cea31314..9eb0571a 100644 --- a/td/telegram/net/NetQueryDispatcher.cpp +++ b/td/telegram/net/NetQueryDispatcher.cpp @@ -248,7 +248,7 @@ NetQueryDispatcher::NetQueryDispatcher(std::function()> create_ref common_public_rsa_key_ = std::make_shared(DcId::empty()); public_rsa_key_watchdog_ = create_actor("PublicRsaKeyWatchdog", create_reference()); - td_guard_ = create_shared_lamda_guard([actor = create_reference] {}); + td_guard_ = create_shared_lambda_guard([actor = create_reference] {}); } NetQueryDispatcher::NetQueryDispatcher() = default; diff --git a/td/telegram/net/NetQueryDispatcher.h b/td/telegram/net/NetQueryDispatcher.h index 5ccc5201..461c8b5b 100644 --- a/td/telegram/net/NetQueryDispatcher.h +++ b/td/telegram/net/NetQueryDispatcher.h @@ -11,6 +11,7 @@ #include "td/actor/actor.h" #include "td/utils/common.h" +#include "td/utils/ScopeGuard.h" #include "td/utils/Status.h" #include diff --git a/tdutils/td/utils/ScopeGuard.h b/tdutils/td/utils/ScopeGuard.h index 541a0ce2..a914ce35 100644 --- a/tdutils/td/utils/ScopeGuard.h +++ b/tdutils/td/utils/ScopeGuard.h @@ -8,10 +8,10 @@ #include "td/utils/common.h" +#include +#include #include #include -#include -#include namespace td { class Guard { @@ -23,7 +23,7 @@ class Guard { Guard &operator=(Guard &&other) = default; virtual ~Guard() = default; virtual void dismiss() { - abort(); + std::abort(); } }; @@ -57,11 +57,11 @@ class LambdaGuard : public Guard { }; template -std::unique_ptr create_lamda_guard(F &&f) { +std::unique_ptr create_lambda_guard(F &&f) { return std::make_unique>(std::forward(f)); } template -std::shared_ptr create_shared_lamda_guard(F &&f) { +std::shared_ptr create_shared_lambda_guard(F &&f) { return std::make_shared>(std::forward(f)); } diff --git a/tdutils/td/utils/port/thread_local.h b/tdutils/td/utils/port/thread_local.h index d28fb7b5..6d8c135e 100644 --- a/tdutils/td/utils/port/thread_local.h +++ b/tdutils/td/utils/port/thread_local.h @@ -50,7 +50,7 @@ void do_init_thread_local(P &raw_ptr, ArgsT &&... args) { auto ptr = std::make_unique(std::forward(args)...); raw_ptr = ptr.get(); - detail::add_thread_local_destructor(create_lamda_guard([ptr = std::move(ptr), &raw_ptr]() mutable { + detail::add_thread_local_destructor(create_lambda_guard([ptr = std::move(ptr), &raw_ptr]() mutable { ptr.reset(); raw_ptr = nullptr; }));