diff options
author | ermolovd <ermolovd@yandex-team.ru> | 2022-02-10 16:47:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:53 +0300 |
commit | b91bcef7c99a119b0846479ef71bfab4beec72ca (patch) | |
tree | be118d54d12a61bc4812ceb0a266a170a2fa3bc9 /library/cpp/yt | |
parent | f421873774cf0b71743afbe5f6677861e66601ea (diff) | |
download | ydb-b91bcef7c99a119b0846479ef71bfab4beec72ca.tar.gz |
Restoring authorship annotation for <ermolovd@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yt')
-rw-r--r-- | library/cpp/yt/coding/varint-inl.h | 82 | ||||
-rw-r--r-- | library/cpp/yt/coding/varint.h | 12 | ||||
-rw-r--r-- | library/cpp/yt/memory/new-inl.h | 24 | ||||
-rw-r--r-- | library/cpp/yt/memory/ref-inl.h | 4 | ||||
-rw-r--r-- | library/cpp/yt/memory/ref.cpp | 8 | ||||
-rw-r--r-- | library/cpp/yt/memory/ref.h | 4 | ||||
-rw-r--r-- | library/cpp/yt/memory/unittests/ya.make | 6 | ||||
-rw-r--r-- | library/cpp/yt/misc/enum-inl.h | 8 | ||||
-rw-r--r-- | library/cpp/yt/misc/enum.h | 8 | ||||
-rw-r--r-- | library/cpp/yt/misc/port.h | 6 | ||||
-rw-r--r-- | library/cpp/yt/small_containers/compact_vector.h | 8 | ||||
-rw-r--r-- | library/cpp/yt/string/string_builder-inl.h | 4 | ||||
-rw-r--r-- | library/cpp/yt/string/string_builder.h | 10 | ||||
-rw-r--r-- | library/cpp/yt/string/unittests/format_ut.cpp | 6 | ||||
-rw-r--r-- | library/cpp/yt/ya.make | 16 |
15 files changed, 103 insertions, 103 deletions
diff --git a/library/cpp/yt/coding/varint-inl.h b/library/cpp/yt/coding/varint-inl.h index f0a09e9d30..8a2eca7068 100644 --- a/library/cpp/yt/coding/varint-inl.h +++ b/library/cpp/yt/coding/varint-inl.h @@ -139,25 +139,25 @@ Y_FORCE_INLINE int ReadVarUint64(const char* input, ui64* value) }, value); } -Y_FORCE_INLINE int ReadVarUint64(const char* input, const char* end, ui64* value) -{ - return ReadVarUint64Impl([&] () { - if (input == end) { +Y_FORCE_INLINE int ReadVarUint64(const char* input, const char* end, ui64* value) +{ + return ReadVarUint64Impl([&] () { + if (input == end) { throw TSimpleException("Premature end of data while reading varuint64"); - } - char byte = *input; - ++input; - return byte; - }, value); -} - + } + char byte = *input; + ++input; + return byte; + }, value); +} + //////////////////////////////////////////////////////////////////////////////// -template <class... Args> -Y_FORCE_INLINE int ReadVarUint32Impl(ui32* value, Args... args) +template <class... Args> +Y_FORCE_INLINE int ReadVarUint32Impl(ui32* value, Args... args) { ui64 varInt; - int bytesRead = ReadVarUint64(args..., &varInt); + int bytesRead = ReadVarUint64(args..., &varInt); if (varInt > std::numeric_limits<ui32>::max()) { throw TSimpleException("Value is too big for varuint32"); } @@ -167,26 +167,26 @@ Y_FORCE_INLINE int ReadVarUint32Impl(ui32* value, Args... args) Y_FORCE_INLINE int ReadVarUint32(IInputStream* input, ui32* value) { - return ReadVarUint32Impl(value, input); + return ReadVarUint32Impl(value, input); } Y_FORCE_INLINE int ReadVarUint32(const char* input, ui32* value) { - return ReadVarUint32Impl(value, input); -} - -Y_FORCE_INLINE int ReadVarUint32(const char* input, const char* end, ui32* value) -{ - return ReadVarUint32Impl(value, input, end); + return ReadVarUint32Impl(value, input); } +Y_FORCE_INLINE int ReadVarUint32(const char* input, const char* end, ui32* value) +{ + return ReadVarUint32Impl(value, input, end); +} + //////////////////////////////////////////////////////////////////////////////// -template <class... Args> -Y_FORCE_INLINE int ReadVarInt32Impl(i32* value, Args... args) +template <class... Args> +Y_FORCE_INLINE int ReadVarInt32Impl(i32* value, Args... args) { ui64 varInt; - int bytesRead = ReadVarUint64(args..., &varInt); + int bytesRead = ReadVarUint64(args..., &varInt); if (varInt > std::numeric_limits<ui32>::max()) { throw TSimpleException("Value is too big for varint32"); } @@ -196,45 +196,45 @@ Y_FORCE_INLINE int ReadVarInt32Impl(i32* value, Args... args) Y_FORCE_INLINE int ReadVarInt32(IInputStream* input, i32* value) { - return ReadVarInt32Impl(value, input); + return ReadVarInt32Impl(value, input); } Y_FORCE_INLINE int ReadVarInt32(const char* input, i32* value) { - return ReadVarInt32Impl(value, input); -} - -Y_FORCE_INLINE int ReadVarInt32(const char* input, const char* end, i32* value) -{ - return ReadVarInt32Impl(value, input, end); + return ReadVarInt32Impl(value, input); } +Y_FORCE_INLINE int ReadVarInt32(const char* input, const char* end, i32* value) +{ + return ReadVarInt32Impl(value, input, end); +} + //////////////////////////////////////////////////////////////////////////////// -template <class... Args> -Y_FORCE_INLINE int ReadVarInt64Impl(i64* value, Args... args) +template <class... Args> +Y_FORCE_INLINE int ReadVarInt64Impl(i64* value, Args... args) { ui64 varInt; - int bytesRead = ReadVarUint64(args..., &varInt); + int bytesRead = ReadVarUint64(args..., &varInt); *value = ZigZagDecode64(varInt); return bytesRead; } Y_FORCE_INLINE int ReadVarInt64(IInputStream* input, i64* value) { - return ReadVarInt64Impl(value, input); + return ReadVarInt64Impl(value, input); } Y_FORCE_INLINE int ReadVarInt64(const char* input, i64* value) { - return ReadVarInt64Impl(value, input); -} - -Y_FORCE_INLINE int ReadVarInt64(const char* input, const char* end, i64* value) -{ - return ReadVarInt64Impl(value, input, end); + return ReadVarInt64Impl(value, input); } +Y_FORCE_INLINE int ReadVarInt64(const char* input, const char* end, i64* value) +{ + return ReadVarInt64Impl(value, input, end); +} + //////////////////////////////////////////////////////////////////////////////// } // namespace NYT diff --git a/library/cpp/yt/coding/varint.h b/library/cpp/yt/coding/varint.h index c5399f8b06..96b609a042 100644 --- a/library/cpp/yt/coding/varint.h +++ b/library/cpp/yt/coding/varint.h @@ -41,12 +41,12 @@ int ReadVarUint32(const char* input, ui32* value); int ReadVarInt32(const char* input, i32* value); int ReadVarInt64(const char* input, i64* value); -// Throws exception if integer is not complete when `end' is reached. -int ReadVarUint64(const char* input, const char* end, ui64* value); -int ReadVarUint32(const char* input, const char* end, ui32* value); -int ReadVarInt32(const char* input, const char* end, i32* value); -int ReadVarInt64(const char* input, const char* end, i64* value); - +// Throws exception if integer is not complete when `end' is reached. +int ReadVarUint64(const char* input, const char* end, ui64* value); +int ReadVarUint32(const char* input, const char* end, ui32* value); +int ReadVarInt32(const char* input, const char* end, i32* value); +int ReadVarInt64(const char* input, const char* end, i64* value); + //////////////////////////////////////////////////////////////////////////////// } // namespace NYT diff --git a/library/cpp/yt/memory/new-inl.h b/library/cpp/yt/memory/new-inl.h index 0a84818516..63ff4ba97b 100644 --- a/library/cpp/yt/memory/new-inl.h +++ b/library/cpp/yt/memory/new-inl.h @@ -92,17 +92,17 @@ struct TRefCountedWrapperWithCookie final namespace NDetail { -Y_FORCE_INLINE void* AllignedMalloc(size_t size, size_t allignment) -{ -#ifdef _win_ - return ::_aligned_malloc(size, allignment); -#else - void* ptr = nullptr; - ::posix_memalign(&ptr, allignment, size); - return ptr; -#endif -} - +Y_FORCE_INLINE void* AllignedMalloc(size_t size, size_t allignment) +{ +#ifdef _win_ + return ::_aligned_malloc(size, allignment); +#else + void* ptr = nullptr; + ::posix_memalign(&ptr, allignment, size); + return ptr; +#endif +} + template <class... Args> Y_FORCE_INLINE void CustomInitialize(Args... args) { @@ -189,7 +189,7 @@ void* AllocateConstSizeAligned() if (Alignment <= 16) { return NYTAlloc::AllocateConstSize<Size>(); } else { - return AllignedMalloc(Size, Alignment); + return AllignedMalloc(Size, Alignment); } } diff --git a/library/cpp/yt/memory/ref-inl.h b/library/cpp/yt/memory/ref-inl.h index 79be8356c5..2ef0179b69 100644 --- a/library/cpp/yt/memory/ref-inl.h +++ b/library/cpp/yt/memory/ref-inl.h @@ -10,8 +10,8 @@ namespace NYT { namespace NDetail { -extern const char EmptyRefData[]; -extern char MutableEmptyRefData[]; +extern const char EmptyRefData[]; +extern char MutableEmptyRefData[]; } // namespace NDetail diff --git a/library/cpp/yt/memory/ref.cpp b/library/cpp/yt/memory/ref.cpp index e8ff42e976..9dcdb46a7e 100644 --- a/library/cpp/yt/memory/ref.cpp +++ b/library/cpp/yt/memory/ref.cpp @@ -11,10 +11,10 @@ namespace NYT { namespace NDetail { -// N.B. We would prefer these arrays to be zero sized -// but zero sized arrays are not supported in MSVC. -const char EmptyRefData[1] = {0}; -char MutableEmptyRefData[1] = {0}; +// N.B. We would prefer these arrays to be zero sized +// but zero sized arrays are not supported in MSVC. +const char EmptyRefData[1] = {0}; +char MutableEmptyRefData[1] = {0}; } // namespace NDetail diff --git a/library/cpp/yt/memory/ref.h b/library/cpp/yt/memory/ref.h index 73d19d9013..da9c8394b0 100644 --- a/library/cpp/yt/memory/ref.h +++ b/library/cpp/yt/memory/ref.h @@ -59,8 +59,8 @@ class TMutableRef { public: //! Creates a null TMutableRef. - //! Note empty TMutableRef is not the same as null TMutableRef. - //! `operator bool` can be used to check if ref is nonnull. + //! Note empty TMutableRef is not the same as null TMutableRef. + //! `operator bool` can be used to check if ref is nonnull. TMutableRef() = default; //! Creates a TMutableRef for a given block of memory. diff --git a/library/cpp/yt/memory/unittests/ya.make b/library/cpp/yt/memory/unittests/ya.make index f09ad7d0c9..16b29a729f 100644 --- a/library/cpp/yt/memory/unittests/ya.make +++ b/library/cpp/yt/memory/unittests/ya.make @@ -2,9 +2,9 @@ GTEST(unittester-library-memory) OWNER(g:yt) -IF (NOT OS_WINDOWS) - ALLOCATOR(YT) -ENDIF() +IF (NOT OS_WINDOWS) + ALLOCATOR(YT) +ENDIF() SRCS( intrusive_ptr_ut.cpp diff --git a/library/cpp/yt/misc/enum-inl.h b/library/cpp/yt/misc/enum-inl.h index 59ef704775..6c102bf772 100644 --- a/library/cpp/yt/misc/enum-inl.h +++ b/library/cpp/yt/misc/enum-inl.h @@ -368,14 +368,14 @@ bool TEnumIndexedVector<E, T, Min, Max>::IsDomainValue(E value) //////////////////////////////////////////////////////////////////////////////// -template <typename E, typename> -bool Any(E value) +template <typename E, typename> +bool Any(E value) { return static_cast<typename TEnumTraits<E>::TUnderlying>(value) != 0; } -template <class E, typename> -bool None(E value) +template <class E, typename> +bool None(E value) { return static_cast<typename TEnumTraits<E>::TUnderlying>(value) == 0; } diff --git a/library/cpp/yt/misc/enum.h b/library/cpp/yt/misc/enum.h index 894364aa43..71f7f9853c 100644 --- a/library/cpp/yt/misc/enum.h +++ b/library/cpp/yt/misc/enum.h @@ -227,12 +227,12 @@ private: //////////////////////////////////////////////////////////////////////////////// //! Returns |true| iff the enumeration value is not bitwise zero. -template <typename E, typename = std::enable_if_t<NYT::TEnumTraits<E>::IsBitEnum, E>> -bool Any(E value); +template <typename E, typename = std::enable_if_t<NYT::TEnumTraits<E>::IsBitEnum, E>> +bool Any(E value); //! Returns |true| iff the enumeration value is bitwise zero. -template <typename E, typename = std::enable_if_t<NYT::TEnumTraits<E>::IsBitEnum, E>> -bool None(E value); +template <typename E, typename = std::enable_if_t<NYT::TEnumTraits<E>::IsBitEnum, E>> +bool None(E value); //////////////////////////////////////////////////////////////////////////////// diff --git a/library/cpp/yt/misc/port.h b/library/cpp/yt/misc/port.h index b24ac50995..3c36e976ae 100644 --- a/library/cpp/yt/misc/port.h +++ b/library/cpp/yt/misc/port.h @@ -1,9 +1,9 @@ #pragma once -#include <util/system/platform.h> - +#include <util/system/platform.h> + // Check platform bitness. -#if !defined(_64_) +#if !defined(_64_) #error YT requires 64-bit platform #endif diff --git a/library/cpp/yt/small_containers/compact_vector.h b/library/cpp/yt/small_containers/compact_vector.h index 6c4a0b0e39..c49c02be65 100644 --- a/library/cpp/yt/small_containers/compact_vector.h +++ b/library/cpp/yt/small_containers/compact_vector.h @@ -1,7 +1,7 @@ #pragma once -#include <util/system/defaults.h> - +#include <util/system/defaults.h> + #include <cstdint> #include <iterator> #include <limits> @@ -162,13 +162,13 @@ private: // > 0 indicates inline storage // == 0 indicates on-heap storage uint8_t SizePlusOne; - } alias_hack; + } alias_hack; struct TOnHeapMeta { char Padding[ByteSize - sizeof(uintptr_t)]; TOnHeapStorage* Storage; - } alias_hack; + } alias_hack; union { diff --git a/library/cpp/yt/string/string_builder-inl.h b/library/cpp/yt/string/string_builder-inl.h index 151fcabf7f..96b85dadc4 100644 --- a/library/cpp/yt/string/string_builder-inl.h +++ b/library/cpp/yt/string/string_builder-inl.h @@ -12,7 +12,7 @@ namespace NYT { inline char* TStringBuilderBase::Preallocate(size_t size) { - if (Y_UNLIKELY(End_ - Current_ < static_cast<ssize_t>(size))) { + if (Y_UNLIKELY(End_ - Current_ < static_cast<ssize_t>(size))) { size_t length = GetLength(); auto newLength = std::max(length + size, MinBufferLength); DoPreallocate(newLength); @@ -69,7 +69,7 @@ inline void TStringBuilderBase::AppendString(const char* str) inline void TStringBuilderBase::Reset() { - Begin_ = Current_ = End_ = nullptr; + Begin_ = Current_ = End_ = nullptr; DoReset(); } diff --git a/library/cpp/yt/string/string_builder.h b/library/cpp/yt/string/string_builder.h index 0e13e70904..9b15eb9c5c 100644 --- a/library/cpp/yt/string/string_builder.h +++ b/library/cpp/yt/string/string_builder.h @@ -22,8 +22,8 @@ void Format(TStringBuilderBase* builder, TStringBuf format, TArgs&&... args); class TStringBuilderBase { public: - virtual ~TStringBuilderBase() = default; - + virtual ~TStringBuilderBase() = default; + char* Preallocate(size_t size); size_t GetLength() const; @@ -46,9 +46,9 @@ public: void Reset(); protected: - char* Begin_ = nullptr; - char* Current_ = nullptr; - char* End_ = nullptr; + char* Begin_ = nullptr; + char* Current_ = nullptr; + char* End_ = nullptr; virtual void DoReset() = 0; virtual void DoPreallocate(size_t newLength) = 0; diff --git a/library/cpp/yt/string/unittests/format_ut.cpp b/library/cpp/yt/string/unittests/format_ut.cpp index ee069bb2c0..c8d30b65b7 100644 --- a/library/cpp/yt/string/unittests/format_ut.cpp +++ b/library/cpp/yt/string/unittests/format_ut.cpp @@ -19,9 +19,9 @@ static_assert(TFormatTraits<const char*>::HasCustomFormatValue); static_assert(TFormatTraits<TStringBuf>::HasCustomFormatValue); static_assert(TFormatTraits<TString>::HasCustomFormatValue); static_assert(TFormatTraits<std::vector<int>>::HasCustomFormatValue); - -// N.B. TCompactVector<int, 1> is not buildable on Windows -static_assert(TFormatTraits<TCompactVector<int, 2>>::HasCustomFormatValue); + +// N.B. TCompactVector<int, 1> is not buildable on Windows +static_assert(TFormatTraits<TCompactVector<int, 2>>::HasCustomFormatValue); static_assert(TFormatTraits<std::set<int>>::HasCustomFormatValue); static_assert(TFormatTraits<std::map<int, int>>::HasCustomFormatValue); static_assert(TFormatTraits<std::multimap<int, int>>::HasCustomFormatValue); diff --git a/library/cpp/yt/ya.make b/library/cpp/yt/ya.make index f4d43806f4..75e3e16434 100644 --- a/library/cpp/yt/ya.make +++ b/library/cpp/yt/ya.make @@ -1,14 +1,14 @@ -RECURSE( - assert +RECURSE( + assert coding exception - misc - string + misc + string system yson - yson_string -) - + yson_string +) + IF (NOT OS_WINDOWS) RECURSE( containers @@ -21,4 +21,4 @@ IF (NOT OS_WINDOWS) small_containers threading ) -ENDIF() +ENDIF() |