diff options
author | agorodilov <agorodilov@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
commit | 7a4979e6211c3e78c7f9041d4a9e5d3405343c36 (patch) | |
tree | 9e9943579e5a14679af7cd2cda3c36d8c0b775d3 /library | |
parent | 676340c42e269f3070f194d160f42a83a10568d4 (diff) | |
download | ydb-7a4979e6211c3e78c7f9041d4a9e5d3405343c36.tar.gz |
Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library')
164 files changed, 573 insertions, 573 deletions
diff --git a/library/cpp/actors/core/mailbox_queue_revolving.h b/library/cpp/actors/core/mailbox_queue_revolving.h index b0e78a18db..e9a139862f 100644 --- a/library/cpp/actors/core/mailbox_queue_revolving.h +++ b/library/cpp/actors/core/mailbox_queue_revolving.h @@ -56,7 +56,7 @@ namespace NActors { T Head(bool pop) { ui64 tag = Max<ui64>(); - T ret = T{}; + T ret = T{}; ui32 idx = 0; for (ui32 i = 0; i < TWriteConcurrency; ++i) diff --git a/library/cpp/actors/core/scheduler_cookie.h b/library/cpp/actors/core/scheduler_cookie.h index 2c20ca67f3..e4bef9acda 100644 --- a/library/cpp/actors/core/scheduler_cookie.h +++ b/library/cpp/actors/core/scheduler_cookie.h @@ -23,7 +23,7 @@ namespace NActors { public: TSchedulerCookieHolder() - : Cookie(nullptr) + : Cookie(nullptr) { } @@ -58,7 +58,7 @@ namespace NActors { bool Detach() noexcept { if (Cookie) { const bool res = Cookie->Detach(); - Cookie = nullptr; + Cookie = nullptr; return res; } else { return false; @@ -68,7 +68,7 @@ namespace NActors { bool DetachEvent() noexcept { if (Cookie) { const bool res = Cookie->DetachEvent(); - Cookie = nullptr; + Cookie = nullptr; return res; } else { return false; diff --git a/library/cpp/actors/dnscachelib/dnscache.cpp b/library/cpp/actors/dnscachelib/dnscache.cpp index 649339ddb2..6e51cfe1b6 100644 --- a/library/cpp/actors/dnscachelib/dnscache.cpp +++ b/library/cpp/actors/dnscachelib/dnscache.cpp @@ -113,7 +113,7 @@ NAddr::IRemoteAddrPtr TDnsCache::GetAddr( } LWPROBE(FamilyMismatch, family, AllowIpV4, AllowIpV6); - return nullptr; + return nullptr; } void TDnsCache::GetAllAddresses( @@ -372,7 +372,7 @@ void TDnsCache::GHBNCallback(void* arg, int status, int, struct hostent* info) { if (status == ARES_SUCCESS) { if (info->h_addrtype == AF_INET) { p->second.AddrsV4.clear(); - for (int i = 0; info->h_addr_list[i] != nullptr; i++) { + for (int i = 0; info->h_addr_list[i] != nullptr; i++) { p->second.AddrsV4.push_back(*(TIpHost*)(info->h_addr_list[i])); } /* It is possible to ask ares for IPv6 and have IPv4 addrs instead, @@ -383,7 +383,7 @@ void TDnsCache::GHBNCallback(void* arg, int status, int, struct hostent* info) { AtomicSet(p->second.InProgressV4, 0); } else if (info->h_addrtype == AF_INET6) { p->second.AddrsV6.clear(); - for (int i = 0; info->h_addr_list[i] != nullptr; i++) { + for (int i = 0; info->h_addr_list[i] != nullptr; i++) { p->second.AddrsV6.push_back(*(struct in6_addr*)(info->h_addr_list[i])); } } else { diff --git a/library/cpp/actors/dnscachelib/timekeeper.h b/library/cpp/actors/dnscachelib/timekeeper.h index 0528d8549c..a189f8247d 100644 --- a/library/cpp/actors/dnscachelib/timekeeper.h +++ b/library/cpp/actors/dnscachelib/timekeeper.h @@ -37,7 +37,7 @@ public: } } if (!ConstTime) { - gettimeofday(&CurrentTime, nullptr); + gettimeofday(&CurrentTime, nullptr); Thread.Start(); } } @@ -62,9 +62,9 @@ private: do { /* Race condition may occur here but locking looks too expensive */ - gettimeofday(&owner->CurrentTime, nullptr); + gettimeofday(&owner->CurrentTime, nullptr); } while (!owner->Exit.WaitT(TDuration::MicroSeconds(UpdateInterval))); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/actors/testlib/test_runtime.cpp b/library/cpp/actors/testlib/test_runtime.cpp index 6fa25b9965..2252cff5cb 100644 --- a/library/cpp/actors/testlib/test_runtime.cpp +++ b/library/cpp/actors/testlib/test_runtime.cpp @@ -869,7 +869,7 @@ namespace NActors { // first step - find good enough mailbox ui32 hint = 0; - TMailboxHeader *mailbox = nullptr; + TMailboxHeader *mailbox = nullptr; { ui32 hintBackoff = 0; diff --git a/library/cpp/actors/util/queue_oneone_inplace.h b/library/cpp/actors/util/queue_oneone_inplace.h index d7ec8bb21c..15c0f382d3 100644 --- a/library/cpp/actors/util/queue_oneone_inplace.h +++ b/library/cpp/actors/util/queue_oneone_inplace.h @@ -35,7 +35,7 @@ public: ReadPosition = 0; return Next(); } - return T{}; + return T{}; } }; @@ -62,7 +62,7 @@ public: struct TCleanDestructor { static inline void Destroy(TOneOneQueueInplace<T, TSize>* x) noexcept { - while (x->Pop() != nullptr) + while (x->Pop() != nullptr) continue; delete x; } @@ -102,7 +102,7 @@ public: ReadPosition = 0; return Head(); } - return T{}; + return T{}; } T Pop() { diff --git a/library/cpp/archive/yarchive.cpp b/library/cpp/archive/yarchive.cpp index 1becc3e5da..1c8929bb61 100644 --- a/library/cpp/archive/yarchive.cpp +++ b/library/cpp/archive/yarchive.cpp @@ -76,7 +76,7 @@ namespace { { } - inline ~TArchiveRecordDescriptor() = default; + inline ~TArchiveRecordDescriptor() = default; inline void SaveTo(IOutputStream* out) const { ESSave(out, Off_); @@ -116,7 +116,7 @@ public: { } - inline ~TImpl() = default; + inline ~TImpl() = default; inline void Flush() { Out_->Flush(); @@ -248,7 +248,7 @@ namespace { { } - ~TArchiveInputStream() override = default; + ~TArchiveInputStream() override = default; }; } @@ -263,7 +263,7 @@ public: ReadDict(); } - inline ~TImpl() = default; + inline ~TImpl() = default; inline void ReadDict() { Y_ENSURE(Blob_.Size() >= sizeof(ui64), "too small blob"); diff --git a/library/cpp/archive/yarchive_ut.cpp b/library/cpp/archive/yarchive_ut.cpp index 602a1cdbbd..c89c5f9895 100644 --- a/library/cpp/archive/yarchive_ut.cpp +++ b/library/cpp/archive/yarchive_ut.cpp @@ -69,7 +69,7 @@ void TArchiveTest::TestOffsetOrder() { TBlob blob1 = TBlob::FromFileSingleThreaded(ARCHIVE); TArchiveReader r(blob1); - const void* prevOffset = nullptr; + const void* prevOffset = nullptr; for (size_t i = 0; i < r.Count(); ++i) { const TString key = r.KeyByIndex(i); diff --git a/library/cpp/binsaver/bin_saver.cpp b/library/cpp/binsaver/bin_saver.cpp index fe0775af9f..323b901d0c 100644 --- a/library/cpp/binsaver/bin_saver.cpp +++ b/library/cpp/binsaver/bin_saver.cpp @@ -18,7 +18,7 @@ void IBinSaver::StoreObject(IObjectBase* pObject) { Y_ASSERT(pSaverClasses->GetObjectTypeID(pObject) != -1 && "trying to save unregistered object"); } - ui64 ptrId = ((char*)pObject) - ((char*)nullptr); + ui64 ptrId = ((char*)pObject) - ((char*)nullptr); if (StableOutput) { ui32 id = 0; if (pObject) { @@ -63,7 +63,7 @@ IObjectBase* IBinSaver::LoadObject() { DataChunk(&typeId, sizeof(typeId)); IObjectBase* pObj = pSaverClasses->CreateObject(typeId); Y_ASSERT(pObj != nullptr); - if (pObj == nullptr) { + if (pObj == nullptr) { fprintf(stderr, "IBinSaver: trying to load unregistered object\n"); abort(); } @@ -71,7 +71,7 @@ IObjectBase* IBinSaver::LoadObject() { ObjectQueue.push_back(pObj); return pObj; } - return nullptr; + return nullptr; } IBinSaver::~IBinSaver() { diff --git a/library/cpp/binsaver/bin_saver.h b/library/cpp/binsaver/bin_saver.h index 412424889f..0359f61941 100644 --- a/library/cpp/binsaver/bin_saver.h +++ b/library/cpp/binsaver/bin_saver.h @@ -500,7 +500,7 @@ public: if (pData && pData->Get()) { } if (IsReading()) - pData->Set(CastToUserObject(LoadObject(), (T1*)nullptr)); + pData->Set(CastToUserObject(LoadObject(), (T1*)nullptr)); else StoreObject(pData->GetBarePtr()); } @@ -574,7 +574,7 @@ template <class TReg> struct TRegisterSaveLoadType { TRegisterSaveLoadType(int num) { StartRegisterSaveload(); - pSaverClasses->RegisterType(num, TReg::NewSaveLoadNullItem, (TReg*)nullptr); + pSaverClasses->RegisterType(num, TReg::NewSaveLoadNullItem, (TReg*)nullptr); } }; diff --git a/library/cpp/blockcodecs/core/codecs.cpp b/library/cpp/blockcodecs/core/codecs.cpp index 21506e812b..e096ef79b4 100644 --- a/library/cpp/blockcodecs/core/codecs.cpp +++ b/library/cpp/blockcodecs/core/codecs.cpp @@ -145,4 +145,4 @@ void ICodec::Decode(const TData& in, TString& out) const { out.resize(actualLen); } -ICodec::~ICodec() = default; +ICodec::~ICodec() = default; diff --git a/library/cpp/blockcodecs/core/common.h b/library/cpp/blockcodecs/core/common.h index f05df4d334..7d754b6419 100644 --- a/library/cpp/blockcodecs/core/common.h +++ b/library/cpp/blockcodecs/core/common.h @@ -35,21 +35,21 @@ namespace NBlockCodecs { }; struct TNullCodec: public ICodec { - size_t DecompressedLength(const TData& in) const override { + size_t DecompressedLength(const TData& in) const override { return in.size(); } - size_t MaxCompressedLength(const TData& in) const override { + size_t MaxCompressedLength(const TData& in) const override { return in.size(); } - size_t Compress(const TData& in, void* out) const override { + size_t Compress(const TData& in, void* out) const override { MemCopy((char*)out, in.data(), in.size()); return in.size(); } - size_t Decompress(const TData& in, void* out) const override { + size_t Decompress(const TData& in, void* out) const override { MemCopy((char*)out, in.data(), in.size()); return in.size(); @@ -68,17 +68,17 @@ namespace NBlockCodecs { } } - size_t DecompressedLength(const TData& in) const override { + size_t DecompressedLength(const TData& in) const override { Check(in); return ReadUnaligned<ui64>(in.data()); } - size_t MaxCompressedLength(const TData& in) const override { + size_t MaxCompressedLength(const TData& in) const override { return T::DoMaxCompressedLength(in.size()) + sizeof(ui64); } - size_t Compress(const TData& in, void* out) const override { + size_t Compress(const TData& in, void* out) const override { ui64* ptr = (ui64*)out; WriteUnaligned<ui64>(ptr, (ui64) in.size()); @@ -86,7 +86,7 @@ namespace NBlockCodecs { return Base()->DoCompress(!in ? TData(TStringBuf("")) : in, ptr + 1) + sizeof(*ptr); } - size_t Decompress(const TData& in, void* out) const override { + size_t Decompress(const TData& in, void* out) const override { Check(in); const auto len = ReadUnaligned<ui64>(in.data()); diff --git a/library/cpp/blockcodecs/core/stream.cpp b/library/cpp/blockcodecs/core/stream.cpp index 4f7db3c32b..6584d51460 100644 --- a/library/cpp/blockcodecs/core/stream.cpp +++ b/library/cpp/blockcodecs/core/stream.cpp @@ -136,7 +136,7 @@ void TCodedOutput::DoFlush() { void TCodedOutput::DoFinish() { if (S_) { Y_DEFER { - S_ = nullptr; + S_ = nullptr; }; if (FlushImpl()) { @@ -158,7 +158,7 @@ TDecodedInput::TDecodedInput(IInputStream* in, const ICodec* codec) { } -TDecodedInput::~TDecodedInput() = default; +TDecodedInput::~TDecodedInput() = default; size_t TDecodedInput::DoUnboundedNext(const void** ptr) { if (!S_) { @@ -181,7 +181,7 @@ size_t TDecodedInput::DoUnboundedNext(const void** ptr) { } if (!blockLen) { - S_ = nullptr; + S_ = nullptr; return 0; } diff --git a/library/cpp/blockcodecs/core/stream.h b/library/cpp/blockcodecs/core/stream.h index fd44ef88f2..51ee695a6f 100644 --- a/library/cpp/blockcodecs/core/stream.h +++ b/library/cpp/blockcodecs/core/stream.h @@ -15,9 +15,9 @@ namespace NBlockCodecs { ~TCodedOutput() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; bool FlushImpl(); @@ -36,7 +36,7 @@ namespace NBlockCodecs { ~TDecodedInput() override; private: - size_t DoUnboundedNext(const void** ptr) override; + size_t DoUnboundedNext(const void** ptr) override; private: TBuffer D_; diff --git a/library/cpp/cache/cache.h b/library/cpp/cache/cache.h index 6dc997076d..d6ad880dfc 100644 --- a/library/cpp/cache/cache.h +++ b/library/cpp/cache/cache.h @@ -72,7 +72,7 @@ public: } TItem* RemoveIfOverflown() { - TItem* deleted = nullptr; + TItem* deleted = nullptr; if (TotalSize > MaxSize && ItemsAmount > 1) { deleted = GetOldest(); Erase(deleted); @@ -180,7 +180,7 @@ public: } TItem* RemoveIfOverflown() { - TItem* deleted = nullptr; + TItem* deleted = nullptr; if (ListSize > MaxSize) { deleted = GetLeastFrequentlyUsed(); Erase(deleted); diff --git a/library/cpp/cache/thread_safe_cache.h b/library/cpp/cache/thread_safe_cache.h index 71e1442717..fd94b1e603 100644 --- a/library/cpp/cache/thread_safe_cache.h +++ b/library/cpp/cache/thread_safe_cache.h @@ -24,7 +24,7 @@ namespace NPrivate { using TOwner = TThreadSafeCache<Key, Value, List, GettersPromotionPolicy, TArgs...>; public: - virtual ~ICallbacks() = default; + virtual ~ICallbacks() = default; virtual TKey GetKey(TArgs... args) const = 0; virtual TValue* CreateObject(TArgs... args) const = 0; }; diff --git a/library/cpp/cache/ut/cache_ut.cpp b/library/cpp/cache/ut/cache_ut.cpp index 329872cfde..ffdf26deb7 100644 --- a/library/cpp/cache/ut/cache_ut.cpp +++ b/library/cpp/cache/ut/cache_ut.cpp @@ -364,10 +364,10 @@ Y_UNIT_TEST_SUITE(TThreadSafeCacheTest) { class TCallbacks: public TCache::ICallbacks { public: - TKey GetKey(ui32 i) const override { + TKey GetKey(ui32 i) const override { return i; } - TValue* CreateObject(ui32 i) const override { + TValue* CreateObject(ui32 i) const override { Creations++; return new TString(VALS[i]); } diff --git a/library/cpp/compproto/compproto_ut.cpp b/library/cpp/compproto/compproto_ut.cpp index 9393be967a..1e755c5b35 100644 --- a/library/cpp/compproto/compproto_ut.cpp +++ b/library/cpp/compproto/compproto_ut.cpp @@ -178,8 +178,8 @@ Y_UNIT_TEST_SUITE(CompProtoTestBasic) { const TData* Data; const TRegInfo* Elem; TRegClicks() - : Data(nullptr) - , Elem(nullptr) + : Data(nullptr) + , Elem(nullptr) { } void BeginSelf(ui32 /*count*/, ui32 /*id*/) { @@ -236,7 +236,7 @@ Y_UNIT_TEST_SUITE(CompProtoTestBasic) { return GetEmptyDecompressor(); } TMultiDecompressor() - : Elem(nullptr) + : Elem(nullptr) { } }; diff --git a/library/cpp/containers/atomizer/atomizer.h b/library/cpp/containers/atomizer/atomizer.h index 5e40f47ab9..b0ca6da007 100644 --- a/library/cpp/containers/atomizer/atomizer.h +++ b/library/cpp/containers/atomizer/atomizer.h @@ -41,7 +41,7 @@ public: { order.reserve(hash_size); } - ~atomizer() = default; + ~atomizer() = default; ui32 string_to_atom(const char* key) { const char* old_begin = pool.Begin(); const char* old_end = pool.End(); @@ -73,7 +73,7 @@ public: const char* get_atom_name(ui32 atom) const { if (atom && atom <= size()) return order[atom - 1]; - return nullptr; + return nullptr; } void clear_atomizer() { clear_hash(); @@ -137,7 +137,7 @@ public: { order.reserve(hash_size); } - ~super_atomizer() = default; + ~super_atomizer() = default; ui32 string_to_atom(const char* key, const T* atom_data = NULL) { const char* old_begin = pool.Begin(); const char* old_end = pool.End(); @@ -169,7 +169,7 @@ public: const char* get_atom_name(ui32 atom) const { if (atom && atom <= size()) return order[atom - 1].first; - return nullptr; + return nullptr; } const T* get_atom_data(ui32 atom) const { if (atom && atom <= size()) diff --git a/library/cpp/containers/bitseq/bitvector.h b/library/cpp/containers/bitseq/bitvector.h index 3f8fd81ee5..d7d8db4268 100644 --- a/library/cpp/containers/bitseq/bitvector.h +++ b/library/cpp/containers/bitseq/bitvector.h @@ -34,7 +34,7 @@ public: { } - virtual ~TBitVector() = default; + virtual ~TBitVector() = default; void Clear() { Size_ = 0; diff --git a/library/cpp/containers/compact_vector/compact_vector.h b/library/cpp/containers/compact_vector/compact_vector.h index dbe7473f0c..95f1255815 100644 --- a/library/cpp/containers/compact_vector/compact_vector.h +++ b/library/cpp/containers/compact_vector/compact_vector.h @@ -39,12 +39,12 @@ public: typedef TConstIterator const_iterator; TCompactVector() - : Ptr(nullptr) + : Ptr(nullptr) { } TCompactVector(const TThis& that) - : Ptr(nullptr) + : Ptr(nullptr) { Reserve(that.Size()); for (TConstIterator i = that.Begin(); i != that.End(); ++i) { @@ -101,9 +101,9 @@ public: void Reserve(size_t newCapacity) { if (newCapacity <= Capacity()) { - } else if (Ptr == nullptr) { + } else if (Ptr == nullptr) { void* mem = ::malloc(sizeof(THeader) + newCapacity * sizeof(T)); - if (mem == nullptr) + if (mem == nullptr) ythrow yexception() << "out of memory"; Ptr = (T*)(((THeader*)mem) + 1); Header()->Size = 0; diff --git a/library/cpp/containers/comptrie/chunked_helpers_trie.h b/library/cpp/containers/comptrie/chunked_helpers_trie.h index cfa35f5ba2..4b925042a1 100644 --- a/library/cpp/containers/comptrie/chunked_helpers_trie.h +++ b/library/cpp/containers/comptrie/chunked_helpers_trie.h @@ -185,7 +185,7 @@ private: TValues Values; public: - TTrieSortedMapWriter() = default; + TTrieSortedMapWriter() = default; void Add(const char* key, const T& value) { Values.push_back(TValue(key, value)); diff --git a/library/cpp/containers/comptrie/comptrie_builder.inl b/library/cpp/containers/comptrie/comptrie_builder.inl index f273fa6571..35afea402b 100644 --- a/library/cpp/containers/comptrie/comptrie_builder.inl +++ b/library/cpp/containers/comptrie/comptrie_builder.inl @@ -115,7 +115,7 @@ public: typedef typename TBuilderImpl::TArc TArc; struct ISubtree { - virtual ~ISubtree() = default; + virtual ~ISubtree() = default; virtual bool IsLast() const = 0; virtual ui64 Measure(const TBuilderImpl* builder) const = 0; virtual ui64 Save(const TBuilderImpl* builder, IOutputStream& os) const = 0; @@ -146,8 +146,8 @@ public: return this->Empty(); } - const TNode* Find(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override; - const TNode* FindLongestPrefix(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override { + const TNode* Find(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override; + const TNode* FindLongestPrefix(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override { return Find(key, value, result, packer); } @@ -208,7 +208,7 @@ public: this->clear(); } - ~TArcSet() override { + ~TArcSet() override { Y_ASSERT(this->empty()); } @@ -225,7 +225,7 @@ public: return Buffer.Empty(); } - const TNode* Find(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override { + const TNode* Find(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override { if (Buffer.Empty()) { result = false; return nullptr; @@ -237,7 +237,7 @@ public: return nullptr; } - const TNode* FindLongestPrefix(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override { + const TNode* FindLongestPrefix(TStringBuf& key, TData* value, bool& result, const TPacker& packer) const override { if (Buffer.Empty()) { result = false; return nullptr; @@ -291,7 +291,7 @@ public: return Data->Size == 0; } - const TNode* Find(TStringBuf& key, typename TCompactTrieBuilder::TData* value, bool& result, const TPacker& packer) const override { + const TNode* Find(TStringBuf& key, typename TCompactTrieBuilder::TData* value, bool& result, const TPacker& packer) const override { if (!Data) { result = false; return nullptr; @@ -302,7 +302,7 @@ public: return nullptr; } - const TNode* FindLongestPrefix(TStringBuf& key, typename TCompactTrieBuilder::TData* value, bool& result, const TPacker& packer) const override { + const TNode* FindLongestPrefix(TStringBuf& key, typename TCompactTrieBuilder::TData* value, bool& result, const TPacker& packer) const override { if (!Data) { result = false; return nullptr; @@ -622,7 +622,7 @@ typename TCompactTrieBuilder<T, D, S>::TCompactTrieBuilderImpl::TNode* char* ckey = ckeybuf.Data(); TNode* next; - while ((ckeylen > 0) && (next = NodeForwardAdd(current, ckey, ckeylen, passed, &NodeCount)) != nullptr) { + while ((ckeylen > 0) && (next = NodeForwardAdd(current, ckey, ckeylen, passed, &NodeCount)) != nullptr) { current = next; ckeylen -= passed; ckey += passed; @@ -807,7 +807,7 @@ typename TCompactTrieBuilder<T, D, S>::TCompactTrieBuilderImpl::TNode* return it->Node; } - return nullptr; + return nullptr; } template <class T, class D, class S> diff --git a/library/cpp/containers/comptrie/comptrie_impl.h b/library/cpp/containers/comptrie/comptrie_impl.h index f41c38311a..b2fdba0931 100644 --- a/library/cpp/containers/comptrie/comptrie_impl.h +++ b/library/cpp/containers/comptrie/comptrie_impl.h @@ -172,7 +172,7 @@ namespace NCompactTrie { } // if we got here, we're past the dataend - bail out ASAP - datapos = nullptr; + datapos = nullptr; return 0; } diff --git a/library/cpp/containers/comptrie/comptrie_trie.h b/library/cpp/containers/comptrie/comptrie_trie.h index 40ec1e52b3..5a6811f8a1 100644 --- a/library/cpp/containers/comptrie/comptrie_trie.h +++ b/library/cpp/containers/comptrie/comptrie_trie.h @@ -52,7 +52,7 @@ protected: NCompactTrie::TPackerLeafSkipper<TPacker> Skipper = &Packer; // This should be true for every constructor. public: - TCompactTrie() = default; + TCompactTrie() = default; TCompactTrie(const char* d, size_t len, TPacker packer); TCompactTrie(const char* d, size_t len) @@ -150,7 +150,7 @@ public: TConstIterator(const TOpaqueTrie& trie, const char* emptyValue, const TKeyBuf& key, TPacker packer); // only usable from UpperBound() method public: - TConstIterator() = default; + TConstIterator() = default; bool IsEmpty() const { return !Impl; } // Almost no other method can be called. diff --git a/library/cpp/containers/comptrie/leaf_skipper.h b/library/cpp/containers/comptrie/leaf_skipper.h index 3959258948..2136b8d59a 100644 --- a/library/cpp/containers/comptrie/leaf_skipper.h +++ b/library/cpp/containers/comptrie/leaf_skipper.h @@ -6,7 +6,7 @@ namespace NCompactTrie { class ILeafSkipper { public: virtual size_t SkipLeaf(const char* p) const = 0; - virtual ~ILeafSkipper() = default; + virtual ~ILeafSkipper() = default; }; template <class TPacker> @@ -20,7 +20,7 @@ namespace NCompactTrie { { } - size_t SkipLeaf(const char* p) const override { + size_t SkipLeaf(const char* p) const override { return Packer->SkipLeaf(p); } diff --git a/library/cpp/containers/comptrie/protopacker.h b/library/cpp/containers/comptrie/protopacker.h index 3e15866dc5..b5f82c17b1 100644 --- a/library/cpp/containers/comptrie/protopacker.h +++ b/library/cpp/containers/comptrie/protopacker.h @@ -6,7 +6,7 @@ template <class Proto> class TProtoPacker { public: - TProtoPacker() = default; + TProtoPacker() = default; void UnpackLeaf(const char* p, Proto& entry) const { TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32)); diff --git a/library/cpp/containers/comptrie/set.h b/library/cpp/containers/comptrie/set.h index acd43338f0..92c378b780 100644 --- a/library/cpp/containers/comptrie/set.h +++ b/library/cpp/containers/comptrie/set.h @@ -12,7 +12,7 @@ public: using typename TBase::TKeyBuf; using typename TBase::TSymbol; - TCompactTrieSet() = default; + TCompactTrieSet() = default; explicit TCompactTrieSet(const TBlob& data) : TBase(data) diff --git a/library/cpp/containers/comptrie/write_trie_backwards.h b/library/cpp/containers/comptrie/write_trie_backwards.h index 634e6b811a..d50d45159e 100644 --- a/library/cpp/containers/comptrie/write_trie_backwards.h +++ b/library/cpp/containers/comptrie/write_trie_backwards.h @@ -9,7 +9,7 @@ namespace NCompactTrie { class TReverseNodeEnumerator { public: - virtual ~TReverseNodeEnumerator() = default; + virtual ~TReverseNodeEnumerator() = default; virtual bool Move() = 0; virtual size_t GetLeafLength() const = 0; virtual size_t RecreateNode(char* buffer, size_t resultLength) = 0; diff --git a/library/cpp/containers/intrusive_rb_tree/rb_tree.h b/library/cpp/containers/intrusive_rb_tree/rb_tree.h index 0259452a14..1ac2c9d62d 100644 --- a/library/cpp/containers/intrusive_rb_tree/rb_tree.h +++ b/library/cpp/containers/intrusive_rb_tree/rb_tree.h @@ -95,7 +95,7 @@ struct TRbTreeIterator: public TRbTreeBaseIterator { using TSelf = TRbTreeIterator<TValue, TTraits>; using TBasePtr = TRbTreeNodeBase*; - inline TRbTreeIterator() noexcept = default; + inline TRbTreeIterator() noexcept = default; template <class T1> inline TRbTreeIterator(const T1& x) noexcept @@ -147,7 +147,7 @@ struct TRbTreeIterator: public TRbTreeBaseIterator { template <class TValue, class TCmp> class TRbTree { struct TCmpAdaptor: public TCmp { - inline TCmpAdaptor() noexcept = default; + inline TCmpAdaptor() noexcept = default; inline TCmpAdaptor(const TCmp& cmp) noexcept : TCmp(cmp) diff --git a/library/cpp/coroutine/engine/coroutine_ut.cpp b/library/cpp/coroutine/engine/coroutine_ut.cpp index 8b372496a2..7d1705b8f3 100644 --- a/library/cpp/coroutine/engine/coroutine_ut.cpp +++ b/library/cpp/coroutine/engine/coroutine_ut.cpp @@ -139,7 +139,7 @@ static void CoRun(TCont* c, void* /*run*/) { static void CoMain(TCont* c, void* /*arg*/) { for (volatile size_t i2 = 0; i2 < 10; ++i2) { UNIT_ASSERT(RunningCont() == c); - c->Executor()->Create(CoRun, nullptr, "run"); + c->Executor()->Create(CoRun, nullptr, "run"); UNIT_ASSERT(RunningCont() == c); } } @@ -274,8 +274,8 @@ static void CoMutex(TCont* c, void* /*run*/) { } static void CoMutexTest(TCont* c, void* /*run*/) { - c->Executor()->Create(CoMutex, nullptr, "1"); - c->Executor()->Create(CoMutex, nullptr, "2"); + c->Executor()->Create(CoMutex, nullptr, "1"); + c->Executor()->Create(CoMutex, nullptr, "2"); } void TCoroTest::TestMutex() { @@ -298,17 +298,17 @@ static void CoCondVar(TCont* c, void* /*run*/) { } static void CoCondVarTest(TCont* c, void* /*run*/) { - c->Executor()->Create(CoCondVar, nullptr, "1"); + c->Executor()->Create(CoCondVar, nullptr, "1"); c->Yield(); - c->Executor()->Create(CoCondVar, nullptr, "2"); + c->Executor()->Create(CoCondVar, nullptr, "2"); c->Yield(); - c->Executor()->Create(CoCondVar, nullptr, "3"); + c->Executor()->Create(CoCondVar, nullptr, "3"); c->Yield(); - c->Executor()->Create(CoCondVar, nullptr, "4"); + c->Executor()->Create(CoCondVar, nullptr, "4"); c->Yield(); - c->Executor()->Create(CoCondVar, nullptr, "5"); + c->Executor()->Create(CoCondVar, nullptr, "5"); c->Yield(); - c->Executor()->Create(CoCondVar, nullptr, "6"); + c->Executor()->Create(CoCondVar, nullptr, "6"); c->Yield(); for (size_t i5 = 0; i5 < 3; ++i5) { diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp index 61164fa56b..e0b893be11 100644 --- a/library/cpp/coroutine/engine/poller.cpp +++ b/library/cpp/coroutine/engine/poller.cpp @@ -51,11 +51,11 @@ namespace { { } - void Set(const TChange& c) override { + void Set(const TChange& c) override { P_.Set(c); } - void Wait(TEvents& events, TInstant deadLine) override { + void Wait(TEvents& events, TInstant deadLine) override { P_.Wait(events, deadLine); } diff --git a/library/cpp/coroutine/engine/sockpool.h b/library/cpp/coroutine/engine/sockpool.h index 1ebb7e7b38..3365b1a4b6 100644 --- a/library/cpp/coroutine/engine/sockpool.h +++ b/library/cpp/coroutine/engine/sockpool.h @@ -7,7 +7,7 @@ #include <util/network/socket.h> #include <util/system/mutex.h> -extern void SetCommonSockOpts(SOCKET sock, const struct sockaddr* sa = nullptr); +extern void SetCommonSockOpts(SOCKET sock, const struct sockaddr* sa = nullptr); class TSocketPool; @@ -90,7 +90,7 @@ class TPooledSocket { public: TPooledSocket() - : Impl_(nullptr) + : Impl_(nullptr) { } @@ -204,7 +204,7 @@ private: return ret.Release(); } } - return nullptr; + return nullptr; } void Release(TPooledSocket::TImpl* impl) noexcept { @@ -235,11 +235,11 @@ public: { } - void DoWrite(const void* buf, size_t len) override { + void DoWrite(const void* buf, size_t len) override { NCoro::WriteI(Cont_, Fd_, buf, len).Checked(); } - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { return NCoro::ReadI(Cont_, Fd_, buf, len).Checked(); } diff --git a/library/cpp/coroutine/listener/listen.cpp b/library/cpp/coroutine/listener/listen.cpp index 3d4e711d1d..90f8003a85 100644 --- a/library/cpp/coroutine/listener/listen.cpp +++ b/library/cpp/coroutine/listener/listen.cpp @@ -55,7 +55,7 @@ private: public: inline TOneSocketListener(TImpl* parent, IRemoteAddrPtr addr) : Parent_(parent) - , C_(nullptr) + , C_(nullptr) , ListenSocket_(socket(addr->Addr()->sa_family, SOCK_STREAM, 0)) , Addr_(std::move(addr)) { @@ -92,7 +92,7 @@ private: inline void Run(TCont* cont) noexcept { C_ = cont; DoRun(); - C_ = nullptr; + C_ = nullptr; } inline void StartListen() { diff --git a/library/cpp/deprecated/kmp/kmp.h b/library/cpp/deprecated/kmp/kmp.h index a7f72eece6..84411c71ec 100644 --- a/library/cpp/deprecated/kmp/kmp.h +++ b/library/cpp/deprecated/kmp/kmp.h @@ -64,7 +64,7 @@ public: class ICallback { public: virtual void OnMatch(const T* begin, const T* end) = 0; - virtual ~ICallback() = default; + virtual ~ICallback() = default; }; private: diff --git a/library/cpp/deprecated/kmp/kmp_ut.cpp b/library/cpp/deprecated/kmp/kmp_ut.cpp index c2eda83c57..88226e2329 100644 --- a/library/cpp/deprecated/kmp/kmp_ut.cpp +++ b/library/cpp/deprecated/kmp/kmp_ut.cpp @@ -49,7 +49,7 @@ public: { } - void OnMatch(const int* begin, const int* end) override { + void OnMatch(const int* begin, const int* end) override { UNIT_ASSERT_EQUAL(end - begin, End - Begin); const int* p0 = Begin; const int* p1 = begin; diff --git a/library/cpp/deprecated/mapped_file/mapped_file.h b/library/cpp/deprecated/mapped_file/mapped_file.h index 45859ed65a..865aafe21d 100644 --- a/library/cpp/deprecated/mapped_file/mapped_file.h +++ b/library/cpp/deprecated/mapped_file/mapped_file.h @@ -61,7 +61,7 @@ public: void* getData(size_t pos = 0) const { Y_ASSERT(!Map_ || (pos <= getSize())); - return (Map_ ? (void*)((unsigned char*)Map_->Ptr() + pos) : nullptr); + return (Map_ ? (void*)((unsigned char*)Map_->Ptr() + pos) : nullptr); } void precharge(size_t pos = 0, size_t size = (size_t)-1) const; diff --git a/library/cpp/deprecated/split/split_iterator.h b/library/cpp/deprecated/split/split_iterator.h index 0eacc29228..fe05c32cb8 100644 --- a/library/cpp/deprecated/split/split_iterator.h +++ b/library/cpp/deprecated/split/split_iterator.h @@ -19,7 +19,7 @@ struct TNumPair { T Begin; T End; - TNumPair() = default; + TNumPair() = default; TNumPair(T begin, T end) : Begin(begin) diff --git a/library/cpp/deprecated/ya.make b/library/cpp/deprecated/ya.make index 6c753f68a9..e63707aaf0 100644 --- a/library/cpp/deprecated/ya.make +++ b/library/cpp/deprecated/ya.make @@ -33,9 +33,9 @@ RECURSE( sgi_hash threadable transgene - datawork - datawork/conf - calc_module + datawork + datawork/conf + calc_module iterators_heap parse_utils parse_utils/ut diff --git a/library/cpp/diff/diff.h b/library/cpp/diff/diff.h index 94fb00cd0b..f0f42fcf9c 100644 --- a/library/cpp/diff/diff.h +++ b/library/cpp/diff/diff.h @@ -16,7 +16,7 @@ namespace NDiff { TConstArrayRef<T> Right; TConstArrayRef<T> Common; - TChunk() = default; + TChunk() = default; TChunk(const TConstArrayRef<T>& left, const TConstArrayRef<T>& right, const TConstArrayRef<T>& common) : Left(left) diff --git a/library/cpp/digest/md5/md5.cpp b/library/cpp/digest/md5/md5.cpp index 24a5b69eef..a4f7f09e2c 100644 --- a/library/cpp/digest/md5/md5.cpp +++ b/library/cpp/digest/md5/md5.cpp @@ -20,7 +20,7 @@ namespace { { } - void DoWrite(const void* buf, size_t len) override { + void DoWrite(const void* buf, size_t len) override { M_->Update(buf, len); } diff --git a/library/cpp/dns/cache.cpp b/library/cpp/dns/cache.cpp index 05c14e82fc..968d9af0e8 100644 --- a/library/cpp/dns/cache.cpp +++ b/library/cpp/dns/cache.cpp @@ -30,7 +30,7 @@ namespace { class IDns { public: - virtual ~IDns() = default; + virtual ~IDns() = default; virtual const TResolvedHost* Resolve(const TResolveTask&) = 0; }; @@ -50,7 +50,7 @@ namespace { class TGlobalCachedDns: public IDns, public TNonCopyable { public: - const TResolvedHost* Resolve(const TResolveTask& rt) override { + const TResolvedHost* Resolve(const TResolveTask& rt) override { //2. search host in cache { TReadGuard guard(L_); @@ -144,7 +144,7 @@ namespace { { } - const TResolvedHost* Resolve(const TResolveTask& rt) override { + const TResolvedHost* Resolve(const TResolveTask& rt) override { //1. search in local thread cache { TCache::const_iterator it = C_.find(rt.Info); diff --git a/library/cpp/dns/magic.cpp b/library/cpp/dns/magic.cpp index b93792146f..1f75afdd21 100644 --- a/library/cpp/dns/magic.cpp +++ b/library/cpp/dns/magic.cpp @@ -12,7 +12,7 @@ namespace { { } - void Raise() override { + void Raise() override { std::rethrow_exception(E_); } diff --git a/library/cpp/dns/magic.h b/library/cpp/dns/magic.h index d52cde0a6c..c0d1db340d 100644 --- a/library/cpp/dns/magic.h +++ b/library/cpp/dns/magic.h @@ -6,7 +6,7 @@ namespace NDns { class IError { public: - virtual ~IError() = default; + virtual ~IError() = default; virtual void Raise() = 0; }; diff --git a/library/cpp/dns/thread.cpp b/library/cpp/dns/thread.cpp index 8b27d2d527..8f51a4f56a 100644 --- a/library/cpp/dns/thread.cpp +++ b/library/cpp/dns/thread.cpp @@ -65,14 +65,14 @@ namespace { } inline ~TThreadedResolver() override { - Schedule(nullptr); + Schedule(nullptr); for (size_t i = 0; i < T_.size(); ++i) { T_[i]->Join(); } { - TResolveRequest* rr = nullptr; + TResolveRequest* rr = nullptr; while (Q_.Dequeue(&rr)) { if (rr) { @@ -100,9 +100,9 @@ namespace { E_.Signal(); } - void DoExecute() override { + void DoExecute() override { while (true) { - TResolveRequest* rr = nullptr; + TResolveRequest* rr = nullptr; while (!Q_.Dequeue(&rr)) { E_.Wait(); @@ -115,7 +115,7 @@ namespace { } } - Schedule(nullptr); + Schedule(nullptr); } private: diff --git a/library/cpp/execprofile/profile.cpp b/library/cpp/execprofile/profile.cpp index d05de20203..36daf74cd2 100644 --- a/library/cpp/execprofile/profile.cpp +++ b/library/cpp/execprofile/profile.cpp @@ -38,7 +38,7 @@ public: // NOTE: There is no synchronization here as the instance is supposed to be // created on the main thread. static TExecutionSampler* Instance() { - if (SInstance == nullptr) { + if (SInstance == nullptr) { SInstance = new TExecutionSampler(); } @@ -66,21 +66,21 @@ public: void Stop(TSampleVector& sampleVector, TStats& stats) { // Reset signal handler and timer if (Started) { - setitimer(ITIMER_PROF, &OldTimerValue, nullptr); + setitimer(ITIMER_PROF, &OldTimerValue, nullptr); sleep(1); } WaitForWriteFlag(); if (Started) { - sigaction(SIGPROF, &OldSignalHandler, nullptr); + sigaction(SIGPROF, &OldSignalHandler, nullptr); Started = false; } TExecutionSampler::TSampleVector hits; hits.reserve(Samples); for (size_t i = 0; i < SZ; ++i) { - if (Ips[i].first != nullptr) { + if (Ips[i].first != nullptr) { hits.push_back(Ips[i]); } } @@ -122,7 +122,7 @@ private: { } - ~TExecutionSampler() = default; + ~TExecutionSampler() = default; // Signal handler is not allowed to do anything that can deadlock with activity // on the thread to which the signal is delivered or corrupt data structures that @@ -232,7 +232,7 @@ private: } inline bool IsSlotEmpty(ui32 slot) const { - return Ips[slot].first == nullptr; + return Ips[slot].first == nullptr; } inline bool InsertsAllowed() const { @@ -244,7 +244,7 @@ private: Y_ASSERT(WriteFlag == 1); for (size_t i = 0; i < SZ; ++i) { - Ips[i] = std::make_pair((void*)nullptr, (size_t)0); + Ips[i] = std::make_pair((void*)nullptr, (size_t)0); } Samples = 0; AtomicSet(DroppedSamples, 0); @@ -282,7 +282,7 @@ public: Samples.swap(samples); } - ~TSampleAnalyser() = default; + ~TSampleAnalyser() = default; void Analyze(FILE* out) const; @@ -329,7 +329,7 @@ void TSampleAnalyser::Analyze(FILE* out) const { } } -TExecutionSampler* TExecutionSampler::SInstance = nullptr; +TExecutionSampler* TExecutionSampler::SInstance = nullptr; // Starts capturing execution samples void BeginProfiling() { diff --git a/library/cpp/getopt/small/last_getopt.h b/library/cpp/getopt/small/last_getopt.h index 07687bc914..916cbf3818 100644 --- a/library/cpp/getopt/small/last_getopt.h +++ b/library/cpp/getopt/small/last_getopt.h @@ -30,7 +30,7 @@ namespace NLastGetopt { { } - void HandleOpt(const TOptsParser* parser) override { + void HandleOpt(const TOptsParser* parser) override { const TStringBuf curval(parser->CurValOrDef()); if (curval.IsInited()) { StringSplitter(curval).Split(ElementsDelim).Consume([&](const TStringBuf& val) { @@ -68,7 +68,7 @@ namespace NLastGetopt { { } - void HandleOpt(const TOptsParser* parser) override { + void HandleOpt(const TOptsParser* parser) override { const TStringBuf curval(parser->CurValOrDef()); if (curval.IsInited()) { StringSplitter(curval).Split(Delim).Consume([&](const TStringBuf& val) { diff --git a/library/cpp/getopt/small/last_getopt_parser.cpp b/library/cpp/getopt/small/last_getopt_parser.cpp index 7668b12a03..1fccbcaf60 100644 --- a/library/cpp/getopt/small/last_getopt_parser.cpp +++ b/library/cpp/getopt/small/last_getopt_parser.cpp @@ -182,7 +182,7 @@ namespace NLastGetopt { if (!arg.StartsWith('-') || opt->GetHasArg() == REQUIRED_ARGUMENT) { return Commit(opt, arg, pos + 1, 0); } - return Commit(opt, nullptr, pos, 0); + return Commit(opt, nullptr, pos, 0); } TOptsParser::EIsOpt TOptsParser::IsOpt(const TStringBuf& arg) const { diff --git a/library/cpp/getopt/small/modchooser.cpp b/library/cpp/getopt/small/modchooser.cpp index 2fa5cfd070..f4919a24f0 100644 --- a/library/cpp/getopt/small/modchooser.cpp +++ b/library/cpp/getopt/small/modchooser.cpp @@ -71,14 +71,14 @@ TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString& TModChooser::TModChooser() : ModesHelpOption("-?") // Default help option in last_getopt - , VersionHandler(nullptr) + , VersionHandler(nullptr) , ShowSeparated(true) , SvnRevisionOptionDisabled(false) , PrintShortCommandInUsage(false) { } -TModChooser::~TModChooser() = default; +TModChooser::~TModChooser() = default; void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) { AddMode(mode, TMainFunctionPtr(func), description, hidden, noCompletion); diff --git a/library/cpp/getopt/small/modchooser.h b/library/cpp/getopt/small/modchooser.h index 0a8de6d50b..7a2a2d6f61 100644 --- a/library/cpp/getopt/small/modchooser.h +++ b/library/cpp/getopt/small/modchooser.h @@ -20,14 +20,14 @@ using TMainFunctionRawPtr = int (*)(const int argc, const char** argv); class TMainClassV { public: virtual int operator()(const TVector<TString>& argv) = 0; - virtual ~TMainClassV() = default; + virtual ~TMainClassV() = default; }; //! Mode class with classic argc and argv arguments. class TMainClass { public: virtual int operator()(int argc, const char** argv) = 0; - virtual ~TMainClass() = default; + virtual ~TMainClass() = default; }; //! Function to handle '--version' parameter @@ -111,7 +111,7 @@ public: TVector<TString> Aliases; TMode() - : Main(nullptr) + : Main(nullptr) { } diff --git a/library/cpp/getopt/small/opt.cpp b/library/cpp/getopt/small/opt.cpp index 744501765c..d6bb60ea38 100644 --- a/library/cpp/getopt/small/opt.cpp +++ b/library/cpp/getopt/small/opt.cpp @@ -23,7 +23,7 @@ void Opt::Init(int argc, char* argv[], const char* optString, const Ion* longOpt Ind = argc; Opts_.Reset(new TOptsNoDefault(optString)); - for (const Ion* o = longOptions; o != nullptr && o->name != nullptr; ++o) { + for (const Ion* o = longOptions; o != nullptr && o->name != nullptr; ++o) { TOpt* opt; if ((unsigned)o->val < 0x80 && isalnum(o->val)) { opt = &Opts_->CharOption(char(o->val)); @@ -52,14 +52,14 @@ Opt::Opt(int argc, const char* argv[], const char* optString, const Ion* longOpt } int Opt::Get() { - return Get(nullptr); + return Get(nullptr); } int Opt::Get(int* longOptionIndex) { if (GotError_) return EOF; - Arg = nullptr; + Arg = nullptr; try { bool r = OptsParser_->Next(); diff --git a/library/cpp/getopt/small/opt.h b/library/cpp/getopt/small/opt.h index ecb57439bc..0bc624e8c4 100644 --- a/library/cpp/getopt/small/opt.h +++ b/library/cpp/getopt/small/opt.h @@ -76,11 +76,11 @@ private: const Ion* Ions_; bool GotError_; - void Init(int argc, char* argv[], const char* optString, const Ion* longOptions = nullptr, bool longOnly = false, bool isOpen = false); + void Init(int argc, char* argv[], const char* optString, const Ion* longOptions = nullptr, bool longOnly = false, bool isOpen = false); public: - Opt(int argc, char* argv[], const char* optString, const Ion* longOptions = nullptr, bool longOnly = false, bool isOpen = false); - Opt(int argc, const char* argv[], const char* optString, const Ion* longOptions = nullptr, bool longOnly = false, bool isOpen = false); + Opt(int argc, char* argv[], const char* optString, const Ion* longOptions = nullptr, bool longOnly = false, bool isOpen = false); + Opt(int argc, const char* argv[], const char* optString, const Ion* longOptions = nullptr, bool longOnly = false, bool isOpen = false); // Get() means next int Get(); diff --git a/library/cpp/getopt/small/opt2.cpp b/library/cpp/getopt/small/opt2.cpp index 0cdc774e78..2af0f89648 100644 --- a/library/cpp/getopt/small/opt2.cpp +++ b/library/cpp/getopt/small/opt2.cpp @@ -20,7 +20,7 @@ void Opt2::Init(int argc, char* const* argv, const char* optspec, IntRange free_ Argc = argc; Argv = argv; HasErrors = false, BadPosCount = false, UnknownOption = 0, OptionMissingArg = 0; - UnknownLongOption = nullptr; + UnknownLongOption = nullptr; OptionWrongArg = 0, RequiredOptionMissing = 0; EatArgv(optspec, long_alias); MinArgs = Min<int>(free_args_num.Left, free_args_num.Right); @@ -292,7 +292,7 @@ int Opt2::AutoUsage(const char* free_arg_names) { if (UnknownLongOption) { fprintf(where, " *** Unknown long option '%s'\n", UnknownLongOption); free(UnknownLongOption); - UnknownLongOption = nullptr; + UnknownLongOption = nullptr; } if (RequiredOptionMissing) fprintf(where, " *** Required option '%c' missing\n", RequiredOptionMissing); diff --git a/library/cpp/getopt/small/opt2.h b/library/cpp/getopt/small/opt2.h index 4d9d943237..8d03ce4e5b 100644 --- a/library/cpp/getopt/small/opt2.h +++ b/library/cpp/getopt/small/opt2.h @@ -85,7 +85,7 @@ public: // For options with parameters const char* Arg(char opt, const char* helpUsage, const char* defValue, bool required = false); const char* Arg(char opt, const char* helpUsage) { - return Arg(opt, helpUsage, nullptr, true); + return Arg(opt, helpUsage, nullptr, true); } const char* Arg(char opt, const char* helpUsage, TString defValue, bool required = false); @@ -108,7 +108,7 @@ public: bool Has(char opt, const char* helpUsage); // Add user defined error message and set error flag - void AddError(const char* message = nullptr); + void AddError(const char* message = nullptr); public: // non-option args diff --git a/library/cpp/getopt/small/posix_getopt.cpp b/library/cpp/getopt/small/posix_getopt.cpp index bd06f3499f..a2f073bdd4 100644 --- a/library/cpp/getopt/small/posix_getopt.cpp +++ b/library/cpp/getopt/small/posix_getopt.cpp @@ -17,7 +17,7 @@ namespace NLastGetopt { int getopt_long_impl(int argc, char* const* argv, const char* optstring, const struct option* longopts, int* longindex, bool long_only) { if (!Opts || optreset == 1) { - optarg = nullptr; + optarg = nullptr; optind = 1; opterr = 1; optreset = 0; @@ -25,7 +25,7 @@ namespace NLastGetopt { Opts->AllowSingleDashForLong_ = long_only; - for (const struct option* o = longopts; o != nullptr && o->name != nullptr; ++o) { + for (const struct option* o = longopts; o != nullptr && o->name != nullptr; ++o) { TOpt* opt; if ((unsigned)o->val < 0x80 && isalnum(o->val)) { opt = &Opts->CharOption(char(o->val)); @@ -41,7 +41,7 @@ namespace NLastGetopt { OptsParser.Reset(new TOptsParser(&*Opts, argc, (const char**)argv)); } - optarg = nullptr; + optarg = nullptr; try { if (!OptsParser->Next()) { @@ -71,7 +71,7 @@ namespace NLastGetopt { // XXX: leading colon is not supported // XXX: updating optind by client is not supported int getopt(int argc, char* const* argv, const char* optstring) { - return getopt_long(argc, argv, optstring, nullptr, nullptr); + return getopt_long(argc, argv, optstring, nullptr, nullptr); } } diff --git a/library/cpp/getopt/small/ygetopt.cpp b/library/cpp/getopt/small/ygetopt.cpp index 1f52827f74..2f55c73e8e 100644 --- a/library/cpp/getopt/small/ygetopt.cpp +++ b/library/cpp/getopt/small/ygetopt.cpp @@ -68,7 +68,7 @@ private: }; TGetOpt::TIterator::TIterator() noexcept - : Impl_(nullptr) + : Impl_(nullptr) { } @@ -99,7 +99,7 @@ const char* TGetOpt::TIterator::Arg() const noexcept { return Impl_->Arg(); } - return nullptr; + return nullptr; } TGetOpt::TGetOpt(int argc, const char* const* argv, const TString& format) diff --git a/library/cpp/getopt/ut/posix_getopt_ut.cpp b/library/cpp/getopt/ut/posix_getopt_ut.cpp index b6d374bf28..50e1f944de 100644 --- a/library/cpp/getopt/ut/posix_getopt_ut.cpp +++ b/library/cpp/getopt/ut/posix_getopt_ut.cpp @@ -39,12 +39,12 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { NLastGetopt::optreset = 1; UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, &longIndex)); UNIT_ASSERT_VALUES_EQUAL(0, longIndex); - UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, &longIndex)); UNIT_ASSERT_VALUES_EQUAL(1, longIndex); - UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL(0, NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL(0, NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); UNIT_ASSERT_VALUES_EQUAL(6, NLastGetopt::optind); } @@ -63,9 +63,9 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { char** const argv = (char**)argv0; NLastGetopt::optreset = 1; - UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('b', NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt_long(argc, argv, "bf:", longopts, nullptr)); UNIT_ASSERT_VALUES_EQUAL(3, NLastGetopt::optind); } @@ -81,7 +81,7 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { char** const argv = (char**)argv0; NLastGetopt::optreset = 1; - UNIT_ASSERT_VALUES_EQUAL('?', NLastGetopt::getopt_long(argc, argv, "bf", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('?', NLastGetopt::getopt_long(argc, argv, "bf", longopts, nullptr)); } Y_UNIT_TEST(TestLongOnly) { @@ -96,10 +96,10 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { char** const argv = (char**)argv0; NLastGetopt::optreset = 1; - UNIT_ASSERT_VALUES_EQUAL('F', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL('F', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); - UNIT_ASSERT_VALUES_EQUAL('o', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('F', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('F', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('f', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('o', NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); UNIT_ASSERT_VALUES_EQUAL(-1, NLastGetopt::getopt_long_only(argc, argv, "fo", longopts, nullptr)); } @@ -114,6 +114,6 @@ Y_UNIT_TEST_SUITE(TPosixGetoptTest) { char** const argv = (char**)argv0; NLastGetopt::optreset = 1; - UNIT_ASSERT_VALUES_EQUAL('?', NLastGetopt::getopt_long(argc, argv, "z", longopts, nullptr)); + UNIT_ASSERT_VALUES_EQUAL('?', NLastGetopt::getopt_long(argc, argv, "z", longopts, nullptr)); } } diff --git a/library/cpp/getopt/ut/ygetopt_ut.cpp b/library/cpp/getopt/ut/ygetopt_ut.cpp index a76f117216..b9b259c4fb 100644 --- a/library/cpp/getopt/ut/ygetopt_ut.cpp +++ b/library/cpp/getopt/ut/ygetopt_ut.cpp @@ -16,7 +16,7 @@ public: UNIT_TEST_SUITE_REGISTRATION(TGetOptTest); void TGetOptTest::TestZeroArgC() { - TGetOpt opt(0, nullptr, ""); + TGetOpt opt(0, nullptr, ""); } void TGetOptTest::TestGetOpt() { diff --git a/library/cpp/histogram/adaptive/adaptive_histogram.cpp b/library/cpp/histogram/adaptive/adaptive_histogram.cpp index cbfc494021..afb643e5a2 100644 --- a/library/cpp/histogram/adaptive/adaptive_histogram.cpp +++ b/library/cpp/histogram/adaptive/adaptive_histogram.cpp @@ -37,7 +37,7 @@ namespace NKiwiAggr { Intervals = adaptiveHisto->Intervals; Bins = adaptiveHisto->Bins; BinsByQuality = adaptiveHisto->BinsByQuality; - if (CalcQuality == nullptr) { + if (CalcQuality == nullptr) { CalcQuality = adaptiveHisto->CalcQuality; } } @@ -188,7 +188,7 @@ namespace NKiwiAggr { case HT_ADAPTIVE_WARD_HISTOGRAM: break; // ok case HT_ADAPTIVE_HISTOGRAM: - if (CalcQuality != nullptr) + if (CalcQuality != nullptr) break; // ok [[fallthrough]]; default: // not ok @@ -198,7 +198,7 @@ namespace NKiwiAggr { if (histo.FreqSize() != histo.PositionSize()) { ythrow yexception() << "Attempt to parse TAdaptiveHistogram from THistogram protobuf record where FreqSize != PositionSize. FreqSize == " << (ui32)histo.FreqSize() << ", PositionSize == " << (ui32)histo.PositionSize(); } - if (CalcQuality == nullptr) { + if (CalcQuality == nullptr) { if (histo.GetType() == HT_ADAPTIVE_DISTANCE_HISTOGRAM) { CalcQuality = CalcDistanceQuality; } else if (histo.GetType() == HT_ADAPTIVE_WEIGHT_HISTOGRAM) { diff --git a/library/cpp/http/fetch/http_digest.cpp b/library/cpp/http/fetch/http_digest.cpp index 1eaa02b7f2..b6d3320804 100644 --- a/library/cpp/http/fetch/http_digest.cpp +++ b/library/cpp/http/fetch/http_digest.cpp @@ -27,8 +27,8 @@ httpDigestHandler::~httpDigestHandler() { void httpDigestHandler::clear() { free(Nonce_); free(HeaderInstruction_); - User_ = Password_ = nullptr; - Nonce_ = HeaderInstruction_ = nullptr; + User_ = Password_ = nullptr; + Nonce_ = HeaderInstruction_ = nullptr; NonceCount_ = 0; } @@ -49,7 +49,7 @@ const char* httpDigestHandler::getHeaderInstruction() const { /************************************************************/ void httpDigestHandler::generateCNonce(char* outCNonce) { if (!*outCNonce) - sprintf(outCNonce, "%ld", (long)time(nullptr)); + sprintf(outCNonce, "%ld", (long)time(nullptr)); } /************************************************************/ @@ -148,7 +148,7 @@ bool httpDigestHandler::processHeader(const THttpAuthHeader* header, if (Nonce_) { if (strcmp(Nonce_, header->nonce)) { free(Nonce_); - Nonce_ = nullptr; + Nonce_ = nullptr; NonceCount_ = 0; } } @@ -157,7 +157,7 @@ bool httpDigestHandler::processHeader(const THttpAuthHeader* header, NonceCount_ = 0; } free(HeaderInstruction_); - HeaderInstruction_ = nullptr; + HeaderInstruction_ = nullptr; NonceCount_++; char nonceCount[20]; diff --git a/library/cpp/http/fetch/http_socket.cpp b/library/cpp/http/fetch/http_socket.cpp index 1524ef04a8..248e1935c9 100644 --- a/library/cpp/http/fetch/http_socket.cpp +++ b/library/cpp/http/fetch/http_socket.cpp @@ -198,7 +198,7 @@ socketAbstractHandler* socketHandlerFactory::chooseHandler(const THttpURL& url) return new socketSecureHandler; #endif - return nullptr; + return nullptr; } /************************************************************/ diff --git a/library/cpp/http/fetch/httpfetcher.h b/library/cpp/http/fetch/httpfetcher.h index 7fc251afd2..765ad9aa26 100644 --- a/library/cpp/http/fetch/httpfetcher.h +++ b/library/cpp/http/fetch/httpfetcher.h @@ -72,7 +72,7 @@ public: } bool inheader = 1; - void *bufptr = nullptr, *buf = nullptr, *parsebuf = nullptr; + void *bufptr = nullptr, *buf = nullptr, *parsebuf = nullptr; ssize_t got; size_t buffree = 0, bufsize = 0, buflen = 0; size_t maxsize = TCheck::GetMaxHeaderSize(); @@ -81,7 +81,7 @@ public: if (buf) { TAlloc::Shrink(buf, buflen - buffree); if (TWriter::Write(buf, buflen - buffree) < 0) { - buf = nullptr; + buf = nullptr; ret = EIO; break; } diff --git a/library/cpp/http/fetch/httpfsm.h b/library/cpp/http/fetch/httpfsm.h index c4abdcd0d2..f85ab2c104 100644 --- a/library/cpp/http/fetch/httpfsm.h +++ b/library/cpp/http/fetch/httpfsm.h @@ -70,9 +70,9 @@ private: private: int Init(THttpBaseHeader* header) { base_hd = header; - auth_hd = nullptr; - request_hd = nullptr; - hd = nullptr; + auth_hd = nullptr; + request_hd = nullptr; + hd = nullptr; init(); return 0; } diff --git a/library/cpp/http/fetch/httpload.cpp b/library/cpp/http/fetch/httpload.cpp index 82ea8900b5..55c5cb1030 100644 --- a/library/cpp/http/fetch/httpload.cpp +++ b/library/cpp/http/fetch/httpload.cpp @@ -58,16 +58,16 @@ const THttpHeader* httpAgentReader::readHeader() { while (State == hp_in_header) { if (!step()) { Header_.error = HTTP_CONNECTION_LOST; - return nullptr; + return nullptr; } ParseGeneric(BufPtr_, BufRest_); } if (State == hp_eof || State == hp_error) { - BufPtr_ = nullptr; + BufPtr_ = nullptr; BufRest_ = -1; } if (State == hp_error || Header_.error) - return nullptr; + return nullptr; return &Header_; } @@ -149,7 +149,7 @@ void httpLoadAgent::clearReader() { if (!opened) Disconnect(); delete Reader_; - Reader_ = nullptr; + Reader_ = nullptr; } ErrCode_ = 0; } @@ -159,7 +159,7 @@ void httpLoadAgent::setRealHost(const char* hostname) { if (hostname) RealHost_ = strdup(hostname); else - RealHost_ = nullptr; + RealHost_ = nullptr; ErrCode_ = 0; } @@ -351,7 +351,7 @@ bool httpLoadAgent::doStartRequest() { "GET")) { //mReader->skipTheRest(); delete Reader_; - Reader_ = nullptr; + Reader_ = nullptr; ErrCode_ = 0; Disconnect(); continue; diff --git a/library/cpp/http/fetch/httpload.h b/library/cpp/http/fetch/httpload.h index e22e4b809e..887c3b4000 100644 --- a/library/cpp/http/fetch/httpload.h +++ b/library/cpp/http/fetch/httpload.h @@ -248,7 +248,7 @@ public: void dropHeaderInstructions(); bool startRequest(const char* url, - const char* url_to_merge = nullptr, + const char* url_to_merge = nullptr, bool persistent = false, const TAddrList& addrs = TAddrList()); @@ -270,13 +270,13 @@ public: const THttpAuthHeader* getAuthHeader() { if (Reader_ && Reader_->getAuthHeader()->use_auth) return Reader_->getAuthHeader(); - return nullptr; + return nullptr; } const THttpHeader* getHeader() { if (Reader_) return Reader_->getAuthHeader(); - return nullptr; + return nullptr; } const THttpURL& getURL() { diff --git a/library/cpp/http/fetch/httpzreader.h b/library/cpp/http/fetch/httpzreader.h index 68eb00853d..780d514f58 100644 --- a/library/cpp/http/fetch/httpzreader.h +++ b/library/cpp/http/fetch/httpzreader.h @@ -33,7 +33,7 @@ public: , BufSize(0) , CurContSize(0) , MaxContSize(0) - , Buf(nullptr) + , Buf(nullptr) , ZErr(0) , ConnectionClosed(0) , IgnoreTrailingGarbage(true) @@ -46,7 +46,7 @@ public: if (Buf) { free(Buf); - Buf = nullptr; + Buf = nullptr; } } diff --git a/library/cpp/http/io/chunk.h b/library/cpp/http/io/chunk.h index 88d89fafda..f40286b6c7 100644 --- a/library/cpp/http/io/chunk.h +++ b/library/cpp/http/io/chunk.h @@ -19,8 +19,8 @@ public: ~TChunkedInput() override; private: - size_t DoRead(void* buf, size_t len) override; - size_t DoSkip(size_t len) override; + size_t DoRead(void* buf, size_t len) override; + size_t DoSkip(size_t len) override; private: class TImpl; @@ -36,9 +36,9 @@ public: ~TChunkedOutput() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp index 6689be684f..23205943ab 100644 --- a/library/cpp/http/io/stream.cpp +++ b/library/cpp/http/io/stream.cpp @@ -137,8 +137,8 @@ public: inline TImpl(IInputStream* slave) : Slave_(slave) , Buffered_(Slave_, SuggestBufferSize()) - , ChunkedInput_(nullptr) - , Input_(nullptr) + , ChunkedInput_(nullptr) + , Input_(nullptr) , FirstLine_(ReadFirstLine(Buffered_)) , Headers_(&Buffered_) , KeepAlive_(false) @@ -465,7 +465,7 @@ class THttpOutput::TImpl { ~TSizeCalculator() override { } - void DoWrite(const void* /*buf*/, size_t len) override { + void DoWrite(const void* /*buf*/, size_t len) override { Length_ += len; } @@ -877,7 +877,7 @@ private: }; THttpOutput::THttpOutput(IOutputStream* slave) - : Impl_(new TImpl(slave, nullptr)) + : Impl_(new TImpl(slave, nullptr)) { } diff --git a/library/cpp/http/io/stream.h b/library/cpp/http/io/stream.h index 78ca4fc814..30706e0204 100644 --- a/library/cpp/http/io/stream.h +++ b/library/cpp/http/io/stream.h @@ -87,8 +87,8 @@ public: bool HasExpect100Continue() const noexcept; private: - size_t DoRead(void* buf, size_t len) override; - size_t DoSkip(size_t len) override; + size_t DoRead(void* buf, size_t len) override; + size_t DoSkip(size_t len) override; private: class TImpl; @@ -158,9 +158,9 @@ public: size_t SentSize() const noexcept; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp index 1ea35df675..4e11cc9d25 100644 --- a/library/cpp/http/io/stream_ut.cpp +++ b/library/cpp/http/io/stream_ut.cpp @@ -23,7 +23,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { { } - bool Reply(void* /*tsr*/) override { + bool Reply(void* /*tsr*/) override { if (!ProcessHeaders()) { return true; } @@ -65,7 +65,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { { } - TClientRequest* CreateClient() override { + TClientRequest* CreateClient() override { return new TRequest(this); } diff --git a/library/cpp/http/misc/httpdate.cpp b/library/cpp/http/misc/httpdate.cpp index 4a3031bbf4..47095ed931 100644 --- a/library/cpp/http/misc/httpdate.cpp +++ b/library/cpp/http/misc/httpdate.cpp @@ -68,7 +68,7 @@ char* format_http_date(time_t when, char* buf, size_t buflen) { const int len = format_http_date(buf, buflen, when); if (len == 0) { - return nullptr; + return nullptr; } Y_ASSERT(len > 0 && size_t(len) < buflen); diff --git a/library/cpp/http/misc/httpreqdata.cpp b/library/cpp/http/misc/httpreqdata.cpp index f6951f68cd..c55b454ff4 100644 --- a/library/cpp/http/misc/httpreqdata.cpp +++ b/library/cpp/http/misc/httpreqdata.cpp @@ -3,11 +3,11 @@ #include <util/stream/mem.h> TBaseServerRequestData::TBaseServerRequestData(SOCKET s) - : Addr(nullptr) + : Addr(nullptr) , Host() , Port() - , Path(nullptr) - , Search(nullptr) + , Path(nullptr) + , Search(nullptr) , SearchLength(0) , Socket(s) , BeginTime(MicroSeconds()) @@ -15,10 +15,10 @@ TBaseServerRequestData::TBaseServerRequestData(SOCKET s) } TBaseServerRequestData::TBaseServerRequestData(const char* qs, SOCKET s) - : Addr(nullptr) + : Addr(nullptr) , Host() , Port() - , Path(nullptr) + , Path(nullptr) , Search((char*)qs) , SearchLength(qs ? strlen(qs) : 0) , OrigSearch(Search, SearchLength) @@ -68,7 +68,7 @@ const char* TBaseServerRequestData::HeaderIn(TStringBuf key) const { auto it = HeadersIn_.find(key); if (it == HeadersIn_.end()) { - return nullptr; + return nullptr; } return it->second.data(); @@ -76,7 +76,7 @@ const char* TBaseServerRequestData::HeaderIn(TStringBuf key) const { TString TBaseServerRequestData::HeaderByIndex(size_t n) const noexcept { if (n >= HeadersCount()) { - return nullptr; + return nullptr; } THttpHeadersContainer::const_iterator i = HeadersIn_.begin(); @@ -104,12 +104,12 @@ const char* TBaseServerRequestData::Environment(const char* key) const { } else if (stricmp(key, "SCRIPT_NAME") == 0) { return ScriptName(); } - return nullptr; + return nullptr; } void TBaseServerRequestData::Clear() { HeadersIn_.clear(); - Addr = Path = Search = nullptr; + Addr = Path = Search = nullptr; OrigSearch = {}; SearchLength = 0; Host.clear(); diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index 128583bdd7..f216ef8952 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -142,7 +142,7 @@ public: } - return nullptr; + return nullptr; } TAutoPtr<TClientRequest> CreateRequest(TAutoPtr<TClientConnection> c) { @@ -215,7 +215,7 @@ public: TGuard<TMutex> g(StopMutex); if (ListenThread) { ListenThread->Join(); - ListenThread.Reset(nullptr); + ListenThread.Reset(nullptr); } } @@ -225,7 +225,7 @@ public: TGuard<TMutex> g(StopMutex); if (ListenThread) { ListenThread->Join(); - ListenThread.Reset(nullptr); + ListenThread.Reset(nullptr); } while (ConnectionCount) { @@ -249,7 +249,7 @@ public: HttpConn_.Reset(parent->HttpConn_.Release()); } - bool Reply(void*) override { + bool Reply(void*) override { if (!ProcessHeaders()) { return true; } @@ -301,7 +301,7 @@ public: } void OnPollEvent(TInstant) override { - SOCKET s = ::accept(S_, nullptr, nullptr); + SOCKET s = ::accept(S_, nullptr, nullptr); if (s == INVALID_SOCKET) { ythrow yexception() << "accept: " << LastSystemErrorText(); diff --git a/library/cpp/http/server/http.h b/library/cpp/http/server/http.h index b292d38f27..bb8fa4a2cb 100644 --- a/library/cpp/http/server/http.h +++ b/library/cpp/http/server/http.h @@ -54,7 +54,7 @@ public: } virtual void* CreateThreadSpecificResource() { - return nullptr; + return nullptr; } virtual void DestroyThreadSpecificResource(void*) { @@ -107,7 +107,7 @@ class TClientRequest: public IObjectInQueue { public: TClientRequest(); - ~TClientRequest() override; + ~TClientRequest() override; inline THttpInput& Input() noexcept { return *HttpConn_->Input(); @@ -137,7 +137,7 @@ private: * 'true' otherwise ('this' will be deleted) */ virtual bool Reply(void* ThreadSpecificResource); - void Process(void* ThreadSpecificResource) override; + void Process(void* ThreadSpecificResource) override; public: TVector<std::pair<TString, TString>> ParsedHeaders; @@ -151,7 +151,7 @@ private: class TRequestReplier: public TClientRequest { public: TRequestReplier(); - ~TRequestReplier() override; + ~TRequestReplier() override; struct TReplyParams { void* ThreadSpecificResource; @@ -167,7 +167,7 @@ public: virtual bool DoReply(const TReplyParams& params) = 0; private: - bool Reply(void* threadSpecificResource) final; + bool Reply(void* threadSpecificResource) final; using TClientRequest::Input; using TClientRequest::Output; diff --git a/library/cpp/http/server/http_ut.cpp b/library/cpp/http/server/http_ut.cpp index cc62bb988e..9a2b50ab1e 100644 --- a/library/cpp/http/server/http_ut.cpp +++ b/library/cpp/http/server/http_ut.cpp @@ -19,7 +19,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { { } - bool Reply(void* /*tsr*/) override { + bool Reply(void* /*tsr*/) override { if (!ProcessHeaders()) { return true; } @@ -45,7 +45,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { { } - TClientRequest* CreateClient() override { + TClientRequest* CreateClient() override { return new TRequest(this); } diff --git a/library/cpp/json/ut/json_reader_ut.cpp b/library/cpp/json/ut/json_reader_ut.cpp index cd31afa0b8..55f8ed5158 100644 --- a/library/cpp/json/ut/json_reader_ut.cpp +++ b/library/cpp/json/ut/json_reader_ut.cpp @@ -15,17 +15,17 @@ public: { } - bool OnBoolean(bool val) override { + bool OnBoolean(bool val) override { Writer.Write(val); return true; } - bool OnInteger(long long val) override { + bool OnInteger(long long val) override { Writer.Write(val); return true; } - bool OnUInteger(unsigned long long val) override { + bool OnUInteger(unsigned long long val) override { Writer.Write(val); return true; } @@ -35,27 +35,27 @@ public: return true; } - bool OnDouble(double val) override { + bool OnDouble(double val) override { Writer.Write(val); return true; } - bool OnOpenArray() override { + bool OnOpenArray() override { Writer.OpenArray(); return true; } - bool OnCloseArray() override { + bool OnCloseArray() override { Writer.CloseArray(); return true; } - bool OnOpenMap() override { + bool OnOpenMap() override { Writer.OpenArray(); return true; } - bool OnCloseMap() override { + bool OnCloseMap() override { Writer.CloseArray(); return true; } diff --git a/library/cpp/lfalloc/lf_allocX64.cpp b/library/cpp/lfalloc/lf_allocX64.cpp index 2eb90761fe..8be9c4ef3b 100644 --- a/library/cpp/lfalloc/lf_allocX64.cpp +++ b/library/cpp/lfalloc/lf_allocX64.cpp @@ -85,7 +85,7 @@ extern "C" void* calloc(size_t n, size_t elem_size) { return nullptr; void* result = LFAlloc(size); - if (result != nullptr) { + if (result != nullptr) { memset(result, 0, size); } return result; @@ -96,18 +96,18 @@ extern "C" void cfree(void* ptr) { } extern "C" void* realloc(void* old_ptr, size_t new_size) { - if (old_ptr == nullptr) { + if (old_ptr == nullptr) { void* result = LFAlloc(new_size); return result; } if (new_size == 0) { LFFree(old_ptr); - return nullptr; + return nullptr; } void* new_ptr = LFAlloc(new_size); - if (new_ptr == nullptr) { - return nullptr; + if (new_ptr == nullptr) { + return nullptr; } size_t old_size = LFGetSize(old_ptr); memcpy(new_ptr, old_ptr, ((old_size < new_size) ? old_size : new_size)); diff --git a/library/cpp/lfalloc/lf_allocX64.h b/library/cpp/lfalloc/lf_allocX64.h index fd2a906d6f..4764c16900 100644 --- a/library/cpp/lfalloc/lf_allocX64.h +++ b/library/cpp/lfalloc/lf_allocX64.h @@ -335,7 +335,7 @@ static char* AllocWithMMapLinuxImpl(uintptr_t sz, EMMapMode mode) { for (;;) { char* prevAllocPtr = *areaPtr; char* nextAllocPtr = prevAllocPtr + sz; - if (uintptr_t(nextAllocPtr - (char*)nullptr) >= areaFinish) { + if (uintptr_t(nextAllocPtr - (char*)nullptr) >= areaFinish) { if (Y_UNLIKELY(wrapped)) { NMalloc::AbortFromCorruptedAllocator("virtual memory is over fragmented"); } @@ -463,16 +463,16 @@ static void* LargeBlockAlloc(size_t _nSize, ELFAllocCounter counter) { int lbHash = pgCount % LB_BUF_HASH; for (int i = 0; i < LB_BUF_SIZE; ++i) { void* p = lbFreePtrs[lbHash][i]; - if (p == nullptr) + if (p == nullptr) continue; - if (DoCas(&lbFreePtrs[lbHash][i], (void*)nullptr, p) == p) { + if (DoCas(&lbFreePtrs[lbHash][i], (void*)nullptr, p) == p) { size_t realPageCount = TLargeBlk::As(p)->Pages; if (realPageCount == pgCount) { AtomicAdd(lbFreePageCount, -pgCount); TLargeBlk::As(p)->Mark(ELarge::Alloc); return p; } else { - if (DoCas(&lbFreePtrs[lbHash][i], p, (void*)nullptr) != (void*)nullptr) { + if (DoCas(&lbFreePtrs[lbHash][i], p, (void*)nullptr) != (void*)nullptr) { // block was freed while we were busy AtomicAdd(lbFreePageCount, -realPageCount); LargeBlockUnmap(p, realPageCount); @@ -495,7 +495,7 @@ static void FreeAllLargeBlockMem() { for (auto& lbFreePtr : lbFreePtrs) { for (int i = 0; i < LB_BUF_SIZE; ++i) { void* p = lbFreePtr[i]; - if (p == nullptr) + if (p == nullptr) continue; if (DoCas(&lbFreePtr[i], (void*)nullptr, p) == p) { int pgCount = TLargeBlk::As(p)->Pages; @@ -508,7 +508,7 @@ static void FreeAllLargeBlockMem() { #endif static void LargeBlockFree(void* p, ELFAllocCounter counter) { - if (p == nullptr) + if (p == nullptr) return; #ifdef _MSC_VER VirtualFree((char*)p - 4096ll, 0, MEM_RELEASE); @@ -523,8 +523,8 @@ static void LargeBlockFree(void* p, ELFAllocCounter counter) { FreeAllLargeBlockMem(); int lbHash = pgCount % LB_BUF_HASH; for (int i = 0; i < LB_BUF_SIZE; ++i) { - if (lbFreePtrs[lbHash][i] == nullptr) { - if (DoCas(&lbFreePtrs[lbHash][i], p, (void*)nullptr) == nullptr) { + if (lbFreePtrs[lbHash][i] == nullptr) { + if (DoCas(&lbFreePtrs[lbHash][i], p, (void*)nullptr) == nullptr) { AtomicAdd(lbFreePageCount, pgCount); return; } @@ -736,7 +736,7 @@ public: void* GetWholeList() { TNode* res; for (res = Head; res; res = Head) { - if (DoCas(&Head, (TNode*)nullptr, res) == res) + if (DoCas(&Head, (TNode*)nullptr, res) == res) break; } return res; @@ -835,7 +835,7 @@ static bool DefragmentMem() { } else { // reset invalid pointers to 0 for (int i = dst; i < FL_GROUP_SIZE; ++i) - g->Ptrs[i] = nullptr; + g->Ptrs[i] = nullptr; ppPtr = &g->Next; } } @@ -872,12 +872,12 @@ static Y_FORCE_INLINE void* LFAllocFromCurrentChunk(int nSizeIdx, int blockSize, if (nextFree >= globalEndPtr) { if (nextFree > globalEndPtr) break; - nextFree = nullptr; // it was last block in chunk + nextFree = nullptr; // it was last block in chunk } if (DoCas(pFreeArray, nextFree, newBlock) == newBlock) return newBlock; } - return nullptr; + return nullptr; } enum EDefrag { @@ -927,7 +927,7 @@ static void* SlowLFAlloc(int nSizeIdx, int blockSize, EDefrag defrag) { AddFreeChunk(chunk); } } - return nullptr; + return nullptr; } // allocate single block @@ -991,7 +991,7 @@ static Y_FORCE_INLINE void PutBlocksToGlobalFreeList(ptrdiff_t nSizeIdx, char** for (int i = 0; i < groupSize; ++i) g->Ptrs[i] = buf[startIdx + i]; for (int i = groupSize; i < FL_GROUP_SIZE; ++i) - g->Ptrs[i] = nullptr; + g->Ptrs[i] = nullptr; // add free group to the global list TLFAllocFreeList& fl = globalFreeLists[nSizeIdx]; @@ -1249,7 +1249,7 @@ static void FreeThreadCache(void*) { { TLFLockHolder ll(&LFLockThreadInfo); pToDelete = pThreadInfo; - if (pToDelete == nullptr) + if (pToDelete == nullptr) return; // remove from the list @@ -1260,7 +1260,7 @@ static void FreeThreadCache(void*) { } } IsStoppingThread = true; - pThreadInfo = nullptr; + pThreadInfo = nullptr; } // free per thread buf @@ -1272,7 +1272,7 @@ static void FreeThreadCache(void*) { static void AllocThreadInfo() { #ifndef _win_ - if (DoCas(&ThreadCacheCleanerStarted, (void*)-2, (void*)nullptr) == (void*)nullptr) { + if (DoCas(&ThreadCacheCleanerStarted, (void*)-2, (void*)nullptr) == (void*)nullptr) { pthread_key_create(&ThreadCacheCleaner, FreeThreadCache); ThreadCacheCleanerStarted = (void*)-1; } @@ -1590,7 +1590,7 @@ static Y_FORCE_INLINE void LFFree(void* p) { uintptr_t chkOffset = ((char*)p - ALLOC_START) - 1ll; if (chkOffset >= N_MAX_WORKSET_SIZE) { - if (p == nullptr) + if (p == nullptr) return; #if defined(LFALLOC_DBG) TrackDeallocation(p, N_SIZES); @@ -1653,7 +1653,7 @@ static size_t LFGetSize(const void* p) { uintptr_t chkOffset = ((const char*)p - ALLOC_START); if (chkOffset >= N_MAX_WORKSET_SIZE) { - if (p == nullptr) + if (p == nullptr) return 0; return TLargeBlk::As(p)->Pages * 4096ll; } diff --git a/library/cpp/logger/filter.h b/library/cpp/logger/filter.h index 9ef83fb58c..51c417ead5 100644 --- a/library/cpp/logger/filter.h +++ b/library/cpp/logger/filter.h @@ -20,11 +20,11 @@ public: return Level; } - void ReopenLog() override { + void ReopenLog() override { Backend->ReopenLog(); } - void WriteData(const TLogRecord& rec) override { + void WriteData(const TLogRecord& rec) override { if (rec.Priority <= (ELogPriority)Level) { Backend->WriteData(rec); } diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.cpp b/library/cpp/lwtrace/mon/mon_lwtrace.cpp index a61ee9ce22..1ab5eb2219 100644 --- a/library/cpp/lwtrace/mon/mon_lwtrace.cpp +++ b/library/cpp/lwtrace/mon/mon_lwtrace.cpp @@ -1550,7 +1550,7 @@ public: row.emplace_back(); TString& groups = row.back(); bool first = true; - for (const char* const* i = probe->Event.Groups; *i != nullptr; ++i, first = false) { + for (const char* const* i = probe->Event.Groups; *i != nullptr; ++i, first = false) { groups.append(TString(first? "": ", ") + GroupHtml(*i)); } diff --git a/library/cpp/messagebus/actor/actor_ut.cpp b/library/cpp/messagebus/actor/actor_ut.cpp index b76ab55bfa..c8aca5e64c 100644 --- a/library/cpp/messagebus/actor/actor_ut.cpp +++ b/library/cpp/messagebus/actor/actor_ut.cpp @@ -59,7 +59,7 @@ struct TDecrementAndSendActor: public TTestActorBase<TDecrementAndSendActor>, pu TDecrementAndSendActor(TExecutor* executor) : TTestActorBase<TDecrementAndSendActor>(executor) - , Next(nullptr) + , Next(nullptr) { } diff --git a/library/cpp/messagebus/actor/executor.cpp b/library/cpp/messagebus/actor/executor.cpp index 7a2227a458..08791def08 100644 --- a/library/cpp/messagebus/actor/executor.cpp +++ b/library/cpp/messagebus/actor/executor.cpp @@ -290,7 +290,7 @@ TAutoPtr<IWorkItem> TExecutor::DequeueWork() { TWhatThreadDoesAcquireGuard<TMutex> g(WorkMutex, "executor: acquiring lock for DequeueWork"); while (!WorkItems.TryPop(&wi, &queueSize)) { if (AtomicGet(ExitWorkers) != 0) - return nullptr; + return nullptr; TWhatThreadDoesPushPop pp("waiting for work on condvar"); WorkAvailable.Wait(WorkMutex); diff --git a/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h b/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h index f0b7cd90e4..a03db713b1 100644 --- a/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h +++ b/library/cpp/messagebus/actor/ring_buffer_with_spin_lock.h @@ -31,7 +31,7 @@ public: AtomicSet(CachedSize, RingBuffer.Size()); } - bool TryPop(T* r, size_t* sizePtr = nullptr) { + bool TryPop(T* r, size_t* sizePtr = nullptr) { if (AtomicGet(CachedSize) == 0) { return false; } diff --git a/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h b/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h index 0aed6b9984..025d12f160 100644 --- a/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h +++ b/library/cpp/messagebus/debug_receiver/debug_receiver_handler.h @@ -5,6 +5,6 @@ struct TDebugReceiverHandler: public NBus::IBusServerHandler { NBus::TBusServerSession* ServerSession; - void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; - void OnMessage(NBus::TOnMessageContext& message) override; + void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; + void OnMessage(NBus::TOnMessageContext& message) override; }; diff --git a/library/cpp/messagebus/event_loop.h b/library/cpp/messagebus/event_loop.h index d5b0a53b0c..71607621e2 100644 --- a/library/cpp/messagebus/event_loop.h +++ b/library/cpp/messagebus/event_loop.h @@ -50,14 +50,14 @@ namespace NEventLoop { class TEventLoop { public: - TEventLoop(const char* name = nullptr); + TEventLoop(const char* name = nullptr); ~TEventLoop(); void Run(); void Stop(); bool IsRunning(); - TChannelPtr Register(TSocket socket, TEventHandlerPtr, void* cookie = nullptr); + TChannelPtr Register(TSocket socket, TEventHandlerPtr, void* cookie = nullptr); private: class TImpl; diff --git a/library/cpp/messagebus/futex_like.cpp b/library/cpp/messagebus/futex_like.cpp index 7f965126db..1169155780 100644 --- a/library/cpp/messagebus/futex_like.cpp +++ b/library/cpp/messagebus/futex_like.cpp @@ -30,7 +30,7 @@ void TFutexLike::Wake(size_t count) { if (count > unsigned(Max<int>())) { count = Max<int>(); } - int r = futex(&Value, FUTEX_WAKE, count, nullptr, nullptr, 0); + int r = futex(&Value, FUTEX_WAKE, count, nullptr, nullptr, 0); Y_VERIFY(r >= 0, "futex_wake failed: %s", strerror(errno)); #else TGuard<TMutex> guard(Mutex); @@ -44,7 +44,7 @@ void TFutexLike::Wake(size_t count) { void TFutexLike::Wait(int expected) { #ifdef _linux_ - int r = futex(&Value, FUTEX_WAIT, expected, nullptr, nullptr, 0); + int r = futex(&Value, FUTEX_WAIT, expected, nullptr, nullptr, 0); Y_VERIFY(r >= 0 || errno == EWOULDBLOCK, "futex_wait failed: %s", strerror(errno)); #else TGuard<TMutex> guard(Mutex); diff --git a/library/cpp/messagebus/memory.h b/library/cpp/messagebus/memory.h index b2c0544491..fa8f3d64b5 100644 --- a/library/cpp/messagebus/memory.h +++ b/library/cpp/messagebus/memory.h @@ -13,7 +13,7 @@ static inline void* MallocAligned(size_t size, size_t alignment) { void** ptr = (void**)malloc(size + alignment + sizeof(size_t*)); if (!ptr) { - return nullptr; + return nullptr; } size_t mask = ~(alignment - 1); diff --git a/library/cpp/messagebus/misc/weak_ptr.h b/library/cpp/messagebus/misc/weak_ptr.h index 70fdeb0e2a..45f05cae56 100644 --- a/library/cpp/messagebus/misc/weak_ptr.h +++ b/library/cpp/messagebus/misc/weak_ptr.h @@ -24,7 +24,7 @@ private: void Release() { TGuard<TMutex> g(Mutex); Y_ASSERT(!!Outer); - Outer = nullptr; + Outer = nullptr; } TIntrusivePtr<TSelf> Get() { @@ -91,7 +91,7 @@ public: TIntrusivePtr<T> Get() { if (!RefPtr) { - return nullptr; + return nullptr; } else { return RefPtr->Get(); } diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp index 24bd778799..c335bfaed8 100644 --- a/library/cpp/messagebus/oldmodule/module.cpp +++ b/library/cpp/messagebus/oldmodule/module.cpp @@ -848,7 +848,7 @@ EMessageStatus TBusModule::StartJob(TAutoPtr<TBusMessage> message) { } void TModuleServerHandler::OnMessage(TOnMessageContext& msg) { - Module->OnMessageReceived(nullptr, msg); + Module->OnMessageReceived(nullptr, msg); } void TModuleClientHandler::OnReply(TAutoPtr<TBusMessage> req, TAutoPtr<TBusMessage> resp) { @@ -863,7 +863,7 @@ void TModuleClientHandler::OnMessageSentOneWay(TAutoPtr<TBusMessage> req) { TJobRunner* job = GetJob(req.Get()); Y_ASSERT(job); Y_ASSERT(job->Job->Message != req.Get()); - job->EnqueueAndSchedule(TJobResponseMessage(req.Release(), nullptr, MESSAGE_OK)); + job->EnqueueAndSchedule(TJobResponseMessage(req.Release(), nullptr, MESSAGE_OK)); job->UnRef(); } @@ -871,7 +871,7 @@ void TModuleClientHandler::OnError(TAutoPtr<TBusMessage> msg, EMessageStatus sta TJobRunner* job = GetJob(msg.Get()); if (job) { Y_ASSERT(job->Job->Message != msg.Get()); - job->EnqueueAndSchedule(TJobResponseMessage(msg.Release(), nullptr, status)); + job->EnqueueAndSchedule(TJobResponseMessage(msg.Release(), nullptr, status)); job->UnRef(); } } diff --git a/library/cpp/messagebus/protobuf/ybusbuf.cpp b/library/cpp/messagebus/protobuf/ybusbuf.cpp index 63415b3737..63849b8960 100644 --- a/library/cpp/messagebus/protobuf/ybusbuf.cpp +++ b/library/cpp/messagebus/protobuf/ybusbuf.cpp @@ -23,7 +23,7 @@ TBusBufferBase* TBusBufferProtocol::FindType(int type) { return Types[i]; } } - return nullptr; + return nullptr; } bool TBusBufferProtocol::IsRegisteredType(unsigned type) { @@ -67,8 +67,8 @@ TAutoPtr<TBusMessage> TBusBufferProtocol::Deserialize(ui16 messageType, TArrayRe TWhatThreadDoesPushPop pp("deserialize protobuf message"); TBusBufferBase* messageTemplate = FindType(messageType); - if (messageTemplate == nullptr) { - return nullptr; + if (messageTemplate == nullptr) { + return nullptr; //Y_FAIL("unknown message type: %d", unsigned(messageType)); } @@ -82,7 +82,7 @@ TAutoPtr<TBusMessage> TBusBufferProtocol::Deserialize(ui16 messageType, TArrayRe bool ok = bmess->GetRecord()->ParseFromCodedStream(&input) && input.ConsumedEntireMessage(); if (!ok) { - return nullptr; + return nullptr; } return bmess.Release(); } diff --git a/library/cpp/messagebus/rain_check/core/coro.h b/library/cpp/messagebus/rain_check/core/coro.h index 95e2a30f9b..5d77e8b55b 100644 --- a/library/cpp/messagebus/rain_check/core/coro.h +++ b/library/cpp/messagebus/rain_check/core/coro.h @@ -22,14 +22,14 @@ namespace NRainCheck { public: TCoroTaskRunner(IEnv* env, ISubtaskListener* parent, TAutoPtr<ICoroTask> impl); - ~TCoroTaskRunner() override; + ~TCoroTaskRunner() override; private: static TContClosure ContClosure(TCoroTaskRunner* runner, TArrayRef<char> memRegion); - bool ReplyReceived() override /* override */; + bool ReplyReceived() override /* override */; - void DoRun() override /* override */; + void DoRun() override /* override */; ICoroTask* GetImpl() { return (ICoroTask*)GetImplBase(); diff --git a/library/cpp/messagebus/rain_check/core/coro_ut.cpp b/library/cpp/messagebus/rain_check/core/coro_ut.cpp index 61a33584a5..b0a9d47fbf 100644 --- a/library/cpp/messagebus/rain_check/core/coro_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/coro_ut.cpp @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { { } - void Run() override { + void Run() override { TestSync->WaitForAndIncrement(0); } }; @@ -42,7 +42,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { TSubtaskCompletion SleepCompletion; - void Run() override { + void Run() override { Env->SleepService.Sleep(&SleepCompletion, TDuration::MilliSeconds(1)); WaitForSubtasks(); TestSync->WaitForAndIncrement(0); @@ -69,7 +69,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { { } - void Run() override { + void Run() override { TestSync->CheckAndIncrement(1); } }; @@ -86,7 +86,7 @@ Y_UNIT_TEST_SUITE(RainCheckCoro) { TSubtaskCompletion SubtaskCompletion; - void Run() override { + void Run() override { TestSync->CheckAndIncrement(0); SpawnSubtask<TSubtask>(Env, &SubtaskCompletion, TestSync); WaitForSubtasks(); diff --git a/library/cpp/messagebus/rain_check/core/simple.h b/library/cpp/messagebus/rain_check/core/simple.h index 20e1bf19f5..06890b8443 100644 --- a/library/cpp/messagebus/rain_check/core/simple.h +++ b/library/cpp/messagebus/rain_check/core/simple.h @@ -14,12 +14,12 @@ namespace NRainCheck { public: TContinueFunc() - : Func(nullptr) + : Func(nullptr) { } TContinueFunc(void*) - : Func(nullptr) + : Func(nullptr) { } @@ -38,13 +38,13 @@ namespace NRainCheck { class TSimpleTaskRunner: public TTaskRunnerBase { public: TSimpleTaskRunner(IEnv* env, ISubtaskListener* parentTask, TAutoPtr<ISimpleTask>); - ~TSimpleTaskRunner() override; + ~TSimpleTaskRunner() override; private: // Function to be called on completion of all pending tasks. TContinueFunc ContinueFunc; - bool ReplyReceived() override /* override */; + bool ReplyReceived() override /* override */; ISimpleTask* GetImpl() { return (ISimpleTask*)GetImplBase(); diff --git a/library/cpp/messagebus/rain_check/core/simple_ut.cpp b/library/cpp/messagebus/rain_check/core/simple_ut.cpp index d4545e05aa..98b4b9bd52 100644 --- a/library/cpp/messagebus/rain_check/core/simple_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/simple_ut.cpp @@ -21,7 +21,7 @@ Y_UNIT_TEST_SUITE(RainCheckSimple) { TSubtaskCompletion SleepCompletion; - TContinueFunc Start() override { + TContinueFunc Start() override { TestSync->CheckAndIncrement(0); Env->SleepService.Sleep(&SleepCompletion, TDuration::MilliSeconds(1)); @@ -44,7 +44,7 @@ Y_UNIT_TEST_SUITE(RainCheckSimple) { TContinueFunc Last() { TestSync->CheckAndIncrement(3); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/core/sleep.cpp b/library/cpp/messagebus/rain_check/core/sleep.cpp index f5d0b4cac9..ae38d8017c 100644 --- a/library/cpp/messagebus/rain_check/core/sleep.cpp +++ b/library/cpp/messagebus/rain_check/core/sleep.cpp @@ -34,7 +34,7 @@ namespace { { } - void Do() override { + void Do() override { Parent->SetDone(); } }; diff --git a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp index 2ae85a87b1..da00dee153 100644 --- a/library/cpp/messagebus/rain_check/core/sleep_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/sleep_ut.cpp @@ -20,7 +20,7 @@ Y_UNIT_TEST_SUITE(Sleep) { TSubtaskCompletion Sleep; - TContinueFunc Start() override { + TContinueFunc Start() override { Env->SleepService.Sleep(&Sleep, TDuration::MilliSeconds(1)); TestSync->CheckAndIncrement(0); @@ -30,7 +30,7 @@ Y_UNIT_TEST_SUITE(Sleep) { TContinueFunc Continue() { TestSync->CheckAndIncrement(1); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp index ba5a5e41cf..acfa11ded9 100644 --- a/library/cpp/messagebus/rain_check/core/spawn_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/spawn_ut.cpp @@ -26,7 +26,7 @@ Y_UNIT_TEST_SUITE(Spawn) { unsigned I; - TContinueFunc Start() override { + TContinueFunc Start() override { if (I < 4) { I += 1; return &TTestTask::Start; @@ -39,7 +39,7 @@ Y_UNIT_TEST_SUITE(Spawn) { TestSync->CheckAndIncrement(1); Started.Signal(); - return nullptr; + return nullptr; } }; @@ -63,10 +63,10 @@ Y_UNIT_TEST_SUITE(Spawn) { { } - TContinueFunc Start() override { + TContinueFunc Start() override { Sleep(TDuration::MilliSeconds(1)); TestSync->CheckAndIncrement(1); - return nullptr; + return nullptr; } }; @@ -82,7 +82,7 @@ Y_UNIT_TEST_SUITE(Spawn) { TSubtaskCompletion SubtaskCompletion; - TContinueFunc Start() override { + TContinueFunc Start() override { TestSync->CheckAndIncrement(0); SpawnSubtask<TSubtask>(Env, &SubtaskCompletion, TestSync); return &TSpawnTask::Continue; @@ -90,7 +90,7 @@ Y_UNIT_TEST_SUITE(Spawn) { TContinueFunc Continue() { TestSync->CheckAndIncrement(2); - return nullptr; + return nullptr; } }; @@ -118,10 +118,10 @@ Y_UNIT_TEST_SUITE(Spawn) { std::array<TSubtaskCompletion, 3> Subtasks; - TContinueFunc Start() override { + TContinueFunc Start() override { if (I == 1000) { TestSync->CheckAndIncrement(0); - return nullptr; + return nullptr; } for (auto& subtask : Subtasks) { diff --git a/library/cpp/messagebus/rain_check/core/task.cpp b/library/cpp/messagebus/rain_check/core/task.cpp index a098437d53..0cd209f44f 100644 --- a/library/cpp/messagebus/rain_check/core/task.cpp +++ b/library/cpp/messagebus/rain_check/core/task.cpp @@ -153,7 +153,7 @@ void TSubtaskCompletion::SetRunning(TTaskRunnerBase* parent) { void TSubtaskCompletion::SetDone() { Y_ASSERT(!!TaskRunner); TTaskRunnerBase* temp = TaskRunner; - TaskRunner = nullptr; + TaskRunner = nullptr; for (;;) { ESubtaskState state = State.Get(); @@ -212,5 +212,5 @@ TString TTaskRunnerBase::GetStatusSingleLine() { } bool NRainCheck::AreWeInsideTask() { - return ThreadCurrentTask != nullptr; + return ThreadCurrentTask != nullptr; } diff --git a/library/cpp/messagebus/rain_check/core/task.h b/library/cpp/messagebus/rain_check/core/task.h index 7d8778bcda..5da3136b23 100644 --- a/library/cpp/messagebus/rain_check/core/task.h +++ b/library/cpp/messagebus/rain_check/core/task.h @@ -19,7 +19,7 @@ namespace NRainCheck { }; struct TNopSubtaskListener: public ISubtaskListener { - void SetDone() override; + void SetDone() override; static TNopSubtaskListener Instance; }; @@ -32,12 +32,12 @@ namespace NRainCheck { public: TSubtaskCompletionFunc() - : Func(nullptr) + : Func(nullptr) { } TSubtaskCompletionFunc(void*) - : Func(nullptr) + : Func(nullptr) { } @@ -84,7 +84,7 @@ namespace NRainCheck { , TaskRunner() { } - ~TSubtaskCompletion() override; + ~TSubtaskCompletion() override; // Either done or cancel requested or cancelled bool IsComplete() const { @@ -124,7 +124,7 @@ namespace NRainCheck { // called by service provider implementations // must not be called by actor void SetRunning(TTaskRunnerBase* parent); - void SetDone() override; + void SetDone() override; }; // See ISimpleTask, ICoroTask @@ -151,7 +151,7 @@ namespace NRainCheck { public: // Construct task. Task is not automatically started. TTaskRunnerBase(IEnv*, ISubtaskListener* parent, TAutoPtr<ITaskBase> impl); - ~TTaskRunnerBase() override; + ~TTaskRunnerBase() override; bool IsRunningInThisThread() const; void AssertInThisThread() const; diff --git a/library/cpp/messagebus/rain_check/core/track.h b/library/cpp/messagebus/rain_check/core/track.h index d387de7574..90993c128f 100644 --- a/library/cpp/messagebus/rain_check/core/track.h +++ b/library/cpp/messagebus/rain_check/core/track.h @@ -29,7 +29,7 @@ namespace NRainCheck { { } - void SetDone() override; + void SetDone() override; TString GetStatusSingleLine(); }; @@ -61,7 +61,7 @@ namespace NRainCheck { public: TTaskTracker(NActor::TExecutor* executor); - ~TTaskTracker() override; + ~TTaskTracker() override; void Shutdown(); @@ -83,7 +83,7 @@ namespace NRainCheck { { } - TIntrusivePtr<TTaskRunnerBase> NewTask(ISubtaskListener* subtaskListener) override { + TIntrusivePtr<TTaskRunnerBase> NewTask(ISubtaskListener* subtaskListener) override { return NRainCheck::SpawnTask<TTask>(Env, Param, subtaskListener).Get(); } }; diff --git a/library/cpp/messagebus/rain_check/core/track_ut.cpp b/library/cpp/messagebus/rain_check/core/track_ut.cpp index 05f7de1319..86f6f60416 100644 --- a/library/cpp/messagebus/rain_check/core/track_ut.cpp +++ b/library/cpp/messagebus/rain_check/core/track_ut.cpp @@ -16,10 +16,10 @@ Y_UNIT_TEST_SUITE(TaskTracker) { { } - TContinueFunc Start() override { + TContinueFunc Start() override { TestSync->WaitForAndIncrement(0); TestSync->WaitForAndIncrement(2); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp index daac8d9a99..bd7d7cb13a 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.cpp @@ -37,7 +37,7 @@ void TBusClientService::ProcessResultCommon(NBus::TBusMessageAutoPtr message, return; } - future->SetDoneAndSchedule(status, nullptr); + future->SetDoneAndSchedule(status, nullptr); } void TBusClientService::SendOneWay( @@ -76,19 +76,19 @@ void NRainCheck::TBusClientService::OnMessageSentOneWay( TBusFuture* future = (TBusFuture*)request->Data; Y_ASSERT(future->Request.Get() == request.Get()); Y_UNUSED(request.Release()); - future->SetDoneAndSchedule(MESSAGE_OK, nullptr); + future->SetDoneAndSchedule(MESSAGE_OK, nullptr); } void TBusClientService::OnError( TAutoPtr<TBusMessage> message, NBus::EMessageStatus status) { - if (message->Data == nullptr) { + if (message->Data == nullptr) { return; } TBusFuture* future = (TBusFuture*)message->Data; Y_ASSERT(future->Request.Get() == message.Get()); Y_UNUSED(message.Release()); - future->SetDoneAndSchedule(status, nullptr); + future->SetDoneAndSchedule(status, nullptr); } void TBusFuture::SetDoneAndSchedule(EMessageStatus status, TAutoPtr<TBusMessage> response) { diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h index 0a291cdea6..251eae5738 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client.h @@ -47,7 +47,7 @@ namespace NRainCheck { public: TBusClientService(const NBus::TBusSessionConfig&, NBus::TBusProtocol*, NBus::TBusMessageQueue*); - ~TBusClientService() override; + ~TBusClientService() override; void Send(NBus::TBusMessageAutoPtr, const NBus::TNetAddr&, TBusFuture* future); void SendOneWay(NBus::TBusMessageAutoPtr, const NBus::TNetAddr&, TBusFuture* future); @@ -59,9 +59,9 @@ namespace NRainCheck { void SendCommon(NBus::TBusMessage*, const NBus::TNetAddr&, TBusFuture* future); void ProcessResultCommon(NBus::TBusMessageAutoPtr, const NBus::TNetAddr&, TBusFuture* future, NBus::EMessageStatus); - void OnReply(TAutoPtr<NBus::TBusMessage> pMessage, TAutoPtr<NBus::TBusMessage> pReply) override; - void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; - void OnMessageSentOneWay(TAutoPtr<NBus::TBusMessage>) override; + void OnReply(TAutoPtr<NBus::TBusMessage> pMessage, TAutoPtr<NBus::TBusMessage> pReply) override; + void OnError(TAutoPtr<NBus::TBusMessage> pMessage, NBus::EMessageStatus status) override; + void OnMessageSentOneWay(TAutoPtr<NBus::TBusMessage>) override; }; } diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp index 1b3618558b..f65e8b382c 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_client_ut.cpp @@ -46,7 +46,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { TVector<TSimpleSharedPtr<TBusFuture>> Requests; - TContinueFunc Start() override { + TContinueFunc Start() override { for (unsigned i = 0; i < 3; ++i) { Requests.push_back(new TBusFuture); TNetAddr addr("localhost", ServerPort); @@ -62,7 +62,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { VerifyDynamicCast<TExampleResponse*>(Requests[i]->GetResponse()); } Env->TestSync.CheckAndIncrement(0); - return nullptr; + return nullptr; } }; @@ -91,7 +91,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { Session = Queue->CreateDestination(&Proto, this, NBus::TBusSessionConfig()); } - void OnMessage(NBus::TOnMessageContext& context) override { + void OnMessage(NBus::TOnMessageContext& context) override { TestSync->CheckAndIncrement(1); context.ForgetRequest(); } @@ -110,7 +110,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { TVector<TSimpleSharedPtr<TBusFuture>> Requests; - TContinueFunc Start() override { + TContinueFunc Start() override { Env->TestSync.CheckAndIncrement(0); for (unsigned i = 0; i < 1; ++i) { @@ -128,7 +128,7 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusClient) { Y_VERIFY(!Requests[i]->GetResponse()); } Env->TestSync.WaitForAndIncrement(2); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h index 1334f05fe4..ec7a883d32 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server.h @@ -18,11 +18,11 @@ namespace NRainCheck { THolder<ITaskFactory> TaskFactory; - void OnMessage(NBus::TOnMessageContext&) override; + void OnMessage(NBus::TOnMessageContext&) override; public: TBusTaskStarter(TAutoPtr<ITaskFactory>); - ~TBusTaskStarter() override; + ~TBusTaskStarter() override; public: template <typename TTask, typename TEnv> @@ -35,7 +35,7 @@ namespace NRainCheck { { } - void NewTask(NBus::TOnMessageContext& context) override { + void NewTask(NBus::TOnMessageContext& context) override { SpawnTask<TTask, TEnv, NBus::TOnMessageContext&>(Env, context); } }; diff --git a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp index 7c11399f1b..32c131798b 100644 --- a/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp +++ b/library/cpp/messagebus/rain_check/messagebus/messagebus_server_ut.cpp @@ -27,9 +27,9 @@ Y_UNIT_TEST_SUITE(RainCheckMessageBusServer) { MessageContext.Swap(messageContext); } - TContinueFunc Start() override { + TContinueFunc Start() override { MessageContext.SendReplyMove(new TExampleResponse(&Env->Proto.ResponseCount)); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/rain_check/test/helper/misc.cpp b/library/cpp/messagebus/rain_check/test/helper/misc.cpp index c0fcb27252..e07fc7e3cc 100644 --- a/library/cpp/messagebus/rain_check/test/helper/misc.cpp +++ b/library/cpp/messagebus/rain_check/test/helper/misc.cpp @@ -23,5 +23,5 @@ TContinueFunc TSpawnNopTasksSimpleTask::Start() { } TContinueFunc TSpawnNopTasksSimpleTask::Join() { - return nullptr; + return nullptr; } diff --git a/library/cpp/messagebus/rain_check/test/helper/misc.h b/library/cpp/messagebus/rain_check/test/helper/misc.h index 9150be4d2f..ba95ee5f23 100644 --- a/library/cpp/messagebus/rain_check/test/helper/misc.h +++ b/library/cpp/messagebus/rain_check/test/helper/misc.h @@ -9,8 +9,8 @@ namespace NRainCheck { TNopSimpleTask(IEnv*, const void*) { } - TContinueFunc Start() override { - return nullptr; + TContinueFunc Start() override { + return nullptr; } }; @@ -34,7 +34,7 @@ namespace NRainCheck { std::array<TSubtaskCompletion, 2> Completion; - void Run() override; + void Run() override; }; struct TSpawnNopTasksSimpleTask: public ISimpleTask { @@ -49,7 +49,7 @@ namespace NRainCheck { std::array<TSubtaskCompletion, 2> Completion; - TContinueFunc Start() override; + TContinueFunc Start() override; TContinueFunc Join(); }; diff --git a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp index 22edbd8c6b..e19dea5561 100644 --- a/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/rain_check/test/perftest/perftest.cpp @@ -28,7 +28,7 @@ struct TCoroOuter: public ICoroTask { { } - void Run() override { + void Run() override { for (;;) { TInstant start = TInstant::Now(); @@ -73,7 +73,7 @@ struct TSimpleOuter: public ISimpleTask { unsigned Current; unsigned I; - TContinueFunc Start() override { + TContinueFunc Start() override { StartInstant = TInstant::Now(); Count = 0; Current = 1000; @@ -126,7 +126,7 @@ struct TReproduceCrashTask: public ISimpleTask { std::array<TSubtaskCompletion, SUBTASKS> Completion; - TContinueFunc Start() override { + TContinueFunc Start() override { for (unsigned j = 0; j < 2; ++j) { //SpawnSubtask<TNopSimpleTask>(Env, &Completion[j]); SpawnSubtask<TSpawnNopTasksSimpleTask>(Env, &Completion[j], SUBTASKS); diff --git a/library/cpp/messagebus/scheduler/scheduler_ut.cpp b/library/cpp/messagebus/scheduler/scheduler_ut.cpp index a5ea641c10..4773d0d6e2 100644 --- a/library/cpp/messagebus/scheduler/scheduler_ut.cpp +++ b/library/cpp/messagebus/scheduler/scheduler_ut.cpp @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TSchedulerTests) { { } - void Do() override { + void Do() override { TestSync->WaitForAndIncrement(0); } }; diff --git a/library/cpp/messagebus/session_impl.cpp b/library/cpp/messagebus/session_impl.cpp index ddf9f360c4..ffd6313405 100644 --- a/library/cpp/messagebus/session_impl.cpp +++ b/library/cpp/messagebus/session_impl.cpp @@ -25,7 +25,7 @@ namespace { { } - void Do() override { + void Do() override { TIntrusivePtr<TBusSession> session = Session.Get(); if (!!session) { SessionImpl->Cron(); @@ -579,7 +579,7 @@ TRemoteConnectionPtr TBusSessionImpl::GetConnectionById(ui64 id) { THashMap<ui64, TRemoteConnectionPtr>::const_iterator it = ConnectionsById.find(id); if (it == ConnectionsById.end()) { - return nullptr; + return nullptr; } else { return it->second; } @@ -594,7 +594,7 @@ TAcceptorPtr TBusSessionImpl::GetAcceptorById(ui64 id) { } } - return nullptr; + return nullptr; } void TBusSessionImpl::InvokeOnError(TNonDestroyingAutoPtr<TBusMessage> message, EMessageStatus status) { diff --git a/library/cpp/messagebus/synchandler.cpp b/library/cpp/messagebus/synchandler.cpp index 8e891d66b3..5198eaadd5 100644 --- a/library/cpp/messagebus/synchandler.cpp +++ b/library/cpp/messagebus/synchandler.cpp @@ -19,7 +19,7 @@ struct TBusSyncMessageData { EMessageStatus ReplyStatus; TBusSyncMessageData() - : Reply(nullptr) + : Reply(nullptr) , ReplyStatus(MESSAGE_DONT_ASK) { } @@ -29,13 +29,13 @@ class TSyncHandler: public IBusClientHandler { public: TSyncHandler(bool expectReply = true) : ExpectReply(expectReply) - , Session(nullptr) + , Session(nullptr) { } ~TSyncHandler() override { } - void OnReply(TAutoPtr<TBusMessage> pMessage0, TAutoPtr<TBusMessage> pReply0) override { + void OnReply(TAutoPtr<TBusMessage> pMessage0, TAutoPtr<TBusMessage> pReply0) override { TBusMessage* pMessage = pMessage0.Release(); TBusMessage* pReply = pReply0.Release(); @@ -47,25 +47,25 @@ public: SignalResult(data, pReply, MESSAGE_OK); } - void OnError(TAutoPtr<TBusMessage> pMessage0, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> pMessage0, EMessageStatus status) override { TBusMessage* pMessage = pMessage0.Release(); TBusSyncMessageData* data = static_cast<TBusSyncMessageData*>(pMessage->Data); if (!data) { return; } - SignalResult(data, /*pReply=*/nullptr, status); + SignalResult(data, /*pReply=*/nullptr, status); } - void OnMessageSent(TBusMessage* pMessage) override { + void OnMessageSent(TBusMessage* pMessage) override { Y_UNUSED(pMessage); Y_ASSERT(ExpectReply); } - void OnMessageSentOneWay(TAutoPtr<TBusMessage> pMessage) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage> pMessage) override { Y_ASSERT(!ExpectReply); TBusSyncMessageData* data = static_cast<TBusSyncMessageData*>(pMessage.Release()->Data); - SignalResult(data, /*pReply=*/nullptr, MESSAGE_OK); + SignalResult(data, /*pReply=*/nullptr, MESSAGE_OK); } void SetSession(TRemoteClientSession* session) { diff --git a/library/cpp/messagebus/test/example/client/client.cpp b/library/cpp/messagebus/test/example/client/client.cpp index 89b5f2c9be..b61bfb1a6e 100644 --- a/library/cpp/messagebus/test/example/client/client.cpp +++ b/library/cpp/messagebus/test/example/client/client.cpp @@ -18,11 +18,11 @@ namespace NCalculator { ClientSession = TBusClientSession::Create(&Proto, this, config, MessageQueue); } - ~TCalculatorClient() override { + ~TCalculatorClient() override { MessageQueue->Stop(); } - void OnReply(TAutoPtr<TBusMessage> request, TAutoPtr<TBusMessage> response0) override { + void OnReply(TAutoPtr<TBusMessage> request, TAutoPtr<TBusMessage> response0) override { Y_VERIFY(response0->GetHeader()->Type == TResponse::MessageType, "wrong response"); TResponse* response = VerifyDynamicCast<TResponse*>(response0.Get()); if (request->GetHeader()->Type == TRequestSum::MessageType) { @@ -40,7 +40,7 @@ namespace NCalculator { } } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { Cerr << "got error " << status << "\n"; } }; diff --git a/library/cpp/messagebus/test/example/server/server.cpp b/library/cpp/messagebus/test/example/server/server.cpp index 13e52d75f5..b7e1045782 100644 --- a/library/cpp/messagebus/test/example/server/server.cpp +++ b/library/cpp/messagebus/test/example/server/server.cpp @@ -15,11 +15,11 @@ namespace NCalculator { ServerSession = TBusServerSession::Create(&Proto, this, config, MessageQueue); } - ~TCalculatorServer() override { + ~TCalculatorServer() override { MessageQueue->Stop(); } - void OnMessage(TOnMessageContext& request) override { + void OnMessage(TOnMessageContext& request) override { if (request.GetMessage()->GetHeader()->Type == TRequestSum::MessageType) { TRequestSum* requestSum = VerifyDynamicCast<TRequestSum*>(request.GetMessage()); int a = requestSum->Record.GetA(); diff --git a/library/cpp/messagebus/test/helper/example.cpp b/library/cpp/messagebus/test/helper/example.cpp index 7c6d704042..b76fcbbe5f 100644 --- a/library/cpp/messagebus/test/helper/example.cpp +++ b/library/cpp/messagebus/test/helper/example.cpp @@ -100,7 +100,7 @@ TAutoPtr<TBusMessage> TExampleProtocol::Deserialize(ui16 messageType, TArrayRef< exampleReply->Data.append(payload.data(), payload.size()); return exampleReply; } else { - return nullptr; + return nullptr; } } diff --git a/library/cpp/messagebus/test/helper/example_module.cpp b/library/cpp/messagebus/test/helper/example_module.cpp index 65ecfcf73f..3f040b37c9 100644 --- a/library/cpp/messagebus/test/helper/example_module.cpp +++ b/library/cpp/messagebus/test/helper/example_module.cpp @@ -22,7 +22,7 @@ bool TExampleModule::Shutdown() { } TBusServerSessionPtr TExampleModule::CreateExtSession(TBusMessageQueue&) { - return nullptr; + return nullptr; } TBusServerSessionPtr TExampleServerModule::CreateExtSession(TBusMessageQueue& queue) { @@ -39,5 +39,5 @@ TExampleClientModule::TExampleClientModule() TBusServerSessionPtr TExampleClientModule::CreateExtSession(TBusMessageQueue& queue) { Source = CreateDefaultSource(queue, &Proto, TBusServerSessionConfig()); Source->RegisterService("localhost"); - return nullptr; + return nullptr; } diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp index 8489319278..20ac0e2015 100644 --- a/library/cpp/messagebus/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/test/perftest/perftest.cpp @@ -294,7 +294,7 @@ public: } /// actual work is being done here - void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { + void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { Y_UNUSED(mess); if (Config.SimpleProtocol) { @@ -309,7 +309,7 @@ public: } /// message that could not be delivered - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_UNUSED(status); @@ -372,7 +372,7 @@ public: } /// when message comes, send reply - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { if (Config.SimpleProtocol) { TSimpleMessage* typed = VerifyDynamicCast<TSimpleMessage*>(mess.GetMessage()); TAutoPtr<TSimpleMessage> response(new TSimpleMessage); @@ -425,7 +425,7 @@ public: } private: - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { TPerftestRequest* typed = VerifyDynamicCast<TPerftestRequest*>(mess); CheckRequest(typed); @@ -436,14 +436,14 @@ private: /// forget replies for few messages, see what happends if (TheConfig->Failure > RandomNumber<double>()) { - return nullptr; + return nullptr; } job->SendReply(NewResponse(typed).Release()); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { return Session = CreateDefaultDestination(queue, Proto.Get(), Config.ServerSessionConfig); } }; @@ -459,7 +459,7 @@ static TNetworkAddress ParseNetworkAddress(const char* string) { const char* port = strchr(string, ':'); - if (port != nullptr) { + if (port != nullptr) { Name.append(string, port - string); Port = atoi(port + 1); } else { @@ -591,8 +591,8 @@ int main(int argc, char* argv[]) { NLWTrace::StartLwtraceFromEnv(); /* unix foo */ - setvbuf(stdout, nullptr, _IONBF, 0); - setvbuf(stderr, nullptr, _IONBF, 0); + setvbuf(stdout, nullptr, _IONBF, 0); + setvbuf(stderr, nullptr, _IONBF, 0); Umask(0); SetAsyncSignalHandler(SIGINT, stopsignal); SetAsyncSignalHandler(SIGTERM, stopsignal); diff --git a/library/cpp/messagebus/test/perftest/simple_proto.cpp b/library/cpp/messagebus/test/perftest/simple_proto.cpp index 19d6c15b9d..b50659d794 100644 --- a/library/cpp/messagebus/test/perftest/simple_proto.cpp +++ b/library/cpp/messagebus/test/perftest/simple_proto.cpp @@ -14,7 +14,7 @@ void TSimpleProtocol::Serialize(const TBusMessage* mess, TBuffer& data) { TAutoPtr<TBusMessage> TSimpleProtocol::Deserialize(ui16, TArrayRef<const char> payload) { if (payload.size() != 4) { - return nullptr; + return nullptr; } TAutoPtr<TSimpleMessage> r(new TSimpleMessage); memcpy(&r->Payload, payload.data(), 4); diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp index 040f9b7702..26db074861 100644 --- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp +++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp @@ -30,7 +30,7 @@ namespace { Session->Shutdown(); } - void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { + void OnReply(TAutoPtr<TBusMessage> mess, TAutoPtr<TBusMessage> reply) override { Y_VERIFY(AtomicGet(SentCompleted), "must be completed"); TExampleClient::OnReply(mess, reply); @@ -38,7 +38,7 @@ namespace { ReplyReceived.Signal(); } - void OnMessageSent(TBusMessage*) override { + void OnMessageSent(TBusMessage*) override { Sleep(TDuration::MilliSeconds(100)); AtomicSet(SentCompleted, 1); } @@ -259,13 +259,13 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { { } - ~TSendTimeoutCheckerExampleClient() override { + ~TSendTimeoutCheckerExampleClient() override { Session->Shutdown(); } TSystemEvent ErrorHappened; - void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data()); ErrorHappened.Signal(); } @@ -326,7 +326,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { } } - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { Y_VERIFY(mess.IsConnectionAlive(), "connection should be alive here"); TAutoPtr<TOnMessageContext> delayedMsg(new TOnMessageContext); delayedMsg->Swap(mess); @@ -376,7 +376,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { return DelayedMessages.size(); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data()); } @@ -418,7 +418,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session = TBusServerSession::Create(&Proto, this, sessionConfig, Bus); } - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { TBusIdentity ident; mess.AckMessage(ident); @@ -430,7 +430,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { mess.GetSession()->SendReply(resurrected, new TExampleResponse(&Proto.ResponseCount)); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed"); } @@ -488,7 +488,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { TAutoPtr<TBusMessage> response; if (TestSync.Get() == 0) { @@ -502,7 +502,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { mess.SendReplyMove(response); } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override { TestSync.WaitForAndIncrement(1); Y_VERIFY(status == MESSAGE_MESSAGE_TOO_LARGE, "status"); @@ -548,7 +548,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessage(TOnMessageContext& req) override { + void OnMessage(TOnMessageContext& req) override { unsigned n = TestSync.Get(); if (n < 2) { TestSync.CheckAndIncrement(n); @@ -695,7 +695,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { TestSync.WaitForAndIncrement(0); Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data()); mess.Destroy(); @@ -723,7 +723,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override { TestSync.CheckAndIncrement(0); Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data()); @@ -777,7 +777,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessageSentOneWay(TAutoPtr<TBusMessage> sent) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage> sent) override { TestSync.WaitForAndIncrement(0); sent->Reset(); TestSync.CheckAndIncrement(1); @@ -889,7 +889,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnClientConnectionEvent(const TClientConnectionEvent& event) override { + void OnClientConnectionEvent(const TClientConnectionEvent& event) override { if (Sync.Get() > 2) { // Test OnClientConnectionEvent_Disconnect is broken. // Sometimes reconnect happens during server shutdown @@ -905,11 +905,11 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { } } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { // We do not check for message errors in this test. } - void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { } }; @@ -923,7 +923,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { + void OnError(TAutoPtr<TBusMessage>, EMessageStatus) override { // We do not check for server message errors in this test. } }; @@ -988,7 +988,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) { Session->Shutdown(); } - void OnMessage(TOnMessageContext& req) override { + void OnMessage(TOnMessageContext& req) override { if (!GoOn.Wait(0)) { TGuard<TMutex> guard(OneLock); diff --git a/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp b/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp index 4083cf3b7b..8cbef0b4a5 100644 --- a/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_one_way_ut.cpp @@ -25,7 +25,7 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { ServerSession = TBusServerSession::Create(&Proto, this, TBusServerSessionConfig(), Queue); } - void OnMessage(TOnMessageContext& context) override { + void OnMessage(TOnMessageContext& context) override { TestSync->WaitForAndIncrement(1); context.ForgetRequest(); } @@ -46,7 +46,7 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { { } - TJobHandler Start(TBusJob* job, TBusMessage*) override { + TJobHandler Start(TBusJob* job, TBusMessage*) override { TestSync->WaitForAndIncrement(0); job->SendOneWayTo(new TExampleRequest(&Proto.RequestCount), ClientSession.Get(), TNetAddr("localhost", Port)); @@ -57,12 +57,12 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { TJobHandler Sent(TBusJob* job, TBusMessage*) { TestSync->WaitForAndIncrement(2); job->Cancel(MESSAGE_DONT_ASK); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { ClientSession = CreateDefaultSource(queue, &Proto, TBusServerSessionConfig()); - return nullptr; + return nullptr; } }; @@ -97,7 +97,7 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { { } - TJobHandler Start(TBusJob* job, TBusMessage*) override { + TJobHandler Start(TBusJob* job, TBusMessage*) override { TestSync->WaitForAndIncrement(0); job->SendOneWayTo(new TExampleRequest(&Proto.RequestCount), ClientSession.Get(), TNetAddr("localhost", 1)); @@ -108,17 +108,17 @@ Y_UNIT_TEST_SUITE(ModuleClientOneWay) { TJobHandler Sent(TBusJob* job, TBusMessage*) { TestSync->WaitForAndIncrement(1); job->Cancel(MESSAGE_DONT_ASK); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { TBusServerSessionConfig sessionConfig; sessionConfig.ConnectTimeout = 1; sessionConfig.SendTimeout = 1; sessionConfig.TotalTimeout = 1; sessionConfig.Secret.TimeoutPeriod = TDuration::MilliSeconds(1); ClientSession = CreateDefaultSource(queue, &Proto, sessionConfig); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/test/ut/module_client_ut.cpp b/library/cpp/messagebus/test/ut/module_client_ut.cpp index ebfe185cc6..ef446dd7e2 100644 --- a/library/cpp/messagebus/test/ut/module_client_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_client_ut.cpp @@ -111,7 +111,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); job->Send(new TExampleRequest(&Proto.RequestCount), Source, TReplyHandler(&TParallelOnReplyModule::ReplyHandler), 0, ServerAddr); return &TParallelOnReplyModule::HandleReplies; @@ -128,7 +128,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { RepliesLatch.CountDown(); Y_VERIFY(RepliesLatch.Await(TDuration::Seconds(10)), "failed to get answers"); job->Cancel(MESSAGE_UNKNOWN); - return nullptr; + return nullptr; } }; @@ -169,7 +169,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); TExampleRequest* message = new TExampleRequest(&Proto.RequestCount); job->Send(message, Source, TReplyHandler(&TErrorHandlerCheckerModule::ReplyHandler), 0, ServerAddr); @@ -188,16 +188,16 @@ Y_UNIT_TEST_SUITE(BusJobTest) { Y_UNUSED(mess); job->Cancel(MESSAGE_UNKNOWN); GotReplyLatch.CountDown(); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { TBusClientSessionConfig sessionConfig; sessionConfig.SendTimeout = 1; // TODO: allow 0 sessionConfig.Secret.TimeoutPeriod = TDuration::MilliSeconds(10); Source = CreateDefaultSource(queue, &Proto, sessionConfig); Source->RegisterService("localhost"); - return nullptr; + return nullptr; } }; @@ -239,7 +239,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { ServerSession = TBusServerSession::Create(&Proto, this, sessionConfig, Bus); } - void OnMessage(TOnMessageContext& req) override { + void OnMessage(TOnMessageContext& req) override { if (AtomicIncrement(OnMessageCount) == 1) { TestSync->WaitForAndIncrement(0); } @@ -258,12 +258,12 @@ Y_UNIT_TEST_SUITE(BusJobTest) { TModuleThatSendsReplyEarly(TTestSync* testSync, unsigned serverPort) : TestSync(testSync) , ServerPort(serverPort) - , ServerSession(nullptr) + , ServerSession(nullptr) , ReplyCount(0) { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); for (unsigned i = 0; i < 2; ++i) { job->Send( @@ -291,10 +291,10 @@ Y_UNIT_TEST_SUITE(BusJobTest) { TJobHandler HandleReplies(TBusJob* job, TBusMessage* mess) { Y_UNUSED(mess); job->Cancel(MESSAGE_UNKNOWN); - return nullptr; + return nullptr; } - TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { + TBusServerSessionPtr CreateExtSession(TBusMessageQueue& queue) override { TExampleClientModule::CreateExtSession(queue); TBusServerSessionConfig sessionConfig; return ServerSession = CreateDefaultDestination(queue, &Proto, sessionConfig); @@ -328,7 +328,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage*) override { + TJobHandler Start(TBusJob* job, TBusMessage*) override { TestSync.CheckAndIncrement(0); job->Send(new TExampleRequest(&Proto.RequestCount), Source, @@ -345,7 +345,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) { TJobHandler End(TBusJob* job, TBusMessage*) { TestSync.CheckAndIncrement(2); job->Cancel(MESSAGE_SHUTDOWN); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/test/ut/module_server_ut.cpp b/library/cpp/messagebus/test/ut/module_server_ut.cpp index 88fe1dd9b6..b96479af71 100644 --- a/library/cpp/messagebus/test/ut/module_server_ut.cpp +++ b/library/cpp/messagebus/test/ut/module_server_ut.cpp @@ -47,14 +47,14 @@ Y_UNIT_TEST_SUITE(ModuleServerTests) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { WaitTwoRequestsLatch.CountDown(); Y_VERIFY(WaitTwoRequestsLatch.Await(TDuration::Seconds(5)), "oops"); VerifyDynamicCast<TExampleRequest*>(mess); job->SendReply(new TExampleResponse(&Proto.ResponseCount)); - return nullptr; + return nullptr; } }; @@ -78,7 +78,7 @@ Y_UNIT_TEST_SUITE(ModuleServerTests) { TSystemEvent MessageReceivedEvent; TSystemEvent ClientDiedEvent; - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); MessageReceivedEvent.Signal(); @@ -86,7 +86,7 @@ Y_UNIT_TEST_SUITE(ModuleServerTests) { Y_VERIFY(ClientDiedEvent.WaitT(TDuration::Seconds(5)), "oops"); job->SendReply(new TExampleResponse(&Proto.ResponseCount)); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/test/ut/one_way_ut.cpp b/library/cpp/messagebus/test/ut/one_way_ut.cpp index 9c21227e2b..057c0de406 100644 --- a/library/cpp/messagebus/test/ut/one_way_ut.cpp +++ b/library/cpp/messagebus/test/ut/one_way_ut.cpp @@ -79,7 +79,7 @@ struct NullClient : TBusClientHandlerError { } } - void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { + void OnMessageSentOneWay(TAutoPtr<TBusMessage>) override { } }; @@ -111,7 +111,7 @@ public: } /// when message comes do not send reply, just acknowledge - void OnMessage(TOnMessageContext& mess) override { + void OnMessage(TOnMessageContext& mess) override { TExampleRequest* fmess = static_cast<TExampleRequest*>(mess.GetMessage()); Y_ASSERT(fmess->Data == "TADA"); @@ -123,7 +123,7 @@ public: } /// this handler should not be called because this server does not send replies - void OnSent(TAutoPtr<TBusMessage> mess) override { + void OnSent(TAutoPtr<TBusMessage> mess) override { Y_UNUSED(mess); Y_FAIL("This server does not sent replies"); } @@ -161,11 +161,11 @@ Y_UNIT_TEST_SUITE(TMessageBusTests_OneWay) { { } - ~TMessageTooLargeClient() override { + ~TMessageTooLargeClient() override { Session->Shutdown(); } - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_VERIFY(status == MESSAGE_MESSAGE_TOO_LARGE, "wrong status: %s", ToCString(status)); @@ -188,7 +188,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests_OneWay) { } struct TCheckTimeoutClient: public NullClient { - ~TCheckTimeoutClient() override { + ~TCheckTimeoutClient() override { Session->Shutdown(); } @@ -208,7 +208,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests_OneWay) { TSystemEvent GotError; /// message that could not be delivered - void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { + void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override { Y_UNUSED(mess); Y_UNUSED(status); // TODO: check status diff --git a/library/cpp/messagebus/test/ut/starter_ut.cpp b/library/cpp/messagebus/test/ut/starter_ut.cpp index dd4d3aaa5e..c738b16eb5 100644 --- a/library/cpp/messagebus/test/ut/starter_ut.cpp +++ b/library/cpp/messagebus/test/ut/starter_ut.cpp @@ -18,7 +18,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { { } - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); AtomicIncrement(StartCount); job->Sleep(10); @@ -29,7 +29,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { Y_UNUSED(mess); AtomicIncrement(StartCount); job->Cancel(MESSAGE_UNKNOWN); - return nullptr; + return nullptr; } }; @@ -78,7 +78,7 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { struct TSleepModule: public TExampleServerModule { TSystemEvent MessageReceivedEvent; - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); MessageReceivedEvent.Signal(); @@ -113,14 +113,14 @@ Y_UNIT_TEST_SUITE(TBusStarterTest) { struct TSendReplyModule: public TExampleServerModule { TSystemEvent MessageReceivedEvent; - TJobHandler Start(TBusJob* job, TBusMessage* mess) override { + TJobHandler Start(TBusJob* job, TBusMessage* mess) override { Y_UNUSED(mess); job->SendReply(new TExampleResponse(&Proto.ResponseCount)); MessageReceivedEvent.Signal(); - return nullptr; + return nullptr; } }; diff --git a/library/cpp/messagebus/use_count_checker.cpp b/library/cpp/messagebus/use_count_checker.cpp index c6243ea21f..54f111bad8 100644 --- a/library/cpp/messagebus/use_count_checker.cpp +++ b/library/cpp/messagebus/use_count_checker.cpp @@ -20,7 +20,7 @@ void TUseCountChecker::Dec() { } TUseCountHolder::TUseCountHolder() - : CurrentChecker(nullptr) + : CurrentChecker(nullptr) { } diff --git a/library/cpp/messagebus/www/www.cpp b/library/cpp/messagebus/www/www.cpp index 62ec241d85..beb42b21d8 100644 --- a/library/cpp/messagebus/www/www.cpp +++ b/library/cpp/messagebus/www/www.cpp @@ -864,7 +864,7 @@ struct TBusWwwHttpServer::TImpl: public THttpServer::ICallBack { { } - bool Reply(void*) override { + bool Reply(void*) override { Outer->ServeRequest(Input(), Output()); return true; } @@ -912,11 +912,11 @@ struct TBusWwwHttpServer::TImpl: public THttpServer::ICallBack { } } - TClientRequest* CreateClient() override { + TClientRequest* CreateClient() override { return new TClientRequestImpl(this); } - ~TImpl() override { + ~TImpl() override { HttpServer.Stop(); } }; diff --git a/library/cpp/mime/types/mime.cpp b/library/cpp/mime/types/mime.cpp index 706d776b24..0ff2ba062b 100644 --- a/library/cpp/mime/types/mime.cpp +++ b/library/cpp/mime/types/mime.cpp @@ -52,7 +52,7 @@ private: }; const TMimeTypes::TRecord TMimeTypes::Records[] = { - {MIME_UNKNOWN, nullptr, nullptr}, + {MIME_UNKNOWN, nullptr, nullptr}, {MIME_TEXT, "text/plain\0", "asc\0txt\0"}, {MIME_HTML, "text/html\0", "html\0htm\0shtml\0"}, {MIME_PDF, "application/pdf\0", "pdf\0"}, @@ -72,10 +72,10 @@ const TMimeTypes::TRecord TMimeTypes::Records[] = { {MIME_ODT, "application/vnd.oasis.opendocument.text\0", "odt\0"}, {MIME_ODP, "application/vnd.oasis.opendocument.presentation\0", "odp\0"}, {MIME_ODS, "application/vnd.oasis.opendocument.spreadsheet\0", "ods\0"}, - {MIME_UNKNOWN, nullptr, nullptr}, + {MIME_UNKNOWN, nullptr, nullptr}, {MIME_IMAGE_BMP, "image/bmp\0image/x-ms-bmp\0image/x-windows-bmp\0", "bmp\0"}, {MIME_WAV, "audio/x-wav\0", "wav\0"}, - {MIME_ARCHIVE, "application/x-archive\0", nullptr}, + {MIME_ARCHIVE, "application/x-archive\0", nullptr}, {MIME_EXE, "application/exe\0application/octet-stream\0application/x-dosexec\0application/x-msdownload\0", "exe\0"}, {MIME_ODG, "application/vnd.oasis.opendocument.graphics\0", "odg\0"}, {MIME_GZIP, "application/x-gzip\0", "gz\0gzip\0"}, @@ -99,7 +99,7 @@ const TMimeTypes::TRecord TMimeTypes::Records[] = { {MIME_WOFF2, "font/woff2\0", "woff2\0"}, {MIME_TTF, "font/ttf\0", "ttf\0"}, {MIME_WEBMANIFEST, "application/manifest+json\0", "webmanifest\0"}, - {MIME_MAX, nullptr, nullptr}, + {MIME_MAX, nullptr, nullptr}, // Additional records {MIME_HTML, "application/xhtml+xml\0", "xhtml\0"}, @@ -142,7 +142,7 @@ void TMimeTypes::SetExt() { const char* TMimeTypes::StrByExt(const char* ext) const { TRecordHash::const_iterator it = Ext.find(ext); if (it == Ext.end()) - return nullptr; + return nullptr; return Records[it->second].ContentType; } @@ -166,9 +166,9 @@ const char* TMimeTypes::StrByMime(MimeTypes mime) const { const char* mimetypeByExt(const char* fname, const char* check_ext) { const char* ext_p; - if (fname == nullptr || *fname == 0 || - (ext_p = strrchr(fname, '.')) == nullptr || strlen(ext_p) - 1 > TMimeTypes::MAX_EXT_LEN) { - return nullptr; + if (fname == nullptr || *fname == 0 || + (ext_p = strrchr(fname, '.')) == nullptr || strlen(ext_p) - 1 > TMimeTypes::MAX_EXT_LEN) { + return nullptr; } char ext[TMimeTypes::MAX_EXT_LEN + 1]; @@ -178,11 +178,11 @@ const char* mimetypeByExt(const char* fname, const char* check_ext) { ext[i] = (char)tolower(ext_p[i]); ext[i] = 0; - if (check_ext != nullptr) { + if (check_ext != nullptr) { if (strcmp(ext, check_ext) == 0) return check_ext; else - return nullptr; + return nullptr; } return Singleton<TMimeTypes>()->StrByExt(ext); @@ -198,7 +198,7 @@ MimeTypes mimeByStr(const TStringBuf& mimeStr) { const char* strByMime(MimeTypes mime) { if (mime < 0 || mime > MIME_MAX) - return nullptr; // index may contain documents with invalid MIME (ex. 255) + return nullptr; // index may contain documents with invalid MIME (ex. 255) return Singleton<TMimeTypes>()->StrByMime(mime); } diff --git a/library/cpp/mime/types/mime.h b/library/cpp/mime/types/mime.h index 05da389ea9..311f691293 100644 --- a/library/cpp/mime/types/mime.h +++ b/library/cpp/mime/types/mime.h @@ -63,7 +63,7 @@ enum MimeTypes { extern const char* MimeNames[MIME_MAX]; -const char* mimetypeByExt(const char* fname, const char* check_ext = nullptr); +const char* mimetypeByExt(const char* fname, const char* check_ext = nullptr); MimeTypes mimeByStr(const char* mimeStr); MimeTypes mimeByStr(const TStringBuf& mimeStr); const char* strByMime(MimeTypes mime); diff --git a/library/cpp/monlib/dynamic_counters/counters.h b/library/cpp/monlib/dynamic_counters/counters.h index dc178cfbe0..b423c8e573 100644 --- a/library/cpp/monlib/dynamic_counters/counters.h +++ b/library/cpp/monlib/dynamic_counters/counters.h @@ -239,7 +239,7 @@ namespace NMonitoring { , OnLookup(origin->OnLookup) {} - ~TDynamicCounters() override; + ~TDynamicCounters() override; // This counter allows to track lookups by name within the whole subtree void SetLookupCounter(TCounterPtr lookupCounter) { diff --git a/library/cpp/monlib/service/monservice.cpp b/library/cpp/monlib/service/monservice.cpp index d1b9cda1d2..0c6594b029 100644 --- a/library/cpp/monlib/service/monservice.cpp +++ b/library/cpp/monlib/service/monservice.cpp @@ -24,7 +24,7 @@ TMonService2::TMonService2(const THttpServerOptions& options, const TString& tit , AuthProvider_{std::move(auth)} { Y_VERIFY(!!title); - time_t t = time(nullptr); + time_t t = time(nullptr); ctime_r(&t, StartTime); } diff --git a/library/cpp/monlib/service/pages/index_mon_page.cpp b/library/cpp/monlib/service/pages/index_mon_page.cpp index 83ff8b529a..d46e0ced30 100644 --- a/library/cpp/monlib/service/pages/index_mon_page.cpp +++ b/library/cpp/monlib/service/pages/index_mon_page.cpp @@ -100,7 +100,7 @@ IMonPage* TIndexMonPage::FindPage(const TString& relativePath) { Y_VERIFY(!relativePath.StartsWith('/')); TPagesByPath::iterator i = PagesByPath.find("/" + relativePath); if (i == PagesByPath.end()) { - return nullptr; + return nullptr; } else { return i->second.Get(); } diff --git a/library/cpp/monlib/service/service.cpp b/library/cpp/monlib/service/service.cpp index 929efbf816..1274c22be2 100644 --- a/library/cpp/monlib/service/service.cpp +++ b/library/cpp/monlib/service/service.cpp @@ -54,16 +54,16 @@ namespace NMonitoring { } } - const char* GetURI() const override { + const char* GetURI() const override { return Header.request_uri.c_str(); } - const char* GetPath() const override { + const char* GetPath() const override { return Url.Get(THttpURL::FieldPath); } - const TCgiParameters& GetParams() const override { + const TCgiParameters& GetParams() const override { return CgiParams; } - const TCgiParameters& GetPostParams() const override { + const TCgiParameters& GetPostParams() const override { if (PostParams.empty() && !PostContent.Buffer().Empty()) const_cast<THttpClient*>(this)->ScanPostParams(); return PostParams; @@ -194,7 +194,7 @@ namespace NMonitoring { { } - bool Reply(void*) override { + bool Reply(void*) override { ServeRequest(Input(), Output(), NAddr::GetPeerAddr(Socket()).Get(), Parent.Handler); return true; } diff --git a/library/cpp/monlib/service/service.h b/library/cpp/monlib/service/service.h index 2f66dddaf8..48c5480070 100644 --- a/library/cpp/monlib/service/service.h +++ b/library/cpp/monlib/service/service.h @@ -48,7 +48,7 @@ namespace NMonitoring { // ICallBack implementation void OnAcceptFull(const TAcceptFull& a) override; - void OnError() override; + void OnError() override; private: TContExecutor& Executor; @@ -84,7 +84,7 @@ namespace NMonitoring { private: class TConnection; - TClientRequest* CreateClient() override; + TClientRequest* CreateClient() override; THandler Handler; }; diff --git a/library/cpp/on_disk/chunks/chunks_ut.cpp b/library/cpp/on_disk/chunks/chunks_ut.cpp index f727647f7f..fb6652245c 100644 --- a/library/cpp/on_disk/chunks/chunks_ut.cpp +++ b/library/cpp/on_disk/chunks/chunks_ut.cpp @@ -72,7 +72,7 @@ public: { TBlob temp = TBlob::FromStreamSingleThreaded(stream); TPlainHash<wchar16, void*> reader(temp); - void* value = nullptr; + void* value = nullptr; UNIT_ASSERT(reader.Find(k, &value)); UNIT_ASSERT_EQUAL((int*)value, &v); } diff --git a/library/cpp/openssl/io/stream.cpp b/library/cpp/openssl/io/stream.cpp index 0b4be38c0e..d50ffedcdc 100644 --- a/library/cpp/openssl/io/stream.cpp +++ b/library/cpp/openssl/io/stream.cpp @@ -30,7 +30,7 @@ namespace { } const char* SslErrorText(int error) noexcept { - return ERR_error_string(error, nullptr); + return ERR_error_string(error, nullptr); } inline TStringBuf SslLastError() noexcept { diff --git a/library/cpp/openssl/io/stream.h b/library/cpp/openssl/io/stream.h index 7bca8f80ef..018a7dbd28 100644 --- a/library/cpp/openssl/io/stream.h +++ b/library/cpp/openssl/io/stream.h @@ -27,11 +27,11 @@ public: TOpenSslClientIO(IInputStream* in, IOutputStream* out); TOpenSslClientIO(IInputStream* in, IOutputStream* out, const TOptions& options); - ~TOpenSslClientIO() override; + ~TOpenSslClientIO() override; private: - void DoWrite(const void* buf, size_t len) override; - size_t DoRead(void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: struct TImpl; diff --git a/library/cpp/protobuf/json/json2proto.cpp b/library/cpp/protobuf/json/json2proto.cpp index 640c10f5a5..eec5308cba 100644 --- a/library/cpp/protobuf/json/json2proto.cpp +++ b/library/cpp/protobuf/json/json2proto.cpp @@ -136,7 +136,7 @@ JsonEnum2Field(const NJson::TJsonValue& json, Y_ASSERT(!!enumField); /// @todo configure name/numerical value - const EnumValueDescriptor* enumFieldValue = nullptr; + const EnumValueDescriptor* enumFieldValue = nullptr; if (json.IsInteger()) { const auto value = json.GetInteger(); diff --git a/library/cpp/regex/pcre/regexp.cpp b/library/cpp/regex/pcre/regexp.cpp index 575c09cee4..e688a3cc84 100644 --- a/library/cpp/regex/pcre/regexp.cpp +++ b/library/cpp/regex/pcre/regexp.cpp @@ -241,12 +241,12 @@ TRegExMatch::TRegExMatch(const TString& re, int cflags) } bool TRegExMatch::Match(const char* str) const { - return Exec(str, nullptr, 0, 0) == 0; + return Exec(str, nullptr, 0, 0) == 0; } TRegExSubst::TRegExSubst(const char* re, int cflags) : TRegExBase(re, cflags) - , Replacement(nullptr) + , Replacement(nullptr) { memset(Brfs, 0, sizeof(TBackReferences) * NMATCHES); } @@ -285,8 +285,8 @@ int TRegExSubst::ParseReplacement(const char* repl) { if (!Replacement || *Replacement == 0) return 0; char* pos = (char*)Replacement; - char* pos1 = nullptr; - char* pos2 = nullptr; + char* pos1 = nullptr; + char* pos2 = nullptr; int i = 0; while (pos && *pos && i < NMATCHES) { pos1 = strchr(pos, '$'); @@ -306,7 +306,7 @@ int TRegExSubst::ParseReplacement(const char* repl) { } } Brfs[i].Beg = int(pos - (char*)Replacement); - Brfs[i].End = (pos1 == nullptr ? (int)strlen(Replacement) : int(pos1 - Replacement)); + Brfs[i].End = (pos1 == nullptr ? (int)strlen(Replacement) : int(pos1 - Replacement)); pos = pos2; i++; } diff --git a/library/cpp/regex/pcre/regexp.h b/library/cpp/regex/pcre/regexp.h index bc610bd2f3..ab49726a53 100644 --- a/library/cpp/regex/pcre/regexp.h +++ b/library/cpp/regex/pcre/regexp.h @@ -21,7 +21,7 @@ protected: TSimpleIntrusivePtr<TRegExBaseImpl> Impl; public: - TRegExBase(const char* regExpr = nullptr, int cflags = REG_EXTENDED); + TRegExBase(const char* regExpr = nullptr, int cflags = REG_EXTENDED); TRegExBase(const TString& regExpr, int cflags = REG_EXTENDED); virtual ~TRegExBase(); @@ -35,7 +35,7 @@ public: class TRegExMatch: public TRegExBase { public: - TRegExMatch(const char* regExpr = nullptr, int cflags = REG_NOSUB | REG_EXTENDED); + TRegExMatch(const char* regExpr = nullptr, int cflags = REG_NOSUB | REG_EXTENDED); TRegExMatch(const TString& regExpr, int cflags = REG_NOSUB | REG_EXTENDED); bool Match(const char* str) const; @@ -56,7 +56,7 @@ private: int BrfsCount; public: - TRegExSubst(const char* regExpr = nullptr, int cflags = REG_EXTENDED); + TRegExSubst(const char* regExpr = nullptr, int cflags = REG_EXTENDED); TString Replace(const char* str, int eflags = 0); int ParseReplacement(const char* replacement); diff --git a/library/cpp/resource/registry.cpp b/library/cpp/resource/registry.cpp index 66001c4769..920929a70a 100644 --- a/library/cpp/resource/registry.cpp +++ b/library/cpp/resource/registry.cpp @@ -91,7 +91,7 @@ namespace { return D_.size(); } - TStringBuf KeyByIndex(size_t idx) const override { + TStringBuf KeyByIndex(size_t idx) const override { return D_.at(idx).first; } diff --git a/library/cpp/resource/resource.cpp b/library/cpp/resource/resource.cpp index cc20f847a5..944c628c97 100644 --- a/library/cpp/resource/resource.cpp +++ b/library/cpp/resource/resource.cpp @@ -18,7 +18,7 @@ void NResource::FindMatch(const TStringBuf subkey, TResources* out) { { } - void OnMatch(const TResource& res) override { + void OnMatch(const TResource& res) override { R->push_back(res); } diff --git a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp index 4f907157e9..e500b397ca 100644 --- a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp @@ -97,13 +97,13 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { , B(b) { } - NSc::TValue ToTValue() const override { + NSc::TValue ToTValue() const override { NSc::TValue res; res["a"] = A; res["b"] = B; return res; } - void FromTValue(const NSc::TValue& v, const bool) override { + void FromTValue(const NSc::TValue& v, const bool) override { A = v["a"].GetNumber(); B = v["b"].GetNumber(); } diff --git a/library/cpp/sighandler/async_signals_handler.cpp b/library/cpp/sighandler/async_signals_handler.cpp index 00ce1c18fb..18121e227d 100644 --- a/library/cpp/sighandler/async_signals_handler.cpp +++ b/library/cpp/sighandler/async_signals_handler.cpp @@ -194,10 +194,10 @@ namespace { void SetAsyncSignalHandler(int signum, TAutoPtr<TEventHandler> handler) { static TAtomic lock; - if (Y_UNLIKELY(SIGNALS_HANDLER == nullptr)) { + if (Y_UNLIKELY(SIGNALS_HANDLER == nullptr)) { TGuard<TAtomic> dnd(lock); - if (SIGNALS_HANDLER == nullptr) { + if (SIGNALS_HANDLER == nullptr) { // NEVERS GETS DESTROYED SIGNALS_HANDLER = new TAsyncSignalsHandler(); } @@ -225,7 +225,7 @@ namespace { Func = func; } - int Handle(int signum) override { + int Handle(int signum) override { if (Func) { Func(signum); } diff --git a/library/cpp/streams/bzip2/bzip2.h b/library/cpp/streams/bzip2/bzip2.h index 2322277ef6..feb8f7531f 100644 --- a/library/cpp/streams/bzip2/bzip2.h +++ b/library/cpp/streams/bzip2/bzip2.h @@ -28,7 +28,7 @@ public: ~TBZipDecompress() override; private: - size_t DoRead(void* buf, size_t size) override; + size_t DoRead(void* buf, size_t size) override; private: class TImpl; @@ -41,9 +41,9 @@ public: ~TBZipCompress() override; private: - void DoWrite(const void* buf, size_t size) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t size) override; + void DoFlush() override; + void DoFinish() override; public: class TImpl; diff --git a/library/cpp/streams/lz/lz.cpp b/library/cpp/streams/lz/lz.cpp index b65bb3ed96..a57750d553 100644 --- a/library/cpp/streams/lz/lz.cpp +++ b/library/cpp/streams/lz/lz.cpp @@ -72,7 +72,7 @@ public: inline void Finish() { this->Flush(); - this->WriteBlock(nullptr, 0); + this->WriteBlock(nullptr, 0); } template <class T> @@ -188,7 +188,7 @@ public: inline TDecompressorBaseImpl(IInputStream* slave) : Slave_(slave) - , Input_(nullptr, 0) + , Input_(nullptr, 0) , Eof_(false) , Version_(CheckVer(Load<ui32>())) , BlockSize_(Load<ui16>()) @@ -543,7 +543,7 @@ public: } inline TQuickLZBase() - : Table_(nullptr) + : Table_(nullptr) { } @@ -647,7 +647,7 @@ namespace { } private: - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { return Impl_.Read(buf, len); } @@ -673,7 +673,7 @@ static TAutoPtr<IInputStream> TryOpenLzDecompressorX(const TDecompressSignature& if (s.Check<TQuickLZDecompress>()) return new TLzDecompressInput<T, TQuickLZDecompress>(input); - return nullptr; + return nullptr; } template <class T> @@ -685,7 +685,7 @@ static inline TAutoPtr<IInputStream> TryOpenLzDecompressorImpl(const TStringBuf& return TryOpenLzDecompressorX(s, input); } - return nullptr; + return nullptr; } template <class T> diff --git a/library/cpp/streams/lz/lz.h b/library/cpp/streams/lz/lz.h index 3a2eaad88b..10e67dfb71 100644 --- a/library/cpp/streams/lz/lz.h +++ b/library/cpp/streams/lz/lz.h @@ -36,9 +36,9 @@ public: ~TLz4Compress() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; @@ -56,7 +56,7 @@ public: ~TLz4Decompress() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: class TImpl; @@ -74,9 +74,9 @@ public: ~TSnappyCompress() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; @@ -94,7 +94,7 @@ public: ~TSnappyDecompress() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: class TImpl; @@ -110,9 +110,9 @@ public: ~TLzoCompress() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; @@ -128,7 +128,7 @@ public: ~TLzoDecompress() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: class TImpl; @@ -144,9 +144,9 @@ public: ~TLzfCompress() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; @@ -162,7 +162,7 @@ public: ~TLzfDecompress() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: class TImpl; @@ -196,9 +196,9 @@ public: ~TLzqCompress() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; + void DoFinish() override; private: class TImpl; @@ -214,7 +214,7 @@ public: ~TLzqDecompress() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: class TImpl; diff --git a/library/cpp/streams/lz/lz_ut.cpp b/library/cpp/streams/lz/lz_ut.cpp index 6876f070fc..6eea541b2a 100644 --- a/library/cpp/streams/lz/lz_ut.cpp +++ b/library/cpp/streams/lz/lz_ut.cpp @@ -168,7 +168,7 @@ public: } private: - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { return Slave_->Read(buf, len); } diff --git a/library/cpp/streams/lzma/lzma.cpp b/library/cpp/streams/lzma/lzma.cpp index f1942fa546..f466a27659 100644 --- a/library/cpp/streams/lzma/lzma.cpp +++ b/library/cpp/streams/lzma/lzma.cpp @@ -50,7 +50,7 @@ namespace { { } - void DoRun() override { + void DoRun() override { Parent_->RunFilter(); } @@ -68,7 +68,7 @@ namespace { ~TInput() override { } - size_t DoRead(void* ptr, size_t len) override { + size_t DoRead(void* ptr, size_t len) override { return Parent_->ReadImpl(ptr, len); } @@ -86,7 +86,7 @@ namespace { ~TOutput() override { } - void DoWrite(const void* ptr, size_t len) override { + void DoWrite(const void* ptr, size_t len) override { Parent_->WriteImpl(ptr, len); } @@ -101,7 +101,7 @@ namespace { , TrampoLine_(this) , FilterCtx_(FilterClosure()) , Finished_(false) - , In_(nullptr, 0) + , In_(nullptr, 0) { } @@ -180,7 +180,7 @@ namespace { inline bool FlushImpl() { if (Out_.Avail()) { TransferData(&Out_, Slave_); - Out_.Reset(nullptr, 0); + Out_.Reset(nullptr, 0); return true; } @@ -327,7 +327,7 @@ namespace { out->Write(PropsBuf_, sizeof(PropsBuf_)); - Check(LzmaEnc_Encode(H_, &output, &input, nullptr, Alloc(), Alloc())); + Check(LzmaEnc_Encode(H_, &output, &input, nullptr, Alloc(), Alloc())); } private: diff --git a/library/cpp/streams/lzma/lzma.h b/library/cpp/streams/lzma/lzma.h index ca1e06e9ef..db292b0c52 100644 --- a/library/cpp/streams/lzma/lzma.h +++ b/library/cpp/streams/lzma/lzma.h @@ -12,8 +12,8 @@ public: ~TLzmaCompress() override; private: - void DoWrite(const void* buf, size_t len) override; - void DoFinish() override; + void DoWrite(const void* buf, size_t len) override; + void DoFinish() override; private: class TImpl; @@ -27,7 +27,7 @@ public: ~TLzmaDecompress() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: class TImpl; diff --git a/library/cpp/streams/lzma/lzma_ut.cpp b/library/cpp/streams/lzma/lzma_ut.cpp index 847e98d1ca..89f59abefe 100644 --- a/library/cpp/streams/lzma/lzma_ut.cpp +++ b/library/cpp/streams/lzma/lzma_ut.cpp @@ -15,7 +15,7 @@ public: } private: - size_t DoNext(const void** ptr, size_t len) override { + size_t DoNext(const void** ptr, size_t len) override { if (Pos < Data.end()) { len = Min(len, static_cast<size_t>(1)); *ptr = Pos; @@ -57,7 +57,7 @@ private: ~TExcOutput() override { } - void DoWrite(const void*, size_t) override { + void DoWrite(const void*, size_t) override { throw 12345; } }; diff --git a/library/cpp/streams/zc_memory_input/zc_memory_input.h b/library/cpp/streams/zc_memory_input/zc_memory_input.h index c939d8e426..3515904926 100644 --- a/library/cpp/streams/zc_memory_input/zc_memory_input.h +++ b/library/cpp/streams/zc_memory_input/zc_memory_input.h @@ -32,7 +32,7 @@ public: template <class T> Y_FORCE_INLINE T LoadPOD() { - const char* buf = nullptr; + const char* buf = nullptr; if (!ReadFixed(buf, sizeof(T))) ythrow yexception() << "TZCMemoryInput::LoadPOD failed: not enough data (" << Avail() << " of " << sizeof(T) << " bytes)"; diff --git a/library/cpp/string_utils/base64/base64.cpp b/library/cpp/string_utils/base64/base64.cpp index 05c201f0de..154da5d1f6 100644 --- a/library/cpp/string_utils/base64/base64.cpp +++ b/library/cpp/string_utils/base64/base64.cpp @@ -92,9 +92,9 @@ static const char base64_bkw[] = { static_assert(Y_ARRAY_SIZE(base64_bkw) == 256, "wrong size"); -// Base64 for url encoding, RFC3548 +// Base64 for url encoding, RFC3548 static const char base64_etab_url[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - + static inline unsigned char GetBase64EncodedIndex0(unsigned char octet0) { return (octet0 >> 2); } @@ -115,7 +115,7 @@ template <bool urlVersion> static inline char* Base64EncodeImpl(char* outstr, const unsigned char* instr, size_t len) { const char* const base64_etab = (urlVersion ? base64_etab_url : base64_etab_std); const char pad = (urlVersion ? ',' : '='); - + size_t idx = 0; while (idx + 2 < len) { @@ -140,15 +140,15 @@ static inline char* Base64EncodeImpl(char* outstr, const unsigned char* instr, s return outstr; } - + static char* Base64EncodePlain(char* outstr, const unsigned char* instr, size_t len) { return Base64EncodeImpl<false>(outstr, instr, len); -} - +} + char* Base64EncodeUrl(char* outstr, const unsigned char* instr, size_t len) { return Base64EncodeImpl<true>(outstr, instr, len); -} - +} + inline void uudecode_1(char* dst, unsigned char* src) { dst[0] = char((base64_bkw[src[0]] << 2) | (base64_bkw[src[1]] >> 4)); dst[1] = char((base64_bkw[src[1]] << 4) | (base64_bkw[src[2]] >> 2)); diff --git a/library/cpp/testing/benchmark/bench.cpp b/library/cpp/testing/benchmark/bench.cpp index 08d8708005..cb7ce6e47f 100644 --- a/library/cpp/testing/benchmark/bench.cpp +++ b/library/cpp/testing/benchmark/bench.cpp @@ -63,9 +63,9 @@ namespace { Register(); } - TResult Run(const TOptions& opts) override; + TResult Run(const TOptions& opts) override; - TStringBuf Name() const noexcept override { + TStringBuf Name() const noexcept override { return N; } @@ -299,7 +299,7 @@ namespace { class TConsoleReporter: public IReporter { public: - ~TConsoleReporter() override { + ~TConsoleReporter() override { } void Report(TResult&& r) override { @@ -315,7 +315,7 @@ namespace { Cout << "Name\tSamples\tIterations\tRun_time\tPer_iteration_sec\tPer_iteration_cycles" << Endl; } - ~TCSVReporter() override { + ~TCSVReporter() override { } void Report(TResult&& r) override { @@ -346,7 +346,7 @@ namespace { class TJSONReporter: public IReporter { public: - ~TJSONReporter() override { + ~TJSONReporter() override { } void Report(TResult&& r) override { diff --git a/library/cpp/testing/unittest/gtest.cpp b/library/cpp/testing/unittest/gtest.cpp index ebad1ea4d6..61a562af23 100644 --- a/library/cpp/testing/unittest/gtest.cpp +++ b/library/cpp/testing/unittest/gtest.cpp @@ -42,7 +42,7 @@ namespace { return Test.Name(); } - TTestBase* ConstructTest() override { + TTestBase* ConstructTest() override { return new TCurrentTest(Test); } diff --git a/library/cpp/testing/unittest/gtest.h b/library/cpp/testing/unittest/gtest.h index b6768b1bf0..594feaca8a 100644 --- a/library/cpp/testing/unittest/gtest.h +++ b/library/cpp/testing/unittest/gtest.h @@ -78,7 +78,7 @@ namespace testing { #define EXPECT_EQ(A, B) UNIT_ASSERT_VALUES_EQUAL(A, B) #define EXPECT_NE(A, B) UNIT_ASSERT_UNEQUAL(A, B) -#define EXPECT_LE(A, B) UNIT_ASSERT((A) <= (B)) +#define EXPECT_LE(A, B) UNIT_ASSERT((A) <= (B)) #define EXPECT_LT(A, B) UNIT_ASSERT((A) < (B)) #define EXPECT_GE(A, B) UNIT_ASSERT((A) >= (B)) #define EXPECT_GT(A, B) UNIT_ASSERT((A) > (B)) diff --git a/library/cpp/testing/unittest/ut/main.cpp b/library/cpp/testing/unittest/ut/main.cpp index e303e21e30..1ecc4897a6 100644 --- a/library/cpp/testing/unittest/ut/main.cpp +++ b/library/cpp/testing/unittest/ut/main.cpp @@ -22,7 +22,7 @@ namespace { { } - void SetUp() override { + void SetUp() override { I = 5; } diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp index 305bc6b40f..2e13ff1145 100644 --- a/library/cpp/testing/unittest/utmain.cpp +++ b/library/cpp/testing/unittest/utmain.cpp @@ -115,7 +115,7 @@ private: NUnitTest::GetResetTag(); } - void OnBeforeTest(const TTest* test) override { + void OnBeforeTest(const TTest* test) override { NJson::TJsonValue event; event.InsertValue("class", test->unit->name); event.InsertValue("subtest", test->name); @@ -127,19 +127,19 @@ private: Cerr.Flush(); } - void OnUnitStart(const TUnit* unit) override { + void OnUnitStart(const TUnit* unit) override { NJson::TJsonValue event; event.InsertValue("class", unit->name); Trace("test-started", event); } - void OnUnitStop(const TUnit* unit) override { + void OnUnitStop(const TUnit* unit) override { NJson::TJsonValue event; event.InsertValue("class", unit->name); Trace("test-finished", event); } - void OnError(const TError* descr) override { + void OnError(const TError* descr) override { const TString comment = BuildComment(descr->msg, descr->BackTrace.data()); ErrorMessages.push_back(comment); } @@ -270,7 +270,7 @@ public: ForkTests = val; } - inline bool GetForkTests() const override { + inline bool GetForkTests() const override { return ForkTests; } @@ -279,7 +279,7 @@ public: SetIsTTY(IsForked || CalcIsTTY(stderr)); } - inline bool GetIsForked() const override { + inline bool GetIsForked() const override { return IsForked; } @@ -296,7 +296,7 @@ public: } private: - void OnUnitStart(const TUnit* unit) override { + void OnUnitStart(const TUnit* unit) override { TraceProcessor->UnitStart(*unit); if (IsForked) { return; @@ -306,7 +306,7 @@ private: } } - void OnUnitStop(const TUnit* unit) override { + void OnUnitStop(const TUnit* unit) override { TraceProcessor->UnitStop(*unit); if (IsForked) { return; @@ -325,7 +325,7 @@ private: fprintf(stderr, "\n"); } - void OnBeforeTest(const TTest* test) override { + void OnBeforeTest(const TTest* test) override { TraceProcessor->BeforeTest(*test); if (IsForked) { return; @@ -335,7 +335,7 @@ private: } } - void OnError(const TError* descr) override { + void OnError(const TError* descr) override { TraceProcessor->Error(*descr); if (!IsForked && ForkExitedCorrectly) { return; @@ -400,7 +400,7 @@ private: Cerr << d << "\n"; } - void OnEnd() override { + void OnEnd() override { TraceProcessor->End(); if (IsForked) { return; diff --git a/library/cpp/unicode/normalization/normalization.cpp b/library/cpp/unicode/normalization/normalization.cpp index 7da7211514..cec8c93ddc 100644 --- a/library/cpp/unicode/normalization/normalization.cpp +++ b/library/cpp/unicode/normalization/normalization.cpp @@ -49,7 +49,7 @@ NUnicode::NPrivate::TComposition::TComposition() { for (wchar32 s = 0xAC00; s != 0xD7A4; ++s) { const wchar32* decompBegin = NUnicode::Decomposition<true>(s); - if (decompBegin == nullptr) + if (decompBegin == nullptr) continue; wchar32 lead = *(decompBegin++); diff --git a/library/cpp/unicode/normalization/normalization.h b/library/cpp/unicode/normalization/normalization.h index 4f5f57881c..45af825b82 100644 --- a/library/cpp/unicode/normalization/normalization.h +++ b/library/cpp/unicode/normalization/normalization.h @@ -30,7 +30,7 @@ namespace NUnicode { namespace NPrivate { inline const wchar32* Decomposition(const TDecompositionTable& table, wchar32 ch) { - return table.Get(ch, static_cast<const wchar32*>(nullptr)); + return table.Get(ch, static_cast<const wchar32*>(nullptr)); } class TDecompositor { diff --git a/library/cpp/xml/document/node-attr.h b/library/cpp/xml/document/node-attr.h index 6e74403943..7cd9f06036 100644 --- a/library/cpp/xml/document/node-attr.h +++ b/library/cpp/xml/document/node-attr.h @@ -168,10 +168,10 @@ namespace NXml { xmlNode* child = nullptr; if (value.empty()) { - child = xmlNewTextChild(NodePointer, nullptr, XMLCHAR(name.c_str()), nullptr); + child = xmlNewTextChild(NodePointer, nullptr, XMLCHAR(name.c_str()), nullptr); } else { child = xmlNewTextChild( - NodePointer, nullptr, XMLCHAR(name.c_str()), XMLCHAR(value.c_str())); + NodePointer, nullptr, XMLCHAR(name.c_str()), XMLCHAR(value.c_str())); } if (!child) { diff --git a/library/cpp/xml/document/xml-document-decl.h b/library/cpp/xml/document/xml-document-decl.h index bfda1fb7e6..7351ff7889 100644 --- a/library/cpp/xml/document/xml-document-decl.h +++ b/library/cpp/xml/document/xml-document-decl.h @@ -449,8 +449,8 @@ namespace NXml { * constructs null node */ TNode() - : NodePointer(nullptr) - , DocPointer(nullptr) + : NodePointer(nullptr) + , DocPointer(nullptr) { } diff --git a/library/cpp/xml/document/xml-document.cpp b/library/cpp/xml/document/xml-document.cpp index 18a554d732..1b91de2a81 100644 --- a/library/cpp/xml/document/xml-document.cpp +++ b/library/cpp/xml/document/xml-document.cpp @@ -31,7 +31,7 @@ namespace NXml { THROW(XmlException, "Can't create xml document."); doc->encoding = xmlStrdup(XMLCHAR("utf-8")); - TNodePtr node(xmlNewNode(nullptr, XMLCHAR(xml.c_str()))); + TNodePtr node(xmlNewNode(nullptr, XMLCHAR(xml.c_str()))); if (!node) THROW(XmlException, "Can't create root node."); xmlDocSetRootElement(doc.Get(), node.Get()); @@ -77,7 +77,7 @@ namespace NXml { void TDocument::ParseString(TZtStringBuf xml) { TParserCtxtPtr pctx(xmlNewParserCtxt()); - if (pctx.Get() == nullptr) + if (pctx.Get() == nullptr) THROW(XmlException, "Can't create parser context"); TDocHolder doc(xmlCtxtReadMemory(pctx.Get(), xml.c_str(), (int)xml.size(), nullptr, nullptr, XML_PARSE_NOCDATA)); @@ -90,7 +90,7 @@ namespace NXml { TNode TDocument::Root() { xmlNode* r = xmlDocGetRootElement(Doc.Get()); - if (r == nullptr) + if (r == nullptr) THROW(XmlException, "TDocument hasn't root element"); return TNode(Doc.Get(), r); @@ -98,14 +98,14 @@ namespace NXml { TConstNode TDocument::Root() const { xmlNode* r = xmlDocGetRootElement(Doc.Get()); - if (r == nullptr) + if (r == nullptr) THROW(XmlException, "TDocument hasn't root element"); return TConstNode(TNode(Doc.Get(), r)); } bool TNode::IsNull() const { - return NodePointer == nullptr; + return NodePointer == nullptr; } bool TNode::IsElementNode() const { @@ -208,7 +208,7 @@ namespace NXml { } TNode TNode::Parent() { - if (nullptr == NodePointer->parent) + if (nullptr == NodePointer->parent) THROW(XmlException, "Parent node not exists"); return TNode(DocPointer, NodePointer->parent); @@ -315,7 +315,7 @@ namespace NXml { void TNode::SaveInternal(IOutputStream& stream, TZtStringBuf enc, int options) const { const char* encoding = enc.size() ? enc.data() : "utf-8"; - TSaveCtxtPtr ctx(xmlSaveToIO(XmlWriteToOstream, /* close */ nullptr, &stream, + TSaveCtxtPtr ctx(xmlSaveToIO(XmlWriteToOstream, /* close */ nullptr, &stream, encoding, options)); if (xmlSaveTree(ctx.Get(), (xmlNode*)GetPtr()) < 0) THROW(XmlException, "Failed saving node to stream"); diff --git a/library/cpp/xml/init/init.cpp b/library/cpp/xml/init/init.cpp index aa96c2dd31..eebb1ea5f7 100644 --- a/library/cpp/xml/init/init.cpp +++ b/library/cpp/xml/init/init.cpp @@ -25,7 +25,7 @@ namespace { public: inline TLibXml2() { xmlInitParser(); - xmlNewCharEncodingHandler("windows-1251", CharEncodingInput, nullptr); + xmlNewCharEncodingHandler("windows-1251", CharEncodingInput, nullptr); } inline ~TLibXml2() { diff --git a/library/cpp/yson/node/node_builder.h b/library/cpp/yson/node/node_builder.h index 69800016e0..e77652cda7 100644 --- a/library/cpp/yson/node/node_builder.h +++ b/library/cpp/yson/node/node_builder.h @@ -19,19 +19,19 @@ public: TNodeBuilder(TNode* node); void OnStringScalar(TStringBuf) override; - void OnInt64Scalar(i64) override; - void OnUint64Scalar(ui64) override; - void OnDoubleScalar(double) override; - void OnBooleanScalar(bool) override; - void OnEntity() override; - void OnBeginList() override; - void OnListItem() override; - void OnEndList() override; - void OnBeginMap() override; + void OnInt64Scalar(i64) override; + void OnUint64Scalar(ui64) override; + void OnDoubleScalar(double) override; + void OnBooleanScalar(bool) override; + void OnEntity() override; + void OnBeginList() override; + void OnListItem() override; + void OnEndList() override; + void OnBeginMap() override; void OnKeyedItem(TStringBuf) override; - void OnEndMap() override; - void OnBeginAttributes() override; - void OnEndAttributes() override; + void OnEndMap() override; + void OnBeginAttributes() override; + void OnEndAttributes() override; void OnNode(TNode node); private: |