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 | bd5ef432f5cfb1e18851381329d94665a4c22470 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 | |
parent | 7a4979e6211c3e78c7f9041d4a9e5d3405343c36 (diff) | |
download | ydb-bd5ef432f5cfb1e18851381329d94665a4c22470.tar.gz |
Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 2 of 2.
286 files changed, 1531 insertions, 1531 deletions
diff --git a/contrib/libs/ya.make b/contrib/libs/ya.make index f0c3ec60b8..9c4640fdcf 100644 --- a/contrib/libs/ya.make +++ b/contrib/libs/ya.make @@ -194,7 +194,7 @@ RECURSE( libvorbis libvorbis/libvorbisenc libvpx - libwebp + libwebp libx264 libx265 libxml @@ -246,7 +246,7 @@ RECURSE( odpi onnx opencl-headers - opencv + opencv opencv/modules opencv/modules/python/src2 openfst @@ -428,12 +428,12 @@ IF (OS_LINUX OR OS_WINDOWS) ) ENDIF() -IF (OS_ANDROID) - RECURSE( +IF (OS_ANDROID) + RECURSE( android_cpufeatures android_crazy_linker - ) -ENDIF() + ) +ENDIF() IF (OS_IOS AND ARCH_ARM64 OR OS_DARWIN) RECURSE( diff --git a/library/cpp/actors/core/mailbox_queue_revolving.h b/library/cpp/actors/core/mailbox_queue_revolving.h index e9a139862f..b0e78a18db 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 e4bef9acda..2c20ca67f3 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 6e51cfe1b6..649339ddb2 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 a189f8247d..0528d8549c 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 2252cff5cb..6fa25b9965 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 15c0f382d3..d7ec8bb21c 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 1c8929bb61..1becc3e5da 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 c89c5f9895..602a1cdbbd 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 323b901d0c..fe0775af9f 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 0359f61941..412424889f 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 e096ef79b4..21506e812b 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 7d754b6419..f05df4d334 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 6584d51460..4f7db3c32b 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 51ee695a6f..fd44ef88f2 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 d6ad880dfc..6dc997076d 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 fd94b1e603..71e1442717 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 ffdf26deb7..329872cfde 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 1e755c5b35..9393be967a 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 b0ca6da007..5e40f47ab9 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 d7d8db4268..3f8fd81ee5 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 95f1255815..dbe7473f0c 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 4b925042a1..cfa35f5ba2 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 35afea402b..f273fa6571 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 b2fdba0931..f41c38311a 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 5a6811f8a1..40ec1e52b3 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 2136b8d59a..3959258948 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 b5f82c17b1..3e15866dc5 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 92c378b780..acd43338f0 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 d50d45159e..634e6b811a 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 1ac2c9d62d..0259452a14 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 7d1705b8f3..8b372496a2 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 e0b893be11..61164fa56b 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 3365b1a4b6..1ebb7e7b38 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 90f8003a85..3d4e711d1d 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 84411c71ec..a7f72eece6 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 88226e2329..c2eda83c57 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 865aafe21d..45859ed65a 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 fe05c32cb8..0eacc29228 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 e63707aaf0..6c753f68a9 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 f0f42fcf9c..94fb00cd0b 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 a4f7f09e2c..24a5b69eef 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 968d9af0e8..05c14e82fc 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 1f75afdd21..b93792146f 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 c0d1db340d..d52cde0a6c 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 8f51a4f56a..8b27d2d527 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 36daf74cd2..d05de20203 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 916cbf3818..07687bc914 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 1fccbcaf60..7668b12a03 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 f4919a24f0..2fa5cfd070 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 7a2a2d6f61..0a8de6d50b 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 d6bb60ea38..744501765c 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 0bc624e8c4..ecb57439bc 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 2af0f89648..0cdc774e78 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 8d03ce4e5b..4d9d943237 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 a2f073bdd4..bd06f3499f 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 2f55c73e8e..1f52827f74 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 50e1f944de..b6d374bf28 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 b9b259c4fb..a76f117216 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 afb643e5a2..cbfc494021 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 b6d3320804..1eaa02b7f2 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 248e1935c9..1524ef04a8 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 765ad9aa26..7fc251afd2 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 f85ab2c104..c4abdcd0d2 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 55c5cb1030..82ea8900b5 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 887c3b4000..e22e4b809e 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 780d514f58..68eb00853d 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 f40286b6c7..88d89fafda 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 23205943ab..6689be684f 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 30706e0204..78ca4fc814 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 4e11cc9d25..1ea35df675 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 47095ed931..4a3031bbf4 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 c55b454ff4..f6951f68cd 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 f216ef8952..128583bdd7 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 bb8fa4a2cb..b292d38f27 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 9a2b50ab1e..cc62bb988e 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 55f8ed5158..cd31afa0b8 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 8be9c4ef3b..2eb90761fe 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 4764c16900..fd2a906d6f 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 51c417ead5..9ef83fb58c 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 1ab5eb2219..a61ee9ce22 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 c8aca5e64c..b76ab55bfa 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 08791def08..7a2227a458 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 a03db713b1..f0b7cd90e4 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 025d12f160..0aed6b9984 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 71607621e2..d5b0a53b0c 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 1169155780..7f965126db 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 fa8f3d64b5..b2c0544491 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 45f05cae56..70fdeb0e2a 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 c335bfaed8..24bd778799 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 63849b8960..63415b3737 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 5d77e8b55b..95e2a30f9b 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 b0a9d47fbf..61a33584a5 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 06890b8443..20e1bf19f5 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 98b4b9bd52..d4545e05aa 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 ae38d8017c..f5d0b4cac9 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 da00dee153..2ae85a87b1 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 acfa11ded9..ba5a5e41cf 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 0cd209f44f..a098437d53 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 5da3136b23..7d8778bcda 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 90993c128f..d387de7574 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 86f6f60416..05f7de1319 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 bd7d7cb13a..daac8d9a99 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 251eae5738..0a291cdea6 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 f65e8b382c..1b3618558b 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 ec7a883d32..1334f05fe4 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 32c131798b..7c11399f1b 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 e07fc7e3cc..c0fcb27252 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 ba95ee5f23..9150be4d2f 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 e19dea5561..22edbd8c6b 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 4773d0d6e2..a5ea641c10 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 ffd6313405..ddf9f360c4 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 5198eaadd5..8e891d66b3 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 b61bfb1a6e..89b5f2c9be 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 b7e1045782..13e52d75f5 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 b76fcbbe5f..7c6d704042 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 3f040b37c9..65ecfcf73f 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 20ac0e2015..8489319278 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 b50659d794..19d6c15b9d 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 26db074861..040f9b7702 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 8cbef0b4a5..4083cf3b7b 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 ef446dd7e2..ebfe185cc6 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 b96479af71..88fe1dd9b6 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 057c0de406..9c21227e2b 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 c738b16eb5..dd4d3aaa5e 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 54f111bad8..c6243ea21f 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 beb42b21d8..62ec241d85 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 0ff2ba062b..706d776b24 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 311f691293..05da389ea9 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 b423c8e573..dc178cfbe0 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 0c6594b029..d1b9cda1d2 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 d46e0ced30..83ff8b529a 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 1274c22be2..929efbf816 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 48c5480070..2f66dddaf8 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 fb6652245c..f727647f7f 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 d50ffedcdc..0b4be38c0e 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 018a7dbd28..7bca8f80ef 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 eec5308cba..640c10f5a5 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 e688a3cc84..575c09cee4 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 ab49726a53..bc610bd2f3 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 920929a70a..66001c4769 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 944c628c97..cc20f847a5 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 e500b397ca..4f907157e9 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 18121e227d..00ce1c18fb 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 feb8f7531f..2322277ef6 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 a57750d553..b65bb3ed96 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 10e67dfb71..3a2eaad88b 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 6eea541b2a..6876f070fc 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 f466a27659..f1942fa546 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 db292b0c52..ca1e06e9ef 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 89f59abefe..847e98d1ca 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 3515904926..c939d8e426 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 154da5d1f6..05c201f0de 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 cb7ce6e47f..08d8708005 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 61a562af23..ebad1ea4d6 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 594feaca8a..b6768b1bf0 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 1ecc4897a6..e303e21e30 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 2e13ff1145..305bc6b40f 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 cec8c93ddc..7da7211514 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 45af825b82..4f5f57881c 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 7cd9f06036..6e74403943 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 7351ff7889..bfda1fb7e6 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 1b91de2a81..18a554d732 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 eebb1ea5f7..aa96c2dd31 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 e77652cda7..69800016e0 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: diff --git a/tools/archiver/main.cpp b/tools/archiver/main.cpp index 1b81657972..6cda54c1ea 100644 --- a/tools/archiver/main.cpp +++ b/tools/archiver/main.cpp @@ -27,11 +27,11 @@ namespace { { Buf.reserve(stride); } - void DoFinish() override { + void DoFinish() override { WriteBuf(); Flush(); } - void DoWrite(const void* data, size_t len) override { + void DoWrite(const void* data, size_t len) override { for (const char* p = (const char*)data; len > 0; ++p, --len) { Buf.append(*p); if (Buf.size() == Stride) @@ -66,12 +66,12 @@ namespace { } private: - void DoFinish() override { + void DoFinish() override { Slave_->Write('\n'); Slave_->Flush(); } - void DoWrite(const void* data, size_t len) override { + void DoWrite(const void* data, size_t len) override { const char* b = (const char*)data; while (len) { @@ -128,7 +128,7 @@ namespace { ~TYasmOutput() override { } - void DoFinish() override { + void DoFinish() override { *Out_ << Base_ << "Size:\ndd " << Count_ << '\n'; *Out_ << "%ifidn __OUTPUT_FORMAT__,elf64\n"; @@ -137,7 +137,7 @@ namespace { *Out_ << "%endif\n"; } - void DoWrite(const void* data, size_t len) override { + void DoWrite(const void* data, size_t len) override { Count_ += len; const unsigned char* p = (const unsigned char*)data; @@ -173,7 +173,7 @@ namespace { ~TCOutput() override { } - void DoFinish() override { + void DoFinish() override { *Slave() << "\n};\nextern const unsigned int " << B << "Size = sizeof(" << B << ") / sizeof(" << B << "[0]);\n}\n"; } @@ -191,11 +191,11 @@ namespace { ~TCStringOutput() override { } - void DoWrite(const void* data, size_t len) override { + void DoWrite(const void* data, size_t len) override { *O << TString((const char*)data, len).Quote() << '\n'; } - void DoFinish() override { + void DoFinish() override { //*O << ";\nextern const unsigned char* " << B << " = (const unsigned char*)" << B << "Array;\n"; *O << ";\nextern const unsigned int " << B << "Size = sizeof(" << B << ") / sizeof(" << B << "[0]) - 1;\n}\n"; } diff --git a/tools/fix_elf/patch.cpp b/tools/fix_elf/patch.cpp index 058cfd7fb1..d49ebab307 100644 --- a/tools/fix_elf/patch.cpp +++ b/tools/fix_elf/patch.cpp @@ -123,7 +123,7 @@ void Patch(const TString& path, const TString& library, IOutputStream& verboseOu TVector<Elf64_Vernaux*> patchAux; - Elf64_Vernaux* patchFromAux = nullptr; + Elf64_Vernaux* patchFromAux = nullptr; Elf64_Verneed* verneed = verneedSect.GetFirstVerneed(); while (verneed) { diff --git a/tools/fix_elf/patch.h b/tools/fix_elf/patch.h index bab280666e..c3dcd24224 100644 --- a/tools/fix_elf/patch.h +++ b/tools/fix_elf/patch.h @@ -37,7 +37,7 @@ public: } Elf64_Shdr* GetSectionByType(Elf64_Word type) const { - Elf64_Shdr* r = nullptr; + Elf64_Shdr* r = nullptr; for (Elf64_Shdr* p = GetSectionBegin(), *end = GetSectionEnd(); p != end; ++p) { if (p->sh_type == type) { @@ -141,7 +141,7 @@ public: Elf64_Verneed* GetFirstVerneed() const noexcept { if (!GetSize()) { - return nullptr; + return nullptr; } return reinterpret_cast<Elf64_Verneed*>(GetPtr()); @@ -149,7 +149,7 @@ public: Elf64_Verneed* GetNextVerneed(Elf64_Verneed* v) const noexcept { if (!v->vn_next) { - return nullptr; + return nullptr; } return Offset<Elf64_Verneed*>(v, v->vn_next); @@ -157,7 +157,7 @@ public: Elf64_Vernaux* GetFirstVernaux(Elf64_Verneed* v) const noexcept { if (!v->vn_cnt) { - return nullptr; + return nullptr; } return Offset<Elf64_Vernaux*>(v, v->vn_aux); @@ -165,7 +165,7 @@ public: Elf64_Vernaux* GetNextVernaux(Elf64_Vernaux* v) const noexcept { if (!v->vna_next) { - return nullptr; + return nullptr; } return Offset<Elf64_Vernaux*>(v, v->vna_next); diff --git a/util/charset/benchmark/utf8_to_wide/main.cpp b/util/charset/benchmark/utf8_to_wide/main.cpp index 3392b65bb2..09fa567fe5 100644 --- a/util/charset/benchmark/utf8_to_wide/main.cpp +++ b/util/charset/benchmark/utf8_to_wide/main.cpp @@ -1,24 +1,24 @@ #include <library/cpp/testing/benchmark/bench.h> - -#include <util/random/fast.h> -#include <util/random/random.h> -#include <util/generic/singleton.h> -#include <util/generic/vector.h> -#include <util/charset/wide.h> - -#include <cmath> - -namespace { - template <size_t N> + +#include <util/random/fast.h> +#include <util/random/random.h> +#include <util/generic/singleton.h> +#include <util/generic/vector.h> +#include <util/charset/wide.h> + +#include <cmath> + +namespace { + template <size_t N> struct TRandomAsciiString: public TVector<char> { - inline TRandomAsciiString() { + inline TRandomAsciiString() { reserve(N); - for (size_t i = 0; i < N; ++i) { - push_back(RandomNumber<char>(127)); - } - } - }; - + for (size_t i = 0; i < N; ++i) { + push_back(RandomNumber<char>(127)); + } + } + }; + template <size_t N> struct TRandomRuString: public TVector<char> { inline TRandomRuString() { @@ -33,18 +33,18 @@ namespace { } }; - using RAS1 = TRandomAsciiString<1>; - using RAS10 = TRandomAsciiString<10>; - using RAS50 = TRandomAsciiString<50>; - using RAS1000 = TRandomAsciiString<1000>; - using RAS1000000 = TRandomAsciiString<1000000>; + using RAS1 = TRandomAsciiString<1>; + using RAS10 = TRandomAsciiString<10>; + using RAS50 = TRandomAsciiString<50>; + using RAS1000 = TRandomAsciiString<1000>; + using RAS1000000 = TRandomAsciiString<1000000>; using RRS1 = TRandomRuString<1>; using RRS10 = TRandomRuString<10>; using RRS1000 = TRandomRuString<1000>; using RRS1000000 = TRandomRuString<1000000>; -} - +} + #ifdef _sse2_ #define IS_ASCII_BENCHMARK(length) \ Y_CPU_BENCHMARK(IsStringASCII##length, iface) { \ @@ -80,7 +80,7 @@ namespace { } \ } #endif - + IS_ASCII_BENCHMARK(1); IS_ASCII_BENCHMARK(10); IS_ASCII_BENCHMARK(50); diff --git a/util/charset/benchmark/utf8_to_wide/ya.make b/util/charset/benchmark/utf8_to_wide/ya.make index 2fb1bbcf29..4631fd7c41 100644 --- a/util/charset/benchmark/utf8_to_wide/ya.make +++ b/util/charset/benchmark/utf8_to_wide/ya.make @@ -1,9 +1,9 @@ Y_BENCHMARK() - -OWNER(agorodilov) - -SRCS( - main.cpp -) - -END() + +OWNER(agorodilov) + +SRCS( + main.cpp +) + +END() diff --git a/util/charset/ut/utf8/test1.txt b/util/charset/ut/utf8/test1.txt index 15aa804424..47a0c36486 100644 --- a/util/charset/ut/utf8/test1.txt +++ b/util/charset/ut/utf8/test1.txt @@ -1,505 +1,505 @@ -Sentences that contain all letters commonly used in a language --------------------------------------------------------------- - -Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2001-09-02 - -This file is UTF-8 encoded. - - -Danish (da) ---------- - - Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen - Wolther spillede på xylofon. - (= Quiz contestants were eating strawbery with cream while Wolther - the circus clown played on xylophone.) - -German (de) ------------ - - Falsches Üben von Xylophonmusik quält jeden größeren Zwerg - (= Wrongful practicing of xylophone music tortures every larger dwarf) - - Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich - (= Twelve boxing fighters hunted Eva across the dike of Sylt) - - Heizölrückstoßabdämpfung - (= fuel oil recoil absorber) - (jqvwxy missing, but all non-ASCII letters in one word) - -English (en) ------------- - - The quick brown fox jumps over the lazy dog - -Spanish (es) ------------- - - El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y - frío, añoraba a su querido cachorro. - (Contains every letter and every accent, but not every combination - of vowel + acute.) - -French (fr) ------------ - - Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à - côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce - qui lui permet de penser à la cænogenèse de l'être dont il est question - dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, - pense-t-il, diminue çà et là la qualité de son œuvre. - - l'île exiguë - Où l'obèse jury mûr - Fête l'haï volapük, - Âne ex aéquo au whist, - Ôtez ce vœu déçu. - - Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en - canoë au delà des îles, près du mälström où brûlent les novæ. - -Irish Gaelic (ga) ------------------ - - D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh - -Hungarian (hu) --------------- - - Árvíztűrő tükörfúrógép - (= flood-proof mirror-drilling machine, only all non-ASCII letters) - -Icelandic (is) --------------- - - Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa - - Sævör grét áðan því úlpan var ónýt - (some ASCII letters missing) - -Japanese (jp) -------------- - - Hiragana: (Iroha) - - いろはにほへとちりぬるを - わかよたれそつねならむ - うゐのおくやまけふこえて - あさきゆめみしゑひもせす - - Katakana: - - イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム - ウヰノオクヤマ ケフコエテ アサキユメミシ ヱヒモセスン - -Hebrew (iw) ------------ - - ? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה - -Polish (pl) ------------ - - Pchnąć w tę łódź jeża lub ośm skrzyń fig - (= To push a hedgehog or eight bins of figs in this boat) - -Russian (ru) ------------- - - В чащах юга жил бы цитрус? Да, но фальшивый экземпляр! - (= Would a citrus live in the bushes of south? Yes, but only a fake one!) - -Thai (th) ---------- - - [--------------------------|------------------------] - ๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน - จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร - ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย - ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ - - [The copyright for the Thai example is owned by The Computer - Association of Thailand under the Royal Patronage of His Majesty the - King.] - -Please let me know if you find others! Special thanks to the people -from all over the world who contributed these sentences. -? *Unicode Transcriptions* Notes <#Notes> - -Glyphs <http://www.macchiato.com/unicode/show.html> | Samples -<http://www.macchiato.com/unicode/Unicode_transcriptions.html> | Charts -<http://www.macchiato.com/unicode/charts.html> | UTF -<http://www.macchiato.com/unicode/convert.html> | Forms -<http://www-4.ibm.com/software/developer/library/utfencodingforms/> | -Home <http://www.macchiato.com>. -<http://member.linkexchange.com/cgi-bin/fc/fastcounter-login?750641> - -Name Text Image -Arabic (Arabic) يونِكود ? -Arabic (Persian) یونیکُد / ?/ -Armenian Յունիկօդ -Bengali য়ূনিকোড -Bopomofo ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅ -ㄨㄢˋ ㄍㄨㄛˊ ㄇㄚ˅ -Braille -Buhid -Canadian Aboriginal ᔫᗂᑰᑦ -Cherokee ᏳᏂᎪᏛ -Cypriot -Cyrillic (Russian) Юникод ? -Deseret (English) ??????? -Devanagari (Hindi) यूनिकोड ? -Ethiopic ዩኒኮድ -Georgian უნიკოდი ? -Gothic -Greek Γιούνικοντ -Gujarati યૂનિકોડ -Gurmukhi ਯੂਨਿਕੋਡ -Han (Chinese) 统一码 ? -統一碼 ? -万国码 ? -萬國碼 ? -Hangul 유니코드 -Hanunoo -Hebrew יוניקוד -Hebrew (pointed) יוּנִיקוׁד -Hebrew (Yiddish) יוניקאָד ? -Hiragana (Japanese) ゆにこおど -Katakana (Japanese) ユニコード ? -Kannada ಯೂನಿಕೋಡ್ -Khmer យូនីគោដ -Lao -Latin Unicode Unicode -Latin (IPA <#English_Pronunciation>) ˈjunɪˌkoːd ? -Latin (Am. Dict. <#American_Dictionary>) Ūnĭcōde̽ ? -Limbu -Linear B -Malayalam യൂനികോഡ് -Mongolian -Myanmar -Ogham ᚔᚒᚅᚔᚉᚑᚇ / / -Old Italic -Oriya ୟୂନିକୋଡ -Osmanya -Runic (Anglo-Saxon) ᛡᚢᚾᛁᚳᚩᛞ -Shavian -Sinhala යණනිකෞද් -Syriac ܝܘܢܝܩܘܕ -Tagbanwa -Tagalog -Tai Le -Tamil யூனிகோட் -Telugu యూనికోడ్ -Thaana -Thai ยูนืโคด -Tibetan (Dzongkha) ཨུ་ནི་ཀོཌྲ། -Ugaritic -Yi - - - Notes: - -There are different ways to transcribe the word “Unicode”, depending on -the language and script. In some cases there is only one language that -customarily uses a given script; in others there are many languages. The -goal here is at a minimum to collect at least one transcription for each -script in a language customarily written in that script, with more -languages if possible. If the transcription is the same for multiple -languages in a script, then a single representative language is used. - -Still missing are transcriptions for the items above in RED (in at least -one language). I would appreciate any other transcriptions, or -corrections for the ones listed here. Send to mark3@macchiato.com -<mailto:mark3@macchiato.com>, using the directions below: - - * *Supplying Missing Items* - o Most Latin-script languages will follow the spelling, and - change the pronunciation. For any that would not, it would - be good to have the alternate spelling. - o For non-Latin scripts the goal is to match the English - pronunciation — /*not*/ spelling. Above is the IPA <#IPA> - (in phonemic transcription) that should be matched as - closely as possible (without sounding affected in the target - language) - o Text would be best in either the UTF-8 text, or the code - points in hex HTML. E.g. either of the following: - + "Юникод" - + "Юникод" - + Note: for / supplementary characters/ - <http://www.unicode.org/glossary/#supplementary_character>, - there should be one hex number per code point, not two - surrogates - <http://www.unicode.org/glossary/#surrogate_code_point>: - # 𐀀 /*not*/ �&xDC00; - o If you have a good font, I'd also appreciate a GIF. It - should be *96 x 24* bits, with the text centered, in black - on white (plus grays if smoothed). - * *Other Comments* - o Because some browsers won't handle the text, both text and - GIF image are supplied. If you can’t read the text columns, - see Display Problems - <http://www.unicode.org/help/display_problems.html>. - o The Chinese versions (inc. Bopomofo) are translations, not - transcriptions, since "transcription in Chinese is pretty - lame" [J. Becker]. - o There are other "translations" of Unicode that may be in - use, such as the Vietnamese "Thống Nhất Mã". - o For sample pages in different languages on the Unicode site, - see What is Unicode? - <http://www.unicode.org/unicode/standard/WhatIsUnicode.html> - o Americans are not generally used to IPA, and find a variety - of different systems in their dictionaries. This one leaves - the base letters as they are, and uses diacritics for - pronunciation. - * *Etymology of /Unicode/* - o Coined by J. Becker. Not related to previous usages, such as: - + A telegraphic code in which one word or set of letters - represents a sentence or phrase; a telegram or message - in this. (late 19th century, OED) - o According to my references, the prefix "uni" is directly - from Latin while the word "code" is through French. - o The original Indo-European apparently would have been - *oino-kau-do ("one strike give"): *kau apparently being - related to such English words as: hew, haggle, hoe, hag, - hay, hack, caudad, caudal, caudate, caudex, coda, codex, - codicil, coward, incus, and Kovač (personal name: "smith"). - + I will leave the exact derivations to the exegetes, - but I like the association with "haggle" myself. - * *Contributions* - o This draws on contributions or comments from: - + Dixon Au - + Joe Becker - + Maurice Bauhahn - + Abel Cheung - + Peter Constable - + Michael Everson - + Christopher John Fynn - + Michael Kaplan - + George Kiraz - + Abdul Malik - + Siva Nataraja - + Roozbeh Pournader - + Jonathan Rosenne - + Jungshik Shin - ------------------------------------------------------------------------- - - -Terms of Use <http://www.macchiato.com/terms_of_use.html>. Last updated: -MED - 04/20/2003 15:30:33. -<http://member.linkexchange.com/cgi-bin/fc/fastcounter-login?750641> - - - - -UTF-8 encoded sample plain-text file -‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - -Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 - - -The ASCII compatible UTF-8 encoding used in this plain-text file -is defined in Unicode, ISO 10646-1, and RFC 2279. - - -Using Unicode/UTF-8, you can write in emails and source code things such as - -Mathematics and sciences: - - ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫ - ⎪⎢⎜│a²+b³ ⎟⎥⎪ - ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪ - ⎪⎢⎜⎷ c₈ ⎟⎥⎪ - ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬ - ⎪⎢⎜ ∞ ⎟⎥⎪ - ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪ - ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪ - 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭ - -Linguistics and dictionaries: - - ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn - Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ] - -APL: - - ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈ - -Nicer typography in plain text files: - - ╔══════════════════════════════════════════╗ - ║ ║ - ║ • ‘single’ and “double” quotes ║ - ║ ║ - ║ • Curly apostrophes: “We’ve been here” ║ - ║ ║ - ║ • Latin-1 apostrophe and accents: '´` ║ - ║ ║ - ║ • ‚deutsche‘ „Anführungszeichen“ ║ - ║ ║ - ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║ - ║ ║ - ║ • ASCII safety test: 1lI|, 0OD, 8B ║ - ║ ╭─────────╮ ║ - ║ • the euro symbol: │ 14.95 € │ ║ - ║ ╰─────────╯ ║ - ╚══════════════════════════════════════════╝ - -Combining characters: - - STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑ - -Greek (in Polytonic): - - The Greek anthem: - - Σὲ γνωρίζω ἀπὸ τὴν κόψη - τοῦ σπαθιοῦ τὴν τρομερή, - σὲ γνωρίζω ἀπὸ τὴν ὄψη - ποὺ μὲ βία μετράει τὴ γῆ. - - ᾿Απ᾿ τὰ κόκκαλα βγαλμένη - τῶν ῾Ελλήνων τὰ ἱερά - καὶ σὰν πρῶτα ἀνδρειωμένη - χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά! - - From a speech of Demosthenes in the 4th century BC: - - Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι, - ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς - λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ - τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿ - εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ - πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν - οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι, - οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν - ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον - τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι - γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν - προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους - σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ - τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ - τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς - τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον. - - Δημοσθένους, Γ´ ᾿Ολυνθιακὸς - -Georgian: - - From a Unicode conference invitation: - - გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო - კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს, - ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს - ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი, - ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება - ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში, - ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. - -Russian: - - From a Unicode conference invitation: - - Зарегистрируйтесь сейчас на Десятую Международную Конференцию по - Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии. - Конференция соберет широкий круг экспертов по вопросам глобального - Интернета и Unicode, локализации и интернационализации, воплощению и - применению Unicode в различных операционных системах и программных - приложениях, шрифтах, верстке и многоязычных компьютерных системах. - -Thai (UCS Level 2): - - Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese - classic 'San Gua'): - - [----------------------------|------------------------] - ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่ - สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา - ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา - โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ - เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ - ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ - พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้ - ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ - - (The above is a two-column text. If combining characters are handled - correctly, the lines of the second column should be aligned with the - | character above.) - -Ethiopian: - - Proverbs in the Amharic language: - - ሰማይ አይታረስ ንጉሥ አይከሰስ። - ብላ ካለኝ እንደአባቴ በቆመጠኝ። - ጌጥ ያለቤቱ ቁምጥና ነው። - ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው። - የአፍ ወለምታ በቅቤ አይታሽም። - አይጥ በበላ ዳዋ ተመታ። - ሲተረጉሙ ይደረግሙ። - ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል። - ድር ቢያብር አንበሳ ያስር። - ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም። - እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም። - የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ። - ሥራ ከመፍታት ልጄን ላፋታት። - ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል። - የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ። - ተንጋሎ ቢተፉ ተመልሶ ባፉ። - ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው። - እግርህን በፍራሽህ ልክ ዘርጋ። - -Runes: - - ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ - - (Old English, which transcribed into Latin reads 'He cwaeth that he - bude thaem lande northweardum with tha Westsae.' and means 'He said - that he lived in the northern land near the Western Sea.') - -Braille: - - ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌ - - ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞ - ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎ - ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂ - ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙ - ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑ - ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲ - - ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ - - ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹ - ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞ - ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕ - ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹ - ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎ - ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎ - ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳ - ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞ - ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ - - (The first couple of paragraphs of "A Christmas Carol" by Dickens) - -Compact font selection example text: - - ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 - abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ - –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд - ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა - -Greetings in various languages: - - Hello world, Καλημέρα κόσμε, コンニチハ - -Box drawing alignment tests: █ - ▉ - ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳ - ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳ - ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳ - ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳ - ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎ - ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏ - ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█ - ▝▀▘▙▄▟ +Sentences that contain all letters commonly used in a language +-------------------------------------------------------------- + +Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2001-09-02 + +This file is UTF-8 encoded. + + +Danish (da) +--------- + + Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen + Wolther spillede på xylofon. + (= Quiz contestants were eating strawbery with cream while Wolther + the circus clown played on xylophone.) + +German (de) +----------- + + Falsches Üben von Xylophonmusik quält jeden größeren Zwerg + (= Wrongful practicing of xylophone music tortures every larger dwarf) + + Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich + (= Twelve boxing fighters hunted Eva across the dike of Sylt) + + Heizölrückstoßabdämpfung + (= fuel oil recoil absorber) + (jqvwxy missing, but all non-ASCII letters in one word) + +English (en) +------------ + + The quick brown fox jumps over the lazy dog + +Spanish (es) +------------ + + El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y + frío, añoraba a su querido cachorro. + (Contains every letter and every accent, but not every combination + of vowel + acute.) + +French (fr) +----------- + + Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à + côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce + qui lui permet de penser à la cænogenèse de l'être dont il est question + dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, + pense-t-il, diminue çà et là la qualité de son œuvre. + + l'île exiguë + Où l'obèse jury mûr + Fête l'haï volapük, + Âne ex aéquo au whist, + Ôtez ce vœu déçu. + + Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en + canoë au delà des îles, près du mälström où brûlent les novæ. + +Irish Gaelic (ga) +----------------- + + D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh + +Hungarian (hu) +-------------- + + Árvíztűrő tükörfúrógép + (= flood-proof mirror-drilling machine, only all non-ASCII letters) + +Icelandic (is) +-------------- + + Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa + + Sævör grét áðan því úlpan var ónýt + (some ASCII letters missing) + +Japanese (jp) +------------- + + Hiragana: (Iroha) + + いろはにほへとちりぬるを + わかよたれそつねならむ + うゐのおくやまけふこえて + あさきゆめみしゑひもせす + + Katakana: + + イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム + ウヰノオクヤマ ケフコエテ アサキユメミシ ヱヒモセスン + +Hebrew (iw) +----------- + + ? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה + +Polish (pl) +----------- + + Pchnąć w tę łódź jeża lub ośm skrzyń fig + (= To push a hedgehog or eight bins of figs in this boat) + +Russian (ru) +------------ + + В чащах юга жил бы цитрус? Да, но фальшивый экземпляр! + (= Would a citrus live in the bushes of south? Yes, but only a fake one!) + +Thai (th) +--------- + + [--------------------------|------------------------] + ๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน + จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร + ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย + ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ + + [The copyright for the Thai example is owned by The Computer + Association of Thailand under the Royal Patronage of His Majesty the + King.] + +Please let me know if you find others! Special thanks to the people +from all over the world who contributed these sentences. +? *Unicode Transcriptions* Notes <#Notes> + +Glyphs <http://www.macchiato.com/unicode/show.html> | Samples +<http://www.macchiato.com/unicode/Unicode_transcriptions.html> | Charts +<http://www.macchiato.com/unicode/charts.html> | UTF +<http://www.macchiato.com/unicode/convert.html> | Forms +<http://www-4.ibm.com/software/developer/library/utfencodingforms/> | +Home <http://www.macchiato.com>. +<http://member.linkexchange.com/cgi-bin/fc/fastcounter-login?750641> + +Name Text Image +Arabic (Arabic) يونِكود ? +Arabic (Persian) یونیکُد / ?/ +Armenian Յունիկօդ +Bengali য়ূনিকোড +Bopomofo ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅ +ㄨㄢˋ ㄍㄨㄛˊ ㄇㄚ˅ +Braille +Buhid +Canadian Aboriginal ᔫᗂᑰᑦ +Cherokee ᏳᏂᎪᏛ +Cypriot +Cyrillic (Russian) Юникод ? +Deseret (English) ??????? +Devanagari (Hindi) यूनिकोड ? +Ethiopic ዩኒኮድ +Georgian უნიკოდი ? +Gothic +Greek Γιούνικοντ +Gujarati યૂનિકોડ +Gurmukhi ਯੂਨਿਕੋਡ +Han (Chinese) 统一码 ? +統一碼 ? +万国码 ? +萬國碼 ? +Hangul 유니코드 +Hanunoo +Hebrew יוניקוד +Hebrew (pointed) יוּנִיקוׁד +Hebrew (Yiddish) יוניקאָד ? +Hiragana (Japanese) ゆにこおど +Katakana (Japanese) ユニコード ? +Kannada ಯೂನಿಕೋಡ್ +Khmer យូនីគោដ +Lao +Latin Unicode Unicode +Latin (IPA <#English_Pronunciation>) ˈjunɪˌkoːd ? +Latin (Am. Dict. <#American_Dictionary>) Ūnĭcōde̽ ? +Limbu +Linear B +Malayalam യൂനികോഡ് +Mongolian +Myanmar +Ogham ᚔᚒᚅᚔᚉᚑᚇ / / +Old Italic +Oriya ୟୂନିକୋଡ +Osmanya +Runic (Anglo-Saxon) ᛡᚢᚾᛁᚳᚩᛞ +Shavian +Sinhala යණනිකෞද් +Syriac ܝܘܢܝܩܘܕ +Tagbanwa +Tagalog +Tai Le +Tamil யூனிகோட் +Telugu యూనికోడ్ +Thaana +Thai ยูนืโคด +Tibetan (Dzongkha) ཨུ་ནི་ཀོཌྲ། +Ugaritic +Yi + + + Notes: + +There are different ways to transcribe the word “Unicode”, depending on +the language and script. In some cases there is only one language that +customarily uses a given script; in others there are many languages. The +goal here is at a minimum to collect at least one transcription for each +script in a language customarily written in that script, with more +languages if possible. If the transcription is the same for multiple +languages in a script, then a single representative language is used. + +Still missing are transcriptions for the items above in RED (in at least +one language). I would appreciate any other transcriptions, or +corrections for the ones listed here. Send to mark3@macchiato.com +<mailto:mark3@macchiato.com>, using the directions below: + + * *Supplying Missing Items* + o Most Latin-script languages will follow the spelling, and + change the pronunciation. For any that would not, it would + be good to have the alternate spelling. + o For non-Latin scripts the goal is to match the English + pronunciation — /*not*/ spelling. Above is the IPA <#IPA> + (in phonemic transcription) that should be matched as + closely as possible (without sounding affected in the target + language) + o Text would be best in either the UTF-8 text, or the code + points in hex HTML. E.g. either of the following: + + "Юникод" + + "Юникод" + + Note: for / supplementary characters/ + <http://www.unicode.org/glossary/#supplementary_character>, + there should be one hex number per code point, not two + surrogates + <http://www.unicode.org/glossary/#surrogate_code_point>: + # 𐀀 /*not*/ �&xDC00; + o If you have a good font, I'd also appreciate a GIF. It + should be *96 x 24* bits, with the text centered, in black + on white (plus grays if smoothed). + * *Other Comments* + o Because some browsers won't handle the text, both text and + GIF image are supplied. If you can’t read the text columns, + see Display Problems + <http://www.unicode.org/help/display_problems.html>. + o The Chinese versions (inc. Bopomofo) are translations, not + transcriptions, since "transcription in Chinese is pretty + lame" [J. Becker]. + o There are other "translations" of Unicode that may be in + use, such as the Vietnamese "Thống Nhất Mã". + o For sample pages in different languages on the Unicode site, + see What is Unicode? + <http://www.unicode.org/unicode/standard/WhatIsUnicode.html> + o Americans are not generally used to IPA, and find a variety + of different systems in their dictionaries. This one leaves + the base letters as they are, and uses diacritics for + pronunciation. + * *Etymology of /Unicode/* + o Coined by J. Becker. Not related to previous usages, such as: + + A telegraphic code in which one word or set of letters + represents a sentence or phrase; a telegram or message + in this. (late 19th century, OED) + o According to my references, the prefix "uni" is directly + from Latin while the word "code" is through French. + o The original Indo-European apparently would have been + *oino-kau-do ("one strike give"): *kau apparently being + related to such English words as: hew, haggle, hoe, hag, + hay, hack, caudad, caudal, caudate, caudex, coda, codex, + codicil, coward, incus, and Kovač (personal name: "smith"). + + I will leave the exact derivations to the exegetes, + but I like the association with "haggle" myself. + * *Contributions* + o This draws on contributions or comments from: + + Dixon Au + + Joe Becker + + Maurice Bauhahn + + Abel Cheung + + Peter Constable + + Michael Everson + + Christopher John Fynn + + Michael Kaplan + + George Kiraz + + Abdul Malik + + Siva Nataraja + + Roozbeh Pournader + + Jonathan Rosenne + + Jungshik Shin + +------------------------------------------------------------------------ + + +Terms of Use <http://www.macchiato.com/terms_of_use.html>. Last updated: +MED - 04/20/2003 15:30:33. +<http://member.linkexchange.com/cgi-bin/fc/fastcounter-login?750641> + + + + +UTF-8 encoded sample plain-text file +‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 + + +The ASCII compatible UTF-8 encoding used in this plain-text file +is defined in Unicode, ISO 10646-1, and RFC 2279. + + +Using Unicode/UTF-8, you can write in emails and source code things such as + +Mathematics and sciences: + + ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫ + ⎪⎢⎜│a²+b³ ⎟⎥⎪ + ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪ + ⎪⎢⎜⎷ c₈ ⎟⎥⎪ + ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬ + ⎪⎢⎜ ∞ ⎟⎥⎪ + ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪ + ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪ + 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭ + +Linguistics and dictionaries: + + ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn + Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ] + +APL: + + ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈ + +Nicer typography in plain text files: + + ╔══════════════════════════════════════════╗ + ║ ║ + ║ • ‘single’ and “double” quotes ║ + ║ ║ + ║ • Curly apostrophes: “We’ve been here” ║ + ║ ║ + ║ • Latin-1 apostrophe and accents: '´` ║ + ║ ║ + ║ • ‚deutsche‘ „Anführungszeichen“ ║ + ║ ║ + ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║ + ║ ║ + ║ • ASCII safety test: 1lI|, 0OD, 8B ║ + ║ ╭─────────╮ ║ + ║ • the euro symbol: │ 14.95 € │ ║ + ║ ╰─────────╯ ║ + ╚══════════════════════════════════════════╝ + +Combining characters: + + STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑ + +Greek (in Polytonic): + + The Greek anthem: + + Σὲ γνωρίζω ἀπὸ τὴν κόψη + τοῦ σπαθιοῦ τὴν τρομερή, + σὲ γνωρίζω ἀπὸ τὴν ὄψη + ποὺ μὲ βία μετράει τὴ γῆ. + + ᾿Απ᾿ τὰ κόκκαλα βγαλμένη + τῶν ῾Ελλήνων τὰ ἱερά + καὶ σὰν πρῶτα ἀνδρειωμένη + χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά! + + From a speech of Demosthenes in the 4th century BC: + + Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι, + ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς + λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ + τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿ + εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ + πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν + οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι, + οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν + ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον + τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι + γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν + προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους + σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ + τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ + τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς + τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον. + + Δημοσθένους, Γ´ ᾿Ολυνθιακὸς + +Georgian: + + From a Unicode conference invitation: + + გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო + კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს, + ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს + ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი, + ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება + ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში, + ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. + +Russian: + + From a Unicode conference invitation: + + Зарегистрируйтесь сейчас на Десятую Международную Конференцию по + Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии. + Конференция соберет широкий круг экспертов по вопросам глобального + Интернета и Unicode, локализации и интернационализации, воплощению и + применению Unicode в различных операционных системах и программных + приложениях, шрифтах, верстке и многоязычных компьютерных системах. + +Thai (UCS Level 2): + + Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese + classic 'San Gua'): + + [----------------------------|------------------------] + ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่ + สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา + ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา + โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ + เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ + ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ + พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้ + ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ + + (The above is a two-column text. If combining characters are handled + correctly, the lines of the second column should be aligned with the + | character above.) + +Ethiopian: + + Proverbs in the Amharic language: + + ሰማይ አይታረስ ንጉሥ አይከሰስ። + ብላ ካለኝ እንደአባቴ በቆመጠኝ። + ጌጥ ያለቤቱ ቁምጥና ነው። + ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው። + የአፍ ወለምታ በቅቤ አይታሽም። + አይጥ በበላ ዳዋ ተመታ። + ሲተረጉሙ ይደረግሙ። + ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል። + ድር ቢያብር አንበሳ ያስር። + ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም። + እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም። + የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ። + ሥራ ከመፍታት ልጄን ላፋታት። + ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል። + የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ። + ተንጋሎ ቢተፉ ተመልሶ ባፉ። + ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው። + እግርህን በፍራሽህ ልክ ዘርጋ። + +Runes: + + ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ + + (Old English, which transcribed into Latin reads 'He cwaeth that he + bude thaem lande northweardum with tha Westsae.' and means 'He said + that he lived in the northern land near the Western Sea.') + +Braille: + + ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌ + + ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞ + ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎ + ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂ + ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙ + ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑ + ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲ + + ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ + + ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹ + ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞ + ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕ + ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹ + ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎ + ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎ + ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳ + ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞ + ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ + + (The first couple of paragraphs of "A Christmas Carol" by Dickens) + +Compact font selection example text: + + ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789 + abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ + –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд + ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა + +Greetings in various languages: + + Hello world, Καλημέρα κόσμε, コンニチハ + +Box drawing alignment tests: █ + ▉ + ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳ + ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳ + ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳ + ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳ + ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎ + ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏ + ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█ + ▝▀▘▙▄▟ diff --git a/util/charset/ut/ya.make b/util/charset/ut/ya.make index 2d6a618938..6526815e92 100644 --- a/util/charset/ut/ya.make +++ b/util/charset/ut/ya.make @@ -4,7 +4,7 @@ OWNER(g:util) SUBSCRIBER(g:util-subscribers) DATA(arcadia/util/charset/ut/utf8) - + SRCS( utf8_ut.cpp wide_ut.cpp diff --git a/util/charset/utf8_ut.cpp b/util/charset/utf8_ut.cpp index fc735f8331..9e68881cca 100644 --- a/util/charset/utf8_ut.cpp +++ b/util/charset/utf8_ut.cpp @@ -1,9 +1,9 @@ #include "utf8.h" #include "wide.h" -#include <util/stream/file.h> +#include <util/stream/file.h> #include <util/ysaveload.h> - + #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/testing/unittest/env.h> @@ -51,7 +51,7 @@ Y_UNIT_TEST_SUITE(TUtfUtilTest) { } } } - + Y_UNIT_TEST(TestToUpperUtfString) { UNIT_ASSERT_VALUES_EQUAL(ToUpperUTF8("xyz XYZ привет!"), "XYZ XYZ ПРИВЕТ!"); @@ -94,10 +94,10 @@ Y_UNIT_TEST_SUITE(TUtfUtilTest) { Y_UNIT_TEST(TestUTF8ToWide) { TFileInput in(ArcadiaSourceRoot() + TStringBuf("/util/charset/ut/utf8/test1.txt")); - + TString text = in.ReadAll(); - UNIT_ASSERT(WideToUTF8(UTF8ToWide(text)) == text); - } + UNIT_ASSERT(WideToUTF8(UTF8ToWide(text)) == text); + } Y_UNIT_TEST(TestInvalidUTF8) { TVector<TString> testData; diff --git a/util/charset/wide.h b/util/charset/wide.h index f26e4c2a67..04e6928aab 100644 --- a/util/charset/wide.h +++ b/util/charset/wide.h @@ -457,59 +457,59 @@ inline TUtf16String UTF32ToWide(const wchar32* begin, size_t len) { return res; } -// adopted from https://chromium.googlesource.com/chromium/src/+/master/base/strings/string_util.cc -// Assuming that a pointer is the size of a "machine word", then -// uintptr_t is an integer type that is also a machine word. - -namespace NDetail { - using TMachineWord = uintptr_t; - const uintptr_t kMachineWordAlignmentMask = sizeof(TMachineWord) - 1; - - inline bool IsAlignedToMachineWord(const void* pointer) { - return !(reinterpret_cast<TMachineWord>(pointer) & kMachineWordAlignmentMask); - } - +// adopted from https://chromium.googlesource.com/chromium/src/+/master/base/strings/string_util.cc +// Assuming that a pointer is the size of a "machine word", then +// uintptr_t is an integer type that is also a machine word. + +namespace NDetail { + using TMachineWord = uintptr_t; + const uintptr_t kMachineWordAlignmentMask = sizeof(TMachineWord) - 1; + + inline bool IsAlignedToMachineWord(const void* pointer) { + return !(reinterpret_cast<TMachineWord>(pointer) & kMachineWordAlignmentMask); + } + template <typename T> - inline T* AlignToMachineWord(T* pointer) { - return reinterpret_cast<T*>(reinterpret_cast<TMachineWord>(pointer) & ~kMachineWordAlignmentMask); - } - + inline T* AlignToMachineWord(T* pointer) { + return reinterpret_cast<T*>(reinterpret_cast<TMachineWord>(pointer) & ~kMachineWordAlignmentMask); + } + template <size_t size, typename CharacterType> - struct NonASCIIMask; - + struct NonASCIIMask; + template <> struct NonASCIIMask<4, wchar16> { static constexpr ui32 Value() { return 0xFF80FF80U; } - }; - + }; + template <> struct NonASCIIMask<4, char> { static constexpr ui32 Value() { return 0x80808080U; } - }; - + }; + template <> struct NonASCIIMask<8, wchar16> { static constexpr ui64 Value() { return 0xFF80FF80FF80FF80ULL; } - }; - + }; + template <> struct NonASCIIMask<8, char> { static constexpr ui64 Value() { return 0x8080808080808080ULL; } - }; - - template <typename TChar> + }; + + template <typename TChar> inline bool DoIsStringASCIISlow(const TChar* first, const TChar* last) { using TUnsignedChar = std::make_unsigned_t<TChar>; Y_ASSERT(first <= last); @@ -522,41 +522,41 @@ namespace NDetail { } template <typename TChar> - inline bool DoIsStringASCII(const TChar* first, const TChar* last) { + inline bool DoIsStringASCII(const TChar* first, const TChar* last) { if (last - first < 10) { return DoIsStringASCIISlow(first, last); } - TMachineWord allCharBits = 0; - TMachineWord nonAsciiBitMask = NonASCIIMask<sizeof(TMachineWord), TChar>::Value(); - - // Prologue: align the input. - while (!IsAlignedToMachineWord(first) && first != last) { - allCharBits |= *first; - ++first; - } - - // Compare the values of CPU word size. - const TChar* word_end = AlignToMachineWord(last); - const size_t loopIncrement = sizeof(TMachineWord) / sizeof(TChar); - while (first < word_end) { - allCharBits |= *(reinterpret_cast<const TMachineWord*>(first)); - first += loopIncrement; - - // fast exit - if (allCharBits & nonAsciiBitMask) { - return false; - } - } - - // Process the remaining bytes. - while (first != last) { - allCharBits |= *first; - ++first; - } - - return !(allCharBits & nonAsciiBitMask); - } - + TMachineWord allCharBits = 0; + TMachineWord nonAsciiBitMask = NonASCIIMask<sizeof(TMachineWord), TChar>::Value(); + + // Prologue: align the input. + while (!IsAlignedToMachineWord(first) && first != last) { + allCharBits |= *first; + ++first; + } + + // Compare the values of CPU word size. + const TChar* word_end = AlignToMachineWord(last); + const size_t loopIncrement = sizeof(TMachineWord) / sizeof(TChar); + while (first < word_end) { + allCharBits |= *(reinterpret_cast<const TMachineWord*>(first)); + first += loopIncrement; + + // fast exit + if (allCharBits & nonAsciiBitMask) { + return false; + } + } + + // Process the remaining bytes. + while (first != last) { + allCharBits |= *first; + ++first; + } + + return !(allCharBits & nonAsciiBitMask); + } + #ifdef _sse2_ inline bool DoIsStringASCIISSE(const unsigned char* first, const unsigned char* last) { //scalar version for short strings @@ -572,10 +572,10 @@ namespace NDetail { int asciiMask = _mm_movemask_epi8(chunk); if (asciiMask) { - return false; + return false; } first += 16; - } + } if (first + 8 <= last) { memcpy(buf, first, 8); @@ -589,15 +589,15 @@ namespace NDetail { } return ::NDetail::DoIsStringASCIISlow(first, last); - } + } #endif //_sse2_ - + } - + //! returns @c true if character sequence has no symbols with value greater than 0x7F template <typename TChar> inline bool IsStringASCII(const TChar* first, const TChar* last) { - return ::NDetail::DoIsStringASCII(first, last); + return ::NDetail::DoIsStringASCII(first, last); } #ifdef _sse2_ diff --git a/util/draft/date.h b/util/draft/date.h index 67922526fb..e3eb616fe5 100644 --- a/util/draft/date.h +++ b/util/draft/date.h @@ -24,7 +24,7 @@ public: // XXX: wrong. Should be replace with two methods: TodayGmt() and TodayLocal() static TDate Today() { - return TDate(time(nullptr)); + return TDate(time(nullptr)); } TDate(const char* yyyymmdd); diff --git a/util/draft/datetime_ut.cpp b/util/draft/datetime_ut.cpp index 00dd602377..a5e065ef6e 100644 --- a/util/draft/datetime_ut.cpp +++ b/util/draft/datetime_ut.cpp @@ -88,7 +88,7 @@ Y_UNIT_TEST_SUITE(TSimpleTMTest) { UNIT_ASSERT_VALUES_EQUAL((ui32)0, (ui32)TSimpleTM::New(0)); UNIT_ASSERT((ui32)TSimpleTM::New(0).IsUTC()); - time_t t = time(nullptr); + time_t t = time(nullptr); { struct tm tmt; diff --git a/util/draft/enum.h b/util/draft/enum.h index ed8536644a..18002b7df2 100644 --- a/util/draft/enum.h +++ b/util/draft/enum.h @@ -24,7 +24,7 @@ const V* FindEnumFromStringImpl(K1 key, const std::pair<K2, V>* entries, size_t for (size_t i = 0; i < arraySize; i++) if (entries[i].first == key) return &entries[i].second; - return nullptr; + return nullptr; } // special version for const char* @@ -33,7 +33,7 @@ const V* FindEnumFromStringImpl(const char* key, const std::pair<const char*, V> for (size_t i = 0; i < arraySize; i++) if (entries[i].first && key && !strcmp(entries[i].first, key)) return &entries[i].second; - return nullptr; + return nullptr; } template <class K, class V> diff --git a/util/draft/holder_vector.h b/util/draft/holder_vector.h index 2df6c83476..1c62055bd9 100644 --- a/util/draft/holder_vector.h +++ b/util/draft/holder_vector.h @@ -67,7 +67,7 @@ public: T* Release(size_t i) { T* t = (*this)[i]; - (*this)[i] = nullptr; + (*this)[i] = nullptr; return t; } diff --git a/util/draft/holder_vector_ut.cpp b/util/draft/holder_vector_ut.cpp index 9a7a4d0662..f64393860a 100644 --- a/util/draft/holder_vector_ut.cpp +++ b/util/draft/holder_vector_ut.cpp @@ -15,7 +15,7 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) { UNIT_ASSERT(ints); for (size_t i = 0; i < ints.Size(); ++i) { - UNIT_ASSERT_EQUAL(ints[i], (int*)nullptr); + UNIT_ASSERT_EQUAL(ints[i], (int*)nullptr); } } @@ -34,9 +34,9 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) { Y_UNIT_TEST(TestResetNoValue) { THolderVector<int> ints; ints.Resize(1); - UNIT_ASSERT_EQUAL(ints[0], (int*)nullptr); + UNIT_ASSERT_EQUAL(ints[0], (int*)nullptr); ints.Reset(0, MakeHolder<int>(1)); - UNIT_ASSERT_UNEQUAL(ints[0], (int*)nullptr); + UNIT_ASSERT_UNEQUAL(ints[0], (int*)nullptr); UNIT_ASSERT_VALUES_EQUAL(*ints[0], 1); } diff --git a/util/draft/matrix.h b/util/draft/matrix.h index b7dbb7268e..154d00b35e 100644 --- a/util/draft/matrix.h +++ b/util/draft/matrix.h @@ -10,8 +10,8 @@ class TMatrix: TNonCopyable { // Constructor/Destructor public: TMatrix() - : Buf(nullptr) - , Arr(nullptr) + : Buf(nullptr) + , Arr(nullptr) , M(0) , N(0) , BufSize(0) @@ -28,7 +28,7 @@ public: } TMatrix(size_t m, size_t n, T* buf) - : Buf(nullptr) + : Buf(nullptr) , Arr(buf) , M(m) , N(n) diff --git a/util/folder/pathsplit.h b/util/folder/pathsplit.h index 01d921995e..d134338e35 100644 --- a/util/folder/pathsplit.h +++ b/util/folder/pathsplit.h @@ -68,7 +68,7 @@ using TPathSplitTraitsLocal = TPathSplitTraitsWindows; template <class TTraits> class TPathSplitBase: public TTraits { public: - inline TPathSplitBase() = default; + inline TPathSplitBase() = default; inline TPathSplitBase(const TStringBuf part) { this->ParseFirstPart(part); diff --git a/util/generic/bitmap.h b/util/generic/bitmap.h index e0b3f0cd4a..f77d182460 100644 --- a/util/generic/bitmap.h +++ b/util/generic/bitmap.h @@ -347,7 +347,7 @@ public: } public: - ~TReference() = default; + ~TReference() = default; Y_FORCE_INLINE TReference& operator=(bool val) { if (val) @@ -416,14 +416,14 @@ private: } public: - TBitMapOps() = default; + TBitMapOps() = default; TBitMapOps(TChunk val) { Mask.Data[0] = val; Mask.Sanitize(); } - TBitMapOps(const TThis&) = default; + TBitMapOps(const TThis&) = default; template <class T> TBitMapOps(const TBitMapOps<T>& bitmap) @@ -1093,7 +1093,7 @@ public: { } - TBitMap(const TBitMap<BitCount, TChunkType>&) = default; + TBitMap(const TBitMap<BitCount, TChunkType>&) = default; template <class T> TBitMap(const TBitMapOps<T>& bitmap) diff --git a/util/generic/bitops.h b/util/generic/bitops.h index bc4b5e5bbe..2db15fc59b 100644 --- a/util/generic/bitops.h +++ b/util/generic/bitops.h @@ -310,14 +310,14 @@ Y_FORCE_INLINE ui64 LeastSignificantBit(ui64 v) { } /* - * Returns 0 - based position of the most significant bit (compile time) - * 0 for 0. - */ -constexpr ui64 MostSignificantBitCT(ui64 x) { - return x > 1 ? 1 + MostSignificantBitCT(x >> 1) : 0; -} - -/* + * Returns 0 - based position of the most significant bit (compile time) + * 0 for 0. + */ +constexpr ui64 MostSignificantBitCT(ui64 x) { + return x > 1 ? 1 + MostSignificantBitCT(x >> 1) : 0; +} + +/* * Return rounded up binary logarithm of `x`. */ Y_FORCE_INLINE ui8 CeilLog2(ui64 x) { diff --git a/util/generic/bitops_ut.cpp b/util/generic/bitops_ut.cpp index 5a4fc0b433..d23c2b5c27 100644 --- a/util/generic/bitops_ut.cpp +++ b/util/generic/bitops_ut.cpp @@ -85,7 +85,7 @@ Y_UNIT_TEST_SUITE(TBitOpsTest) { static_assert(MostSignificantBitCT(0) == 0, "."); static_assert(MostSignificantBitCT(1) == 0, "."); static_assert(MostSignificantBitCT(5) == 2, "."); - + for (ui32 i = 0; i < 64; ++i) { UNIT_ASSERT_VALUES_EQUAL(i, MostSignificantBit(ui64{1} << i)); } diff --git a/util/generic/cast_ut.cpp b/util/generic/cast_ut.cpp index 2c759a561b..718a8de79d 100644 --- a/util/generic/cast_ut.cpp +++ b/util/generic/cast_ut.cpp @@ -13,7 +13,7 @@ class TGenericCastsTest: public TTestBase { private: struct TAaa { - virtual ~TAaa() = default; + virtual ~TAaa() = default; }; struct TBbb: public TAaa {}; diff --git a/util/generic/flags_ut.cpp b/util/generic/flags_ut.cpp index 63dacffab3..5377c6a058 100644 --- a/util/generic/flags_ut.cpp +++ b/util/generic/flags_ut.cpp @@ -83,7 +83,7 @@ Y_UNIT_TEST_SUITE(TFlagsTest) { } Y_UNIT_TEST(TestOutput) { - ETest1 value0 = nullptr, value1 = Test1, value7 = Test1 | Test2 | Test4; + ETest1 value0 = nullptr, value1 = Test1, value7 = Test1 | Test2 | Test4; UNIT_ASSERT_VALUES_EQUAL(ToString(value0), "TFlags(0000000000000000)"); UNIT_ASSERT_VALUES_EQUAL(ToString(value1), "TFlags(0000000000000001)"); @@ -91,7 +91,7 @@ Y_UNIT_TEST_SUITE(TFlagsTest) { } Y_UNIT_TEST(TestHash) { - ETest1 value0 = nullptr, value1 = Test1; + ETest1 value0 = nullptr, value1 = Test1; THashMap<ETest1, int> hash; hash[value0] = 0; diff --git a/util/generic/hash.h b/util/generic/hash.h index 33fff78e08..e46db21fa9 100644 --- a/util/generic/hash.h +++ b/util/generic/hash.h @@ -97,7 +97,7 @@ struct __yhashtable_iterator { return !cur; } Y_FORCE_INLINE explicit operator bool() const noexcept { - return cur != nullptr; + return cur != nullptr; } }; @@ -144,7 +144,7 @@ struct __yhashtable_const_iterator { return !cur; } Y_FORCE_INLINE explicit operator bool() const noexcept { - return cur != nullptr; + return cur != nullptr; } }; @@ -1242,9 +1242,9 @@ void THashTable<V, K, HF, Ex, Eq, A>::erase(iterator first, iterator last) { else if (f_bucket == l_bucket) erase_bucket(f_bucket, first.cur, last.cur); else { - erase_bucket(f_bucket, first.cur, nullptr); + erase_bucket(f_bucket, first.cur, nullptr); for (size_type n = f_bucket + 1; n < l_bucket; ++n) - erase_bucket(n, nullptr); + erase_bucket(n, nullptr); if (l_bucket != buckets.size()) /*y*/ erase_bucket(l_bucket, last.cur); } @@ -1322,7 +1322,7 @@ void THashTable<V, K, HF, Ex, Eq, A>::erase_bucket(const size_type n, node* firs while (next != last) { /*y; 3.1*/ cur->next = next->next; delete_node(next); - next = ((uintptr_t)cur->next & 1) ? nullptr : cur->next; /*y*/ + next = ((uintptr_t)cur->next & 1) ? nullptr : cur->next; /*y*/ --num_elements; } } @@ -1334,7 +1334,7 @@ void THashTable<V, K, HF, Ex, Eq, A>::erase_bucket(const size_type n, node* last while (cur != last) { node* next = cur->next; delete_node(cur); - cur = ((uintptr_t)next & 1) ? nullptr : next; /*y*/ + cur = ((uintptr_t)next & 1) ? nullptr : next; /*y*/ buckets[n] = cur; --num_elements; } diff --git a/util/generic/intrlist.h b/util/generic/intrlist.h index e8c17df072..b5d3f2051b 100644 --- a/util/generic/intrlist.h +++ b/util/generic/intrlist.h @@ -229,7 +229,7 @@ private: using reference = typename TIterator::reference; using pointer = typename TIterator::pointer; - inline TReverseIteratorBase() noexcept = default; + inline TReverseIteratorBase() noexcept = default; template <class TIterator_> inline TReverseIteratorBase(const TReverseIteratorBase<TIterator_>& right) noexcept @@ -340,7 +340,7 @@ public: } public: - inline TIntrusiveList() noexcept = default; + inline TIntrusiveList() noexcept = default; inline ~TIntrusiveList() = default; @@ -600,7 +600,7 @@ public: using const_reverse_iterator = TConstReverseIterator; public: - inline TIntrusiveListWithAutoDelete() noexcept = default; + inline TIntrusiveListWithAutoDelete() noexcept = default; inline TIntrusiveListWithAutoDelete(TIntrusiveListWithAutoDelete&& right) noexcept : TIntrusiveList<T, Tag>(std::move(right)) @@ -647,7 +647,7 @@ public: { } - inline ~TIntrusiveSListItem() = default; + inline ~TIntrusiveSListItem() = default; inline bool IsEnd() const noexcept { return Next_ == nullptr; diff --git a/util/generic/maybe.h b/util/generic/maybe.h index ae06f836e5..34d21aebcd 100644 --- a/util/generic/maybe.h +++ b/util/generic/maybe.h @@ -306,11 +306,11 @@ public: } const T* Get() const noexcept { - return Defined() ? Data() : nullptr; + return Defined() ? Data() : nullptr; } T* Get() noexcept { - return Defined() ? Data() : nullptr; + return Defined() ? Data() : nullptr; } constexpr const T& GetRef() const& { diff --git a/util/generic/ptr.cpp b/util/generic/ptr.cpp index 3109929a21..b29baebc17 100644 --- a/util/generic/ptr.cpp +++ b/util/generic/ptr.cpp @@ -14,4 +14,4 @@ void TDelete::Destroy(void* t) noexcept { ::operator delete(t); } -TThrRefBase::~TThrRefBase() = default; +TThrRefBase::~TThrRefBase() = default; diff --git a/util/generic/ptr.h b/util/generic/ptr.h index 21b2e3cecb..19db0e3ec5 100644 --- a/util/generic/ptr.h +++ b/util/generic/ptr.h @@ -201,7 +201,7 @@ public: } inline void Destroy() noexcept { - Reset(nullptr); + Reset(nullptr); } inline void Swap(TAutoPtr& r) noexcept { @@ -363,7 +363,7 @@ public: { } - inline ~TRefCounted() = default; + inline ~TRefCounted() = default; inline void Ref(TAtomicBase d) noexcept { auto resultCount = Counter_.Add(d); @@ -563,14 +563,14 @@ public: } inline void Drop() noexcept { - TIntrusivePtr(nullptr).Swap(*this); + TIntrusivePtr(nullptr).Swap(*this); } inline T* Release() const noexcept Y_WARN_UNUSED_RESULT { T* res = T_; if (T_) { Ops::DecRef(T_); - T_ = nullptr; + T_ = nullptr; } return res; } @@ -745,7 +745,7 @@ public: InitStaticOps(); } - inline ~TSimpleIntrusiveOps() = default; + inline ~TSimpleIntrusiveOps() = default; static inline void Ref(T* t) noexcept { Ref_(t); @@ -1060,7 +1060,7 @@ class TCowPtr: public TPointerBase<TCowPtr<TPtr, TCopy>, const typename TPtr::TV using T = typename TPtr::TValueType; public: - inline TCowPtr() = default; + inline TCowPtr() = default; inline TCowPtr(const TPtr& p) : T_(p) diff --git a/util/generic/ptr_ut.cpp b/util/generic/ptr_ut.cpp index 68469ee10f..c2dcff23f6 100644 --- a/util/generic/ptr_ut.cpp +++ b/util/generic/ptr_ut.cpp @@ -166,7 +166,7 @@ void TPointerTest::TestHolderPtrMoveAssignment() { } struct TBase { - virtual ~TBase() = default; + virtual ~TBase() = default; }; struct TDerived: public TBase { @@ -319,7 +319,7 @@ public: { ++Cnt; } - ~TOp2() override { + ~TOp2() override { --Cnt; } }; diff --git a/util/generic/refcount.h b/util/generic/refcount.h index 659c07873d..966e853b77 100644 --- a/util/generic/refcount.h +++ b/util/generic/refcount.h @@ -107,7 +107,7 @@ public: { } - inline ~TAtomicCounter() = default; + inline ~TAtomicCounter() = default; inline TAtomicBase Add(TAtomicBase d) noexcept { return AtomicAdd(Counter_, d); diff --git a/util/generic/utility.h b/util/generic/utility.h index 37a87e222b..43b98eeafc 100644 --- a/util/generic/utility.h +++ b/util/generic/utility.h @@ -24,7 +24,7 @@ static constexpr const T& Max(const T& a, const T& b, const Args&... args) { return Max(a, Max(b, args...)); } -// replace with http://en.cppreference.com/w/cpp/algorithm/clamp in c++17 +// replace with http://en.cppreference.com/w/cpp/algorithm/clamp in c++17 template <class T> constexpr const T& ClampVal(const T& val, const T& min, const T& max) { return val < min ? min : (max < val ? max : val); @@ -44,7 +44,7 @@ static T Mean(const Args&... other) noexcept { template <class T> static inline void Zero(T& t) noexcept { - memset((void*)&t, 0, sizeof(t)); + memset((void*)&t, 0, sizeof(t)); } /** diff --git a/util/memory/addstorage.h b/util/memory/addstorage.h index ff5a3e14f5..597c73a988 100644 --- a/util/memory/addstorage.h +++ b/util/memory/addstorage.h @@ -27,9 +27,9 @@ class alignas(::NPrivate::TAdditionalStorageInfo) TAdditionalStorage { using TInfo = ::NPrivate::TAdditionalStorageInfo; public: - inline TAdditionalStorage() noexcept = default; + inline TAdditionalStorage() noexcept = default; - inline ~TAdditionalStorage() = default; + inline ~TAdditionalStorage() = default; inline void* operator new(size_t len1, size_t len2) { static_assert(alignof(T) >= alignof(TInfo)); diff --git a/util/memory/alloc.h b/util/memory/alloc.h index 0edf818fd2..d59575aef5 100644 --- a/util/memory/alloc.h +++ b/util/memory/alloc.h @@ -12,7 +12,7 @@ public: size_t Len; }; - virtual ~IAllocator() = default; + virtual ~IAllocator() = default; virtual TBlock Allocate(size_t len) = 0; virtual void Release(const TBlock& block) = 0; @@ -20,8 +20,8 @@ public: class TDefaultAllocator: public IAllocator { public: - TBlock Allocate(size_t len) override; - void Release(const TBlock& block) override; + TBlock Allocate(size_t len) override; + void Release(const TBlock& block) override; static IAllocator* Instance() noexcept; }; diff --git a/util/memory/blob.cpp b/util/memory/blob.cpp index 4262188c40..91da5cadca 100644 --- a/util/memory/blob.cpp +++ b/util/memory/blob.cpp @@ -19,9 +19,9 @@ class TDynamicBlobBase: public TBlob::TBase, using TRefBase = TRefCounted<TDynamicBlobBase, TCounter>; public: - inline TDynamicBlobBase() = default; + inline TDynamicBlobBase() = default; - ~TDynamicBlobBase() override = default; + ~TDynamicBlobBase() override = default; void Ref() noexcept override { TRefBase::Ref(); @@ -49,7 +49,7 @@ public: Buf_.Swap(buf); } - ~TBufferBlobBase() override = default; + ~TBufferBlobBase() override = default; void Ref() noexcept override { TRefBase::Ref(); @@ -82,7 +82,7 @@ public: { } - ~TStringBlobBase() override = default; + ~TStringBlobBase() override = default; void Ref() noexcept override { TRefBase::Ref(); diff --git a/util/memory/blob.h b/util/memory/blob.h index 148f05afd9..20c02a68df 100644 --- a/util/memory/blob.h +++ b/util/memory/blob.h @@ -25,8 +25,8 @@ class TBlob { public: class TBase { public: - inline TBase() noexcept = default; - virtual ~TBase() = default; + inline TBase() noexcept = default; + virtual ~TBase() = default; virtual void Ref() noexcept = 0; virtual void UnRef() noexcept = 0; @@ -45,7 +45,7 @@ private: { } - inline ~TStorage() = default; + inline ~TStorage() = default; inline void Swap(TStorage& r) noexcept { DoSwap(Data, r.Data); diff --git a/util/memory/mmapalloc.cpp b/util/memory/mmapalloc.cpp index 52a99db308..ec618cc808 100644 --- a/util/memory/mmapalloc.cpp +++ b/util/memory/mmapalloc.cpp @@ -7,7 +7,7 @@ namespace { class TMmapAllocator: public IAllocator { public: - TBlock Allocate(size_t len) override { + TBlock Allocate(size_t len) override { TMappedAllocation m(len + sizeof(TMappedAllocation)); TMappedAllocation* real = (TMappedAllocation*)m.Data(); @@ -18,7 +18,7 @@ namespace { return ret; } - void Release(const TBlock& block) override { + void Release(const TBlock& block) override { TMappedAllocation tmp(0); TMappedAllocation* real = ((TMappedAllocation*)block.Data) - 1; diff --git a/util/memory/pool.h b/util/memory/pool.h index 1e86b79c0f..13c8b6b9ed 100644 --- a/util/memory/pool.h +++ b/util/memory/pool.h @@ -100,7 +100,7 @@ private: public: class IGrowPolicy { public: - virtual ~IGrowPolicy() = default; + virtual ~IGrowPolicy() = default; virtual size_t Next(size_t prev) const noexcept = 0; }; @@ -336,13 +336,13 @@ public: { } - TBlock Allocate(size_t len) override { + TBlock Allocate(size_t len) override { TBlock ret = {Pool_->Allocate(len), len}; return ret; } - void Release(const TBlock& block) override { + void Release(const TBlock& block) override { (void)block; } diff --git a/util/memory/pool_ut.cpp b/util/memory/pool_ut.cpp index bbfdfd08f3..1158a8ca42 100644 --- a/util/memory/pool_ut.cpp +++ b/util/memory/pool_ut.cpp @@ -14,7 +14,7 @@ public: { } - TBlock Allocate(size_t len) override { + TBlock Allocate(size_t len) override { Check(); Alloced_ += len; @@ -23,7 +23,7 @@ public: return TDefaultAllocator::Allocate(len); } - void Release(const TBlock& block) override { + void Release(const TBlock& block) override { Released_ += block.Len; ++Frees_; diff --git a/util/memory/segpool_alloc.h b/util/memory/segpool_alloc.h index d3838c28db..1a83b7a543 100644 --- a/util/memory/segpool_alloc.h +++ b/util/memory/segpool_alloc.h @@ -43,7 +43,7 @@ struct segpool_alloc { ui64 pool_count, malloc_count, pool_free_count, malloc_free_count; #endif segpool_alloc() - : pool(nullptr) + : pool(nullptr) { Y_IF_DEBUG(pool_count = malloc_count = pool_free_count = malloc_free_count = 0); } @@ -69,7 +69,7 @@ struct segpool_alloc { Y_IF_DEBUG(if (data) malloc_count++); return data; } - _Tp* data = (_Tp*)pool->append(nullptr, __n * sizeof(_Tp)); + _Tp* data = (_Tp*)pool->append(nullptr, __n * sizeof(_Tp)); Y_IF_DEBUG(pool_count++); return data; } diff --git a/util/memory/tempbuf.cpp b/util/memory/tempbuf.cpp index fd288d41c3..09a2d0f140 100644 --- a/util/memory/tempbuf.cpp +++ b/util/memory/tempbuf.cpp @@ -27,7 +27,7 @@ public: * We do not really need 'virtual' here * but for compiler happiness... */ - virtual ~TImpl() = default; + virtual ~TImpl() = default; inline void* Data() noexcept { return Data_; @@ -87,7 +87,7 @@ namespace { { } - inline ~TAllocedBuf() override = default; + inline ~TAllocedBuf() override = default; private: void Dispose() noexcept override { @@ -105,7 +105,7 @@ namespace { { } - inline ~TPerThreadedBuf() override = default; + inline ~TPerThreadedBuf() override = default; private: void Dispose() noexcept override; @@ -194,14 +194,14 @@ TTempBuf::TTempBuf(size_t len) { } -TTempBuf::TTempBuf(const TTempBuf&) noexcept = default; +TTempBuf::TTempBuf(const TTempBuf&) noexcept = default; TTempBuf::TTempBuf(TTempBuf&& b) noexcept : Impl_(std::move(b.Impl_)) { } -TTempBuf::~TTempBuf() = default; +TTempBuf::~TTempBuf() = default; TTempBuf& TTempBuf::operator=(const TTempBuf& b) noexcept { if (this != &b) { diff --git a/util/memory/tempbuf.h b/util/memory/tempbuf.h index 536bb8b0e0..334670eb1e 100644 --- a/util/memory/tempbuf.h +++ b/util/memory/tempbuf.h @@ -67,7 +67,7 @@ private: } public: - TTempArray() = default; + TTempArray() = default; TTempArray(size_t len) : TTempBuf(RawSize(len)) diff --git a/util/network/address.h b/util/network/address.h index e85c495510..448fcac0c9 100644 --- a/util/network/address.h +++ b/util/network/address.h @@ -9,7 +9,7 @@ namespace NAddr { class IRemoteAddr { public: - virtual ~IRemoteAddr() = default; + virtual ~IRemoteAddr() = default; virtual const sockaddr* Addr() const = 0; virtual socklen_t Len() const = 0; @@ -47,11 +47,11 @@ namespace NAddr { Assign(addr, SockAddrLength(addr)); } - const sockaddr* Addr() const override { + const sockaddr* Addr() const override { return MutableAddr(); } - socklen_t Len() const override { + socklen_t Len() const override { return L_; } @@ -82,11 +82,11 @@ namespace NAddr { { } - const sockaddr* Addr() const override { + const sockaddr* Addr() const override { return AI_->ai_addr; } - socklen_t Len() const override { + socklen_t Len() const override { return (socklen_t)AI_->ai_addrlen; } @@ -102,11 +102,11 @@ namespace NAddr { { } - const sockaddr* Addr() const override { + const sockaddr* Addr() const override { return A_; } - socklen_t Len() const override { + socklen_t Len() const override { return A_; } @@ -122,11 +122,11 @@ namespace NAddr { { } - const sockaddr* Addr() const override { + const sockaddr* Addr() const override { return (sockaddr*)&A_; } - socklen_t Len() const override { + socklen_t Len() const override { return sizeof(A_); } diff --git a/util/network/poller.cpp b/util/network/poller.cpp index 628f0f0fe0..7954d0e8b5 100644 --- a/util/network/poller.cpp +++ b/util/network/poller.cpp @@ -39,7 +39,7 @@ TSocketPoller::TSocketPoller() { } -TSocketPoller::~TSocketPoller() = default; +TSocketPoller::~TSocketPoller() = default; void TSocketPoller::WaitRead(SOCKET sock, void* cookie) { Impl_->Set(cookie, sock, CONT_POLL_READ); diff --git a/util/network/sock.h b/util/network/sock.h index 8a2a1c5686..b10be2f715 100644 --- a/util/network/sock.h +++ b/util/network/sock.h @@ -152,11 +152,11 @@ struct TSockAddrLocal: public sockaddr_un, public ISockAddr { Set(path); } - socklen_t Size() const override { + socklen_t Size() const override { return sizeof(sockaddr_un); } - socklen_t Len() const override { + socklen_t Len() const override { return strlen(sun_path) + 2; } @@ -170,11 +170,11 @@ struct TSockAddrLocal: public sockaddr_un, public ISockAddr { strlcpy(sun_path, path, sizeof(sun_path)); } - sockaddr* SockAddr() override { + sockaddr* SockAddr() override { return (struct sockaddr*)(struct sockaddr_un*)this; } - const sockaddr* SockAddr() const override { + const sockaddr* SockAddr() const override { return (const struct sockaddr*)(const struct sockaddr_un*)this; } @@ -186,7 +186,7 @@ struct TSockAddrLocal: public sockaddr_un, public ISockAddr { return TFsPath(sun_path); } - int Bind(SOCKET s, ui16 mode) const override { + int Bind(SOCKET s, ui16 mode) const override { (void)unlink(sun_path); int ret = bind(s, SockAddr(), Len()); @@ -214,11 +214,11 @@ struct TSockAddrInet: public sockaddr_in, public ISockAddr { Set(IpFromString(ip), port); } - socklen_t Size() const override { + socklen_t Size() const override { return sizeof(sockaddr_in); } - socklen_t Len() const override { + socklen_t Len() const override { return Size(); } @@ -233,11 +233,11 @@ struct TSockAddrInet: public sockaddr_in, public ISockAddr { sin_port = HostToInet(port); } - sockaddr* SockAddr() override { + sockaddr* SockAddr() override { return (struct sockaddr*)(struct sockaddr_in*)this; } - const sockaddr* SockAddr() const override { + const sockaddr* SockAddr() const override { return (const struct sockaddr*)(const struct sockaddr_in*)this; } @@ -245,7 +245,7 @@ struct TSockAddrInet: public sockaddr_in, public ISockAddr { return IpToString(sin_addr.s_addr) + ":" + ::ToString(InetToHost(sin_port)); } - int Bind(SOCKET s, ui16 mode) const override { + int Bind(SOCKET s, ui16 mode) const override { Y_UNUSED(mode); int ret = bind(s, SockAddr(), Len()); if (ret < 0) @@ -280,11 +280,11 @@ struct TSockAddrInet6: public sockaddr_in6, public ISockAddr { Set(ip6, port); } - socklen_t Size() const override { + socklen_t Size() const override { return sizeof(sockaddr_in6); } - socklen_t Len() const override { + socklen_t Len() const override { return Size(); } @@ -299,11 +299,11 @@ struct TSockAddrInet6: public sockaddr_in6, public ISockAddr { sin6_port = HostToInet(port); } - sockaddr* SockAddr() override { + sockaddr* SockAddr() override { return (struct sockaddr*)(struct sockaddr_in6*)this; } - const sockaddr* SockAddr() const override { + const sockaddr* SockAddr() const override { return (const struct sockaddr*)(const struct sockaddr_in6*)this; } @@ -311,7 +311,7 @@ struct TSockAddrInet6: public sockaddr_in6, public ISockAddr { return "[" + GetIp() + "]:" + ::ToString(InetToHost(sin6_port)); } - int Bind(SOCKET s, ui16 mode) const override { + int Bind(SOCKET s, ui16 mode) const override { Y_UNUSED(mode); int ret = bind(s, SockAddr(), Len()); if (ret < 0) { @@ -561,7 +561,7 @@ public: protected: TStreamSocket* Socket; - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { Y_VERIFY(Socket, "TStreamSocketInput: socket isn't set"); const ssize_t ret = Socket->Recv(buf, len); @@ -589,7 +589,7 @@ public: protected: TStreamSocket* Socket; - void DoWrite(const void* buf, size_t len) override { + void DoWrite(const void* buf, size_t len) override { Y_VERIFY(Socket, "TStreamSocketOutput: socket isn't set"); const char* ptr = (const char*)buf; diff --git a/util/network/socket.cpp b/util/network/socket.cpp index 9b53e883a2..4f6e804346 100644 --- a/util/network/socket.cpp +++ b/util/network/socket.cpp @@ -583,7 +583,7 @@ public: { } - inline ~TImpl() = default; + inline ~TImpl() = default; inline SOCKET Fd() const noexcept { return Fd_; @@ -755,9 +755,9 @@ public: inline TCommonSockOps() noexcept { } - ~TCommonSockOps() override = default; + ~TCommonSockOps() override = default; - ssize_t Send(SOCKET fd, const void* data, size_t len) override { + ssize_t Send(SOCKET fd, const void* data, size_t len) override { ssize_t ret = -1; do { ret = send(fd, (const char*)data, (int)len, MSG_NOSIGNAL); @@ -770,7 +770,7 @@ public: return ret; } - ssize_t Recv(SOCKET fd, void* buf, size_t len) override { + ssize_t Recv(SOCKET fd, void* buf, size_t len) override { ssize_t ret = -1; do { ret = recv(fd, (char*)buf, (int)len, 0); @@ -783,7 +783,7 @@ public: return ret; } - ssize_t SendV(SOCKET fd, const TPart* parts, size_t count) override { + ssize_t SendV(SOCKET fd, const TPart* parts, size_t count) override { ssize_t ret = SendVImpl(fd, parts, count); if (ret < 0) { @@ -866,7 +866,7 @@ TSocket::TSocket(const TNetworkAddress& addr, const TInstant& deadLine) { } -TSocket::~TSocket() = default; +TSocket::~TSocket() = default; SOCKET TSocket::Fd() const noexcept { return Impl_->Fd(); @@ -893,7 +893,7 @@ TSocketInput::TSocketInput(const TSocket& s) noexcept { } -TSocketInput::~TSocketInput() = default; +TSocketInput::~TSocketInput() = default; size_t TSocketInput::DoRead(void* buf, size_t len) { const ssize_t ret = S_.Recv(buf, len); @@ -1084,7 +1084,7 @@ TNetworkAddress::TNetworkAddress(ui16 port) { } -TNetworkAddress::~TNetworkAddress() = default; +TNetworkAddress::~TNetworkAddress() = default; struct addrinfo* TNetworkAddress::Info() const noexcept { return Impl_->Info(); diff --git a/util/network/socket.h b/util/network/socket.h index 521b55a8ee..40c8648b40 100644 --- a/util/network/socket.h +++ b/util/network/socket.h @@ -301,8 +301,8 @@ public: class TOps { public: - inline TOps() noexcept = default; - virtual ~TOps() = default; + inline TOps() noexcept = default; + virtual ~TOps() = default; virtual ssize_t Send(SOCKET fd, const void* data, size_t len) = 0; virtual ssize_t Recv(SOCKET fd, void* buf, size_t len) = 0; @@ -402,7 +402,7 @@ public: } private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; private: TSocket S_; @@ -421,8 +421,8 @@ public: } private: - void DoWrite(const void* buf, size_t len) override; - void DoWriteV(const TPart* parts, size_t count) override; + void DoWrite(const void* buf, size_t len) override; + void DoWriteV(const TPart* parts, size_t count) override; private: TSocket S_; diff --git a/util/random/entropy.cpp b/util/random/entropy.cpp index 760dabfee1..3617edb83d 100644 --- a/util/random/entropy.cpp +++ b/util/random/entropy.cpp @@ -112,9 +112,9 @@ namespace { { } - ~TMersenneInput() override = default; + ~TMersenneInput() override = default; - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { size_t toRead = len; while (toRead) { @@ -142,7 +142,7 @@ namespace { { } - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { auto guard = Guard(Mutex_); return Bi_.Read(buf, len); @@ -155,7 +155,7 @@ namespace { }; struct TSeedStream: public IInputStream { - size_t DoRead(void* inbuf, size_t len) override { + size_t DoRead(void* inbuf, size_t len) override { char* buf = (char*)inbuf; #define DO_STEP(type) \ diff --git a/util/stream/aligned.h b/util/stream/aligned.h index 81203f71e3..70e7be05a9 100644 --- a/util/stream/aligned.h +++ b/util/stream/aligned.h @@ -42,8 +42,8 @@ public: } private: - size_t DoRead(void* ptr, size_t len) override; - size_t DoSkip(size_t len) override; + size_t DoRead(void* ptr, size_t len) override; + size_t DoSkip(size_t len) override; size_t DoReadTo(TString& st, char ch) override; ui64 DoReadAll(IOutputStream& out) override; @@ -89,7 +89,7 @@ public: } private: - void DoWrite(const void* ptr, size_t len) override; + void DoWrite(const void* ptr, size_t len) override; private: IOutputStream* Stream_; diff --git a/util/stream/aligned_ut.cpp b/util/stream/aligned_ut.cpp index 8ff512fc7c..e980d05cf7 100644 --- a/util/stream/aligned_ut.cpp +++ b/util/stream/aligned_ut.cpp @@ -10,7 +10,7 @@ public: } protected: - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { if (len == 0) { return 0; } @@ -20,7 +20,7 @@ protected: return 1; } - size_t DoSkip(size_t len) override { + size_t DoSkip(size_t len) override { if (len == 0) { return 0; } diff --git a/util/stream/buffer.cpp b/util/stream/buffer.cpp index e3ecbacb03..2facece4ea 100644 --- a/util/stream/buffer.cpp +++ b/util/stream/buffer.cpp @@ -9,7 +9,7 @@ public: { } - virtual ~TImpl() = default; + virtual ~TImpl() = default; inline size_t DoNext(void** ptr) { if (Data_.Avail() == 0) { @@ -69,7 +69,7 @@ TBufferOutput::TBufferOutput(TBuffer& buffer) TBufferOutput::TBufferOutput(TBufferOutput&&) noexcept = default; TBufferOutput& TBufferOutput::operator=(TBufferOutput&&) noexcept = default; -TBufferOutput::~TBufferOutput() = default; +TBufferOutput::~TBufferOutput() = default; TBuffer& TBufferOutput::Buffer() const noexcept { return Impl_->Buffer(); @@ -97,7 +97,7 @@ TBufferInput::TBufferInput(const TBuffer& buffer) { } -TBufferInput::~TBufferInput() = default; +TBufferInput::~TBufferInput() = default; const TBuffer& TBufferInput::Buffer() const noexcept { return Buf_; diff --git a/util/stream/buffer.h b/util/stream/buffer.h index 68cd7af4e0..9dc99dbe49 100644 --- a/util/stream/buffer.h +++ b/util/stream/buffer.h @@ -48,7 +48,7 @@ public: private: size_t DoNext(void** ptr) override; void DoUndo(size_t len) override; - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; void DoWriteC(char c) override; private: @@ -76,7 +76,7 @@ public: void Rewind() noexcept; protected: - size_t DoNext(const void** ptr, size_t len) override; + size_t DoNext(const void** ptr, size_t len) override; void DoUndo(size_t len) override; private: @@ -111,7 +111,7 @@ public: { } - ~TBufferStream() override = default; + ~TBufferStream() override = default; using TBufferOutput::Buffer; }; diff --git a/util/stream/buffered.cpp b/util/stream/buffered.cpp index 6a2e72fd76..a00e592e1c 100644 --- a/util/stream/buffered.cpp +++ b/util/stream/buffered.cpp @@ -13,7 +13,7 @@ public: { } - inline ~TImpl() = default; + inline ~TImpl() = default; inline size_t Next(const void** ptr, size_t len) { if (MemInput_.Exhausted()) { @@ -125,7 +125,7 @@ TBufferedInput::TBufferedInput(IInputStream* slave, size_t buflen) TBufferedInput::TBufferedInput(TBufferedInput&&) noexcept = default; TBufferedInput& TBufferedInput::operator=(TBufferedInput&&) noexcept = default; -TBufferedInput::~TBufferedInput() = default; +TBufferedInput::~TBufferedInput() = default; size_t TBufferedInput::DoRead(void* buf, size_t len) { return Impl_->Read(buf, len); @@ -157,7 +157,7 @@ public: { } - virtual ~TImpl() = default; + virtual ~TImpl() = default; inline void Reset() { MemOut_.Reset(Buf(), Len()); @@ -296,9 +296,9 @@ namespace { Reset(); } - ~TSimpleImpl() override = default; + ~TSimpleImpl() override = default; - void OnBufferExhausted() final { + void OnBufferExhausted() final { } void* Buf() const noexcept override { @@ -323,9 +323,9 @@ namespace { Reset(); } - ~TAdaptiveImpl() override = default; + ~TAdaptiveImpl() override = default; - void OnBufferExhausted() final { + void OnBufferExhausted() final { const size_t c = ((size_t)Step) << Min<size_t>(++N_ / 32, 10); if (c > B_.Capacity()) { @@ -418,11 +418,11 @@ TBufferedOutput::TBufferedOutput(IOutputStream* slave, size_t buflen) { } -TBufferedOutput::~TBufferedOutput() = default; +TBufferedOutput::~TBufferedOutput() = default; TAdaptiveBufferedOutput::TAdaptiveBufferedOutput(IOutputStream* slave) : TBufferedOutputBase(slave) { } -TAdaptiveBufferedOutput::~TAdaptiveBufferedOutput() = default; +TAdaptiveBufferedOutput::~TAdaptiveBufferedOutput() = default; diff --git a/util/stream/buffered.h b/util/stream/buffered.h index 005f482979..0847186141 100644 --- a/util/stream/buffered.h +++ b/util/stream/buffered.h @@ -38,10 +38,10 @@ public: void Reset(IInputStream* slave); protected: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; size_t DoReadTo(TString& st, char ch) override; - size_t DoSkip(size_t len) override; - size_t DoNext(const void** ptr, size_t len) override; + size_t DoSkip(size_t len) override; + size_t DoNext(const void** ptr, size_t len) override; private: class TImpl; @@ -113,10 +113,10 @@ public: protected: size_t DoNext(void** ptr) override; void DoUndo(size_t len) override; - void DoWrite(const void* data, size_t len) override; + void DoWrite(const void* data, size_t len) override; void DoWriteC(char c) override; - void DoFlush() override; - void DoFinish() override; + void DoFlush() override; + void DoFinish() override; private: THolder<TImpl> Impl_; diff --git a/util/stream/debug.h b/util/stream/debug.h index 0407cd6a73..92d6d4b42d 100644 --- a/util/stream/debug.h +++ b/util/stream/debug.h @@ -13,13 +13,13 @@ class TDebugOutput: public IOutputStream { public: inline TDebugOutput() noexcept = default; - ~TDebugOutput() override = default; + ~TDebugOutput() override = default; TDebugOutput(TDebugOutput&&) noexcept = default; TDebugOutput& operator=(TDebugOutput&&) noexcept = default; private: - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; }; /** diff --git a/util/stream/direct_io.h b/util/stream/direct_io.h index 53130e7a12..2e1f2e07dd 100644 --- a/util/stream/direct_io.h +++ b/util/stream/direct_io.h @@ -9,8 +9,8 @@ public: TRandomAccessFileInput(TDirectIOBufferedFile& file, ui64 position); protected: - 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: TDirectIOBufferedFile& File; @@ -28,8 +28,8 @@ protected: TDirectIOBufferedFile* File; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; }; class TBufferedFileOutputEx: public TRandomAccessFileOutput { @@ -37,7 +37,7 @@ public: TBufferedFileOutputEx(const TString& path, EOpenMode oMode, size_t buflen = 1 << 17); private: - void DoFlush() override; - void DoFinish() override; + void DoFlush() override; + void DoFinish() override; THolder<TDirectIOBufferedFile> FileHolder; }; diff --git a/util/stream/file.cpp b/util/stream/file.cpp index 3cae1fbaac..dc5d2f6311 100644 --- a/util/stream/file.cpp +++ b/util/stream/file.cpp @@ -77,7 +77,7 @@ public: { } - inline ~TImpl() = default; + inline ~TImpl() = default; }; TMappedFileInput::TMappedFileInput(const TFile& file) @@ -94,4 +94,4 @@ TMappedFileInput::TMappedFileInput(const TString& path) Reset(Impl_->Data(), Impl_->Size()); } -TMappedFileInput::~TMappedFileInput() = default; +TMappedFileInput::~TMappedFileInput() = default; diff --git a/util/stream/file.h b/util/stream/file.h index ec4d91a2b1..c1cf4f591d 100644 --- a/util/stream/file.h +++ b/util/stream/file.h @@ -26,8 +26,8 @@ public: TUnbufferedFileInput(const TString& path); 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: TFile File_; @@ -63,8 +63,8 @@ public: TUnbufferedFileOutput& operator=(TUnbufferedFileOutput&&) noexcept = default; private: - void DoWrite(const void* buf, size_t len) override; - void DoFlush() override; + void DoWrite(const void* buf, size_t len) override; + void DoFlush() override; private: TFile File_; diff --git a/util/stream/format_ut.cpp b/util/stream/format_ut.cpp index 22fd3d71f9..43245aeb48 100644 --- a/util/stream/format_ut.cpp +++ b/util/stream/format_ut.cpp @@ -61,15 +61,15 @@ Y_UNIT_TEST_SUITE(TOutputStreamFormattingTest) { } Y_UNIT_TEST(TestBin) { - UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(2), nullptr)), "10"); - UNIT_ASSERT_VALUES_EQUAL(ToString(SBin(static_cast<i32>(-2), nullptr)), "-10"); + UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(2), nullptr)), "10"); + UNIT_ASSERT_VALUES_EQUAL(ToString(SBin(static_cast<i32>(-2), nullptr)), "-10"); UNIT_ASSERT_VALUES_EQUAL(ToString(SBin(static_cast<i32>(-2))), "-0b00000000000000000000000000000010"); UNIT_ASSERT_VALUES_EQUAL(ToString(SBin(static_cast<i32>(-2), HF_FULL)), "-00000000000000000000000000000010"); - UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(15), nullptr)), "1111"); + UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(15), nullptr)), "1111"); UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(1))), "0b00000000000000000000000000000001"); UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(-1))), "0b11111111111111111111111111111111"); UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<i32>(-1))), "0b11111111111111111111111111111111"); - UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<i32>(-1), nullptr)), "11111111111111111111111111111111"); + UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<i32>(-1), nullptr)), "11111111111111111111111111111111"); UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui32>(256))), "0b00000000000000000000000100000000"); UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui8>(16))), "0b00010000"); UNIT_ASSERT_VALUES_EQUAL(ToString(Bin(static_cast<ui64>(1234587912357ull))), "0b0000000000000000000000010001111101110011001011001000100010100101"); diff --git a/util/stream/input.cpp b/util/stream/input.cpp index 5877d2a910..6e8170f2f9 100644 --- a/util/stream/input.cpp +++ b/util/stream/input.cpp @@ -164,9 +164,9 @@ ui64 TransferData(IInputStream* in, IOutputStream* out) { namespace { struct TStdIn: public IInputStream { - ~TStdIn() override = default; + ~TStdIn() override = default; - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { const size_t ret = fread(buf, 1, len, F_); if (ret < len && ferror(F_)) { diff --git a/util/stream/input_ut.cpp b/util/stream/input_ut.cpp index c78b1e244e..4a93f5458e 100644 --- a/util/stream/input_ut.cpp +++ b/util/stream/input_ut.cpp @@ -49,7 +49,7 @@ public: } protected: - size_t DoRead(void*, size_t len) override { + size_t DoRead(void*, size_t len) override { len = Min(static_cast<ui64>(len), Size_); Size_ -= len; return len; @@ -64,7 +64,7 @@ public: TNoOutput() = default; protected: - void DoWrite(const void*, size_t) override { + void DoWrite(const void*, size_t) override { } }; @@ -76,7 +76,7 @@ public: } protected: - size_t DoRead(void* buf, size_t len) override { + size_t DoRead(void* buf, size_t len) override { Y_ASSERT(len != 0); if (String_.empty()) { diff --git a/util/stream/ios_ut.cpp b/util/stream/ios_ut.cpp index cfb4ccb860..139f4296e5 100644 --- a/util/stream/ios_ut.cpp +++ b/util/stream/ios_ut.cpp @@ -177,14 +177,14 @@ public: { } - ~TMyStringOutput() override = default; + ~TMyStringOutput() override = default; - void DoWrite(const void* data, size_t len) override { + void DoWrite(const void* data, size_t len) override { S_.Write(data, len); UNIT_ASSERT(len < BufLen_ || ((len % BufLen_) == 0)); } - void DoWriteV(const TPart* p, size_t count) override { + void DoWriteV(const TPart* p, size_t count) override { TString s; for (size_t i = 0; i < count; ++i) { diff --git a/util/stream/length.h b/util/stream/length.h index 2e2d71db93..4d508ae24d 100644 --- a/util/stream/length.h +++ b/util/stream/length.h @@ -20,15 +20,15 @@ public: { } - ~TLengthLimitedInput() override = default; + ~TLengthLimitedInput() override = default; inline ui64 Left() const noexcept { return Length_; } 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: IInputStream* Slave_; @@ -46,7 +46,7 @@ public: { } - ~TCountingInput() override = default; + ~TCountingInput() override = default; /** * \returns The total number of characters read from @@ -57,8 +57,8 @@ public: } 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; size_t DoReadTo(TString& st, char ch) override; ui64 DoReadAll(IOutputStream& out) override; @@ -78,7 +78,7 @@ public: { } - ~TCountingOutput() override = default; + ~TCountingOutput() override = default; TCountingOutput(TCountingOutput&&) noexcept = default; TCountingOutput& operator=(TCountingOutput&&) noexcept = default; @@ -92,7 +92,7 @@ public: } private: - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; private: IOutputStream* Slave_; diff --git a/util/stream/mem.cpp b/util/stream/mem.cpp index 964a475788..22a3339e27 100644 --- a/util/stream/mem.cpp +++ b/util/stream/mem.cpp @@ -20,7 +20,7 @@ TMemoryInput::TMemoryInput(const TStringBuf buf) noexcept { } -TMemoryInput::~TMemoryInput() = default; +TMemoryInput::~TMemoryInput() = default; size_t TMemoryInput::DoNext(const void** ptr, size_t len) { len = Min(Len_, len); @@ -36,7 +36,7 @@ void TMemoryInput::DoUndo(size_t len) { Buf_ -= len; } -TMemoryOutput::~TMemoryOutput() = default; +TMemoryOutput::~TMemoryOutput() = default; size_t TMemoryOutput::DoNext(void** ptr) { Y_ENSURE(Buf_ < End_, TStringBuf("memory output stream exhausted")); diff --git a/util/stream/mem.h b/util/stream/mem.h index aa93f26561..18a5d46772 100644 --- a/util/stream/mem.h +++ b/util/stream/mem.h @@ -97,7 +97,7 @@ public: } private: - size_t DoNext(const void** ptr, size_t len) override; + size_t DoNext(const void** ptr, size_t len) override; void DoUndo(size_t len) override; private: @@ -176,7 +176,7 @@ public: private: size_t DoNext(void** ptr) override; void DoUndo(size_t len) override; - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; void DoWriteC(char c) override; protected: diff --git a/util/stream/multi.cpp b/util/stream/multi.cpp index 2f9b247cb2..b2354298a0 100644 --- a/util/stream/multi.cpp +++ b/util/stream/multi.cpp @@ -7,7 +7,7 @@ TMultiInput::TMultiInput(IInputStream* f, IInputStream* s) noexcept { } -TMultiInput::~TMultiInput() = default; +TMultiInput::~TMultiInput() = default; size_t TMultiInput::DoRead(void* buf, size_t len) { const size_t ret = C_->Read(buf, len); diff --git a/util/stream/multi.h b/util/stream/multi.h index 03e7a1e5c7..8bfd462d99 100644 --- a/util/stream/multi.h +++ b/util/stream/multi.h @@ -16,8 +16,8 @@ public: ~TMultiInput() 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; size_t DoReadTo(TString& st, char ch) override; private: diff --git a/util/stream/null.cpp b/util/stream/null.cpp index 59a62d9a29..4e8b298145 100644 --- a/util/stream/null.cpp +++ b/util/stream/null.cpp @@ -9,7 +9,7 @@ TNullIO& NPrivate::StdNullStream() noexcept { TNullInput::TNullInput() noexcept { } -TNullInput::~TNullInput() = default; +TNullInput::~TNullInput() = default; size_t TNullInput::DoRead(void*, size_t) { return 0; @@ -25,7 +25,7 @@ size_t TNullInput::DoNext(const void**, size_t) { TNullOutput::TNullOutput() noexcept = default; -TNullOutput::~TNullOutput() = default; +TNullOutput::~TNullOutput() = default; void TNullOutput::DoWrite(const void* /*buf*/, size_t /*len*/) { } @@ -33,4 +33,4 @@ void TNullOutput::DoWrite(const void* /*buf*/, size_t /*len*/) { TNullIO::TNullIO() noexcept { } -TNullIO::~TNullIO() = default; +TNullIO::~TNullIO() = default; diff --git a/util/stream/null.h b/util/stream/null.h index 41f831c9ca..8c335a9a78 100644 --- a/util/stream/null.h +++ b/util/stream/null.h @@ -17,9 +17,9 @@ public: ~TNullInput() override; private: - size_t DoRead(void* buf, size_t len) override; - size_t DoSkip(size_t len) override; - size_t DoNext(const void** ptr, size_t len) override; + size_t DoRead(void* buf, size_t len) override; + size_t DoSkip(size_t len) override; + size_t DoNext(const void** ptr, size_t len) override; }; /** @@ -34,7 +34,7 @@ public: TNullOutput& operator=(TNullOutput&&) noexcept = default; private: - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; }; /** diff --git a/util/stream/output.cpp b/util/stream/output.cpp index 77ac3e62e9..db81b81b70 100644 --- a/util/stream/output.cpp +++ b/util/stream/output.cpp @@ -346,10 +346,10 @@ namespace { { } - ~TStdOutput() override = default; + ~TStdOutput() override = default; private: - void DoWrite(const void* buf, size_t len) override { + void DoWrite(const void* buf, size_t len) override { if (len != fwrite(buf, 1, len, F_)) { #if defined(_win_) // On Windows, if 'F_' is console -- 'fwrite' returns count of written characters. @@ -363,7 +363,7 @@ namespace { } } - void DoFlush() override { + void DoFlush() override { if (fflush(F_) != 0) { ythrow TSystemError() << "fflush failed"; } @@ -380,7 +380,7 @@ namespace { { } - ~TStdErr() override = default; + ~TStdErr() override = default; }; struct TStdOut: public TStdOutput { @@ -389,7 +389,7 @@ namespace { { } - ~TStdOut() override = default; + ~TStdOut() override = default; }; TStdOut Out; diff --git a/util/stream/output.h b/util/stream/output.h index 847e96ae2b..00eef50b95 100644 --- a/util/stream/output.h +++ b/util/stream/output.h @@ -42,7 +42,7 @@ public: { } - inline ~TPart() = default; + inline ~TPart() = default; static inline TPart CrLf() noexcept { return TPart("\r\n", 2); diff --git a/util/stream/pipe.cpp b/util/stream/pipe.cpp index 1a137d868c..51be1934a7 100644 --- a/util/stream/pipe.cpp +++ b/util/stream/pipe.cpp @@ -36,7 +36,7 @@ TPipeBase::TPipeBase(const TString& command, const char* mode) { } -TPipeBase::~TPipeBase() = default; +TPipeBase::~TPipeBase() = default; TPipeInput::TPipeInput(const TString& command) : TPipeBase(command, "r") @@ -98,7 +98,7 @@ TPipedInput::TPipedInput(PIPEHANDLE fd) { } -TPipedInput::~TPipedInput() = default; +TPipedInput::~TPipedInput() = default; size_t TPipedInput::DoRead(void* buf, size_t len) { if (!Handle_.IsOpen()) { @@ -112,7 +112,7 @@ TPipedOutput::TPipedOutput(PIPEHANDLE fd) { } -TPipedOutput::~TPipedOutput() = default; +TPipedOutput::~TPipedOutput() = default; void TPipedOutput::DoWrite(const void* buf, size_t len) { if (!Handle_.IsOpen() || static_cast<ssize_t>(len) != Handle_.Write(buf, len)) { diff --git a/util/stream/pipe.h b/util/stream/pipe.h index 544155462b..18525b9517 100644 --- a/util/stream/pipe.h +++ b/util/stream/pipe.h @@ -48,7 +48,7 @@ public: TPipeInput(const TString& command); private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; }; /** @@ -73,7 +73,7 @@ public: void Close(); private: - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; }; class TPipedBase { @@ -94,7 +94,7 @@ public: ~TPipedInput() override; private: - size_t DoRead(void* buf, size_t len) override; + size_t DoRead(void* buf, size_t len) override; }; /** @@ -106,7 +106,7 @@ public: ~TPipedOutput() override; private: - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; }; /** @} */ diff --git a/util/stream/str.cpp b/util/stream/str.cpp index 09ef0b911e..13f0e8ef28 100644 --- a/util/stream/str.cpp +++ b/util/stream/str.cpp @@ -2,7 +2,7 @@ static constexpr size_t MIN_BUFFER_GROW_SIZE = 16; -TStringInput::~TStringInput() = default; +TStringInput::~TStringInput() = default; size_t TStringInput::DoNext(const void** ptr, size_t len) { len = Min(len, S_->size() - Pos_); @@ -16,7 +16,7 @@ void TStringInput::DoUndo(size_t len) { Pos_ -= len; } -TStringOutput::~TStringOutput() = default; +TStringOutput::~TStringOutput() = default; size_t TStringOutput::DoNext(void** ptr) { if (S_->size() == S_->capacity()) { @@ -41,4 +41,4 @@ void TStringOutput::DoWriteC(char c) { S_->push_back(c); } -TStringStream::~TStringStream() = default; +TStringStream::~TStringStream() = default; diff --git a/util/stream/str.h b/util/stream/str.h index f75bbce887..028bd572c0 100644 --- a/util/stream/str.h +++ b/util/stream/str.h @@ -48,7 +48,7 @@ public: } protected: - size_t DoNext(const void** ptr, size_t len) override; + size_t DoNext(const void** ptr, size_t len) override; void DoUndo(size_t len) override; private: @@ -97,7 +97,7 @@ public: protected: size_t DoNext(void** ptr) override; void DoUndo(size_t len) override; - void DoWrite(const void* buf, size_t len) override; + void DoWrite(const void* buf, size_t len) override; void DoWriteC(char c) override; private: diff --git a/util/stream/tee.cpp b/util/stream/tee.cpp index 1057ea06e3..99873b95ba 100644 --- a/util/stream/tee.cpp +++ b/util/stream/tee.cpp @@ -6,7 +6,7 @@ TTeeOutput::TTeeOutput(IOutputStream* l, IOutputStream* r) noexcept { } -TTeeOutput::~TTeeOutput() = default; +TTeeOutput::~TTeeOutput() = default; void TTeeOutput::DoWrite(const void* buf, size_t len) { L_->Write(buf, len); diff --git a/util/stream/tee.h b/util/stream/tee.h index de47e57d17..c69e232fb9 100644 --- a/util/stream/tee.h +++ b/util/stream/tee.h @@ -16,9 +16,9 @@ public: ~TTeeOutput() 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: IOutputStream* L_; diff --git a/util/stream/tempbuf.h b/util/stream/tempbuf.h index f14d8ebf01..a6dc001025 100644 --- a/util/stream/tempbuf.h +++ b/util/stream/tempbuf.h @@ -17,5 +17,5 @@ public: TTempBufOutput& operator=(TTempBufOutput&&) noexcept = default; protected: - void DoWrite(const void* data, size_t len) override; + void DoWrite(const void* data, size_t len) override; }; diff --git a/util/stream/tokenizer.h b/util/stream/tokenizer.h index 4693b0174d..b2398efdd1 100644 --- a/util/stream/tokenizer.h +++ b/util/stream/tokenizer.h @@ -39,7 +39,7 @@ public: { } - inline ~TIterator() = default; + inline ~TIterator() = default; inline void operator++() { Next(); diff --git a/util/stream/walk.h b/util/stream/walk.h index ee0fe6925b..7e62cb44dc 100644 --- a/util/stream/walk.h +++ b/util/stream/walk.h @@ -17,7 +17,7 @@ public: protected: void DoUndo(size_t len) override; - size_t DoNext(const void** ptr, size_t len) override; + size_t DoNext(const void** ptr, size_t len) override; /** * Returns the next data chunk from this input stream. There are no diff --git a/util/stream/walk_ut.cpp b/util/stream/walk_ut.cpp index a458c68bbf..e0a783799f 100644 --- a/util/stream/walk_ut.cpp +++ b/util/stream/walk_ut.cpp @@ -11,7 +11,7 @@ public: } protected: - size_t DoUnboundedNext(const void** ptr) override { + size_t DoUnboundedNext(const void** ptr) override { if (Index_ >= Data_.size()) { return 0; } diff --git a/util/stream/zerocopy.h b/util/stream/zerocopy.h index 9130c8dd5e..3315aa3a51 100644 --- a/util/stream/zerocopy.h +++ b/util/stream/zerocopy.h @@ -50,8 +50,8 @@ public: } protected: - 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; ui64 DoReadAll(IOutputStream& out) override; virtual size_t DoNext(const void** ptr, size_t len) = 0; }; diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 2fc4188de9..60f4e9439f 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -26,7 +26,7 @@ namespace { memset(Z(), 0, sizeof(*Z())); } - inline ~TZLibCommon() = default; + inline ~TZLibCommon() = default; inline const char* GetErrMsg() const noexcept { return Z()->msg != nullptr ? Z()->msg : "unknown error"; @@ -170,10 +170,10 @@ namespace { { } - ~TDecompressStream() override = default; + ~TDecompressStream() override = default; private: - size_t DoNext(const void** ptr, size_t len) override { + size_t DoNext(const void** ptr, size_t len) override { void* buf = AdditionalData(); *ptr = buf; @@ -332,7 +332,7 @@ void TZLibDecompress::SetAllowMultipleStreams(bool allowMultipleStreams) { Impl_->SetAllowMultipleStreams(allowMultipleStreams); } -TZLibDecompress::~TZLibDecompress() = default; +TZLibDecompress::~TZLibDecompress() = default; size_t TZLibDecompress::DoRead(void* buf, size_t size) { return Impl_->Read(buf, MaxPortion(size)); @@ -377,4 +377,4 @@ void TZLibCompress::DoFinish() { } } -TBufferedZLibDecompress::~TBufferedZLibDecompress() = default; +TBufferedZLibDecompress::~TBufferedZLibDecompress() = default; diff --git a/util/stream/zlib.h b/util/stream/zlib.h index 3487858dac..e7de7c81b7 100644 --- a/util/stream/zlib.h +++ b/util/stream/zlib.h @@ -65,7 +65,7 @@ public: ~TZLibDecompress() override; protected: - size_t DoRead(void* buf, size_t size) override; + size_t DoRead(void* buf, size_t size) override; public: class TImpl; @@ -138,9 +138,9 @@ public: private: void Init(const TParams& opts); - 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/util/system/atomic_ut.cpp b/util/system/atomic_ut.cpp index ec0e16bfaa..07211ffba7 100644 --- a/util/system/atomic_ut.cpp +++ b/util/system/atomic_ut.cpp @@ -175,7 +175,7 @@ private: inline void TestAtomicPtr() { int* p; - AtomicSet(p, nullptr); + AtomicSet(p, nullptr); UNIT_ASSERT_VALUES_EQUAL(AtomicGet(p), 0); @@ -183,8 +183,8 @@ private: AtomicSet(p, &i); UNIT_ASSERT_VALUES_EQUAL(AtomicGet(p), &i); - UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&p, nullptr), &i); - UNIT_ASSERT(AtomicCas(&p, &i, nullptr)); + UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&p, nullptr), &i); + UNIT_ASSERT(AtomicCas(&p, &i, nullptr)); } }; diff --git a/util/system/condvar.cpp b/util/system/condvar.cpp index b31e0dca64..62f3d22356 100644 --- a/util/system/condvar.cpp +++ b/util/system/condvar.cpp @@ -132,7 +132,7 @@ TCondVar::TCondVar() { } -TCondVar::~TCondVar() = default; +TCondVar::~TCondVar() = default; void TCondVar::BroadCast() noexcept { Impl_->BroadCast(); diff --git a/util/system/condvar_ut.cpp b/util/system/condvar_ut.cpp index d883c3fc49..5130a18d32 100644 --- a/util/system/condvar_ut.cpp +++ b/util/system/condvar_ut.cpp @@ -50,7 +50,7 @@ class TCondVarTest: public TTestBase { { } - void Process(void*) override { + void Process(void*) override { THolder<TThreadTask> This(this); (this->*Func_)(); diff --git a/util/system/context.h b/util/system/context.h index a60e087f01..d2a349bfc5 100644 --- a/util/system/context.h +++ b/util/system/context.h @@ -45,7 +45,7 @@ #endif struct ITrampoLine { - virtual ~ITrampoLine() = default; + virtual ~ITrampoLine() = default; virtual void DoRun(); virtual void DoRunNaked(); @@ -131,7 +131,7 @@ public: TContMachineContext(const TContClosure& c); - inline ~TContMachineContext() = default; + inline ~TContMachineContext() = default; void SwitchTo(TContMachineContext* next) noexcept; @@ -176,6 +176,6 @@ struct TExceptionSafeContext: public TContMachineContext { void SwitchTo(TExceptionSafeContext* to) noexcept; #if defined(_unix_) - void* Buf_[2] = {nullptr, nullptr}; + void* Buf_[2] = {nullptr, nullptr}; #endif }; diff --git a/util/system/dynlib.cpp b/util/system/dynlib.cpp index deeb1d5654..9d2541c25f 100644 --- a/util/system/dynlib.cpp +++ b/util/system/dynlib.cpp @@ -103,7 +103,7 @@ TDynamicLibrary::TDynamicLibrary(const TString& path, int flags) { Open(path.data(), flags); } -TDynamicLibrary::~TDynamicLibrary() = default; +TDynamicLibrary::~TDynamicLibrary() = default; void TDynamicLibrary::Open(const char* path, int flags) { Impl_.Reset(TImpl::SafeCreate(path, flags)); diff --git a/util/system/dynlib.h b/util/system/dynlib.h index c590209c28..66eaf4a5c1 100644 --- a/util/system/dynlib.h +++ b/util/system/dynlib.h @@ -49,12 +49,12 @@ private: public: TExternalSymbol() noexcept { - PLib = nullptr; - DLib = nullptr; + PLib = nullptr; + DLib = nullptr; } TExternalSymbol(const TExternalSymbol& es) { - PLib = nullptr; - DLib = nullptr; + PLib = nullptr; + DLib = nullptr; if (es.IsDynamic()) Open(es.LibName().data(), es.VtblName().data()); else if (es.IsStatic()) @@ -75,7 +75,7 @@ public: } // set the symbol from dynamic source void Open(const char* lib_name, const char* vtbl_name) { - if (DLib != nullptr || PLib != nullptr) + if (DLib != nullptr || PLib != nullptr) return; try { DLib = new TDynamicLibrary(); @@ -83,7 +83,7 @@ public: PLib = (TLib*)DLib->Sym(vtbl_name); } catch (...) { delete DLib; - DLib = nullptr; + DLib = nullptr; throw; } lname = lib_name; @@ -91,7 +91,7 @@ public: } // set the symbol from static source void SetSym(TLib* pl) noexcept { - if (DLib == nullptr && PLib == nullptr) + if (DLib == nullptr && PLib == nullptr) PLib = pl; } void Close() noexcept { @@ -111,9 +111,9 @@ public: return vname; } bool IsStatic() const noexcept { - return DLib == nullptr && PLib != nullptr; + return DLib == nullptr && PLib != nullptr; } bool IsDynamic() const noexcept { - return DLib && DLib->IsLoaded() && PLib != nullptr; + return DLib && DLib->IsLoaded() && PLib != nullptr; } }; diff --git a/util/system/event_ut.cpp b/util/system/event_ut.cpp index e2a524034d..2506cb7a91 100644 --- a/util/system/event_ut.cpp +++ b/util/system/event_ut.cpp @@ -26,7 +26,7 @@ namespace { { } - void Process(void*) override { + void Process(void*) override { THolder<TThreadTask> This(this); if (Id_ == 0) { @@ -58,7 +58,7 @@ namespace { { } - void Process(void*) override { + void Process(void*) override { Ev_.Signal(); } }; @@ -74,7 +74,7 @@ namespace { { } - void Process(void*) override { + void Process(void*) override { Ev->WaitI(); Ev.Destroy(); } diff --git a/util/system/file.cpp b/util/system/file.cpp index 49960416d2..4a261d020c 100644 --- a/util/system/file.cpp +++ b/util/system/file.cpp @@ -858,7 +858,7 @@ public: } } - inline ~TImpl() = default; + inline ~TImpl() = default; inline void Close() { if (!Handle_.Close()) { @@ -1107,7 +1107,7 @@ TFile::TFile(const TString& fName, EOpenMode oMode) { } -TFile::~TFile() = default; +TFile::~TFile() = default; void TFile::Close() { Impl_->Close(); diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp index c630a15ebc..7454a4cb94 100644 --- a/util/system/filemap.cpp +++ b/util/system/filemap.cpp @@ -381,7 +381,7 @@ TMemoryMap::TMemoryMap(const TFile& file, EOpenMode om, TString dbgName) { } -TMemoryMap::~TMemoryMap() = default; +TMemoryMap::~TMemoryMap() = default; TMemoryMap::TMapResult TMemoryMap::Map(i64 offset, size_t size) { return Impl_->Map(offset, size); diff --git a/util/system/mutex.h b/util/system/mutex.h index 3568a8215b..032630d134 100644 --- a/util/system/mutex.h +++ b/util/system/mutex.h @@ -30,7 +30,7 @@ public: Release(); } - ~TFakeMutex() = default; + ~TFakeMutex() = default; }; class TMutex { diff --git a/util/system/mutex_ut.cpp b/util/system/mutex_ut.cpp index 759081ae9e..c8d7caafa1 100644 --- a/util/system/mutex_ut.cpp +++ b/util/system/mutex_ut.cpp @@ -38,7 +38,7 @@ class TMutexTest: public TTestBase { { } - void Process(void*) override { + void Process(void*) override { THolder<TThreadTask> This(this); (this->*Func_)(); diff --git a/util/system/pipe.cpp b/util/system/pipe.cpp index c41fe30f24..a543bd7472 100644 --- a/util/system/pipe.cpp +++ b/util/system/pipe.cpp @@ -128,7 +128,7 @@ TPipe::TPipe(PIPEHANDLE fd) { } -TPipe::~TPipe() = default; +TPipe::~TPipe() = default; void TPipe::Close() { Impl_->Close(); diff --git a/util/system/rwlock.cpp b/util/system/rwlock.cpp index 941f35d3f6..bb3dcbf188 100644 --- a/util/system/rwlock.cpp +++ b/util/system/rwlock.cpp @@ -219,7 +219,7 @@ TRWMutex::TRWMutex() { } -TRWMutex::~TRWMutex() = default; +TRWMutex::~TRWMutex() = default; void TRWMutex::AcquireRead() noexcept { Impl_->AcquireRead(); diff --git a/util/system/rwlock_ut.cpp b/util/system/rwlock_ut.cpp index 3fc1210887..2b384c05b3 100644 --- a/util/system/rwlock_ut.cpp +++ b/util/system/rwlock_ut.cpp @@ -40,7 +40,7 @@ class TRWMutexTest: public TTestBase { { } - void Process(void*) override { + void Process(void*) override { THolder<TThreadTask> This(this); (this->*Func_)(); diff --git a/util/system/sem.cpp b/util/system/sem.cpp index 93a1390e05..4a93b903b5 100644 --- a/util/system/sem.cpp +++ b/util/system/sem.cpp @@ -225,7 +225,7 @@ TSemaphore::TSemaphore(const char* name, ui32 maxFreeCount) { } -TSemaphore::~TSemaphore() = default; +TSemaphore::~TSemaphore() = default; void TSemaphore::Release() noexcept { Impl_->Release(); @@ -263,7 +263,7 @@ TFastSemaphore::TFastSemaphore(ui32 maxFreeCount) { } -TFastSemaphore::~TFastSemaphore() = default; +TFastSemaphore::~TFastSemaphore() = default; void TFastSemaphore::Release() noexcept { Impl_->Release(); diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp index 3b7361381b..b1989b5c8c 100644 --- a/util/system/shellcommand.cpp +++ b/util/system/shellcommand.cpp @@ -1132,7 +1132,7 @@ TShellCommand::TShellCommand(const TStringBuf cmd, const TShellCommandOptions& o { } -TShellCommand::~TShellCommand() = default; +TShellCommand::~TShellCommand() = default; TShellCommand& TShellCommand::operator<<(const TStringBuf argument) { Impl->AppendArgument(argument); diff --git a/util/system/shellcommand_ut.cpp b/util/system/shellcommand_ut.cpp index 9ccf29deef..9d849279d2 100644 --- a/util/system/shellcommand_ut.cpp +++ b/util/system/shellcommand_ut.cpp @@ -263,11 +263,11 @@ Y_UNIT_TEST_SUITE(TShellCommandTest) { Y_UNIT_TEST(TestStreamClose) { struct TStream: public IOutputStream { size_t NumCloses = 0; - void DoWrite(const void* buf, size_t len) override { + void DoWrite(const void* buf, size_t len) override { Y_UNUSED(buf); Y_UNUSED(len); } - void DoFinish() override { + void DoFinish() override { ++NumCloses; } } stream; diff --git a/util/system/shmat.h b/util/system/shmat.h index 80007beae8..d9da3c151a 100644 --- a/util/system/shmat.h +++ b/util/system/shmat.h @@ -13,7 +13,7 @@ class TSharedMemory: public TThrRefBase { public: TSharedMemory(); - ~TSharedMemory() override; + ~TSharedMemory() override; bool Create(int Size); bool Open(const TGUID& id, int size); diff --git a/util/system/tls.cpp b/util/system/tls.cpp index 82cf6da223..c2f1a04a14 100644 --- a/util/system/tls.cpp +++ b/util/system/tls.cpp @@ -114,7 +114,7 @@ namespace { virtual TPerThreadStorage* MyStorageSlow() = 0; - virtual ~TGenericTlsBase() = default; + virtual ~TGenericTlsBase() = default; }; } @@ -138,7 +138,7 @@ namespace { } private: - TPerThreadStorage* MyStorageSlow() override { + TPerThreadStorage* MyStorageSlow() override { void* ret = pthread_getspecific(Key_); if (!ret) { @@ -245,7 +245,7 @@ TKey::TKey(TDtor dtor) TKey::TKey(TKey&&) noexcept = default; -TKey::~TKey() = default; +TKey::~TKey() = default; void* TKey::Get() const { return Impl_->Get(); diff --git a/util/system/tls.h b/util/system/tls.h index 3ce7211841..3c4f56dbeb 100644 --- a/util/system/tls.h +++ b/util/system/tls.h @@ -180,18 +180,18 @@ namespace NTls { class TValue: public TMoveOnly { class TConstructor { public: - TConstructor() noexcept = default; + TConstructor() noexcept = default; - virtual ~TConstructor() = default; + virtual ~TConstructor() = default; virtual T* Construct(void* ptr) const = 0; }; class TDefaultConstructor: public TConstructor { public: - ~TDefaultConstructor() override = default; + ~TDefaultConstructor() override = default; - T* Construct(void* ptr) const override { + T* Construct(void* ptr) const override { //memset(ptr, 0, sizeof(T)); return ::new (ptr) T(); } @@ -205,9 +205,9 @@ namespace NTls { { } - ~TCopyConstructor() override = default; + ~TCopyConstructor() override = default; - T* Construct(void* ptr) const override { + T* Construct(void* ptr) const override { return ::new (ptr) T(Value); } diff --git a/util/thread/factory.cpp b/util/thread/factory.cpp index 381c11e4f8..48e898f32d 100644 --- a/util/thread/factory.cpp +++ b/util/thread/factory.cpp @@ -16,7 +16,7 @@ namespace { } } - void DoRun(IThreadAble* func) override { + void DoRun(IThreadAble* func) override { Thr_.Reset(new TThread(ThreadProc, func)); Thr_->Start(); @@ -45,7 +45,7 @@ namespace { inline TSystemThreadFactory() noexcept { } - IThread* DoCreate() override { + IThread* DoCreate() override { return new TPoolThread; } }; diff --git a/util/thread/factory.h b/util/thread/factory.h index f56f624618..561fcbac88 100644 --- a/util/thread/factory.h +++ b/util/thread/factory.h @@ -7,9 +7,9 @@ class IThreadFactory { public: class IThreadAble { public: - inline IThreadAble() noexcept = default; + inline IThreadAble() noexcept = default; - virtual ~IThreadAble() = default; + virtual ~IThreadAble() = default; inline void Execute() { DoExecute(); @@ -23,9 +23,9 @@ public: friend class IThreadFactory; public: - inline IThread() noexcept = default; + inline IThread() noexcept = default; - virtual ~IThread() = default; + virtual ~IThread() = default; inline void Join() noexcept { DoJoin(); diff --git a/util/thread/factory_ut.cpp b/util/thread/factory_ut.cpp index 5e340fe4c8..647d96c901 100644 --- a/util/thread/factory_ut.cpp +++ b/util/thread/factory_ut.cpp @@ -15,9 +15,9 @@ class TThrPoolTest: public TTestBase { { } - ~TRunAble() override = default; + ~TRunAble() override = default; - void DoExecute() override { + void DoExecute() override { done = true; } diff --git a/util/thread/lfstack.h b/util/thread/lfstack.h index 8a3ea70638..ca3d95f3c3 100644 --- a/util/thread/lfstack.h +++ b/util/thread/lfstack.h @@ -11,7 +11,7 @@ class TLockFreeStack: TNonCopyable { T Value; TNode* Next; - TNode() = default; + TNode() = default; template <class U> explicit TNode(U&& val) diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp index d2a921f199..05fad02e9b 100644 --- a/util/thread/pool.cpp +++ b/util/thread/pool.cpp @@ -201,7 +201,7 @@ private: } } - void DoExecute() override { + void DoExecute() override { THolder<TTsr> tsr(new TTsr(Parent_)); if (Namer) { @@ -652,7 +652,7 @@ namespace { { } - void Process(void* data) override { + void Process(void* data) override { THolder<TOwnedObjectInQueue> self(this); Owned->Process(data); } @@ -688,7 +688,7 @@ namespace { { } - ~TThreadImpl() override = default; + ~TThreadImpl() override = default; inline void WaitForStart() noexcept { StartEvent_.Wait(); @@ -699,7 +699,7 @@ namespace { } private: - void Process(void* /*tsr*/) override { + void Process(void* /*tsr*/) override { TThreadImplRef This(this); { @@ -736,7 +736,7 @@ namespace { } private: - void DoRun(IThreadAble* func) override { + void DoRun(IThreadAble* func) override { TThreadImplRef impl(new TThreadImpl(func)); Parent_->SafeAdd(impl.Get()); diff --git a/util/thread/pool.h b/util/thread/pool.h index de3fbd11ab..d1ea3a67cb 100644 --- a/util/thread/pool.h +++ b/util/thread/pool.h @@ -13,7 +13,7 @@ class TDuration; struct IObjectInQueue { - virtual ~IObjectInQueue() = default; + virtual ~IObjectInQueue() = default; /** * Supposed to be implemented by user, to define jobs processed @@ -227,7 +227,7 @@ public: } private: - IThread* DoCreate() override; + IThread* DoCreate() override; }; /** @@ -237,14 +237,14 @@ private: */ class TFakeThreadPool: public IThreadPool { public: - bool Add(IObjectInQueue* pObj) override Y_WARN_UNUSED_RESULT { + bool Add(IObjectInQueue* pObj) override Y_WARN_UNUSED_RESULT { TTsr tsr(this); pObj->Process(tsr); return true; } - void Start(size_t, size_t = 0) override { + void Start(size_t, size_t = 0) override { } void Stop() noexcept override { @@ -269,12 +269,12 @@ public: TThreadPool(const TParams& params = {}); ~TThreadPool() override; - bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; + bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; /** * @param queueSizeLimit means "unlimited" when = 0 * @param threadCount means "single thread" when = 0 */ - void Start(size_t threadCount, size_t queueSizeLimit = 0) override; + void Start(size_t threadCount, size_t queueSizeLimit = 0) override; void Stop() noexcept override; size_t Size() const noexcept override; size_t GetThreadCountExpected() const noexcept; @@ -302,7 +302,7 @@ public: */ void SetMaxIdleTime(TDuration interval); - bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; + bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; /** @param thrnum, @param maxque are ignored */ void Start(size_t thrnum = 0, size_t maxque = 0) override; void Stop() noexcept override; @@ -319,12 +319,12 @@ public: TSimpleThreadPool(const TParams& params = {}); ~TSimpleThreadPool() override; - bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; + bool Add(IObjectInQueue* obj) override Y_WARN_UNUSED_RESULT; /** * @parameter thrnum. If thrnum is 0, use TAdaptiveThreadPool with small * SetMaxIdleTime interval parameter. if thrnum is not 0, use non-blocking TThreadPool */ - void Start(size_t thrnum, size_t maxque = 0) override; + void Start(size_t thrnum, size_t maxque = 0) override; void Stop() noexcept override; size_t Size() const noexcept override; @@ -365,11 +365,11 @@ public: } } - void* CreateThreadSpecificResource() override { + void* CreateThreadSpecificResource() override { return Slave_->CreateThreadSpecificResource(); } - void DestroyThreadSpecificResource(void* resource) override { + void DestroyThreadSpecificResource(void* resource) override { Slave_->DestroyThreadSpecificResource(resource); } diff --git a/util/thread/pool_ut.cpp b/util/thread/pool_ut.cpp index 2dc725da7c..893770d0c4 100644 --- a/util/thread/pool_ut.cpp +++ b/util/thread/pool_ut.cpp @@ -23,7 +23,7 @@ struct TThreadPoolTest { { } - void Process(void*) override { + void Process(void*) override { THolder<TTask> This(this); TGuard<TSpinLock> guard(Test->Lock); @@ -41,7 +41,7 @@ struct TThreadPoolTest { { } - ~TOwnedTask() override { + ~TOwnedTask() override { Destructed = true; } @@ -75,11 +75,11 @@ struct TThreadPoolTest { class TFailAddQueue: public IThreadPool { public: - bool Add(IObjectInQueue* /*obj*/) override Y_WARN_UNUSED_RESULT { + bool Add(IObjectInQueue* /*obj*/) override Y_WARN_UNUSED_RESULT { return false; } - void Start(size_t, size_t) override { + void Start(size_t, size_t) override { } void Stop() noexcept override { diff --git a/util/ysafeptr.h b/util/ysafeptr.h index 430563af67..af7dfd4bed 100644 --- a/util/ysafeptr.h +++ b/util/ysafeptr.h @@ -283,7 +283,7 @@ protected: public: TPtrBase() - : ptr(nullptr) + : ptr(nullptr) { } TPtrBase(TUserObj* _ptr) @@ -306,7 +306,7 @@ public: TUserObj* Extract() { TUserObj* pRes = ptr; DecRef(ptr); - ptr = nullptr; + ptr = nullptr; return pRes; } @@ -341,7 +341,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////// template <class T> inline bool IsValid(T* p) { - return p != nullptr && !CastToObjectBase(p)->IsRefInvalid(); + return p != nullptr && !CastToObjectBase(p)->IsRefInvalid(); } template <class T, class TRef> inline bool IsValid(const TPtrBase<T, TRef>& p) { diff --git a/ydb/core/base/blobstorage.h b/ydb/core/base/blobstorage.h index 1b4ddf0a6f..a2faee326e 100644 --- a/ydb/core/base/blobstorage.h +++ b/ydb/core/base/blobstorage.h @@ -1153,7 +1153,7 @@ struct TEvBlobStorage { TEvGetResult(NKikimrProto::EReplyStatus status, ui32 sz, ui32 groupId) : Status(status) , ResponseSz(sz) - , Responses(sz == 0 ? nullptr : new TResponse[sz]) + , Responses(sz == 0 ? nullptr : new TResponse[sz]) , GroupId(groupId) {} diff --git a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp index ebebc4ad5c..b2c020c3d2 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp @@ -402,7 +402,7 @@ class TDbInitWaitActor : public TActorBootstrapped<TDbInitWaitActor> { void Bootstrap(const TActorContext &ctx) { Become(&TThis::StateFunc); TLogoBlobID id(0, 1, 1, 0, 0, 0); - ctx.Schedule(TDuration::Seconds(1000), new TEvents::TEvWakeup(), nullptr); + ctx.Schedule(TDuration::Seconds(1000), new TEvents::TEvWakeup(), nullptr); for (ui32 i = 0; i < Conf->VDisks->GetSize(); ++i) { TAllVDisks::TVDiskInstance &vdisk = Conf->VDisks->Get(i); if (vdisk.Initialized) { diff --git a/ydb/core/blobstorage/vdisk/common/blobstorage_dblogcutter.cpp b/ydb/core/blobstorage/vdisk/common/blobstorage_dblogcutter.cpp index 764358fef8..5f176b61b7 100644 --- a/ydb/core/blobstorage/vdisk/common/blobstorage_dblogcutter.cpp +++ b/ydb/core/blobstorage/vdisk/common/blobstorage_dblogcutter.cpp @@ -45,7 +45,7 @@ namespace NKikimr { } void ScheduleActivity(const TActorContext &ctx, const TDuration &timeout) { - ctx.Schedule(timeout, new TEvents::TEvWakeup(), nullptr); + ctx.Schedule(timeout, new TEvents::TEvWakeup(), nullptr); } void Handle(NPDisk::TEvLogResult::TPtr &ev, const TActorContext &ctx) { diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_events.h b/ydb/core/blobstorage/vdisk/common/vdisk_events.h index 6608631e67..47fbd959c9 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_events.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_events.h @@ -1080,7 +1080,7 @@ namespace NKikimr { return res; } - void AddExtremeQuery(const TLogoBlobID &logoBlobId, ui32 sh, ui32 sz, const ui64 *cookie = nullptr) { + void AddExtremeQuery(const TLogoBlobID &logoBlobId, ui32 sh, ui32 sz, const ui64 *cookie = nullptr) { Y_VERIFY(Extreme); NKikimrBlobStorage::TExtremeQuery *q = Record.AddExtremeQueries(); @@ -1267,7 +1267,7 @@ namespace NKikimr { } void AddResult(NKikimrProto::EReplyStatus status, const TLogoBlobID &logoBlobId, ui64 sh, - const char *data, size_t size, const ui64 *cookie = nullptr, const ui64 *ingress = nullptr) { + const char *data, size_t size, const ui64 *cookie = nullptr, const ui64 *ingress = nullptr) { IncrementSize(size); NKikimrBlobStorage::TQueryResult *r = Record.AddResult(); r->SetStatus(status); @@ -1287,7 +1287,7 @@ namespace NKikimr { r->SetIngress(*ingress); } - void AddResult(NKikimrProto::EReplyStatus status, const TLogoBlobID &logoBlobId, const ui64 *cookie = nullptr, + void AddResult(NKikimrProto::EReplyStatus status, const TLogoBlobID &logoBlobId, const ui64 *cookie = nullptr, const ui64 *ingress = nullptr, const NMatrix::TVectorType *local = nullptr) { NKikimrBlobStorage::TQueryResult *r = Record.AddResult(); r->SetStatus(status); diff --git a/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullload.h b/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullload.h index 735536c6f5..d08b3a04d7 100644 --- a/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullload.h +++ b/ydb/core/blobstorage/vdisk/hullop/blobstorage_hullload.h @@ -333,7 +333,7 @@ namespace NKikimr { THullSegmentsLoaded(TOrderedLevelSegments *segs) : OrderedSegs(segs) - , UnorderedSegs(nullptr) + , UnorderedSegs(nullptr) {} THullSegmentsLoaded(TUnorderedLevelSegments *segs) diff --git a/ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress_matrix.h b/ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress_matrix.h index 96def8a2d9..29ef015032 100644 --- a/ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress_matrix.h +++ b/ydb/core/blobstorage/vdisk/ingress/blobstorage_ingress_matrix.h @@ -216,7 +216,7 @@ namespace NKikimr { class TShiftedBitVecBase { public: TShiftedBitVecBase() - : Ptr(nullptr) + : Ptr(nullptr) , Beg(0) , End(0) {} diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h index 6ae2c260eb..7e899b3236 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonerr.h @@ -323,7 +323,7 @@ namespace NKikimr { const NKikimrBlobStorage::TRangeQuery *q = &record.GetRangeQuery(); const TLogoBlobID first = LogoBlobIDFromLogoBlobID(q->GetFrom()); const ui64 vcookie = q->GetCookie(); - const ui64 *cookie = q->HasCookie() ? &vcookie : nullptr; + const ui64 *cookie = q->HasCookie() ? &vcookie : nullptr; result->AddResult(status, first, cookie); } // extreme queries @@ -331,7 +331,7 @@ namespace NKikimr { const NKikimrBlobStorage::TExtremeQuery *q = &record.GetExtremeQueries(i); const TLogoBlobID first = LogoBlobIDFromLogoBlobID(q->GetId()); const ui64 vcookie = q->GetCookie(); - const ui64 *cookie = q->HasCookie() ? &vcookie : nullptr; + const ui64 *cookie = q->HasCookie() ? &vcookie : nullptr; result->AddResult(status, first, cookie); } SetRacingGroupInfo(ev->Get()->Record, result->Record, groupInfo); diff --git a/ydb/core/tablet_flat/tablet_flat_executed.cpp b/ydb/core/tablet_flat/tablet_flat_executed.cpp index 1b6050987b..4b3c15490c 100644 --- a/ydb/core/tablet_flat/tablet_flat_executed.cpp +++ b/ydb/core/tablet_flat/tablet_flat_executed.cpp @@ -12,7 +12,7 @@ using IExecutor = NFlatExecutorSetup::IExecutor; TTabletExecutedFlat::TTabletExecutedFlat(TTabletStorageInfo *info, const TActorId &tablet, IMiniKQLFactory *factory) : ITablet(info, tablet) , Factory(factory) - , Executor0(nullptr) + , Executor0(nullptr) , StartTime0(TAppData::TimeProvider->Now()) {} diff --git a/ydb/core/util/queue_inplace_ut.cpp b/ydb/core/util/queue_inplace_ut.cpp index 395de05f50..fb2d511d04 100644 --- a/ydb/core/util/queue_inplace_ut.cpp +++ b/ydb/core/util/queue_inplace_ut.cpp @@ -31,7 +31,7 @@ Y_UNIT_TEST_SUITE(TQueueInplaceTests) { using TQueueType = TQueueInplace<TStruct, 32>; // 3 values per chunk TQueueType queue; - UNIT_ASSERT(queue.Head() == nullptr); + UNIT_ASSERT(queue.Head() == nullptr); queue.Push(10); queue.Push(11); @@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(TQueueInplaceTests) { UNIT_ASSERT(*queue.Head() == 14); queue.Pop(); - UNIT_ASSERT(queue.Head() == nullptr); + UNIT_ASSERT(queue.Head() == nullptr); } Y_UNIT_TEST(CleanInDestructor) { diff --git a/ydb/core/util/sig.h b/ydb/core/util/sig.h index af5a56fcca..0cf5ae62ea 100644 --- a/ydb/core/util/sig.h +++ b/ydb/core/util/sig.h @@ -14,7 +14,7 @@ static inline void ThreadSigmask(int how) { SigAddSet(&Mask, SIGHUP); SigAddSet(&Mask, SIGURG); #endif - if (SigProcMask(how, &Mask, nullptr)) + if (SigProcMask(how, &Mask, nullptr)) ythrow yexception() << "Cannot change signal mask"; } diff --git a/ydb/core/util/tracking_alloc.h b/ydb/core/util/tracking_alloc.h index f254135d67..96855506ac 100644 --- a/ydb/core/util/tracking_alloc.h +++ b/ydb/core/util/tracking_alloc.h @@ -75,7 +75,7 @@ public: ~TTrackingAllocator() { } - pointer allocate(size_type n, const void* hint = nullptr) { + pointer allocate(size_type n, const void* hint = nullptr) { *Allocated += n * sizeof(T); return std::allocator<T>::allocate(n, hint); } diff --git a/ydb/library/yql/utils/fetch/fetch.cpp b/ydb/library/yql/utils/fetch/fetch.cpp index 12a273a31e..100c88c385 100644 --- a/ydb/library/yql/utils/fetch/fetch.cpp +++ b/ydb/library/yql/utils/fetch/fetch.cpp @@ -16,7 +16,7 @@ namespace { THttpURL ParseURL(const TStringBuf addr, NUri::TParseFlags features) { THttpURL url; - THttpURL::TParsedState parsedState = url.Parse(addr, features, nullptr, 65536); + THttpURL::TParsedState parsedState = url.Parse(addr, features, nullptr, 65536); if (THttpURL::ParsedOK != parsedState) { ythrow yexception() << "Bad URL: \"" << addr << "\", " << HttpURLParsedStateToString(parsedState); } |