Browse Source

Restoring authorship annotation for <aavdonkin@yandex-team.ru>. Commit 1 of 2.

aavdonkin 3 years ago
parent
commit
fc8d3fe400

+ 4 - 4
library/cpp/cgiparam/cgiparam.cpp

@@ -167,8 +167,8 @@ char* TCgiParameters::Print(char* res) const {
     }
 
     return res;
-}
-
+} 
+ 
 size_t TCgiParameters::PrintSize() const noexcept {
     size_t res = size(); // for '&'
 
@@ -177,8 +177,8 @@ size_t TCgiParameters::PrintSize() const noexcept {
     }
 
     return res;
-}
-
+} 
+ 
 TString TCgiParameters::QuotedPrint(const char* safe) const {
     if (empty()) {
         return TString();

+ 18 - 18
library/cpp/containers/comptrie/protopacker.h

@@ -1,29 +1,29 @@
-#pragma once
-
+#pragma once 
+ 
 #include <util/stream/mem.h>
-#include <util/ysaveload.h>
-
+#include <util/ysaveload.h> 
+ 
 template <class Proto>
 class TProtoPacker {
-public:
+public: 
     TProtoPacker() = default;
-
+ 
     void UnpackLeaf(const char* p, Proto& entry) const {
-        TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32));
+        TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32)); 
         entry.ParseFromArcadiaStream(&in);
-    }
+    } 
     void PackLeaf(char* p, const Proto& entry, size_t size) const {
-        TMemoryOutput out(p, size + sizeof(ui32));
-        Save<ui32>(&out, size);
+        TMemoryOutput out(p, size + sizeof(ui32)); 
+        Save<ui32>(&out, size); 
         entry.SerializeToArcadiaStream(&out);
-    }
+    } 
     size_t MeasureLeaf(const Proto& entry) const {
         return entry.ByteSize() + sizeof(ui32);
     }
-    size_t SkipLeaf(const char* p) const {
-        TMemoryInput in(p, sizeof(ui32));
-        ui32 size;
-        Load<ui32>(&in, size);
-        return size;
-    }
-};
+    size_t SkipLeaf(const char* p) const { 
+        TMemoryInput in(p, sizeof(ui32)); 
+        ui32 size; 
+        Load<ui32>(&in, size); 
+        return size; 
+    } 
+}; 

+ 1 - 1
library/cpp/string_utils/quote/quote.cpp

@@ -119,7 +119,7 @@ static inline It1 Escape(It1 to, It2 from, It3 end, const bool* escape_map = cha
 
     *to = 0;
 
-    return to;
+    return to; 
 }
 
 template <class It1, class It2, class It3, class FromHex>

+ 1 - 1
util/datetime/cputimer.cpp

@@ -15,7 +15,7 @@
 #elif defined(_win_)
     #include <util/system/winint.h>
 #endif
-
+ 
 TTimer::TTimer(const TStringBuf message) {
     static const int SMALL_DURATION_CHAR_LENGTH = 9;                     // strlen("0.123456s")
     Message_.Reserve(message.length() + SMALL_DURATION_CHAR_LENGTH + 1); // +"\n"

+ 4 - 4
util/datetime/cputimer.h

@@ -1,5 +1,5 @@
 #pragma once
-
+ 
 #include "base.h"
 
 #include <util/system/rusage.h>
@@ -11,11 +11,11 @@ private:
     TInstant Start_;
     TStringStream Message_;
 
-public:
+public: 
     TTimer(const TStringBuf message = TStringBuf(" took: "));
     ~TTimer();
-};
-
+}; 
+ 
 class TSimpleTimer {
     TInstant T;
 

+ 14 - 14
util/generic/buffer.h

@@ -145,12 +145,12 @@ public:
         }
     }
 
-    inline void ReserveExactNeverCallMeInSaneCode(size_t len) {
-        if (len > Len_) {
-            Realloc(len);
-        }
-    }
-
+    inline void ReserveExactNeverCallMeInSaneCode(size_t len) { 
+        if (len > Len_) { 
+            Realloc(len); 
+        } 
+    } 
+ 
     inline void ShrinkToFit() {
         if (Pos_ < Len_) {
             Realloc(Pos_);
@@ -162,14 +162,14 @@ public:
         Pos_ = len;
     }
 
-    // Method works like Resize, but allocates exact specified number of bytes
-    // rather than rounded up to next power of 2
-    // Use with care
-    inline void ResizeExactNeverCallMeInSaneCode(size_t len) {
-        ReserveExactNeverCallMeInSaneCode(len);
-        Pos_ = len;
-    }
-
+    // Method works like Resize, but allocates exact specified number of bytes 
+    // rather than rounded up to next power of 2 
+    // Use with care 
+    inline void ResizeExactNeverCallMeInSaneCode(size_t len) { 
+        ReserveExactNeverCallMeInSaneCode(len); 
+        Pos_ = len; 
+    } 
+ 
     inline size_t Capacity() const noexcept {
         return Len_;
     }

+ 2 - 2
util/system/event.cpp

@@ -130,8 +130,8 @@ void TSystemEvent::Reset() noexcept {
 
 void TSystemEvent::Signal() noexcept {
     EvImpl_->Signal();
-}
-
+} 
+ 
 bool TSystemEvent::WaitD(TInstant deadLine) noexcept {
     return EvImpl_->WaitD(deadLine);
 }

+ 29 - 29
util/system/file.cpp

@@ -626,7 +626,7 @@ int TFileHandle::Flock(int op) noexcept {
 }
 
 bool TFileHandle::SetDirect() {
-#ifdef _linux_
+#ifdef _linux_ 
     const long flags = fcntl(Fd_, F_GETFL);
     const int r = fcntl(Fd_, F_SETFL, flags | O_DIRECT);
 
@@ -634,15 +634,15 @@ bool TFileHandle::SetDirect() {
 #endif
 
     return false;
-}
-
-void TFileHandle::ResetDirect() {
-#ifdef _linux_
-    long flags = fcntl(Fd_, F_GETFL);
-    fcntl(Fd_, F_SETFL, flags & ~O_DIRECT);
-#endif
-}
-
+} 
+ 
+void TFileHandle::ResetDirect() { 
+#ifdef _linux_ 
+    long flags = fcntl(Fd_, F_GETFL); 
+    fcntl(Fd_, F_SETFL, flags & ~O_DIRECT); 
+#endif 
+} 
+ 
 i64 TFileHandle::CountCache(i64 offset, i64 length) const noexcept {
 #ifdef _linux_
     const i64 pageSize = NSystemInfo::GetPageSize();
@@ -940,8 +940,8 @@ public:
     i32 RawRead(void* bufferIn, size_t numBytes) {
         const size_t toRead = Min(MaxReadPortion, numBytes);
         return Handle_.Read(bufferIn, toRead);
-    }
-
+    } 
+ 
     size_t ReadOrFail(void* buf, size_t numBytes) {
         const i32 reallyRead = RawRead(buf, numBytes);
 
@@ -1054,16 +1054,16 @@ public:
         }
     }
 
-    void SetDirect() {
+    void SetDirect() { 
         if (!Handle_.SetDirect()) {
             ythrow TFileError() << "can't set direct mode for " << FileName_.Quote();
         }
-    }
-
-    void ResetDirect() {
-        Handle_.ResetDirect();
-    }
-
+    } 
+ 
+    void ResetDirect() { 
+        Handle_.ResetDirect(); 
+    } 
+ 
     i64 CountCache(i64 offset, i64 length) const noexcept {
         return Handle_.CountCache(offset, length);
     }
@@ -1173,8 +1173,8 @@ size_t TFile::Read(void* buf, size_t len) {
 
 i32 TFile::RawRead(void* buf, size_t len) {
     return Impl_->RawRead(buf, len);
-}
-
+} 
+ 
 size_t TFile::ReadOrFail(void* buf, size_t len) {
     return Impl_->ReadOrFail(buf, len);
 }
@@ -1207,14 +1207,14 @@ void TFile::Flock(int op) {
     Impl_->Flock(op);
 }
 
-void TFile::SetDirect() {
-    Impl_->SetDirect();
-}
-
-void TFile::ResetDirect() {
-    Impl_->ResetDirect();
-}
-
+void TFile::SetDirect() { 
+    Impl_->SetDirect(); 
+} 
+ 
+void TFile::ResetDirect() { 
+    Impl_->ResetDirect(); 
+} 
+ 
 i64 TFile::CountCache(i64 offset, i64 length) const noexcept {
     return Impl_->CountCache(offset, length);
 }

+ 3 - 3
util/system/file.h

@@ -127,7 +127,7 @@ public:
 
     //very low-level methods
     bool SetDirect();
-    void ResetDirect();
+    void ResetDirect(); 
 
     /* Manual file cache management, length = 0 means "as much as possible" */
 
@@ -197,8 +197,8 @@ public:
     void Flock(int op);
 
     //do not use, their meaning very platform-dependant
-    void SetDirect();
-    void ResetDirect();
+    void SetDirect(); 
+    void ResetDirect(); 
 
     /* Manual file cache management, length = 0 means "as much as possible" */
 

+ 2 - 2
util/system/filemap.h

@@ -314,7 +314,7 @@ public:
     char* End() const noexcept {
         return Begin() + MappedSize();
     }
-    size_t MappedSize() const {
+    size_t MappedSize() const { 
         return Size_;
     }
     void swap(TMappedAllocation& with);
@@ -342,7 +342,7 @@ public:
     }
     T* Create(size_t siz) {
         Y_ASSERT(MappedSize() == 0 && Ptr() == nullptr);
-        T* arr = (T*)Alloc((sizeof(T) * siz));
+        T* arr = (T*)Alloc((sizeof(T) * siz)); 
         if (!arr)
             return nullptr;
         Y_ASSERT(MappedSize() == sizeof(T) * siz);

Some files were not shown because too many files changed in this diff