diff options
author | paxakor <paxakor@yandex-team.ru> | 2022-02-10 16:47:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:32 +0300 |
commit | 40d35c046ee3a61ee2a581f42499c5ce56ac589a (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util | |
parent | 7fdbed62e54b804e2c12b86a2c2bab12f61065df (diff) | |
download | ydb-40d35c046ee3a61ee2a581f42499c5ce56ac589a.tar.gz |
Restoring authorship annotation for <paxakor@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/folder/dirut.h | 2 | ||||
-rw-r--r-- | util/generic/strbase.h | 2 | ||||
-rw-r--r-- | util/generic/string.h | 10 | ||||
-rw-r--r-- | util/string/hex.cpp | 2 | ||||
-rw-r--r-- | util/string/hex.h | 4 | ||||
-rw-r--r-- | util/string/type.cpp | 8 | ||||
-rw-r--r-- | util/string/util.h | 12 | ||||
-rw-r--r-- | util/string/vector.h | 2 | ||||
-rw-r--r-- | util/system/condvar_ut.cpp | 6 | ||||
-rw-r--r-- | util/system/protect.cpp | 8 | ||||
-rw-r--r-- | util/system/protect.h | 12 | ||||
-rw-r--r-- | util/thread/pool.cpp | 2 | ||||
-rw-r--r-- | util/ya.make | 2 |
13 files changed, 36 insertions, 36 deletions
diff --git a/util/folder/dirut.h b/util/folder/dirut.h index 90b4f4b7cc..2537027b12 100644 --- a/util/folder/dirut.h +++ b/util/folder/dirut.h @@ -19,7 +19,7 @@ #include <io.h> #include "dirent_win.h" -// these live in mktemp_system.cpp +// these live in mktemp_system.cpp extern "C" int mkstemps(char* path, int slen); char* mkdtemp(char* path); diff --git a/util/generic/strbase.h b/util/generic/strbase.h index eb53a17568..ab39fc7537 100644 --- a/util/generic/strbase.h +++ b/util/generic/strbase.h @@ -440,7 +440,7 @@ public: inline TCharType operator[](size_t pos) const noexcept { Y_ASSERT(pos < this->size()); - + return Ptr()[pos]; } diff --git a/util/generic/string.h b/util/generic/string.h index d376ce256a..8cd8aa6917 100644 --- a/util/generic/string.h +++ b/util/generic/string.h @@ -251,14 +251,14 @@ public: } inline const_reference operator[](size_t pos) const noexcept { - Y_ASSERT(pos <= length()); + Y_ASSERT(pos <= length()); return this->data()[pos]; - } - + } + inline reference operator[](size_t pos) noexcept { - Y_ASSERT(pos <= length()); - + Y_ASSERT(pos <= length()); + #ifdef TSTRING_IS_STD_STRING return Storage_[pos]; #else diff --git a/util/string/hex.cpp b/util/string/hex.cpp index 49e94a2a37..667397987f 100644 --- a/util/string/hex.cpp +++ b/util/string/hex.cpp @@ -37,7 +37,7 @@ void* HexDecode(const void* in, size_t len, void* ptr) { char* out = (char*)ptr; while (b != e) { - *out++ = (char)String2Byte(b); + *out++ = (char)String2Byte(b); b += 2; } diff --git a/util/string/hex.h b/util/string/hex.h index 917aa63851..af3d2d528f 100644 --- a/util/string/hex.h +++ b/util/string/hex.h @@ -21,8 +21,8 @@ inline static int Char2Digit(char ch) { } //! Convert a hex string of exactly 2 chars to int -/*! @example String2Byte("10") => 16 */ -inline static int String2Byte(const char* s) { +/*! @example String2Byte("10") => 16 */ +inline static int String2Byte(const char* s) { return Char2Digit(*s) * 16 + Char2Digit(*(s + 1)); } diff --git a/util/string/type.cpp b/util/string/type.cpp index fdb71c1bcd..49671c02c2 100644 --- a/util/string/type.cpp +++ b/util/string/type.cpp @@ -15,8 +15,8 @@ bool IsSpace(const char* s, size_t len) noexcept { return true; } -template <typename TStringType> -static bool IsNumberT(const TStringType& s) noexcept { +template <typename TStringType> +static bool IsNumberT(const TStringType& s) noexcept { if (s.empty()) { return false; } @@ -32,8 +32,8 @@ bool IsNumber(const TWtringBuf s) noexcept { return IsNumberT(s); } -template <typename TStringType> -static bool IsHexNumberT(const TStringType& s) noexcept { +template <typename TStringType> +static bool IsHexNumberT(const TStringType& s) noexcept { if (s.empty()) { return false; } diff --git a/util/string/util.h b/util/string/util.h index c3a20dfb3c..0d77a5042b 100644 --- a/util/string/util.h +++ b/util/string/util.h @@ -182,14 +182,14 @@ private: }; // Removes all occurrences of given character from string -template <typename TStringType> -void RemoveAll(TStringType& str, typename TStringType::char_type ch) { +template <typename TStringType> +void RemoveAll(TStringType& str, typename TStringType::char_type ch) { size_t pos = str.find(ch); // 'find' to avoid cloning of string in 'TString.begin()' - if (pos == TStringType::npos) + if (pos == TStringType::npos) return; - typename TStringType::iterator begin = str.begin(); - typename TStringType::iterator end = begin + str.length(); - typename TStringType::iterator it = std::remove(begin + pos, end, ch); + typename TStringType::iterator begin = str.begin(); + typename TStringType::iterator end = begin + str.length(); + typename TStringType::iterator it = std::remove(begin + pos, end, ch); str.erase(it, end); } diff --git a/util/string/vector.h b/util/string/vector.h index 2495ed5b64..e36c348bbe 100644 --- a/util/string/vector.h +++ b/util/string/vector.h @@ -113,7 +113,7 @@ inline TString JoinVectorIntoString(const TVector<T>& v, const TStringBuf delim) template <typename T> inline TString JoinVectorIntoString(const TVector<T>& v, size_t index, size_t count, const TStringBuf delim) { - Y_ASSERT(index + count <= v.size() && "JoinVectorIntoString(): index or count out of range"); + Y_ASSERT(index + count <= v.size() && "JoinVectorIntoString(): index or count out of range"); return JoinStrings(v.begin() + index, v.begin() + index + count, delim); } diff --git a/util/system/condvar_ut.cpp b/util/system/condvar_ut.cpp index 1c850ab92c..5130a18d32 100644 --- a/util/system/condvar_ut.cpp +++ b/util/system/condvar_ut.cpp @@ -66,7 +66,7 @@ class TCondVarTest: public TTestBase { if (Id_ < 2) { TGuard<TMutex> guard(Data_.mutex); while (!AtomicGet(Data_.stopWaiting)) { - bool res = Data_.condVar1.WaitT(Data_.mutex, TDuration::Seconds(1)); + bool res = Data_.condVar1.WaitT(Data_.mutex, TDuration::Seconds(1)); FAIL_ASSERT(res == true); } } else { @@ -108,7 +108,7 @@ class TCondVarTest: public TTestBase { } else { AtomicIncrement(Data_.waited); while (AtomicGet(Data_.in) < TotalIds_) { - bool res = Data_.condVar1.WaitT(Data_.mutex, TDuration::Seconds(1)); + bool res = Data_.condVar1.WaitT(Data_.mutex, TDuration::Seconds(1)); FAIL_ASSERT(res == true); } } @@ -119,7 +119,7 @@ class TCondVarTest: public TTestBase { Data_.condVar2.BroadCast(); } else { while (AtomicGet(Data_.out) < TotalIds_) { - bool res = Data_.condVar2.WaitT(Data_.mutex, TDuration::Seconds(1)); + bool res = Data_.condVar2.WaitT(Data_.mutex, TDuration::Seconds(1)); FAIL_ASSERT(res == true); } } diff --git a/util/system/protect.cpp b/util/system/protect.cpp index 777808fb38..bbb8d410df 100644 --- a/util/system/protect.cpp +++ b/util/system/protect.cpp @@ -14,7 +14,7 @@ #include <Windows.h> #endif -static TString ModeToString(const EProtectMemory mode) { +static TString ModeToString(const EProtectMemory mode) { TString strMode; if (mode == PM_NONE) { return "PM_NONE"; @@ -32,8 +32,8 @@ static TString ModeToString(const EProtectMemory mode) { return strMode.substr(0, strMode.size() - 1); } -void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode) { - Y_VERIFY(!(mode & ~(PM_READ | PM_WRITE | PM_EXEC)), "Invalid memory protection flag combination. "); +void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode) { + Y_VERIFY(!(mode & ~(PM_READ | PM_WRITE | PM_EXEC)), "Invalid memory protection flag combination. "); #if defined(_unix_) || defined(_darwin_) int mpMode = PROT_NONE; @@ -61,7 +61,7 @@ void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode) { * memory protection. As we don't know, what behavior is more correct, we choose * one of them. A discussion was here: REVIEW: 39725 */ - switch (mode.ToBaseType()) { + switch (mode.ToBaseType()) { case PM_READ: mpMode = PAGE_READONLY; break; diff --git a/util/system/protect.h b/util/system/protect.h index 5b397e07b6..26714f3e92 100644 --- a/util/system/protect.h +++ b/util/system/protect.h @@ -2,8 +2,8 @@ #include "defaults.h" -#include <util/generic/flags.h> - +#include <util/generic/flags.h> + enum EProtectMemoryMode { PM_NONE = 0x00, // no access allowed PM_READ = 0x01, // read access allowed @@ -11,9 +11,9 @@ enum EProtectMemoryMode { PM_EXEC = 0x04 // execute access allowed }; -Y_DECLARE_FLAGS(EProtectMemory, EProtectMemoryMode) -Y_DECLARE_OPERATORS_FOR_FLAGS(EProtectMemory) - +Y_DECLARE_FLAGS(EProtectMemory, EProtectMemoryMode) +Y_DECLARE_OPERATORS_FOR_FLAGS(EProtectMemory) + /** * Set protection mode on memory block * @param addr Block address to be protected @@ -22,4 +22,4 @@ Y_DECLARE_OPERATORS_FOR_FLAGS(EProtectMemory) * @note On Windows there is no write-only protection mode, * so PM_WRITE will be translated to (PM_READ | PM_WRITE) on Windows. **/ -void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode); +void ProtectMemory(void* addr, const size_t length, const EProtectMemory mode); diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp index 89efdd75b7..05fad02e9b 100644 --- a/util/thread/pool.cpp +++ b/util/thread/pool.cpp @@ -516,7 +516,7 @@ private: ++Free_; while (!Obj_ && !AllDone_) { - if (!CondReady_.WaitT(Mutex_, IdleTime_)) { + if (!CondReady_.WaitT(Mutex_, IdleTime_)) { break; } } diff --git a/util/ya.make b/util/ya.make index 571a06390e..6ebe7e40cf 100644 --- a/util/ya.make +++ b/util/ya.make @@ -364,7 +364,7 @@ IF (MUSL) ELSE() IF (OS_LINUX OR SUN OR CYGWIN OR OS_WINDOWS) SRCS( - system/mktemp_system.cpp + system/mktemp_system.cpp ) ENDIF() ENDIF() |