aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorEvgeny Grechnikov <diamondaz@yandex.ru>2022-02-10 16:46:20 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:20 +0300
commit6e38f52f898d7c077ddd319800b4014967a5ca76 (patch)
treef0b2473cfc98506158b8f1d3d387c4f478ade18e /library/cpp
parentbd085aee9b4f7a0bee302ce687964ffb7098f986 (diff)
downloadydb-6e38f52f898d7c077ddd319800b4014967a5ca76.tar.gz
Restoring authorship annotation for Evgeny Grechnikov <diamondaz@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/charset/wide.h8
-rw-r--r--library/cpp/deprecated/split/split_iterator.h56
-rw-r--r--library/cpp/deprecated/split/split_iterator_ut.cpp20
-rw-r--r--library/cpp/lfalloc/lf_allocX64.cpp2
-rw-r--r--library/cpp/logger/log.cpp2
-rw-r--r--library/cpp/packedtypes/longs.h94
-rw-r--r--library/cpp/packedtypes/packed.h48
7 files changed, 115 insertions, 115 deletions
diff --git a/library/cpp/charset/wide.h b/library/cpp/charset/wide.h
index 32d30e849e..d75cbd4473 100644
--- a/library/cpp/charset/wide.h
+++ b/library/cpp/charset/wide.h
@@ -210,16 +210,16 @@ namespace NDetail {
template <bool robust>
inline TWtringBuf CharToWide(const TStringBuf src, TUtf16String& dst, ECharset encoding) {
if (robust && CODES_UTF8 == encoding)
- return ::NDetail::RecodeUTF8Robust(src, dst);
- return ::NDetail::Recode<char>(src, dst, encoding);
+ return ::NDetail::RecodeUTF8Robust(src, dst);
+ return ::NDetail::Recode<char>(src, dst, encoding);
}
inline TWtringBuf CharToWide(const TStringBuf src, TUtf16String& dst, ECharset encoding) {
- return ::NDetail::Recode<char>(src, dst, encoding);
+ return ::NDetail::Recode<char>(src, dst, encoding);
}
inline TStringBuf WideToChar(const TWtringBuf src, TString& dst, ECharset encoding) {
- return ::NDetail::Recode<wchar16>(src, dst, encoding);
+ return ::NDetail::Recode<wchar16>(src, dst, encoding);
}
//! calls either to @c WideToUTF8 or @c WideToChar depending on the encoding type
diff --git a/library/cpp/deprecated/split/split_iterator.h b/library/cpp/deprecated/split/split_iterator.h
index 0eacc29228..683ab11d5c 100644
--- a/library/cpp/deprecated/split/split_iterator.h
+++ b/library/cpp/deprecated/split/split_iterator.h
@@ -61,7 +61,7 @@ private:
bool Delims[256];
public:
- explicit TSplitDelimiters(const char* s);
+ explicit TSplitDelimiters(const char* s);
Y_FORCE_INLINE bool IsDelimiter(ui8 ch) const {
return Delims[ch];
@@ -87,9 +87,9 @@ public:
Y_FORCE_INLINE size_t GetLength() const {
return Len;
}
-
-private:
- // we don't own Str, make sure that no one calls us with temporary object
+
+private:
+ // we don't own Str, make sure that no one calls us with temporary object
TSplitBase(TString&&) = delete;
};
@@ -111,10 +111,10 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Delimiters, make sure that no one calls us with temporary object
- TDelimitersSplit(const char*, size_t, TSplitDelimiters&&) = delete;
+
+private:
+ // we don't own Delimiters, make sure that no one calls us with temporary object
+ TDelimitersSplit(const char*, size_t, TSplitDelimiters&&) = delete;
TDelimitersSplit(const TString&, TSplitDelimiters&&) = delete;
TDelimitersSplit(TString&&, const TSplitDelimiters&) = delete;
};
@@ -132,10 +132,10 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Delimiters, make sure that no one calls us with temporary object
- TDelimitersStrictSplit(const char*, size_t, TSplitDelimiters&&) = delete;
+
+private:
+ // we don't own Delimiters, make sure that no one calls us with temporary object
+ TDelimitersStrictSplit(const char*, size_t, TSplitDelimiters&&) = delete;
TDelimitersStrictSplit(const TString&, TSplitDelimiters&&) = delete;
TDelimitersStrictSplit(TString&&, const TSplitDelimiters&) = delete;
};
@@ -154,9 +154,9 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Delimiters and Screens, make sure that no one calls us with temporary object
+
+private:
+ // we don't own Delimiters and Screens, make sure that no one calls us with temporary object
TScreenedDelimitersSplit(TString&&, const TSplitDelimiters&, const TSplitDelimiters&) = delete;
TScreenedDelimitersSplit(const TString&, TSplitDelimiters&&, const TSplitDelimiters&) = delete;
TScreenedDelimitersSplit(const TString&, const TSplitDelimiters&, TSplitDelimiters&&) = delete;
@@ -177,10 +177,10 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Delimiters, make sure that no one calls us with temporary object
- TDelimitersSplitWithoutTags(const char*, size_t, TSplitDelimiters&&) = delete;
+
+private:
+ // we don't own Delimiters, make sure that no one calls us with temporary object
+ TDelimitersSplitWithoutTags(const char*, size_t, TSplitDelimiters&&) = delete;
TDelimitersSplitWithoutTags(const TString&, TSplitDelimiters&&) = delete;
TDelimitersSplitWithoutTags(TString&&, const TSplitDelimiters&) = delete;
};
@@ -195,9 +195,9 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Str, make sure that no one calls us with temporary object
+
+private:
+ // we don't own Str, make sure that no one calls us with temporary object
TCharSplit(TString&&) = delete;
};
@@ -219,9 +219,9 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Str, make sure that no one calls us with temporary object
+
+private:
+ // we don't own Str, make sure that no one calls us with temporary object
TCharSplitWithoutTags(TString&&) = delete;
};
@@ -246,9 +246,9 @@ public:
TIterator Iterator() const;
TSizeTRegion Next(size_t& pos) const;
size_t Begin() const;
-
-private:
- // we don't own Delimiters, make sure that no one calls us with temporary object
+
+private:
+ // we don't own Delimiters, make sure that no one calls us with temporary object
TSubstringSplit(TString&&, const TSubstringSplitDelimiter&) = delete;
TSubstringSplit(const TString&, TSubstringSplitDelimiter&&) = delete;
};
diff --git a/library/cpp/deprecated/split/split_iterator_ut.cpp b/library/cpp/deprecated/split/split_iterator_ut.cpp
index be5069c4be..5a803f5bdb 100644
--- a/library/cpp/deprecated/split/split_iterator_ut.cpp
+++ b/library/cpp/deprecated/split/split_iterator_ut.cpp
@@ -34,8 +34,8 @@ void TSplitIteratorTest::TestDelimiters() {
void TSplitIteratorTest::TestDelimitersSplit() {
{
TString s = "1a3b45cd";
- TSplitDelimiters delims("abcd");
- TDelimitersSplit split(s, delims);
+ TSplitDelimiters delims("abcd");
+ TDelimitersSplit split(s, delims);
TSplitTokens tokens;
Split(split, &tokens);
TSplitTokens pattern = {"1", "3", "45"};
@@ -43,8 +43,8 @@ void TSplitIteratorTest::TestDelimitersSplit() {
}
{
TString s = "aaaaaa";
- TSplitDelimiters delims("abcd");
- TDelimitersSplit split(s, delims);
+ TSplitDelimiters delims("abcd");
+ TDelimitersSplit split(s, delims);
TSplitTokens tokens;
Split(split, &tokens);
TSplitTokens pattern = {};
@@ -55,8 +55,8 @@ void TSplitIteratorTest::TestDelimitersSplit() {
void TSplitIteratorTest::TestDelimitersStrictSplit() {
{
TString s = "grp@2";
- TSplitDelimiters delims("@");
- TDelimitersStrictSplit split(s, delims);
+ TSplitDelimiters delims("@");
+ TDelimitersStrictSplit split(s, delims);
TSplitTokens tokens;
Split(split, &tokens);
TSplitTokens pattern = {"grp", "2"};
@@ -65,8 +65,8 @@ void TSplitIteratorTest::TestDelimitersStrictSplit() {
{
TString s = "@grp@2@@";
- TSplitDelimiters delims("@");
- TDelimitersStrictSplit split(s, delims);
+ TSplitDelimiters delims("@");
+ TDelimitersStrictSplit split(s, delims);
TSplitTokens tokens;
Split(split, &tokens);
TSplitTokens pattern = {"", "grp", "2", ""};
@@ -76,8 +76,8 @@ void TSplitIteratorTest::TestDelimitersStrictSplit() {
void TSplitIteratorTest::TestTail() {
TString s = "grp@2@4";
- TSplitDelimiters delims("@");
- TDelimitersSplit split(s, delims);
+ TSplitDelimiters delims("@");
+ TDelimitersSplit split(s, delims);
TDelimitersSplit::TIterator it = split.Iterator();
UNIT_ASSERT_EQUAL(it.GetTail(), "grp@2@4");
it.Next();
diff --git a/library/cpp/lfalloc/lf_allocX64.cpp b/library/cpp/lfalloc/lf_allocX64.cpp
index 2eb90761fe..696295663c 100644
--- a/library/cpp/lfalloc/lf_allocX64.cpp
+++ b/library/cpp/lfalloc/lf_allocX64.cpp
@@ -114,7 +114,7 @@ extern "C" void* realloc(void* old_ptr, size_t new_size) {
LFFree(old_ptr);
return new_ptr;
}
-
+
extern "C" size_t malloc_usable_size(void* ptr) {
if (ptr == nullptr) {
return 0;
diff --git a/library/cpp/logger/log.cpp b/library/cpp/logger/log.cpp
index e1d70cc3d2..f5d556dc62 100644
--- a/library/cpp/logger/log.cpp
+++ b/library/cpp/logger/log.cpp
@@ -172,7 +172,7 @@ void TLog::AddLog(ELogPriority priority, const char* format, ...) const {
Impl_->AddLog(priority, format, args);
}
-void TLog::AddLogVAList(const char* format, va_list lst) {
+void TLog::AddLogVAList(const char* format, va_list lst) {
Impl_->AddLog(Impl_->DefaultPriority(), format, lst);
}
diff --git a/library/cpp/packedtypes/longs.h b/library/cpp/packedtypes/longs.h
index 084098d705..9440c95fba 100644
--- a/library/cpp/packedtypes/longs.h
+++ b/library/cpp/packedtypes/longs.h
@@ -8,25 +8,25 @@
#define GET_8_OR(x, buf, type, shift) (x) |= (type) * (buf)++ << (shift)
#if defined(_big_endian_)
-#define LO_SHIFT 1
-#define HI_SHIFT 0
+#define LO_SHIFT 1
+#define HI_SHIFT 0
#elif defined(_little_endian_)
-#define LO_SHIFT 0
-#define HI_SHIFT 1
+#define LO_SHIFT 0
+#define HI_SHIFT 1
#endif
#if !defined(_must_align2_)
#define PUT_16(x, buf, shift) WriteUnaligned<ui16>(buf, (x) >> (shift)), (buf) += 2
#define GET_16_OR(x, buf, type, shift) (x) |= (type)ReadUnaligned<ui16>(buf) << (shift), (buf) += 2
-#else
+#else
#define PUT_16(x, buf, shift) PUT_8(x, buf, shift + 8 * LO_SHIFT), PUT_8(x, buf, shift + 8 * HI_SHIFT)
#define GET_16_OR(x, buf, type, shift) GET_8_OR(x, buf, type, shift + 8 * LO_SHIFT), GET_8_OR(x, buf, type, shift + 8 * HI_SHIFT)
-#endif
-
+#endif
+
#if !defined(_must_align4_)
#define PUT_32(x, buf, shift) WriteUnaligned<ui32>(buf, (x) >> (shift)), (buf) += 4
#define GET_32_OR(x, buf, type, shift) (x) |= (type)ReadUnaligned<ui32>(buf) << (shift), (buf) += 4
-#else
+#else
#define PUT_32(x, buf, shift) PUT_16(x, buf, shift + 16 * LO_SHIFT), PUT_16(x, buf, shift + 16 * HI_SHIFT)
#define GET_32_OR(x, buf, type, shift) GET_16_OR(x, buf, type, shift + 16 * LO_SHIFT), GET_16_OR(x, buf, type, shift + 16 * HI_SHIFT)
#endif
@@ -34,39 +34,39 @@
#if !defined(_must_align8_)
#define PUT_64(x, buf, shift) WriteUnaligned<ui64>(buf, (x) >> (shift)), (buf) += 8
#define GET_64_OR(x, buf, type, shift) (x) |= (type)ReadUnaligned<ui64>(buf) << (shift), (buf) += 8
-#else
+#else
#define PUT_64(x, buf, shift) PUT_32(x, buf, shift + 32 * LO_SHIFT), PUT_32(x, buf, shift + 32 * HI_SHIFT)
#define GET_64_OR(x, buf, type, shift) GET_32_OR(x, buf, type, shift + 32 * LO_SHIFT), GET_32_OR(x, buf, type, shift + 32 * HI_SHIFT)
#endif
struct mem_traits {
- static ui8 get_8(const char*& mem) {
- ui8 x = 0;
- GET_8_OR(x, mem, ui8, 0);
- return x;
- }
- static ui16 get_16(const char*& mem) {
- ui16 x = 0;
- GET_16_OR(x, mem, ui16, 0);
- return x;
- }
- static ui32 get_32(const char*& mem) {
- ui32 x = 0;
- GET_32_OR(x, mem, ui32, 0);
- return x;
- }
- static void put_8(ui8 x, char*& mem) {
- PUT_8(x, mem, 0);
- }
- static void put_16(ui16 x, char*& mem) {
- PUT_16(x, mem, 0);
- }
- static void put_32(ui32 x, char*& mem) {
- PUT_32(x, mem, 0);
- }
+ static ui8 get_8(const char*& mem) {
+ ui8 x = 0;
+ GET_8_OR(x, mem, ui8, 0);
+ return x;
+ }
+ static ui16 get_16(const char*& mem) {
+ ui16 x = 0;
+ GET_16_OR(x, mem, ui16, 0);
+ return x;
+ }
+ static ui32 get_32(const char*& mem) {
+ ui32 x = 0;
+ GET_32_OR(x, mem, ui32, 0);
+ return x;
+ }
+ static void put_8(ui8 x, char*& mem) {
+ PUT_8(x, mem, 0);
+ }
+ static void put_16(ui16 x, char*& mem) {
+ PUT_16(x, mem, 0);
+ }
+ static void put_32(ui32 x, char*& mem) {
+ PUT_32(x, mem, 0);
+ }
static int is_good(char*&) {
- return 1;
- }
+ return 1;
+ }
};
/*
@@ -80,21 +80,21 @@ struct mem_traits {
|iiii|iii1|****|****|****|****|****|****|****|****|****|****|****|****|****|****
*/
-#define PACK1LIM 0x80u
-#define PACK2LIM 0x4000u
-#define PACK3LIM 0x200000u
-#define PACK4LIM 0x10000000u
-#define PACK5LIM 0x800000000ull
-#define PACK6LIM 0x40000000000ull
-#define PACK7LIM 0x2000000000000ull
-#define PACK8LIM 0x100000000000000ull
+#define PACK1LIM 0x80u
+#define PACK2LIM 0x4000u
+#define PACK3LIM 0x200000u
+#define PACK4LIM 0x10000000u
+#define PACK5LIM 0x800000000ull
+#define PACK6LIM 0x40000000000ull
+#define PACK7LIM 0x2000000000000ull
+#define PACK8LIM 0x100000000000000ull
-#define MY_14(x) ((ui16)(x) < PACK1LIM ? 1 : 2)
-#define MY_28(x) ((ui32)(x) < PACK2LIM ? MY_14(x) : ((ui32)(x) < PACK3LIM ? 3 : 4))
+#define MY_14(x) ((ui16)(x) < PACK1LIM ? 1 : 2)
+#define MY_28(x) ((ui32)(x) < PACK2LIM ? MY_14(x) : ((ui32)(x) < PACK3LIM ? 3 : 4))
-#define MY_32(x) ((ui32)(x) < PACK4LIM ? MY_28(x) : 5)
+#define MY_32(x) ((ui32)(x) < PACK4LIM ? MY_28(x) : 5)
#define MY_64(x) ((ui64)(x) < PACK4LIM ? MY_28(x) : ((ui64)(x) < PACK6LIM ? ((ui64)(x) < PACK5LIM ? 5 : 6) : ((ui64)(x) < PACK7LIM ? 7 : ((ui64)(x) < PACK8LIM ? 8 : 9))))
-
+
#if !defined(MACRO_BEGIN)
#define MACRO_BEGIN do {
#define MACRO_END \
diff --git a/library/cpp/packedtypes/packed.h b/library/cpp/packedtypes/packed.h
index 88cff26ae2..2cfadcb4d6 100644
--- a/library/cpp/packedtypes/packed.h
+++ b/library/cpp/packedtypes/packed.h
@@ -10,28 +10,28 @@
struct Stream_traits {
template <typename T>
static T get(IInputStream& in) {
- T x;
- ::Load(&in, x);
- return x;
- }
+ T x;
+ ::Load(&in, x);
+ return x;
+ }
static ui8 get_8(IInputStream& in) {
- return get<ui8>(in);
- }
+ return get<ui8>(in);
+ }
static ui16 get_16(IInputStream& in) {
- return get<ui16>(in);
- }
+ return get<ui16>(in);
+ }
static ui32 get_32(IInputStream& in) {
- return get<ui32>(in);
- }
+ return get<ui32>(in);
+ }
static void put_8(ui8 x, IOutputStream& out) {
- ::Save(&out, x);
- }
+ ::Save(&out, x);
+ }
static void put_16(ui16 x, IOutputStream& out) {
- ::Save(&out, x);
- }
+ ::Save(&out, x);
+ }
static void put_32(ui32 x, IOutputStream& out) {
- ::Save(&out, x);
- }
+ ::Save(&out, x);
+ }
static int is_good(IInputStream& /*in*/) {
return 1;
}
@@ -42,24 +42,24 @@ struct Stream_traits {
struct TZCMemoryInput_traits {
template <typename T>
- static T get(TZCMemoryInput& in) {
- T x;
+ static T get(TZCMemoryInput& in) {
+ T x;
in.ReadPOD(x);
- return x;
+ return x;
}
static ui8 Y_FORCE_INLINE get_8(TZCMemoryInput& in) {
- return get<ui8>(in);
+ return get<ui8>(in);
}
static ui16 Y_FORCE_INLINE get_16(TZCMemoryInput& in) {
- return get<ui16>(in);
+ return get<ui16>(in);
}
static ui32 Y_FORCE_INLINE get_32(TZCMemoryInput& in) {
- return get<ui32>(in);
- }
-
+ return get<ui32>(in);
+ }
+
static int Y_FORCE_INLINE is_good(TZCMemoryInput&) {
return 1;
}