Browse Source

Restoring authorship annotation for Arseny Smalyuk <smalukav@gmail.com>. Commit 2 of 2.

Arseny Smalyuk 3 years ago
parent
commit
5f8a2ce7b1

+ 9 - 9
contrib/libs/pire/pire/re_parser.y

@@ -70,8 +70,8 @@ void AppendRange(const Encoding& encoding, Fsm& a, const Term::CharacterRange& c
 %term YRE_AND
 %term YRE_NOT
 
-%destructor { delete $$; } <> 
- 
+%destructor { delete $$; } <>
+
 %%
 
 regexp
@@ -80,23 +80,23 @@ regexp
             ConvertToFSM(rlex.Encoding(), $1);
             DoSwap(rlex.Retval(), *$1);
             delete $1;
-            $$ = nullptr; 
+            $$ = nullptr;
         }
     ;
 
 alternative
     : conjunction
-    | alternative '|' conjunction { ConvertToFSM(rlex.Encoding(), ($$ = $1)) |= ConvertToFSM(rlex.Encoding(), $3); delete $2; delete $3; } 
+    | alternative '|' conjunction { ConvertToFSM(rlex.Encoding(), ($$ = $1)) |= ConvertToFSM(rlex.Encoding(), $3); delete $2; delete $3; }
     ;
 
 conjunction
     : negation
-    | conjunction YRE_AND negation { ConvertToFSM(rlex.Encoding(), ($$ = $1)) &= ConvertToFSM(rlex.Encoding(), $3); delete $2; delete $3; } 
+    | conjunction YRE_AND negation { ConvertToFSM(rlex.Encoding(), ($$ = $1)) &= ConvertToFSM(rlex.Encoding(), $3); delete $2; delete $3; }
     ;
 
 negation
     : concatenation
-    | YRE_NOT concatenation { ConvertToFSM(rlex.Encoding(), ($$ = $2)).Complement(); delete $1; } 
+    | YRE_NOT concatenation { ConvertToFSM(rlex.Encoding(), ($$ = $2)).Complement(); delete $1; }
     ;
 
 concatenation
@@ -150,7 +150,7 @@ term
     | YRE_DOT
     | '^'
     | '$'
-    | '(' alternative ')'      { $$ = $2; rlex.Parenthesized($$->As<Fsm>()); delete $1; delete $3; } 
+    | '(' alternative ')'      { $$ = $2; rlex.Parenthesized($$->As<Fsm>()); delete $1; delete $3; }
     ;
 
 %%
@@ -161,8 +161,8 @@ int yylex(YYSTYPE* lval, Pire::Lexer& rlex)
         Pire::Term term = rlex.Lex();
         if (!term.Value().Empty())
             *lval = new Any(term.Value());
-        else 
-            *lval = nullptr; 
+        else
+            *lval = nullptr;
         return term.Type();
     } catch (Pire::Error &e) {
         rlex.SetError(e.what());

+ 4 - 4
contrib/libs/zlib/trees.c

@@ -870,10 +870,10 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
     bi_windup(s);        /* align on byte boundary */
     put_short(s, (ush)stored_len);
     put_short(s, (ush)~stored_len);
-    if (stored_len) { 
-        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); 
-        s->pending += stored_len; 
-    } 
+    if (stored_len) {
+        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
+        s->pending += stored_len;
+    }
 #ifdef ZLIB_DEBUG
     s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
     s->compressed_len += (stored_len + 4) << 3;

+ 7 - 7
library/cpp/coroutine/engine/callbacks.h

@@ -6,13 +6,13 @@ class TContExecutor;
 namespace NCoro {
     class IScheduleCallback {
     public:
-        virtual void OnSchedule(TContExecutor&, TCont&) = 0; 
-        virtual void OnUnschedule(TContExecutor&) = 0; 
-    }; 
+        virtual void OnSchedule(TContExecutor&, TCont&) = 0;
+        virtual void OnUnschedule(TContExecutor&) = 0;
+    };
 
-    class IEnterPollerCallback { 
-    public: 
-        virtual void OnEnterPoller() = 0; 
-        virtual void OnExitPoller() = 0; 
+    class IEnterPollerCallback {
+    public:
+        virtual void OnEnterPoller() = 0;
+        virtual void OnExitPoller() = 0;
     };
 }

+ 3 - 3
library/cpp/coroutine/engine/coroutine_ut.cpp

@@ -36,7 +36,7 @@ class TCoroTest: public TTestBase {
 //    UNIT_TEST(TestFastPathWakeEpoll)
     UNIT_TEST(TestFastPathWakeKqueue)
     UNIT_TEST(TestFastPathWakePoll)
-    UNIT_TEST(TestFastPathWakeSelect) 
+    UNIT_TEST(TestFastPathWakeSelect)
     UNIT_TEST(TestLegacyCancelYieldRaceBug)
     UNIT_TEST(TestJoinRescheduleBug);
     UNIT_TEST(TestEventQueue)
@@ -943,7 +943,7 @@ void TCoroTest::TestPollEngines() {
 }
 
 void TCoroTest::TestPause() {
-    TContExecutor executor{1024*1024, IPollerFace::Default(), nullptr, nullptr, NCoro::NStack::EGuard::Canary, Nothing()}; 
+    TContExecutor executor{1024*1024, IPollerFace::Default(), nullptr, nullptr, NCoro::NStack::EGuard::Canary, Nothing()};
 
     int i = 0;
     executor.CreateOwned([&](TCont*) {
@@ -993,7 +993,7 @@ void TCoroTest::TestOverrideTime() {
     };
 
     TTime time;
-    TContExecutor executor{1024*1024, IPollerFace::Default(), nullptr, nullptr, NCoro::NStack::EGuard::Canary, Nothing(), &time}; 
+    TContExecutor executor{1024*1024, IPollerFace::Default(), nullptr, nullptr, NCoro::NStack::EGuard::Canary, Nothing(), &time};
 
     executor.CreateOwned([&](TCont* cont) {
         UNIT_ASSERT_EQUAL(cont->Executor()->Now(), TInstant::Zero());

+ 29 - 29
library/cpp/coroutine/engine/impl.cpp

@@ -119,14 +119,14 @@ void TCont::ReSchedule() noexcept {
 TContExecutor::TContExecutor(
     uint32_t defaultStackSize,
     THolder<IPollerFace> poller,
-    NCoro::IScheduleCallback* scheduleCallback, 
-    NCoro::IEnterPollerCallback* enterPollerCallback, 
+    NCoro::IScheduleCallback* scheduleCallback,
+    NCoro::IEnterPollerCallback* enterPollerCallback,
     NCoro::NStack::EGuard defaultGuard,
     TMaybe<NCoro::NStack::TPoolAllocatorSettings> poolSettings,
     NCoro::ITime* time
 )
-    : ScheduleCallback_(scheduleCallback) 
-    , EnterPollerCallback_(enterPollerCallback) 
+    : ScheduleCallback_(scheduleCallback)
+    , EnterPollerCallback_(enterPollerCallback)
     , DefaultStackSize_(defaultStackSize)
     , Poller_(std::move(poller))
     , Time_(time)
@@ -171,21 +171,21 @@ void TContExecutor::WaitForIO() {
         //      to prevent ourselves from locking out of io by constantly waking coroutines.
 
         if (ReadyNext_.Empty()) {
-            if (EnterPollerCallback_) { 
-                EnterPollerCallback_->OnEnterPoller(); 
-            } 
+            if (EnterPollerCallback_) {
+                EnterPollerCallback_->OnEnterPoller();
+            }
             Poll(next);
-            if (EnterPollerCallback_) { 
-                EnterPollerCallback_->OnExitPoller(); 
-            } 
+            if (EnterPollerCallback_) {
+                EnterPollerCallback_->OnExitPoller();
+            }
         } else if (LastPoll_ + TDuration::MilliSeconds(5) < now) {
-            if (EnterPollerCallback_) { 
-                EnterPollerCallback_->OnEnterPoller(); 
-            } 
+            if (EnterPollerCallback_) {
+                EnterPollerCallback_->OnEnterPoller();
+            }
             Poll(now);
-            if (EnterPollerCallback_) { 
-                EnterPollerCallback_->OnExitPoller(); 
-            } 
+            if (EnterPollerCallback_) {
+                EnterPollerCallback_->OnExitPoller();
+            }
         }
 
         Ready_.Append(ReadyNext_);
@@ -296,8 +296,8 @@ TCont* RunningCont() {
     return thisThreadExecutor ? thisThreadExecutor->Running() : nullptr;
 }
 
-void TContExecutor::RunScheduler() noexcept { 
-    try { 
+void TContExecutor::RunScheduler() noexcept {
+    try {
         TContExecutor* const prev = ThisThreadExecutor();
         ThisThreadExecutor() = this;
         TCont* caller = Current_;
@@ -306,27 +306,27 @@ void TContExecutor::RunScheduler() noexcept {
             ThisThreadExecutor() = prev;
         };
 
-        while (true) { 
-            if (ScheduleCallback_ && Current_) { 
-                ScheduleCallback_->OnUnschedule(*this); 
+        while (true) {
+            if (ScheduleCallback_ && Current_) {
+                ScheduleCallback_->OnUnschedule(*this);
             }
 
             WaitForIO();
             DeleteScheduled();
-            Ready_.Append(ReadyNext_); 
+            Ready_.Append(ReadyNext_);
 
-            if (Ready_.Empty()) { 
+            if (Ready_.Empty()) {
                 Current_ = nullptr;
                 if (caller) {
                     context->SwitchTo(&SchedContext_);
                 }
-                break; 
-            } 
+                break;
+            }
 
             TCont* cont = Ready_.PopFront();
 
-            if (ScheduleCallback_) { 
-                ScheduleCallback_->OnSchedule(*this, *cont); 
+            if (ScheduleCallback_) {
+                ScheduleCallback_->OnSchedule(*this, *cont);
             }
 
             Current_ = cont;
@@ -343,8 +343,8 @@ void TContExecutor::RunScheduler() noexcept {
             if (caller) {
                 break;
             }
-        } 
-    } catch (...) { 
+        }
+    } catch (...) {
         TBackTrace::FromCurrentException().PrintTo(Cerr);
         Y_FAIL("Uncaught exception in the scheduler: %s", CurrentExceptionMessage().c_str());
     }

+ 5 - 5
library/cpp/coroutine/engine/impl.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include "callbacks.h" 
+#include "callbacks.h"
 #include "cont_poller.h"
 #include "iostatus.h"
 #include "poller.h"
@@ -154,7 +154,7 @@ public:
         uint32_t defaultStackSize,
         THolder<IPollerFace> poller = IPollerFace::Default(),
         NCoro::IScheduleCallback* = nullptr,
-        NCoro::IEnterPollerCallback* = nullptr, 
+        NCoro::IEnterPollerCallback* = nullptr,
         NCoro::NStack::EGuard stackGuard = NCoro::NStack::EGuard::Canary,
         TMaybe<NCoro::NStack::TPoolAllocatorSettings> poolSettings = Nothing(),
         NCoro::ITime* time = nullptr
@@ -273,7 +273,7 @@ private:
 
     void Exit(TCont* cont) noexcept;
 
-    void RunScheduler() noexcept; 
+    void RunScheduler() noexcept;
 
     void ScheduleToDelete(TCont* cont) noexcept;
 
@@ -288,8 +288,8 @@ private:
     void Poll(TInstant deadline);
 
 private:
-    NCoro::IScheduleCallback* const ScheduleCallback_ = nullptr; 
-    NCoro::IEnterPollerCallback* const EnterPollerCallback_ = nullptr; 
+    NCoro::IScheduleCallback* const ScheduleCallback_ = nullptr;
+    NCoro::IEnterPollerCallback* const EnterPollerCallback_ = nullptr;
     const uint32_t DefaultStackSize_;
     THolder<NCoro::NStack::IAllocator> StackAllocator_;
 

+ 1 - 1
library/cpp/coroutine/engine/network.cpp

@@ -295,7 +295,7 @@ namespace NCoro {
 
             if (!IsBlocked(err)) {
                 return -err;
-            } 
+            }
 
             err = PollD(cont, s, CONT_POLL_READ, deadline);
 

+ 17 - 17
library/cpp/coroutine/engine/poller.cpp

@@ -88,8 +88,8 @@ namespace {
         void Wait(TEvents& events, TInstant deadLine) {
             const size_t ret = P_.WaitD(~E_, +E_, deadLine);
 
-            events.reserve(ret); 
- 
+            events.reserve(ret);
+
             for (size_t i = 0; i < ret; ++i) {
                 const TInternalEvent* ie = ~E_ + i;
 
@@ -199,12 +199,12 @@ namespace {
             ret |= POLLOUT;
         }
 
-#if defined(_linux_) 
-        if (flags & CONT_POLL_RDHUP) { 
-            ret |= POLLRDHUP; 
-        } 
-#endif 
- 
+#if defined(_linux_)
+        if (flags & CONT_POLL_RDHUP) {
+            ret |= POLLRDHUP;
+        }
+#endif
+
         return ret;
     }
 
@@ -248,12 +248,12 @@ namespace {
 
             const ssize_t ret = PollD(T_.data(), (nfds_t) T_.size(), deadLine);
 
-            if (ret <= 0) { 
+            if (ret <= 0) {
                 return;
             }
 
             events.reserve(T_.size());
- 
+
             for (size_t i = 0; i < T_.size(); ++i) {
                 const pollfd& pfd = T_[i];
                 const short ev = pfd.revents;
@@ -274,12 +274,12 @@ namespace {
                     filter |= CONT_POLL_WRITE;
                 }
 
-#if defined(_linux_) 
-                if (ev & POLLRDHUP) { 
-                    filter |= CONT_POLL_RDHUP; 
-                } 
-#endif 
- 
+#if defined(_linux_)
+                if (ev & POLLRDHUP) {
+                    filter |= CONT_POLL_RDHUP;
+                }
+#endif
+
                 if (ev & POLLERR) {
                     status = EIO;
                 } else if (ev & POLLHUP && pfd.events & POLLOUT) {
@@ -290,7 +290,7 @@ namespace {
                 }
 
                 if (status) {
-                    filter = CONT_POLL_READ | CONT_POLL_WRITE | CONT_POLL_RDHUP; 
+                    filter = CONT_POLL_READ | CONT_POLL_WRITE | CONT_POLL_RDHUP;
                 }
 
                 const TEvent res = {

+ 31 - 31
library/cpp/http/io/compression.cpp

@@ -1,4 +1,4 @@
-#include "compression.h" 
+#include "compression.h"
 
 #if defined(ENABLE_GPL)
 #include <library/cpp/streams/lz/lz.h>
@@ -14,53 +14,53 @@
 #include <util/stream/zlib.h>
 
 
-TCompressionCodecFactory::TCompressionCodecFactory() { 
-    auto gzip = [](auto s) { 
-        return MakeHolder<TZLibDecompress>(s); 
+TCompressionCodecFactory::TCompressionCodecFactory() {
+    auto gzip = [](auto s) {
+        return MakeHolder<TZLibDecompress>(s);
     };
 
-    Add("gzip", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::GZip); }); 
-    Add("deflate", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::ZLib); }); 
-    Add("br", [](auto s) { return MakeHolder<TBrotliDecompress>(s); }, [](auto s) { return MakeHolder<TBrotliCompress>(s, 4); }); 
-    Add("x-gzip", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::GZip); }); 
-    Add("x-deflate", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::ZLib); }); 
+    Add("gzip", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::GZip); });
+    Add("deflate", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::ZLib); });
+    Add("br", [](auto s) { return MakeHolder<TBrotliDecompress>(s); }, [](auto s) { return MakeHolder<TBrotliCompress>(s, 4); });
+    Add("x-gzip", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::GZip); });
+    Add("x-deflate", gzip, [](auto s) { return MakeHolder<TZLibCompress>(s, ZLib::ZLib); });
 
 #if defined(ENABLE_GPL)
-    const ui16 bs = 32 * 1024; 
+    const ui16 bs = 32 * 1024;
 
-    Add("y-lzo", [](auto s) { return MakeHolder<TLzoDecompress>(s); }, [bs](auto s) { return MakeHolder<TLazy<TLzoCompress> >(s, bs); }); 
-    Add("y-lzf", [](auto s) { return MakeHolder<TLzfDecompress>(s); }, [bs](auto s) { return MakeHolder<TLazy<TLzfCompress> >(s, bs); }); 
-    Add("y-lzq", [](auto s) { return MakeHolder<TLzqDecompress>(s); }, [bs](auto s) { return MakeHolder<TLazy<TLzqCompress> >(s, bs); }); 
+    Add("y-lzo", [](auto s) { return MakeHolder<TLzoDecompress>(s); }, [bs](auto s) { return MakeHolder<TLazy<TLzoCompress> >(s, bs); });
+    Add("y-lzf", [](auto s) { return MakeHolder<TLzfDecompress>(s); }, [bs](auto s) { return MakeHolder<TLazy<TLzfCompress> >(s, bs); });
+    Add("y-lzq", [](auto s) { return MakeHolder<TLzqDecompress>(s); }, [bs](auto s) { return MakeHolder<TLazy<TLzqCompress> >(s, bs); });
 #endif
 
-    Add("y-bzip2", [](auto s) { return MakeHolder<TBZipDecompress>(s); }, [](auto s) { return MakeHolder<TBZipCompress>(s); }); 
-    Add("y-lzma", [](auto s) { return MakeHolder<TLzmaDecompress>(s); }, [](auto s) { return MakeHolder<TLzmaCompress>(s); }); 
+    Add("y-bzip2", [](auto s) { return MakeHolder<TBZipDecompress>(s); }, [](auto s) { return MakeHolder<TBZipCompress>(s); });
+    Add("y-lzma", [](auto s) { return MakeHolder<TLzmaDecompress>(s); }, [](auto s) { return MakeHolder<TLzmaCompress>(s); });
 
-    for (auto codecName : NBlockCodecs::ListAllCodecs()) { 
-        if (codecName.StartsWith("zstd06")) { 
-            continue; 
+    for (auto codecName : NBlockCodecs::ListAllCodecs()) {
+        if (codecName.StartsWith("zstd06")) {
+            continue;
         }
 
-        if (codecName.StartsWith("zstd08")) { 
-            continue; 
+        if (codecName.StartsWith("zstd08")) {
+            continue;
         }
 
-        auto codec = NBlockCodecs::Codec(codecName); 
+        auto codec = NBlockCodecs::Codec(codecName);
 
-        auto enc = [codec](auto s) { 
-            return MakeHolder<NBlockCodecs::TCodedOutput>(s, codec, 32 * 1024); 
-        }; 
+        auto enc = [codec](auto s) {
+            return MakeHolder<NBlockCodecs::TCodedOutput>(s, codec, 32 * 1024);
+        };
 
-        auto dec = [codec](auto s) { 
-            return MakeHolder<NBlockCodecs::TDecodedInput>(s, codec); 
+        auto dec = [codec](auto s) {
+            return MakeHolder<NBlockCodecs::TDecodedInput>(s, codec);
         };
 
-        Add(TString("z-") + codecName, dec, enc); 
+        Add(TString("z-") + codecName, dec, enc);
     }
 }
 
-void TCompressionCodecFactory::Add(TStringBuf name, TDecoderConstructor d, TEncoderConstructor e) { 
-    Strings_.emplace_back(name); 
-    Codecs_[Strings_.back()] = TCodec{d, e}; 
-    BestCodecs_.emplace_back(Strings_.back()); 
+void TCompressionCodecFactory::Add(TStringBuf name, TDecoderConstructor d, TEncoderConstructor e) {
+    Strings_.emplace_back(name);
+    Codecs_[Strings_.back()] = TCodec{d, e};
+    BestCodecs_.emplace_back(Strings_.back());
 }

+ 31 - 31
library/cpp/http/io/compression.h

@@ -1,52 +1,52 @@
 #pragma once
 
-#include "stream.h" 
+#include "stream.h"
 
 #include <util/generic/deque.h>
-#include <util/generic/hash.h> 
+#include <util/generic/hash.h>
 
-class TCompressionCodecFactory { 
+class TCompressionCodecFactory {
 public:
-    using TDecoderConstructor = std::function<THolder<IInputStream>(IInputStream*)>; 
-    using TEncoderConstructor = std::function<THolder<IOutputStream>(IOutputStream*)>; 
+    using TDecoderConstructor = std::function<THolder<IInputStream>(IInputStream*)>;
+    using TEncoderConstructor = std::function<THolder<IOutputStream>(IOutputStream*)>;
 
-    TCompressionCodecFactory(); 
+    TCompressionCodecFactory();
 
-    static inline TCompressionCodecFactory& Instance() noexcept { 
-        return *SingletonWithPriority<TCompressionCodecFactory, 0>(); 
-    } 
+    static inline TCompressionCodecFactory& Instance() noexcept {
+        return *SingletonWithPriority<TCompressionCodecFactory, 0>();
+    }
 
-    inline const TDecoderConstructor* FindDecoder(TStringBuf name) const { 
-        if (auto codec = Codecs_.FindPtr(name)) { 
-            return &codec->Decoder; 
-        } 
+    inline const TDecoderConstructor* FindDecoder(TStringBuf name) const {
+        if (auto codec = Codecs_.FindPtr(name)) {
+            return &codec->Decoder;
+        }
 
-        return nullptr; 
-    } 
+        return nullptr;
+    }
 
-    inline const TEncoderConstructor* FindEncoder(TStringBuf name) const { 
-        if (auto codec = Codecs_.FindPtr(name)) { 
-            return &codec->Encoder; 
-        } 
+    inline const TEncoderConstructor* FindEncoder(TStringBuf name) const {
+        if (auto codec = Codecs_.FindPtr(name)) {
+            return &codec->Encoder;
+        }
 
-        return nullptr; 
-    } 
+        return nullptr;
+    }
 
-    inline TArrayRef<const TStringBuf> GetBestCodecs() const { 
-        return BestCodecs_; 
-    } 
+    inline TArrayRef<const TStringBuf> GetBestCodecs() const {
+        return BestCodecs_;
+    }
 
 private:
-    void Add(TStringBuf name, TDecoderConstructor d, TEncoderConstructor e); 
+    void Add(TStringBuf name, TDecoderConstructor d, TEncoderConstructor e);
 
-    struct TCodec { 
-        TDecoderConstructor Decoder; 
-        TEncoderConstructor Encoder; 
-    }; 
+    struct TCodec {
+        TDecoderConstructor Decoder;
+        TEncoderConstructor Encoder;
+    };
 
     TDeque<TString> Strings_;
-    THashMap<TStringBuf, TCodec> Codecs_; 
-    TVector<TStringBuf> BestCodecs_; 
+    THashMap<TStringBuf, TCodec> Codecs_;
+    TVector<TStringBuf> BestCodecs_;
 };
 
 namespace NHttp {

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