diff options
author | antervis <antervis@yandex-team.ru> | 2022-02-10 16:49:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:48 +0300 |
commit | 0942f9eeaefcfc84db83fa240d8ed52b99345e7d (patch) | |
tree | 59616090b13df8c4cb69f2a204dc97c93888262c /library/cpp | |
parent | 99ac40630808727955ac0448822228528f1ea92d (diff) | |
download | ydb-0942f9eeaefcfc84db83fa240d8ed52b99345e7d.tar.gz |
Restoring authorship annotation for <antervis@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/actors/core/scheduler_basic.h | 8 | ||||
-rw-r--r-- | library/cpp/coroutine/engine/trampoline.h | 2 | ||||
-rw-r--r-- | library/cpp/grpc/server/grpc_request.h | 2 | ||||
-rw-r--r-- | library/cpp/histogram/adaptive/adaptive_histogram.h | 2 | ||||
-rw-r--r-- | library/cpp/http/fetch/httpparser.h | 8 | ||||
-rw-r--r-- | library/cpp/http/fetch/httpzreader.h | 42 | ||||
-rw-r--r-- | library/cpp/ipv6_address/ipv6_address.cpp | 98 | ||||
-rw-r--r-- | library/cpp/ipv6_address/ipv6_address.h | 106 | ||||
-rw-r--r-- | library/cpp/ipv6_address/ipv6_address_p.h | 4 | ||||
-rw-r--r-- | library/cpp/ipv6_address/ut/ipv6_address_ut.cpp | 50 | ||||
-rw-r--r-- | library/cpp/messagebus/messqueue.cpp | 50 | ||||
-rw-r--r-- | library/cpp/monlib/metrics/summary_collector.h | 2 | ||||
-rw-r--r-- | library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/threading/future/core/future.h | 16 | ||||
-rw-r--r-- | library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp | 2 |
15 files changed, 198 insertions, 198 deletions
diff --git a/library/cpp/actors/core/scheduler_basic.h b/library/cpp/actors/core/scheduler_basic.h index 2ccde39235..81869f41ab 100644 --- a/library/cpp/actors/core/scheduler_basic.h +++ b/library/cpp/actors/core/scheduler_basic.h @@ -41,13 +41,13 @@ namespace NActors { TBasicSchedulerThread(const TSchedulerConfig& config = TSchedulerConfig()); ~TBasicSchedulerThread(); - void Prepare(TActorSystem* actorSystem, volatile ui64* currentTimestamp, volatile ui64* currentMonotonic) override; + void Prepare(TActorSystem* actorSystem, volatile ui64* currentTimestamp, volatile ui64* currentMonotonic) override; void PrepareSchedules(NSchedulerQueue::TReader** readers, ui32 scheduleReadersCount) override; void PrepareStart() override; - void Start() override; - void PrepareStop() override; - void Stop() override; + void Start() override; + void PrepareStop() override; + void Stop() override; }; class TMockSchedulerThread: public ISchedulerThread { diff --git a/library/cpp/coroutine/engine/trampoline.h b/library/cpp/coroutine/engine/trampoline.h index 37b61cf015..ed52614631 100644 --- a/library/cpp/coroutine/engine/trampoline.h +++ b/library/cpp/coroutine/engine/trampoline.h @@ -44,7 +44,7 @@ namespace NCoro { Ctx_.SwitchTo(ctx); } - void DoRun() override; + void DoRun() override; void DoRunNaked() override; diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h index 5bd8d3902b..43243d7b18 100644 --- a/library/cpp/grpc/server/grpc_request.h +++ b/library/cpp/grpc/server/grpc_request.h @@ -203,7 +203,7 @@ public: NextReplyCb_ = cb; } - void AddTrailingMetadata(const TString& key, const TString& value) override { + void AddTrailingMetadata(const TString& key, const TString& value) override { this->Context.AddTrailingMetadata(key, value); } diff --git a/library/cpp/histogram/adaptive/adaptive_histogram.h b/library/cpp/histogram/adaptive/adaptive_histogram.h index fa8f48433f..1f3993a49e 100644 --- a/library/cpp/histogram/adaptive/adaptive_histogram.h +++ b/library/cpp/histogram/adaptive/adaptive_histogram.h @@ -59,7 +59,7 @@ namespace NKiwiAggr { TQualityFunction GetQualityFunc(); - void Clear() override; + void Clear() override; void Add(double value, double weight) override; void Add(const THistoRec& histoRec) override; diff --git a/library/cpp/http/fetch/httpparser.h b/library/cpp/http/fetch/httpparser.h index 769828e4ae..cc88cbd31d 100644 --- a/library/cpp/http/fetch/httpparser.h +++ b/library/cpp/http/fetch/httpparser.h @@ -51,7 +51,7 @@ public: protected: int CheckHeaders() { - if (Header->http_status < HTTP_OK || Header->http_status == HTTP_NO_CONTENT || Header->http_status == HTTP_NOT_MODIFIED) { + if (Header->http_status < HTTP_OK || Header->http_status == HTTP_NO_CONTENT || Header->http_status == HTTP_NOT_MODIFIED) { Header->content_length = 0; Header->transfer_chunked = 0; } @@ -65,7 +65,7 @@ protected: Header->error = HTTP_BAD_CONTENT_LENGTH; return 1; } - if (Header->http_status == HTTP_OK) { + if (Header->http_status == HTTP_OK) { if (Header->compression_method != HTTP_COMPRESSION_UNSET && Header->compression_method != HTTP_COMPRESSION_IDENTITY && Header->compression_method != HTTP_COMPRESSION_GZIP && @@ -290,12 +290,12 @@ public: using TBaseT::ParseGeneric; using TBaseT::State; - int Init(THttpHeader* H, int parsHeader, int assumeConnectionClosed = 0, bool headRequest = false) { + int Init(THttpHeader* H, int parsHeader, int assumeConnectionClosed = 0, bool headRequest = false) { Header = H; Eoferr = 1; Size = 0; AssumeConnectionClosed = assumeConnectionClosed; - HeadRequest = headRequest; + HeadRequest = headRequest; return parsHeader ? ParseHeader() : SkipHeader(); } diff --git a/library/cpp/http/fetch/httpzreader.h b/library/cpp/http/fetch/httpzreader.h index 68eb00853d..c510935ae1 100644 --- a/library/cpp/http/fetch/httpzreader.h +++ b/library/cpp/http/fetch/httpzreader.h @@ -25,9 +25,9 @@ public: using TBase::ParseGeneric; using TBase::State; - static constexpr size_t DefaultBufSize = 64 << 10; - static constexpr unsigned int DefaultWinSize = 15; - + static constexpr size_t DefaultBufSize = 64 << 10; + static constexpr unsigned int DefaultWinSize = 15; + TCompressedHttpReader() : CompressedInput(false) , BufSize(0) @@ -58,19 +58,19 @@ public: IgnoreTrailingGarbage = ignore; } - int Init( - THttpHeader* H, - int parsHeader, - const size_t maxContSize = Max<size_t>(), - const size_t bufSize = DefaultBufSize, - const unsigned int winSize = DefaultWinSize, - bool headRequest = false) - { + int Init( + THttpHeader* H, + int parsHeader, + const size_t maxContSize = Max<size_t>(), + const size_t bufSize = DefaultBufSize, + const unsigned int winSize = DefaultWinSize, + bool headRequest = false) + { ZErr = 0; CurContSize = 0; MaxContSize = maxContSize; - int ret = TBase::Init(H, parsHeader, ConnectionClosed, headRequest); + int ret = TBase::Init(H, parsHeader, ConnectionClosed, headRequest); if (ret) return ret; @@ -256,15 +256,15 @@ public: { } - int Init( - THttpHeader* H, - int parsHeader, - const size_t maxContSize = Max<size_t>(), - const size_t bufSize = TBase::DefaultBufSize, - const unsigned int winSize = TBase::DefaultWinSize, - bool headRequest = false) - { - int ret = TBase::Init(H, parsHeader, maxContSize, bufSize, winSize, headRequest); + int Init( + THttpHeader* H, + int parsHeader, + const size_t maxContSize = Max<size_t>(), + const size_t bufSize = TBase::DefaultBufSize, + const unsigned int winSize = TBase::DefaultWinSize, + bool headRequest = false) + { + int ret = TBase::Init(H, parsHeader, maxContSize, bufSize, winSize, headRequest); return (int)HandleRetValue((long)ret); } diff --git a/library/cpp/ipv6_address/ipv6_address.cpp b/library/cpp/ipv6_address/ipv6_address.cpp index be8fcbae13..a3d0e0a859 100644 --- a/library/cpp/ipv6_address/ipv6_address.cpp +++ b/library/cpp/ipv6_address/ipv6_address.cpp @@ -23,16 +23,16 @@ namespace { *(reinterpret_cast<const ui64*>(memPtr) + 1) }; } - - // zero-terminated copy of address string - template <size_t N> - inline auto AddrBuf(TStringBuf str) noexcept { - std::array<char, N+1> res; - auto len = Min(str.size(), N); - CopyN(str.begin(), len, res.begin()); - res[len] = '\0'; - return res; - } + + // zero-terminated copy of address string + template <size_t N> + inline auto AddrBuf(TStringBuf str) noexcept { + std::array<char, N+1> res; + auto len = Min(str.size(), N); + CopyN(str.begin(), len, res.begin()); + res[len] = '\0'; + return res; + } } void TIpv6Address::InitFrom(const in6_addr& addr) { @@ -78,35 +78,35 @@ TIpv6Address::TIpv6Address(const in_addr& addr) { InitFrom(addr); } -TIpv6Address TIpv6Address::FromString(TStringBuf str, bool& ok) noexcept { - const TIpType ipType = FigureOutType(str); +TIpv6Address TIpv6Address::FromString(TStringBuf str, bool& ok) noexcept { + const TIpType ipType = FigureOutType(str); if (ipType == Ipv6) { - ui32 scopeId = 0; - if (size_t pos = str.find('%'); pos != TStringBuf::npos) { - ::TryFromString(str.substr(pos + 1), scopeId); - str.Trunc(pos); + ui32 scopeId = 0; + if (size_t pos = str.find('%'); pos != TStringBuf::npos) { + ::TryFromString(str.substr(pos + 1), scopeId); + str.Trunc(pos); } - const auto buf = AddrBuf<INET6_ADDRSTRLEN>(str); + const auto buf = AddrBuf<INET6_ADDRSTRLEN>(str); in6_addr addr; - if (inet_pton(AF_INET6, buf.data(), &addr) != 1) { + if (inet_pton(AF_INET6, buf.data(), &addr) != 1) { ok = false; return TIpv6Address(); } - + ok = true; - return TIpv6Address(addr, scopeId); + return TIpv6Address(addr, scopeId); } else { // if (ipType == Ipv4) { - const auto buf = AddrBuf<INET_ADDRSTRLEN>(str); + const auto buf = AddrBuf<INET_ADDRSTRLEN>(str); in_addr addr; - if (inet_pton(AF_INET, buf.data(), &addr) != 1) { + if (inet_pton(AF_INET, buf.data(), &addr) != 1) { ok = false; return TIpv6Address(); } - + ok = true; - return TIpv6Address(addr); + return TIpv6Address(addr); } } @@ -192,12 +192,12 @@ void TIpv6Address::ToIn6Addr(in6_addr& Addr6) const { } void TIpv6Address::Save(IOutputStream* out) const { - ::Save(out, Ip); + ::Save(out, Ip); ::Save(out, static_cast<ui8>(Type_)); ::Save(out, ScopeId_); } void TIpv6Address::Load(IInputStream* in) { - ::Load(in, Ip); + ::Load(in, Ip); ui8 num; ::Load(in, num); Type_ = static_cast<TIpType>(num); @@ -242,14 +242,14 @@ TIpv6Address TIpv6Address::Normalized() const noexcept { } IOutputStream& operator<<(IOutputStream& Out, const TIpv6Address::TIpType Type) noexcept { - switch (Type) { - case TIpv6Address::Ipv4: - Out << "Ipv4"; - return Out; - case TIpv6Address::Ipv6: - Out << "Ipv6"; - return Out; - default: + switch (Type) { + case TIpv6Address::Ipv4: + Out << "Ipv4"; + return Out; + case TIpv6Address::Ipv6: + Out << "Ipv6"; + return Out; + default: Out << "UnknownType"; return Out; } @@ -317,16 +317,16 @@ std::tuple<THostAddressAndPort, TString, TIpPort> ParseHostAndMayBePortFromStrin const size_t BracketColPos = RawStr.find("]:"); if (BracketColPos != TString::npos) { // [ipv6]:port - if (!RawStr.StartsWith('[')) { + if (!RawStr.StartsWith('[')) { Ok = false; return {}; } - const TStringBuf StrIpv6(RawStr.begin() + 1, RawStr.begin() + BracketColPos); - const TStringBuf StrPort(RawStr.begin() + BracketColPos + 2, RawStr.end()); + const TStringBuf StrIpv6(RawStr.begin() + 1, RawStr.begin() + BracketColPos); + const TStringBuf StrPort(RawStr.begin() + BracketColPos + 2, RawStr.end()); bool IpConverted; const TIpv6Address Ip = TIpv6Address::FromString(StrIpv6, IpConverted); - if (!IpConverted) { + if (!IpConverted) { Ok = false; return {}; } @@ -334,8 +334,8 @@ std::tuple<THostAddressAndPort, TString, TIpPort> ParseHostAndMayBePortFromStrin Ok = false; return {}; } - TIpPort Port {}; - if (!::TryFromString(StrPort, Port)) { + TIpPort Port {}; + if (!::TryFromString(StrPort, Port)) { Ok = false; return {}; } @@ -349,15 +349,15 @@ std::tuple<THostAddressAndPort, TString, TIpPort> ParseHostAndMayBePortFromStrin if (RawStr.StartsWith('[')) { // [ipv6] - if (!RawStr.EndsWith(']')) { + if (!RawStr.EndsWith(']')) { Ok = false; return {}; } - const TStringBuf StrIpv6(RawStr.begin() + 1, RawStr.end() - 1); + const TStringBuf StrIpv6(RawStr.begin() + 1, RawStr.end() - 1); bool IpConverted; const TIpv6Address Ip = TIpv6Address::FromString(StrIpv6, IpConverted); - if (!IpConverted || Ip.Type() != TIpv6Address::Ipv6) { + if (!IpConverted || Ip.Type() != TIpv6Address::Ipv6) { Ok = false; return {}; } @@ -386,14 +386,14 @@ std::tuple<THostAddressAndPort, TString, TIpPort> ParseHostAndMayBePortFromStrin } } - const TStringBuf StrPort(RawStr.begin() + ColPos + 1, RawStr.end()); - TIpPort Port {}; - if (!::TryFromString(StrPort, Port)) { + const TStringBuf StrPort(RawStr.begin() + ColPos + 1, RawStr.end()); + TIpPort Port {}; + if (!::TryFromString(StrPort, Port)) { Ok = false; return {}; } - const TStringBuf StrIpv4OrHost(RawStr.begin(), RawStr.begin() + ColPos); + const TStringBuf StrIpv4OrHost(RawStr.begin(), RawStr.begin() + ColPos); { bool IpConverted; const TIpv6Address Ipv4 = TIpv6Address::FromString(StrIpv4OrHost, IpConverted); @@ -408,7 +408,7 @@ std::tuple<THostAddressAndPort, TString, TIpPort> ParseHostAndMayBePortFromStrin { // host:port Ok = true; - TRes Res{THostAddressAndPort{}, TString(StrIpv4OrHost), Port}; + TRes Res{THostAddressAndPort{}, TString(StrIpv4OrHost), Port}; return Res; } } @@ -431,7 +431,7 @@ std::tuple<THostAddressAndPort, TString, TIpPort> ParseHostAndMayBePortFromStrin { // host Ok = true; - TRes Res{THostAddressAndPort{}, TString(RawStr), DefaultPort}; + TRes Res{THostAddressAndPort{}, TString(RawStr), DefaultPort}; return Res; } } diff --git a/library/cpp/ipv6_address/ipv6_address.h b/library/cpp/ipv6_address/ipv6_address.h index 1d7eb0b65f..3c9db90d15 100644 --- a/library/cpp/ipv6_address/ipv6_address.h +++ b/library/cpp/ipv6_address/ipv6_address.h @@ -32,26 +32,26 @@ public: Ipv4, LAST }; - constexpr TIpv6Address() noexcept = default; - constexpr TIpv6Address(const TIpv6Address&) noexcept = default; - constexpr TIpv6Address& operator=(const TIpv6Address&) noexcept = default; - - constexpr TIpv6Address(const ui128& ip, TIpType Type) noexcept - : Ip(ip), Type_(Type) - {} - - constexpr TIpv6Address(ui8 a, ui8 b, ui8 c, ui8 d) noexcept - : Ip((ui32(a) << 24) | (ui32(b) << 16) | (ui32(c) << 8) | ui32(d)) - , Type_(TIpv6Address::Ipv4) - {} - - constexpr TIpv6Address(ui16 a, ui16 b, ui16 c, ui16 d, ui16 e, ui16 f, ui16 g, ui16 h, ui32 scope = 0) noexcept - : Type_(TIpv6Address::Ipv6) - , ScopeId_(scope) - { - auto hi = (ui64(a) << 48) | (ui64(b) << 32) | (ui64(c) << 16) | ui64(d); - auto lo = (ui64(e) << 48) | (ui64(f) << 32) | (ui64(g) << 16) | ui64(h); - Ip = {hi, lo}; + constexpr TIpv6Address() noexcept = default; + constexpr TIpv6Address(const TIpv6Address&) noexcept = default; + constexpr TIpv6Address& operator=(const TIpv6Address&) noexcept = default; + + constexpr TIpv6Address(const ui128& ip, TIpType Type) noexcept + : Ip(ip), Type_(Type) + {} + + constexpr TIpv6Address(ui8 a, ui8 b, ui8 c, ui8 d) noexcept + : Ip((ui32(a) << 24) | (ui32(b) << 16) | (ui32(c) << 8) | ui32(d)) + , Type_(TIpv6Address::Ipv4) + {} + + constexpr TIpv6Address(ui16 a, ui16 b, ui16 c, ui16 d, ui16 e, ui16 f, ui16 g, ui16 h, ui32 scope = 0) noexcept + : Type_(TIpv6Address::Ipv6) + , ScopeId_(scope) + { + auto hi = (ui64(a) << 48) | (ui64(b) << 32) | (ui64(c) << 16) | ui64(d); + auto lo = (ui64(e) << 48) | (ui64(f) << 32) | (ui64(g) << 16) | ui64(h); + Ip = {hi, lo}; } explicit TIpv6Address(const NAddr::IRemoteAddr& addr); @@ -60,24 +60,24 @@ public: explicit TIpv6Address(const in6_addr& addr, ui32 Scope); explicit TIpv6Address(const in_addr& addr); - static TIpv6Address FromString(TStringBuf srcStr, bool& ok) noexcept; + static TIpv6Address FromString(TStringBuf srcStr, bool& ok) noexcept; - constexpr bool IsNull() const noexcept { + constexpr bool IsNull() const noexcept { return Ip == 0; } - constexpr bool IsValid() const noexcept { - return Ip != 0 && (Type_ == Ipv6 || Type_ == Ipv4); - } + constexpr bool IsValid() const noexcept { + return Ip != 0 && (Type_ == Ipv6 || Type_ == Ipv4); + } - explicit constexpr operator bool() const noexcept { - return IsValid(); - } - - constexpr bool operator ! () const noexcept { - return !IsValid(); + explicit constexpr operator bool() const noexcept { + return IsValid(); } + constexpr bool operator ! () const noexcept { + return !IsValid(); + } + bool Isv4MappedTov6() const noexcept; TIpv6Address TryToExtractIpv4From6() const noexcept; TIpv6Address Normalized() const noexcept; @@ -95,45 +95,45 @@ public: void ToIn6Addr(in6_addr& Addr6) const; // int SocketFamily() const; - constexpr bool operator<(const TIpv6Address& other) const noexcept { + constexpr bool operator<(const TIpv6Address& other) const noexcept { if (Type_ != other.Type_) return Type_ > other.Type_; else return Ip < other.Ip; } - constexpr bool operator>(const TIpv6Address& other) const noexcept { + constexpr bool operator>(const TIpv6Address& other) const noexcept { if (Type_ != other.Type_) return Type_ < other.Type_; else return Ip > other.Ip; } - constexpr bool operator==(const TIpv6Address& other) const noexcept { + constexpr bool operator==(const TIpv6Address& other) const noexcept { return Type_ == other.Type_ && Ip == other.Ip; } - constexpr bool operator!=(const TIpv6Address& other) const noexcept { + constexpr bool operator!=(const TIpv6Address& other) const noexcept { return Type_ != other.Type_ || Ip != other.Ip; } - constexpr bool operator<=(const TIpv6Address& other) const noexcept { + constexpr bool operator<=(const TIpv6Address& other) const noexcept { return !(*this > other); } - constexpr bool operator>=(const TIpv6Address& other) const noexcept { + constexpr bool operator>=(const TIpv6Address& other) const noexcept { return !(*this < other); } - constexpr operator ui128() const noexcept { + constexpr operator ui128() const noexcept { return Ip; } - constexpr TIpType Type() const noexcept { + constexpr TIpType Type() const noexcept { return Type_; } - void SetScopeId(ui32 New) noexcept { + void SetScopeId(ui32 New) noexcept { ScopeId_ = New; } - constexpr ui32 ScopeId() const noexcept { + constexpr ui32 ScopeId() const noexcept { return ScopeId_; } @@ -154,35 +154,35 @@ private: IOutputStream& operator<<(IOutputStream& Out, const TIpv6Address::TIpType Type) noexcept; IOutputStream& operator<<(IOutputStream& Out, const TIpv6Address& ipv6Address) noexcept; -constexpr TIpv6Address Get127001() noexcept { - return {127, 0, 0, 1}; +constexpr TIpv6Address Get127001() noexcept { + return {127, 0, 0, 1}; } - -constexpr TIpv6Address Get1() noexcept { - return {1, TIpv6Address::Ipv6}; + +constexpr TIpv6Address Get1() noexcept { + return {1, TIpv6Address::Ipv6}; } struct THostAddressAndPort { - constexpr THostAddressAndPort() noexcept = default; - constexpr THostAddressAndPort(const TIpv6Address& i, TIpPort p) noexcept { + constexpr THostAddressAndPort() noexcept = default; + constexpr THostAddressAndPort(const TIpv6Address& i, TIpPort p) noexcept { Ip = i; Port = p; } - constexpr bool operator==(const THostAddressAndPort& Other) const noexcept { + constexpr bool operator==(const THostAddressAndPort& Other) const noexcept { return Ip == Other.Ip && Port == Other.Port; } - constexpr bool operator!=(const THostAddressAndPort& Other) const noexcept { + constexpr bool operator!=(const THostAddressAndPort& Other) const noexcept { return !(*this == Other); } - constexpr bool IsValid() const noexcept { + constexpr bool IsValid() const noexcept { return Ip.IsValid() && Port != 0; } TString ToString() const noexcept; - TIpv6Address Ip {}; - TIpPort Port {0}; + TIpv6Address Ip {}; + TIpPort Port {0}; }; IOutputStream& operator<<(IOutputStream& Out, const THostAddressAndPort& HostAddressAndPort) noexcept; diff --git a/library/cpp/ipv6_address/ipv6_address_p.h b/library/cpp/ipv6_address/ipv6_address_p.h index 44bec74579..29405af946 100644 --- a/library/cpp/ipv6_address/ipv6_address_p.h +++ b/library/cpp/ipv6_address/ipv6_address_p.h @@ -2,6 +2,6 @@ #include "ipv6_address.h" -inline TIpv6Address::TIpType FigureOutType(TStringBuf srcStr) noexcept { - return srcStr.Contains(':') ? TIpv6Address::Ipv6 : TIpv6Address::Ipv4; +inline TIpv6Address::TIpType FigureOutType(TStringBuf srcStr) noexcept { + return srcStr.Contains(':') ? TIpv6Address::Ipv6 : TIpv6Address::Ipv4; } diff --git a/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp b/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp index 73bb7cffdd..4a97ff4eab 100644 --- a/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp +++ b/library/cpp/ipv6_address/ut/ipv6_address_ut.cpp @@ -5,12 +5,12 @@ class TIpv6AddressTest: public TTestBase { UNIT_TEST_SUITE(TIpv6AddressTest); UNIT_TEST(ParseHostAndMayBePortFromString_data); - UNIT_TEST(CheckAddressValidity) + UNIT_TEST(CheckAddressValidity) UNIT_TEST_SUITE_END(); private: void ParseHostAndMayBePortFromString_data(); - void CheckAddressValidity(); + void CheckAddressValidity(); void HashCompileTest(); }; @@ -79,33 +79,33 @@ void TIpv6AddressTest::ParseHostAndMayBePortFromString_data() { CheckIpDefPortAgainstIpPortDefPort("ya.ru", 123, HostRes("ya.ru", 123), true); } -void TIpv6AddressTest::CheckAddressValidity() { - bool Ok; - - constexpr TIpv6Address partsV4 {12, 34, 56, 78}; - static_assert(partsV4.Type() == TIpv6Address::Ipv4); - - constexpr TIpv6Address intV4 {0x0C22384E, TIpv6Address::Ipv4}; - static_assert(partsV4 == intV4); - - const auto parsedV4 = TIpv6Address::FromString("12.34.56.78", Ok); +void TIpv6AddressTest::CheckAddressValidity() { + bool Ok; + + constexpr TIpv6Address partsV4 {12, 34, 56, 78}; + static_assert(partsV4.Type() == TIpv6Address::Ipv4); + + constexpr TIpv6Address intV4 {0x0C22384E, TIpv6Address::Ipv4}; + static_assert(partsV4 == intV4); + + const auto parsedV4 = TIpv6Address::FromString("12.34.56.78", Ok); UNIT_ASSERT(Ok); UNIT_ASSERT_EQUAL(parsedV4, partsV4); - - constexpr TIpv6Address partsV6 {0xFB, 0x1634, 0x19, 0xABED, 0, 0x8001, 0x1670, 0x742}; - static_assert(partsV6.Type() == TIpv6Address::Ipv6); - - constexpr TIpv6Address intV6 {{0x00FB16340019ABED, 0x0000800116700742}, TIpv6Address::Ipv6}; - static_assert(partsV6 == intV6); - - const auto parsedV6 = TIpv6Address::FromString("FB:1634:19:ABED:0:8001:1670:742", Ok); + + constexpr TIpv6Address partsV6 {0xFB, 0x1634, 0x19, 0xABED, 0, 0x8001, 0x1670, 0x742}; + static_assert(partsV6.Type() == TIpv6Address::Ipv6); + + constexpr TIpv6Address intV6 {{0x00FB16340019ABED, 0x0000800116700742}, TIpv6Address::Ipv6}; + static_assert(partsV6 == intV6); + + const auto parsedV6 = TIpv6Address::FromString("FB:1634:19:ABED:0:8001:1670:742", Ok); UNIT_ASSERT(Ok); UNIT_ASSERT_EQUAL(parsedV6, partsV6); - - static_assert(Get127001() == TIpv6Address(0x7F000001, TIpv6Address::Ipv4)); - static_assert(Get1() == TIpv6Address(0, 0, 0, 0, 0, 0, 0, 1)); -} - + + static_assert(Get127001() == TIpv6Address(0x7F000001, TIpv6Address::Ipv4)); + static_assert(Get1() == TIpv6Address(0, 0, 0, 0, 0, 0, 0, 1)); +} + void TIpv6AddressTest::HashCompileTest() { std::unordered_set<TIpv6Address> test; Y_UNUSED(test); diff --git a/library/cpp/messagebus/messqueue.cpp b/library/cpp/messagebus/messqueue.cpp index 3474d62705..c956d4a473 100644 --- a/library/cpp/messagebus/messqueue.cpp +++ b/library/cpp/messagebus/messqueue.cpp @@ -131,34 +131,34 @@ TBusClientSessionPtr TBusMessageQueue::CreateSource(TBusProtocol* proto, IBusCli } TBusServerSessionPtr TBusMessageQueue::CreateDestination(TBusProtocol* proto, IBusServerHandler* handler, const TBusClientSessionConfig& config, const TString& name) { - TRemoteServerSessionPtr session(new TRemoteServerSession(this, proto, handler, config, name)); - try { - int port = config.ListenPort; - if (port == 0) { - port = Locator->GetLocalPort(proto->GetService()); - } - if (port == 0) { - port = proto->GetPort(); - } - - session->Listen(port, this); - - Add(session.Get()); - return session.Release(); - } catch (...) { - Y_FAIL("create destination failure: %s", CurrentExceptionMessage().c_str()); - } + TRemoteServerSessionPtr session(new TRemoteServerSession(this, proto, handler, config, name)); + try { + int port = config.ListenPort; + if (port == 0) { + port = Locator->GetLocalPort(proto->GetService()); + } + if (port == 0) { + port = proto->GetPort(); + } + + session->Listen(port, this); + + Add(session.Get()); + return session.Release(); + } catch (...) { + Y_FAIL("create destination failure: %s", CurrentExceptionMessage().c_str()); + } } TBusServerSessionPtr TBusMessageQueue::CreateDestination(TBusProtocol* proto, IBusServerHandler* handler, const TBusServerSessionConfig& config, const TVector<TBindResult>& bindTo, const TString& name) { - TRemoteServerSessionPtr session(new TRemoteServerSession(this, proto, handler, config, name)); - try { - session->Listen(bindTo, this); - Add(session.Get()); - return session.Release(); - } catch (...) { - Y_FAIL("create destination failure: %s", CurrentExceptionMessage().c_str()); - } + TRemoteServerSessionPtr session(new TRemoteServerSession(this, proto, handler, config, name)); + try { + session->Listen(bindTo, this); + Add(session.Get()); + return session.Release(); + } catch (...) { + Y_FAIL("create destination failure: %s", CurrentExceptionMessage().c_str()); + } } void TBusMessageQueue::Add(TIntrusivePtr<TBusSessionImpl> session) { diff --git a/library/cpp/monlib/metrics/summary_collector.h b/library/cpp/monlib/metrics/summary_collector.h index acba0fddf9..a7372e2a10 100644 --- a/library/cpp/monlib/metrics/summary_collector.h +++ b/library/cpp/monlib/metrics/summary_collector.h @@ -41,7 +41,7 @@ namespace NMonitoring { Count_.fetch_add(1ul, std::memory_order_relaxed); } - ISummaryDoubleSnapshotPtr Snapshot() const override { + ISummaryDoubleSnapshotPtr Snapshot() const override { return new TSummaryDoubleSnapshot( Sum_.load(std::memory_order_relaxed), Min_.load(std::memory_order_relaxed), diff --git a/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp b/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp index 97f19050e4..788b252e5e 100644 --- a/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp +++ b/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp @@ -21,8 +21,8 @@ public: class TTestMock: public ITestIface { public: - MOCK_METHOD(void, Func1, (), (override)); - MOCK_METHOD(int, Func2, (const TString&), (const, override)); + MOCK_METHOD(void, Func1, (), (override)); + MOCK_METHOD(int, Func2, (const TString&), (const, override)); }; using namespace testing; diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h index 2e82bb953e..d65c4895e2 100644 --- a/library/cpp/threading/future/core/future.h +++ b/library/cpp/threading/future/core/future.h @@ -78,11 +78,11 @@ namespace NThreading { TFuture() noexcept = default; TFuture(const TFuture<T>& other) noexcept = default; - TFuture(TFuture<T>&& other) noexcept = default; + TFuture(TFuture<T>&& other) noexcept = default; TFuture(const TIntrusivePtr<TFutureState>& state) noexcept; TFuture<T>& operator=(const TFuture<T>& other) noexcept = default; - TFuture<T>& operator=(TFuture<T>&& other) noexcept = default; + TFuture<T>& operator=(TFuture<T>&& other) noexcept = default; void Swap(TFuture<T>& other); bool Initialized() const; @@ -135,11 +135,11 @@ namespace NThreading { TFuture() noexcept = default; TFuture(const TFuture<void>& other) noexcept = default; - TFuture(TFuture<void>&& other) noexcept = default; + TFuture(TFuture<void>&& other) noexcept = default; TFuture(const TIntrusivePtr<TFutureState>& state) noexcept; TFuture<void>& operator=(const TFuture<void>& other) noexcept = default; - TFuture<void>& operator=(TFuture<void>&& other) noexcept = default; + TFuture<void>& operator=(TFuture<void>&& other) noexcept = default; void Swap(TFuture<void>& other); bool Initialized() const; @@ -193,11 +193,11 @@ namespace NThreading { public: TPromise() noexcept = default; TPromise(const TPromise<T>& other) noexcept = default; - TPromise(TPromise<T>&& other) noexcept = default; + TPromise(TPromise<T>&& other) noexcept = default; TPromise(const TIntrusivePtr<TFutureState>& state) noexcept; TPromise<T>& operator=(const TPromise<T>& other) noexcept = default; - TPromise<T>& operator=(TPromise<T>&& other) noexcept = default; + TPromise<T>& operator=(TPromise<T>&& other) noexcept = default; void Swap(TPromise<T>& other); bool Initialized() const; @@ -237,11 +237,11 @@ namespace NThreading { public: TPromise() noexcept = default; TPromise(const TPromise<void>& other) noexcept = default; - TPromise(TPromise<void>&& other) noexcept = default; + TPromise(TPromise<void>&& other) noexcept = default; TPromise(const TIntrusivePtr<TFutureState>& state) noexcept; TPromise<void>& operator=(const TPromise<void>& other) noexcept = default; - TPromise<void>& operator=(TPromise<void>&& other) noexcept = default; + TPromise<void>& operator=(TPromise<void>&& other) noexcept = default; void Swap(TPromise<void>& other); bool Initialized() const; diff --git a/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp b/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp index 770d62b9fd..678e02c1b6 100644 --- a/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp +++ b/library/cpp/yt/small_containers/unittests/compact_vector_ut.cpp @@ -156,7 +156,7 @@ private: class CompactVectorTestBase : public testing::Test { protected: - void SetUp() override { + void SetUp() override { Constructable::reset(); } |