diff options
author | druxa <druxa@yandex-team.ru> | 2022-02-10 16:49:28 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:28 +0300 |
commit | a6b6f52a89f054724740e5f7a04800b3d64f4367 (patch) | |
tree | fa84234b6b0eb745f922f635a6497d1e7eb9b2e0 | |
parent | 3d0b4183f2ddf8aebaf3f4ad74517b2eddef26a8 (diff) | |
download | ydb-a6b6f52a89f054724740e5f7a04800b3d64f4367.tar.gz |
Restoring authorship annotation for <druxa@yandex-team.ru>. Commit 1 of 2.
-rw-r--r-- | library/cpp/binsaver/bin_saver.h | 10 | ||||
-rw-r--r-- | library/cpp/logger/system.cpp | 2 | ||||
-rw-r--r-- | library/cpp/messagebus/www/concat_strings.h | 6 | ||||
-rw-r--r-- | library/cpp/testing/unittest/registar.h | 4 | ||||
-rw-r--r-- | util/generic/string.h | 18 | ||||
-rw-r--r-- | util/generic/typelist.h | 34 | ||||
-rw-r--r-- | util/generic/typelist_ut.cpp | 68 | ||||
-rw-r--r-- | util/system/maxlen.h | 4 | ||||
-rw-r--r-- | util/system/shellcommand.cpp | 2 |
9 files changed, 74 insertions, 74 deletions
diff --git a/library/cpp/binsaver/bin_saver.h b/library/cpp/binsaver/bin_saver.h index 412424889f..1905973c88 100644 --- a/library/cpp/binsaver/bin_saver.h +++ b/library/cpp/binsaver/bin_saver.h @@ -258,11 +258,11 @@ private: for (i64 offset = 0; offset < nSize; offset += chunkSize) { void* ptr = (char*)pData + offset; i64 size = offset + chunkSize < nSize ? chunkSize : (nSize - offset); - if (bRead) - File.Read(ptr, size); - else - File.Write(ptr, size); - } + if (bRead) + File.Read(ptr, size); + else + File.Write(ptr, size); + } } // storing/loading pointers to objects diff --git a/library/cpp/logger/system.cpp b/library/cpp/logger/system.cpp index 42233f63d2..33933a1cb4 100644 --- a/library/cpp/logger/system.cpp +++ b/library/cpp/logger/system.cpp @@ -22,7 +22,7 @@ TSysLogBackend::TSysLogBackend(const char* ident, EFacility facility, int flags) #if defined(_unix_) Y_ASSERT(TSYSLOG_LOCAL0 <= facility && facility <= TSYSLOG_LOCAL7); - static const int f2sf[] = { + static const int f2sf[] = { LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, diff --git a/library/cpp/messagebus/www/concat_strings.h b/library/cpp/messagebus/www/concat_strings.h index 7b730564eb..2a5f79b658 100644 --- a/library/cpp/messagebus/www/concat_strings.h +++ b/library/cpp/messagebus/www/concat_strings.h @@ -10,13 +10,13 @@ inline void DoConcatStrings(TStringStream&) { template <class T, class... R> inline void DoConcatStrings(TStringStream& ss, const T& t, const R&... r) { - ss << t; - DoConcatStrings(ss, r...); + ss << t; + DoConcatStrings(ss, r...); } template <class... R> inline TString ConcatStrings(const R&... r) { TStringStream ss; - DoConcatStrings(ss, r...); + DoConcatStrings(ss, r...); return ss.Str(); } diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 44517a0092..a4abfc9d62 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -374,14 +374,14 @@ public: \ #define UNIT_FAIL(M) UNIT_FAIL_IMPL("forced failure", M) #define UNIT_FAIL_NONFATAL(M) UNIT_FAIL_NONFATAL_IMPL("forced failure", M) -//types +//types #define UNIT_ASSERT_TYPES_EQUAL(A, B) \ do { \ if (!std::is_same<A, B>::value) { \ UNIT_FAIL_IMPL("types equal assertion failed", (::TStringBuilder() << #A << " (" << TypeName<A>() << ") != " << #B << " (" << TypeName<B>() << ")").data()); \ } \ } while (false) - + //doubles // UNIT_ASSERT_DOUBLES_EQUAL_DEPRECATED* macros do not handle NaNs correctly (see IGNIETFERRO-1419) and are for backward compatibility // only. Consider switching to regular UNIT_ASSERT_DOUBLES_EQUAL* macros if you're still using the deprecated version. diff --git a/util/generic/string.h b/util/generic/string.h index 8cd8aa6917..6ad1e5b78f 100644 --- a/util/generic/string.h +++ b/util/generic/string.h @@ -530,7 +530,7 @@ public: return TBasicString(TUninitialized(n)); } -private: +private: template <typename... R> static size_t SumLength(const TBasicStringBuf<TCharType, TTraits> s1, const R&... r) noexcept { return s1.size() + SumLength(r...); @@ -542,15 +542,15 @@ private: } static constexpr size_t SumLength() noexcept { - return 0; + return 0; } template <typename... R> static void CopyAll(TCharType* p, const TBasicStringBuf<TCharType, TTraits> s, const R&... r) { TTraits::copy(p, s.data(), s.size()); CopyAll(p + s.size(), r...); - } - + } + template <typename... R, class TNextCharType, typename = std::enable_if_t<std::is_same<TCharType, TNextCharType>::value>> static void CopyAll(TCharType* p, const TNextCharType s, const R&... r) { p[0] = s; @@ -558,9 +558,9 @@ private: } static void CopyAll(TCharType*) noexcept { - } - -public: + } + +public: inline void clear() noexcept { #ifdef TSTRING_IS_STD_STRING Storage_.clear(); @@ -575,13 +575,13 @@ public: #endif } - template <typename... R> + template <typename... R> static inline TBasicString Join(const R&... r) { TBasicString s{TUninitialized{SumLength(r...)}}; TBasicString::CopyAll((TCharType*)s.data(), r...); - return s; + return s; } // ~~~ Assignment ~~~ : FAMILY0(TBasicString&, assign); diff --git a/util/generic/typelist.h b/util/generic/typelist.h index 5ce26ab97c..a2ecaa5bca 100644 --- a/util/generic/typelist.h +++ b/util/generic/typelist.h @@ -7,8 +7,8 @@ #include <type_traits> template <class... R> -struct TTypeList; - +struct TTypeList; + namespace NTL { template <unsigned N, typename TL> struct TGetImpl { @@ -22,7 +22,7 @@ namespace NTL { } template <> -struct TTypeList<> { +struct TTypeList<> { static constexpr size_t Length = 0; template <class> @@ -34,13 +34,13 @@ struct TTypeList<> { }; }; -using TNone = TTypeList<>; +using TNone = TTypeList<>; template <class H, class... R> -struct TTypeList<H, R...> { - using THead = H; - using TTail = TTypeList<R...>; - +struct TTypeList<H, R...> { + using THead = H; + using TTail = TTypeList<R...>; + static constexpr size_t Length = 1 + sizeof...(R); template <class V> @@ -55,26 +55,26 @@ struct TTypeList<H, R...> { }; }; -//FIXME: temporary to check overall build +//FIXME: temporary to check overall build template <class T> struct TTypeList<T, TNone>: public TTypeList<T> { -}; - +}; + using TCommonSignedInts = TTypeList<signed char, signed short, signed int, signed long, signed long long>; using TCommonUnsignedInts = TTypeList<unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long, bool>; using TFixedWidthSignedInts = TTypeList<i8, i16, i32, i64>; using TFixedWidthUnsignedInts = TTypeList<ui8, ui16, ui32, ui64>; using TFloats = TTypeList<float, double, long double>; - + namespace NTL { template <class T1, class T2> - struct TConcat; - + struct TConcat; + template <class... R1, class... R2> - struct TConcat<TTypeList<R1...>, TTypeList<R2...>> { + struct TConcat<TTypeList<R1...>, TTypeList<R2...>> { using type = TTypeList<R1..., R2...>; - }; - + }; + template <bool isSigned, class T, class TS, class TU> struct TTypeSelectorBase { using TSignedInts = typename TConcat<TTypeList<T>, TS>::type; diff --git a/util/generic/typelist_ut.cpp b/util/generic/typelist_ut.cpp index eeabfa97b1..6846391c38 100644 --- a/util/generic/typelist_ut.cpp +++ b/util/generic/typelist_ut.cpp @@ -1,20 +1,20 @@ #include <library/cpp/testing/unittest/registar.h> #include <util/system/type_name.h> - + #include "typelist.h" #include "vector.h" #include "map.h" - -class TTypeListTest: public TTestBase { - UNIT_TEST_SUITE(TTypeListTest); - UNIT_TEST(TestSimple); - UNIT_TEST(TestHave); + +class TTypeListTest: public TTestBase { + UNIT_TEST_SUITE(TTypeListTest); + UNIT_TEST(TestSimple); + UNIT_TEST(TestHave); UNIT_TEST(TestGet); UNIT_TEST(TestFloatList); - UNIT_TEST(TestSelectBy); - UNIT_TEST_SUITE_END(); - -public: + UNIT_TEST(TestSelectBy); + UNIT_TEST_SUITE_END(); + +public: void TestGet() { using TListType = TTypeList<int, char, float>; @@ -23,56 +23,56 @@ public: UNIT_ASSERT_TYPES_EQUAL(TListType::TGet<2>, float); } - void TestSimple() { + void TestSimple() { using TListType = TTypeList<int, char, float>; UNIT_ASSERT_EQUAL(TListType::Length, 3); UNIT_ASSERT_TYPES_EQUAL(TListType::THead, int); - } - - struct TA {}; - struct TB {}; - struct TC {}; - void TestHave() { + } + + struct TA {}; + struct TB {}; + struct TC {}; + void TestHave() { using TListType = TTypeList<TA, TB*, const TC&>; UNIT_ASSERT(TListType::THave<TA>::value); UNIT_ASSERT(TListType::THave<TB*>::value); UNIT_ASSERT(!TListType::THave<TB>::value); UNIT_ASSERT(TListType::THave<const TC&>::value); UNIT_ASSERT(!TListType::THave<TC&>::value); - } - + } + template <class T> class TT {}; - + template <class T> struct TIs1ArgTemplate: std::false_type {}; - + template <class T, template <class> class TT> struct TIs1ArgTemplate<TT<T>>: std::true_type {}; - + template <class T> struct TIsNArgTemplate: std::false_type {}; - + template <template <class...> class TT, class... R> struct TIsNArgTemplate<TT<R...>>: std::true_type {}; template <class> struct TAnyType: std::true_type {}; - + template <class T> - struct TMyVector {}; - + struct TMyVector {}; + template <class T1, class T2> - struct TMyMap {}; - - void TestSelectBy() { + struct TMyMap {}; + + void TestSelectBy() { using TListType = TTypeList<TA, TB, TMyMap<TA*, TB>, TMyVector<TA>, TC>; - + UNIT_ASSERT_TYPES_EQUAL(TListType::TSelectBy<TAnyType>::type, TA); UNIT_ASSERT_TYPES_EQUAL(TListType::TSelectBy<TIs1ArgTemplate>::type, TMyVector<TA>); using TMyMapPTATB = TMyMap<TA*, TB>; UNIT_ASSERT_TYPES_EQUAL(TListType::TSelectBy<TIsNArgTemplate>::type, TMyMapPTATB); - } + } void TestFloatList() { UNIT_ASSERT_TYPES_EQUAL(TFixedWidthFloat<ui32>, float); @@ -80,6 +80,6 @@ public: UNIT_ASSERT_TYPES_EQUAL(TFixedWidthFloat<ui64>, double); UNIT_ASSERT_TYPES_EQUAL(TFixedWidthFloat<i64>, double); } -}; - -UNIT_TEST_SUITE_REGISTRATION(TTypeListTest); +}; + +UNIT_TEST_SUITE_REGISTRATION(TTypeListTest); diff --git a/util/system/maxlen.h b/util/system/maxlen.h index e1ff7f5008..2cc3134093 100644 --- a/util/system/maxlen.h +++ b/util/system/maxlen.h @@ -8,9 +8,9 @@ #endif #define HOST_MAX 260 -#ifndef URL_MAX +#ifndef URL_MAX #define URL_MAX 1024 -#endif +#endif #define FULLURL_MAX (URL_MAX + HOST_MAX) #define LINKTEXT_MAX 1024 diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp index b1989b5c8c..a0b82e8e21 100644 --- a/util/system/shellcommand.cpp +++ b/util/system/shellcommand.cpp @@ -397,7 +397,7 @@ public: if (!ok && (errno == ESRCH) && DetachSession) { // this could fail when called before child proc completes setsid(). ok = kill(Pid, SIGTERM) == 0; - kill(-Pid, SIGTERM); // between a failed kill(-Pid) and a successful kill(Pid) a grandchild could have been spawned + kill(-Pid, SIGTERM); // between a failed kill(-Pid) and a successful kill(Pid) a grandchild could have been spawned } #else TerminateProcess(Pid, 1 /* exit code */); |