diff options
author | gleb-kov <gleb-kov@yandex-team.ru> | 2022-02-10 16:46:22 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:22 +0300 |
commit | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library | |
parent | 7b1cfa32681104c8468c5824c79fd80d9a88a579 (diff) | |
download | ydb-918e8a1574070d0ec733f0b76cfad8f8892ad2e5.tar.gz |
Restoring authorship annotation for <gleb-kov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library')
28 files changed, 204 insertions, 204 deletions
diff --git a/library/cpp/actors/core/actor_coroutine.cpp b/library/cpp/actors/core/actor_coroutine.cpp index 3fd39f7431..0ab4d2b24d 100644 --- a/library/cpp/actors/core/actor_coroutine.cpp +++ b/library/cpp/actors/core/actor_coroutine.cpp @@ -2,7 +2,7 @@ #include "executor_thread.h" #include <util/system/sanitizers.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> namespace NActors { static constexpr size_t StackOverflowGap = 4096; @@ -143,7 +143,7 @@ namespace NActors { Y_FAIL("unhandled TDtorException"); } } catch (const std::exception& ex) { - Y_FAIL("unhandled exception of type %s", TypeName(ex).data()); + Y_FAIL("unhandled exception of type %s", TypeName(ex).data()); } catch (...) { Y_FAIL("unhandled exception of type not derived from std::exception"); } diff --git a/library/cpp/actors/core/event_local.h b/library/cpp/actors/core/event_local.h index 96313cf1e3..2845aa94dd 100644 --- a/library/cpp/actors/core/event_local.h +++ b/library/cpp/actors/core/event_local.h @@ -3,7 +3,7 @@ #include "event.h" #include "scheduler_cookie.h" #include "event_load.h" -#include <util/system/type_name.h> +#include <util/system/type_name.h> namespace NActors { template <typename TEv, ui32 TEventType> diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h index 210d0c2d83..d7546b901a 100644 --- a/library/cpp/actors/core/event_pb.h +++ b/library/cpp/actors/core/event_pb.h @@ -268,7 +268,7 @@ namespace NActors { // parse the protobuf TRopeStream stream(iter, size); if (!ev->Record.ParseFromZeroCopyStream(&stream)) { - Y_FAIL("Failed to parse protobuf event type %" PRIu32 " class %s", TEventType, TypeName(ev->Record).data()); + Y_FAIL("Failed to parse protobuf event type %" PRIu32 " class %s", TEventType, TypeName(ev->Record).data()); } } ev->CachedByteSize = input->GetSize(); diff --git a/library/cpp/actors/core/executor_thread.cpp b/library/cpp/actors/core/executor_thread.cpp index 8c528fd0f4..446b651efd 100644 --- a/library/cpp/actors/core/executor_thread.cpp +++ b/library/cpp/actors/core/executor_thread.cpp @@ -19,7 +19,7 @@ #include <unistd.h> #endif -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/system/datetime.h> LWTRACE_USING(ACTORLIB_PROVIDER) @@ -92,7 +92,7 @@ namespace NActors { return "nullptr"; } try { - return TypeName(*t); + return TypeName(*t); } catch (...) { return "unknown-type"; } diff --git a/library/cpp/actors/core/invoke.h b/library/cpp/actors/core/invoke.h index da00728062..931a9767dd 100644 --- a/library/cpp/actors/core/invoke.h +++ b/library/cpp/actors/core/invoke.h @@ -9,8 +9,8 @@ #include <utility> #include <variant> -#include <util/system/type_name.h> - +#include <util/system/type_name.h> + namespace NActors { struct TEvents::TEvInvokeResult @@ -55,7 +55,7 @@ namespace NActors { return std::move(*value); } else { Y_FAIL("unspported return type for TEvInvokeResult: actual# %s != expected# %s", - TypeName(arg.type()).data(), TypeName<T>().data()); + TypeName(arg.type()).data(), TypeName<T>().data()); } }, Result); } diff --git a/library/cpp/actors/core/memory_track.h b/library/cpp/actors/core/memory_track.h index c050aeddcb..6035333eeb 100644 --- a/library/cpp/actors/core/memory_track.h +++ b/library/cpp/actors/core/memory_track.h @@ -2,7 +2,7 @@ #include <vector> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/thread/singleton.h> #define ENABLE_MEMORY_TRACKING diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp index e76f3998d6..9ede998d8e 100644 --- a/library/cpp/actors/interconnect/interconnect_handshake.cpp +++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp @@ -93,8 +93,8 @@ namespace NActors { TMaybe<THolder<TProgramInfo>> ProgramInfo; // filled in in case of successful handshake; even if null TSessionParams Params; bool ResolveTimedOut = false; - THashMap<ui32, TInstant> LastLogNotice; - const TDuration MuteDuration = TDuration::Seconds(15); + THashMap<ui32, TInstant> LastLogNotice; + const TDuration MuteDuration = TDuration::Seconds(15); TInstant Deadline; public: @@ -791,12 +791,12 @@ namespace NActors { if (network) { TInstant now = Now(); - TInstant prevLog = LastLogNotice[PeerNodeId]; - NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG; - if (now - prevLog > MuteDuration) { - logPriority = NActors::NLog::PRI_NOTICE; - LastLogNotice[PeerNodeId] = now; - } + TInstant prevLog = LastLogNotice[PeerNodeId]; + NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG; + if (now - prevLog > MuteDuration) { + logPriority = NActors::NLog::PRI_NOTICE; + LastLogNotice[PeerNodeId] = now; + } LOG_LOG_NET_X(logPriority, PeerNodeId, "network-related error occured on handshake: %s", msg.data()); } else { // calculate log severity based on failure type; permanent failures lead to error log messages @@ -883,12 +883,12 @@ namespace NActors { break; } - auto it = LastLogNotice.find(PeerNodeId); - NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG; - if (it != LastLogNotice.end()) { - LastLogNotice.erase(it); - logPriority = NActors::NLog::PRI_NOTICE; - } + auto it = LastLogNotice.find(PeerNodeId); + NActors::NLog::EPriority logPriority = NActors::NLog::PRI_DEBUG; + if (it != LastLogNotice.end()) { + LastLogNotice.erase(it); + logPriority = NActors::NLog::PRI_NOTICE; + } LOG_LOG_IC_X(NActorsServices::INTERCONNECT, "ICH05", logPriority, "connected to peer"); } diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp index 647d7e0d44..7e2d8ccb94 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp @@ -451,12 +451,12 @@ namespace NActors { break; case TEvHandshakeFail::HANDSHAKE_FAIL_PERMANENT: - TString timeExplanation = " LastSessionDieTime# " + LastSessionDieTime.ToString(); + TString timeExplanation = " LastSessionDieTime# " + LastSessionDieTime.ToString(); if (Session) { InvokeOtherActor(*Session, &TInterconnectSessionTCP::Terminate, TDisconnectReason::HandshakeFailPermanent()); } - TransitToErrorState(ev->Get()->Explanation + timeExplanation, false); + TransitToErrorState(ev->Get()->Explanation + timeExplanation, false); break; } } diff --git a/library/cpp/actors/interconnect/logging.h b/library/cpp/actors/interconnect/logging.h index c33654b84a..c429d1cade 100644 --- a/library/cpp/actors/interconnect/logging.h +++ b/library/cpp/actors/interconnect/logging.h @@ -20,13 +20,13 @@ LOG_LOG(::NActors::TActivationContext::AsActorContext(), (priority), (component), "%s " marker " %s", LogPrefix.data(), Sprintf(__VA_ARGS__).data()); \ } while (false) -#define LOG_LOG_NET(priority, NODE_ID, FMT, ...) \ - do { \ - const TActorContext& ctx = ::NActors::TActivationContext::AsActorContext(); \ - LOG_LOG(ctx, (priority), ::NActorsServices::INTERCONNECT_NETWORK, "[%" PRIu32 " <-> %" PRIu32 "] %s", \ - ctx.SelfID.NodeId(), (NODE_ID), Sprintf(FMT, __VA_ARGS__).data()); \ - } while (false) - +#define LOG_LOG_NET(priority, NODE_ID, FMT, ...) \ + do { \ + const TActorContext& ctx = ::NActors::TActivationContext::AsActorContext(); \ + LOG_LOG(ctx, (priority), ::NActorsServices::INTERCONNECT_NETWORK, "[%" PRIu32 " <-> %" PRIu32 "] %s", \ + ctx.SelfID.NodeId(), (NODE_ID), Sprintf(FMT, __VA_ARGS__).data()); \ + } while (false) + #define LOG_EMER_IC(marker, ...) LOG_LOG_IC(::NActorsServices::INTERCONNECT, marker, ::NActors::NLog::PRI_EMER, __VA_ARGS__) #define LOG_ALERT_IC(marker, ...) LOG_LOG_IC(::NActorsServices::INTERCONNECT, marker, ::NActors::NLog::PRI_ALERT, __VA_ARGS__) #define LOG_CRIT_IC(marker, ...) LOG_LOG_IC(::NActorsServices::INTERCONNECT, marker, ::NActors::NLog::PRI_CRIT, __VA_ARGS__) @@ -45,8 +45,8 @@ #define LOG_INFO_IC_SESSION(marker, ...) LOG_LOG_IC(::NActorsServices::INTERCONNECT_SESSION, marker, ::NActors::NLog::PRI_INFO, __VA_ARGS__) #define LOG_DEBUG_IC_SESSION(marker, ...) LOG_LOG_IC(::NActorsServices::INTERCONNECT_SESSION, marker, ::NActors::NLog::PRI_DEBUG, __VA_ARGS__) -#define LOG_NOTICE_NET(NODE_ID, FMT, ...) LOG_LOG_NET(::NActors::NLog::PRI_NOTICE, NODE_ID, FMT, __VA_ARGS__) -#define LOG_DEBUG_NET(NODE_ID, FMT, ...) LOG_LOG_NET(::NActors::NLog::PRI_DEBUG, NODE_ID, FMT, __VA_ARGS__) +#define LOG_NOTICE_NET(NODE_ID, FMT, ...) LOG_LOG_NET(::NActors::NLog::PRI_NOTICE, NODE_ID, FMT, __VA_ARGS__) +#define LOG_DEBUG_NET(NODE_ID, FMT, ...) LOG_LOG_NET(::NActors::NLog::PRI_DEBUG, NODE_ID, FMT, __VA_ARGS__) namespace NActors { class TInterconnectLoggingBase { diff --git a/library/cpp/actors/testlib/test_runtime.cpp b/library/cpp/actors/testlib/test_runtime.cpp index 90da777489..6fa25b9965 100644 --- a/library/cpp/actors/testlib/test_runtime.cpp +++ b/library/cpp/actors/testlib/test_runtime.cpp @@ -890,7 +890,7 @@ namespace NActors { const ui64 localActorId = AllocateLocalId(); if (VERBOSE) { - Cerr << "Register actor " << TypeName(*actor) << " as " << localActorId << ", mailbox: " << hint << "\n"; + Cerr << "Register actor " << TypeName(*actor) << " as " << localActorId << ", mailbox: " << hint << "\n"; } // ok, got mailbox @@ -898,7 +898,7 @@ namespace NActors { // do init const TActorId actorId(FirstNodeId + nodeIndex, poolId, localActorId, hint); - ActorNames[actorId] = TypeName(*actor); + ActorNames[actorId] = TypeName(*actor); RegistrationObserver(*this, parentId ? parentId : CurrentRecipient, actorId); DoActorInit(node->ActorSystem.Get(), actor, actorId, parentId ? parentId : CurrentRecipient); @@ -937,12 +937,12 @@ namespace NActors { const ui64 localActorId = AllocateLocalId(); if (VERBOSE) { - Cerr << "Register actor " << TypeName(*actor) << " as " << localActorId << "\n"; + Cerr << "Register actor " << TypeName(*actor) << " as " << localActorId << "\n"; } mailbox->AttachActor(localActorId, actor); const TActorId actorId(FirstNodeId + nodeIndex, poolId, localActorId, hint); - ActorNames[actorId] = TypeName(*actor); + ActorNames[actorId] = TypeName(*actor); RegistrationObserver(*this, parentId ? parentId : CurrentRecipient, actorId); DoActorInit(node->ActorSystem.Get(), actor, actorId, parentId ? parentId : CurrentRecipient); diff --git a/library/cpp/actors/util/rope.h b/library/cpp/actors/util/rope.h index a506fd000d..f5595efbaa 100644 --- a/library/cpp/actors/util/rope.h +++ b/library/cpp/actors/util/rope.h @@ -993,130 +993,130 @@ public: } }; -struct TRopeUtils { - static void Memset(TRope::TConstIterator dst, char c, size_t size) { - while (size) { - Y_VERIFY_DEBUG(dst.Valid()); - size_t len = std::min(size, dst.ContiguousSize()); - memset(const_cast<char*>(dst.ContiguousData()), c, len); - dst += len; - size -= len; - } - } - - static void Memcpy(TRope::TConstIterator dst, TRope::TConstIterator src, size_t size) { - while (size) { - Y_VERIFY_DEBUG(dst.Valid() && src.Valid(), - "Invalid iterator in memcpy: dst.Valid() - %" PRIu32 ", src.Valid() - %" PRIu32, - (ui32)dst.Valid(), (ui32)src.Valid()); - size_t len = std::min(size, std::min(dst.ContiguousSize(), src.ContiguousSize())); - memcpy(const_cast<char*>(dst.ContiguousData()), src.ContiguousData(), len); - dst += len; - src += len; - size -= len; - } - } - - static void Memcpy(TRope::TConstIterator dst, const char* src, size_t size) { - while (size) { - Y_VERIFY_DEBUG(dst.Valid()); - size_t len = std::min(size, dst.ContiguousSize()); - memcpy(const_cast<char*>(dst.ContiguousData()), src, len); - size -= len; - dst += len; - src += len; - } - } - - static void Memcpy(char* dst, TRope::TConstIterator src, size_t size) { - while (size) { - Y_VERIFY_DEBUG(src.Valid()); - size_t len = std::min(size, src.ContiguousSize()); - memcpy(dst, src.ContiguousData(), len); - size -= len; - dst += len; - src += len; - } - } - - // copy less or equal to sizeBound bytes, until src is valid - static size_t SafeMemcpy(char* dst, TRope::TIterator src, size_t sizeBound) { - size_t origSize = sizeBound; - while (sizeBound && src.Valid()) { - size_t len = Min(sizeBound, src.ContiguousSize()); - memcpy(dst, src.ContiguousData(), len); - sizeBound -= len; - dst += len; - src += len; - } - return origSize - sizeBound; - } -}; - -template<size_t BLOCK, size_t ALIGN = 16> -class TRopeSlideView { - alignas(ALIGN) char Slide[BLOCK]; // use if distance from current point and next chunk is less than BLOCK - TRope::TIterator Position; // current position at rope - size_t Size; - char* Head; // points to data, it might be current rope chunk or Slide - -private: - void FillBlock() { - size_t chunkSize = Position.ContiguousSize(); - if (chunkSize >= BLOCK) { - Size = chunkSize; - Head = const_cast<char*>(Position.ContiguousData()); - } else { - Size = TRopeUtils::SafeMemcpy(Slide, Position, BLOCK); - Head = Slide; - } - } - -public: - TRopeSlideView(TRope::TIterator position) - : Position(position) - { - FillBlock(); - } - - TRopeSlideView(TRope &rope) - : TRopeSlideView(rope.Begin()) - {} - - // if view on slide then copy slide to rope - void FlushBlock() { - if (Head == Slide) { - TRopeUtils::Memcpy(Position, Head, Size); - } - } - - TRope::TIterator operator+=(size_t amount) { - Position += amount; - FillBlock(); - return Position; - } - - TRope::TIterator GetPosition() const { - return Position; - } - - char* GetHead() const { - return Head; - } - - ui8* GetUi8Head() const { - return reinterpret_cast<ui8*>(Head); - } - - size_t ContiguousSize() const { - return Size; - } - - bool IsOnChunk() const { - return Head != Slide; - } -}; - +struct TRopeUtils { + static void Memset(TRope::TConstIterator dst, char c, size_t size) { + while (size) { + Y_VERIFY_DEBUG(dst.Valid()); + size_t len = std::min(size, dst.ContiguousSize()); + memset(const_cast<char*>(dst.ContiguousData()), c, len); + dst += len; + size -= len; + } + } + + static void Memcpy(TRope::TConstIterator dst, TRope::TConstIterator src, size_t size) { + while (size) { + Y_VERIFY_DEBUG(dst.Valid() && src.Valid(), + "Invalid iterator in memcpy: dst.Valid() - %" PRIu32 ", src.Valid() - %" PRIu32, + (ui32)dst.Valid(), (ui32)src.Valid()); + size_t len = std::min(size, std::min(dst.ContiguousSize(), src.ContiguousSize())); + memcpy(const_cast<char*>(dst.ContiguousData()), src.ContiguousData(), len); + dst += len; + src += len; + size -= len; + } + } + + static void Memcpy(TRope::TConstIterator dst, const char* src, size_t size) { + while (size) { + Y_VERIFY_DEBUG(dst.Valid()); + size_t len = std::min(size, dst.ContiguousSize()); + memcpy(const_cast<char*>(dst.ContiguousData()), src, len); + size -= len; + dst += len; + src += len; + } + } + + static void Memcpy(char* dst, TRope::TConstIterator src, size_t size) { + while (size) { + Y_VERIFY_DEBUG(src.Valid()); + size_t len = std::min(size, src.ContiguousSize()); + memcpy(dst, src.ContiguousData(), len); + size -= len; + dst += len; + src += len; + } + } + + // copy less or equal to sizeBound bytes, until src is valid + static size_t SafeMemcpy(char* dst, TRope::TIterator src, size_t sizeBound) { + size_t origSize = sizeBound; + while (sizeBound && src.Valid()) { + size_t len = Min(sizeBound, src.ContiguousSize()); + memcpy(dst, src.ContiguousData(), len); + sizeBound -= len; + dst += len; + src += len; + } + return origSize - sizeBound; + } +}; + +template<size_t BLOCK, size_t ALIGN = 16> +class TRopeSlideView { + alignas(ALIGN) char Slide[BLOCK]; // use if distance from current point and next chunk is less than BLOCK + TRope::TIterator Position; // current position at rope + size_t Size; + char* Head; // points to data, it might be current rope chunk or Slide + +private: + void FillBlock() { + size_t chunkSize = Position.ContiguousSize(); + if (chunkSize >= BLOCK) { + Size = chunkSize; + Head = const_cast<char*>(Position.ContiguousData()); + } else { + Size = TRopeUtils::SafeMemcpy(Slide, Position, BLOCK); + Head = Slide; + } + } + +public: + TRopeSlideView(TRope::TIterator position) + : Position(position) + { + FillBlock(); + } + + TRopeSlideView(TRope &rope) + : TRopeSlideView(rope.Begin()) + {} + + // if view on slide then copy slide to rope + void FlushBlock() { + if (Head == Slide) { + TRopeUtils::Memcpy(Position, Head, Size); + } + } + + TRope::TIterator operator+=(size_t amount) { + Position += amount; + FillBlock(); + return Position; + } + + TRope::TIterator GetPosition() const { + return Position; + } + + char* GetHead() const { + return Head; + } + + ui8* GetUi8Head() const { + return reinterpret_cast<ui8*>(Head); + } + + size_t ContiguousSize() const { + return Size; + } + + bool IsOnChunk() const { + return Head != Slide; + } +}; + inline TRope TRope::CopySpaceOptimized(TRope&& origin, size_t worstRatioPer1k, TRopeArena& arena) { TRope res; for (TChunk& chunk : origin.Chain) { diff --git a/library/cpp/dbg_output/dump.h b/library/cpp/dbg_output/dump.h index c80ff3fd94..c7efa105ee 100644 --- a/library/cpp/dbg_output/dump.h +++ b/library/cpp/dbg_output/dump.h @@ -6,7 +6,7 @@ #include "colorscheme.h" #include <util/stream/format.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/generic/hash_set.h> #include <utility> @@ -31,7 +31,7 @@ namespace NPrivate { template <class V> inline void Pointer(const V* v) { if (v) { - *this << DumpRaw("(") << DumpRaw(TypeName(v).data()) << DumpRaw(")") << Hex((size_t)v); + *this << DumpRaw("(") << DumpRaw(TypeName(v).data()) << DumpRaw(")") << Hex((size_t)v); } else { *this << DumpRaw("(") << DumpRaw(TypeName<V>().data()) << DumpRaw("*)nullptr"); } @@ -52,7 +52,7 @@ namespace NPrivate { inline void Pointer(const V* v) { if (v && !Visited.contains((size_t)v)) { Visited.insert((size_t)v); - *this << DumpRaw("(") << DumpRaw(TypeName(v).data()) << DumpRaw(")") << Hex((size_t)v) << DumpRaw(" -> ") << *v; + *this << DumpRaw("(") << DumpRaw(TypeName(v).data()) << DumpRaw(")") << Hex((size_t)v) << DumpRaw(" -> ") << *v; Visited.erase((size_t)v); } else { *this << DumpRaw("(") << DumpRaw(TypeName<V>().data()) << DumpRaw("*)nullptr"); diff --git a/library/cpp/linear_regression/benchmark/main.cpp b/library/cpp/linear_regression/benchmark/main.cpp index 374d94caab..735d41e988 100644 --- a/library/cpp/linear_regression/benchmark/main.cpp +++ b/library/cpp/linear_regression/benchmark/main.cpp @@ -5,7 +5,7 @@ #include <util/datetime/base.h> #include <util/datetime/cputimer.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/string/printf.h> diff --git a/library/cpp/messagebus/message.cpp b/library/cpp/messagebus/message.cpp index d0b09a3486..bfa7ed8e9b 100644 --- a/library/cpp/messagebus/message.cpp +++ b/library/cpp/messagebus/message.cpp @@ -24,7 +24,7 @@ namespace NBus { // TODO: print local flags #ifndef NDEBUG Y_VERIFY(LocalFlags == 0, "local flags must be zero at this point; message type is %s", - MessageType.value_or("unknown").c_str()); + MessageType.value_or("unknown").c_str()); #else Y_VERIFY(LocalFlags == 0, "local flags must be zero at this point"); #endif @@ -83,7 +83,7 @@ namespace NBus { } TString TBusMessage::Describe() const { - return Sprintf("object type: %s, message type: %d", TypeName(*this).data(), int(GetHeader()->Type)); + return Sprintf("object type: %s, message type: %d", TypeName(*this).data(), int(GetHeader()->Type)); } TBusMessage::~TBusMessage() { @@ -184,7 +184,7 @@ namespace NBus { << " flags=" << Flags << " local-flags=" << LocalFlags #ifndef NDEBUG - << " msg-type= " << MessageType.value_or("unknown").c_str() + << " msg-type= " << MessageType.value_or("unknown").c_str() #endif ; return ss.Str(); diff --git a/library/cpp/messagebus/message.h b/library/cpp/messagebus/message.h index 6e96c964d5..005ca10c65 100644 --- a/library/cpp/messagebus/message.h +++ b/library/cpp/messagebus/message.h @@ -11,12 +11,12 @@ #include <util/generic/ptr.h> #include <util/generic/string.h> #include <util/system/defaults.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/system/yassert.h> -#include <optional> -#include <typeinfo> - +#include <optional> +#include <typeinfo> + namespace NBus { /////////////////////////////////////////////////////////////////// /// \brief Structure to preserve identity from message to reply @@ -37,10 +37,10 @@ namespace NBus { TInstant RecvTime; #ifndef NDEBUG - std::optional<TString> MessageType; + std::optional<TString> MessageType; #endif - private: + private: // TODO: drop TNetAddr GetNetAddr() const; @@ -91,12 +91,12 @@ namespace NBus { } } - void SetMessageType(const std::type_info& messageTypeInfo) { + void SetMessageType(const std::type_info& messageTypeInfo) { #ifndef NDEBUG Y_VERIFY(!MessageType, "state check"); - MessageType = TypeName(messageTypeInfo); + MessageType = TypeName(messageTypeInfo); #else - Y_UNUSED(messageTypeInfo); + Y_UNUSED(messageTypeInfo); #endif } }; diff --git a/library/cpp/messagebus/rain_check/core/task.cpp b/library/cpp/messagebus/rain_check/core/task.cpp index dd7885ae16..a098437d53 100644 --- a/library/cpp/messagebus/rain_check/core/task.cpp +++ b/library/cpp/messagebus/rain_check/core/task.cpp @@ -2,7 +2,7 @@ #include <library/cpp/messagebus/actor/temp_tls_vector.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/system/tls.h> using namespace NRainCheck; @@ -208,7 +208,7 @@ ITaskBase* TTaskRunnerBase::CurrentTaskImpl() { } TString TTaskRunnerBase::GetStatusSingleLine() { - return TypeName(*Impl); + return TypeName(*Impl); } bool NRainCheck::AreWeInsideTask() { diff --git a/library/cpp/messagebus/remote_server_session.cpp b/library/cpp/messagebus/remote_server_session.cpp index 7daf409811..6abbf88a60 100644 --- a/library/cpp/messagebus/remote_server_session.cpp +++ b/library/cpp/messagebus/remote_server_session.cpp @@ -103,8 +103,8 @@ void TRemoteServerSession::InvokeOnMessage(TBusMessagePtrAndHeader& request, TIn ident.RecvTime = request.MessagePtr->RecvTime; #ifndef NDEBUG - auto& message = *request.MessagePtr; - ident.SetMessageType(typeid(message)); + auto& message = *request.MessagePtr; + ident.SetMessageType(typeid(message)); #endif TOnMessageContext context(request.MessagePtr.Release(), ident, this); diff --git a/library/cpp/messagebus/test/helper/object_count_check.h b/library/cpp/messagebus/test/helper/object_count_check.h index b13ca07185..1c4756e58c 100644 --- a/library/cpp/messagebus/test/helper/object_count_check.h +++ b/library/cpp/messagebus/test/helper/object_count_check.h @@ -11,7 +11,7 @@ #include <library/cpp/messagebus/scheduler/scheduler.h> #include <util/generic/object_counter.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/stream/output.h> #include <typeinfo> @@ -49,7 +49,7 @@ struct TObjectCountCheck { } void operator()() { - UNIT_ASSERT_VALUES_EQUAL_C(0L, TObjectCounter<T>::ObjectCount(), TypeName<T>()); + UNIT_ASSERT_VALUES_EQUAL_C(0L, TObjectCounter<T>::ObjectCount(), TypeName<T>()); } }; diff --git a/library/cpp/messagebus/ybus.h b/library/cpp/messagebus/ybus.h index 5878b87ca7..de21ad8521 100644 --- a/library/cpp/messagebus/ybus.h +++ b/library/cpp/messagebus/ybus.h @@ -30,7 +30,7 @@ #include <util/stream/input.h> #include <util/system/atomic.h> #include <util/system/condvar.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/system/event.h> #include <util/system/mutex.h> diff --git a/library/cpp/on_disk/chunks/chunks_ut.cpp b/library/cpp/on_disk/chunks/chunks_ut.cpp index 88df97b727..f727647f7f 100644 --- a/library/cpp/on_disk/chunks/chunks_ut.cpp +++ b/library/cpp/on_disk/chunks/chunks_ut.cpp @@ -231,7 +231,7 @@ public: void TestNamedChunkedData() { const TString filename = MakeTempName(nullptr, "named_chunked_data_test"); - TTempFile file(filename); + TTempFile file(filename); { TFixedBufferFileOutput fOut(filename); diff --git a/library/cpp/pop_count/benchmark/main.cpp b/library/cpp/pop_count/benchmark/main.cpp index a1b6aa42fd..41ea3c91cc 100644 --- a/library/cpp/pop_count/benchmark/main.cpp +++ b/library/cpp/pop_count/benchmark/main.cpp @@ -1,6 +1,6 @@ #include <util/stream/output.h> #include <util/datetime/cputimer.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <library/cpp/pop_count/popcount.h> #include <library/cpp/testing/benchmark/bench.h> diff --git a/library/cpp/protobuf/util/path.h b/library/cpp/protobuf/util/path.h index 8712f81389..487f643a2d 100644 --- a/library/cpp/protobuf/util/path.h +++ b/library/cpp/protobuf/util/path.h @@ -11,8 +11,8 @@ namespace NProtoBuf { TFieldPath(); TFieldPath(const Descriptor* msgType, const TStringBuf& path); // throws exception if path doesn't exist TFieldPath(const TVector<const FieldDescriptor*>& path); - TFieldPath(const TFieldPath&) = default; - TFieldPath& operator=(const TFieldPath&) = default; + TFieldPath(const TFieldPath&) = default; + TFieldPath& operator=(const TFieldPath&) = default; bool InitUnsafe(const Descriptor* msgType, const TStringBuf path); // noexcept void Init(const Descriptor* msgType, const TStringBuf& path); // throws diff --git a/library/cpp/testing/gtest_extensions/assertions.cpp b/library/cpp/testing/gtest_extensions/assertions.cpp index 1163da4189..f390409d1b 100644 --- a/library/cpp/testing/gtest_extensions/assertions.cpp +++ b/library/cpp/testing/gtest_extensions/assertions.cpp @@ -2,12 +2,12 @@ #include <util/string/builder.h> #include <util/string/split.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> namespace NGTest::NInternal { namespace { void FormatActual(const std::exception& err, const TBackTrace* bt, TStringBuilder& out) { - out << "an exception of type " << TypeName(err) << " " + out << "an exception of type " << TypeName(err) << " " << "with message " << TString(err.what()).Quote() << "."; if (bt) { out << "\n Trace: "; diff --git a/library/cpp/testing/unittest/gtest.cpp b/library/cpp/testing/unittest/gtest.cpp index 8be1164afe..ebad1ea4d6 100644 --- a/library/cpp/testing/unittest/gtest.cpp +++ b/library/cpp/testing/unittest/gtest.cpp @@ -3,7 +3,7 @@ #include <util/generic/map.h> #include <util/generic/vector.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> using namespace NUnitTest; using namespace NUnitTest::NPrivate; @@ -19,7 +19,7 @@ namespace { } TString TypeId() const override { - return TypeName(*this) + "-" + MyName; + return TypeName(*this) + "-" + MyName; } TString Name() const noexcept override { diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp index a51f694076..3679b768ed 100644 --- a/library/cpp/testing/unittest/registar.cpp +++ b/library/cpp/testing/unittest/registar.cpp @@ -299,7 +299,7 @@ NUnitTest::TTestBase::TTestBase() noexcept NUnitTest::TTestBase::~TTestBase() = default; TString NUnitTest::TTestBase::TypeId() const { - return TypeName(*this); + return TypeName(*this); } void NUnitTest::TTestBase::SetUp() { diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 18652a5178..44517a0092 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -17,7 +17,7 @@ #include <util/string/printf.h> #include <util/system/defaults.h> -#include <util/system/type_name.h> +#include <util/system/type_name.h> #include <util/system/spinlock.h> #include <util/system/src_location.h> @@ -282,8 +282,8 @@ private: \ this->AtStart(); #ifndef UT_SKIP_EXCEPTIONS -#define CATCH_REACTION(FN, e, context) this->AddError(("(" + TypeName(e) + ") " + e.what()).data(), context) -#define CATCH_REACTION_BT(FN, e, context) this->AddError(("(" + TypeName(e) + ") " + e.what()).data(), (e.BackTrace() ? e.BackTrace()->PrintToString() : TString()), context) +#define CATCH_REACTION(FN, e, context) this->AddError(("(" + TypeName(e) + ") " + e.what()).data(), context) +#define CATCH_REACTION_BT(FN, e, context) this->AddError(("(" + TypeName(e) + ") " + e.what()).data(), (e.BackTrace() ? e.BackTrace()->PrintToString() : TString()), context) #else #define CATCH_REACTION(FN, e, context) throw #define CATCH_REACTION_BT(FN, e, context) throw diff --git a/library/cpp/threading/atomic/bool.h b/library/cpp/threading/atomic/bool.h index 793673d1e6..d52544e762 100644 --- a/library/cpp/threading/atomic/bool.h +++ b/library/cpp/threading/atomic/bool.h @@ -6,16 +6,16 @@ namespace NAtomic { class TBool { public: TBool() noexcept = default; - + TBool(bool val) noexcept : Val_(val) { } - TBool(const TBool& src) noexcept { - AtomicSet(Val_, AtomicGet(src.Val_)); - } - + TBool(const TBool& src) noexcept { + AtomicSet(Val_, AtomicGet(src.Val_)); + } + operator bool() const noexcept { return AtomicGet(Val_); } diff --git a/library/cpp/tvmauth/client/misc/disk_cache.cpp b/library/cpp/tvmauth/client/misc/disk_cache.cpp index f3fa20dc44..3c01be4a83 100644 --- a/library/cpp/tvmauth/client/misc/disk_cache.cpp +++ b/library/cpp/tvmauth/client/misc/disk_cache.cpp @@ -11,7 +11,7 @@ #include <util/stream/str.h> #include <util/system/fs.h> #include <util/system/sysstat.h> -#include <util/system/tempfile.h> +#include <util/system/tempfile.h> #include <exception> |