diff options
| author | jimmy <[email protected]> | 2022-02-10 16:49:38 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:38 +0300 | 
| commit | 5ab412f19b9312abbfa362391df45d6603bb84c3 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp | |
| parent | affdafdb1fc09bf0bfc384355143ee6db9e90046 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp')
| -rw-r--r-- | library/cpp/balloc/balloc.cpp | 24 | ||||
| -rw-r--r-- | library/cpp/http/server/http.cpp | 16 | ||||
| -rw-r--r-- | library/cpp/http/server/http_ut.cpp | 8 | ||||
| -rw-r--r-- | library/cpp/json/ut/json_writer_ut.cpp | 24 | ||||
| -rw-r--r-- | library/cpp/json/writer/json.cpp | 4 | ||||
| -rw-r--r-- | library/cpp/json/writer/json.h | 2 | ||||
| -rw-r--r-- | library/cpp/json/writer/json_ut.cpp | 4 | ||||
| -rw-r--r-- | library/cpp/logger/log.cpp | 8 | ||||
| -rw-r--r-- | library/cpp/messagebus/config/netaddr.cpp | 14 | ||||
| -rw-r--r-- | library/cpp/messagebus/config/netaddr.h | 4 | ||||
| -rw-r--r-- | library/cpp/messagebus/locator.cpp | 2 | ||||
| -rw-r--r-- | library/cpp/messagebus/message.cpp | 4 | ||||
| -rw-r--r-- | library/cpp/messagebus/oldmodule/startsession.cpp | 2 | 
13 files changed, 58 insertions, 58 deletions
| diff --git a/library/cpp/balloc/balloc.cpp b/library/cpp/balloc/balloc.cpp index 2109ac4e358..fab489db4c5 100644 --- a/library/cpp/balloc/balloc.cpp +++ b/library/cpp/balloc/balloc.cpp @@ -6,7 +6,7 @@ namespace NBalloc {      static constexpr size_t ALIVE_SIGNATURE = 0xaULL << 56;      static constexpr size_t DISABLED_SIGNATURE = 0xbULL << 56;      static constexpr size_t SIGNATURE_MASK = 0xfULL << 56; -  +      static constexpr size_t MINIMAL_ALIGNMENT = sizeof(NBalloc::TAllocHeader);      static_assert(((MINIMAL_ALIGNMENT - 1) & MINIMAL_ALIGNMENT) == 0,          "invalid BALLOC_MINIMAL_ALIGNMENT"); @@ -63,7 +63,7 @@ namespace NBalloc {          }          NMalloc::AbortFromCorruptedAllocator();          Y_UNREACHABLE(); -    }  +    }      static void Y_FORCE_INLINE Disable() {  #if defined(_musl_) @@ -224,7 +224,7 @@ extern "C" void cfree(void* ptr) {  #if defined(Y_COVER_PTR)      free(ptr);  #else -    NBalloc::Free(ptr);  +    NBalloc::Free(ptr);  #endif  } @@ -238,7 +238,7 @@ extern "C" void* realloc(void* oldPtr, size_t newSize) {          return result;      }      if (newSize == 0) { -        NBalloc::Free(oldPtr);  +        NBalloc::Free(oldPtr);          return nullptr;      }      void* newPtr = NBalloc::Malloc(newSize); @@ -249,14 +249,14 @@ extern "C" void* realloc(void* oldPtr, size_t newSize) {      const size_t oldSize = header->AllocSize & ~NBalloc::SIGNATURE_MASK;      const size_t signature = header->AllocSize & NBalloc::SIGNATURE_MASK;      if (Y_LIKELY((signature == NBalloc::ALIVE_SIGNATURE) || (signature == NBalloc::DISABLED_SIGNATURE))) { -        memcpy(newPtr, oldPtr, oldSize < newSize ? oldSize : newSize);  -        NBalloc::Free(oldPtr);  -        return newPtr;  -    }  +        memcpy(newPtr, oldPtr, oldSize < newSize ? oldSize : newSize); +        NBalloc::Free(oldPtr); +        return newPtr; +    }      NMalloc::AbortFromCorruptedAllocator();      return nullptr;  } -  +  #if defined(Y_COVER_PTR)  extern "C" void* realloc(void* oldPtr, size_t newSize) {      if (!oldPtr) { @@ -282,9 +282,9 @@ extern "C" bool BallocDisabled() {      return NBalloc::IsDisabled();  } -extern "C" void DisableBalloc() {  -    NBalloc::Disable();  -}  +extern "C" void DisableBalloc() { +    NBalloc::Disable(); +}  extern "C" void EnableBalloc() {      NBalloc::Enable(); diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index 13e3832f533..128583bdd70 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -197,8 +197,8 @@ public:          ListenStartEvent.Reset();          try { -            ListenThread.Reset(new TThread(ListenSocketFunction, this));  -            ListenThread->Start();  +            ListenThread.Reset(new TThread(ListenSocketFunction, this)); +            ListenThread->Start();          } catch (const yexception&) {              SaveErrorCode();              return false; @@ -214,9 +214,9 @@ public:          Cb_->OnWait();          TGuard<TMutex> g(StopMutex);          if (ListenThread) { -            ListenThread->Join();  +            ListenThread->Join();              ListenThread.Reset(nullptr); -        }  +        }      }      void Stop() { @@ -224,9 +224,9 @@ public:          TGuard<TMutex> g(StopMutex);          if (ListenThread) { -            ListenThread->Join();  +            ListenThread->Join();              ListenThread.Reset(nullptr); -        }  +        }          while (ConnectionCount) {              usleep(10000); @@ -398,7 +398,7 @@ public:      }      TImpl(THttpServer* parent, ICallBack* cb, TMtpQueueRef mainWorkers, TMtpQueueRef failWorkers, const TOptions& options_) -        : Requests(mainWorkers)  +        : Requests(mainWorkers)          , FailRequests(failWorkers)          , Options_(options_)          , Cb_(cb) @@ -442,7 +442,7 @@ public:          return Options_.MaxConnections && ((size_t)GetClientCount() >= Options_.MaxConnections);      } -    THolder<TThread> ListenThread;  +    THolder<TThread> ListenThread;      TPipeHandle ListenWakeupReadFd;      TPipeHandle ListenWakeupWriteFd;      TSystemEvent ListenStartEvent; diff --git a/library/cpp/http/server/http_ut.cpp b/library/cpp/http/server/http_ut.cpp index a96f4ab68bf..cc62bb988e7 100644 --- a/library/cpp/http/server/http_ut.cpp +++ b/library/cpp/http/server/http_ut.cpp @@ -329,7 +329,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {          TEchoServer serverImpl(res);          THttpServer server(&serverImpl, THttpServer::TOptions(port).EnableKeepAlive(true).EnableCompression(true)); -        for (int i = 0; i < 2; ++i) {  +        for (int i = 0; i < 2; ++i) {              UNIT_ASSERT(server.Start());              TTestRequest r(port); @@ -362,9 +362,9 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {                          }                      }                  } -            }  -  -            server.Stop();  +            } + +            server.Stop();          }      } diff --git a/library/cpp/json/ut/json_writer_ut.cpp b/library/cpp/json/ut/json_writer_ut.cpp index 2c838d243f7..ca11d34dad9 100644 --- a/library/cpp/json/ut/json_writer_ut.cpp +++ b/library/cpp/json/ut/json_writer_ut.cpp @@ -57,18 +57,18 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) {      Y_UNIT_TEST(FormatOutput) {          TString expected = "{\n  \"key1\":null,\n  \"key2\":\n    {\n      \"subkey1\":\n        [\n          1,\n          {\n            \"subsubkey\":\"test2\"\n          },\n          null,\n          true\n        ],\n      \"subkey2\":\"test\"\n    }\n}"; -        TJsonValue v;  -        v["key1"] = JSON_NULL;  -        v["key2"]["subkey1"].AppendValue(1);  -        v["key2"]["subkey1"].AppendValue(JSON_MAP)["subsubkey"] = "test2";  -        v["key2"]["subkey1"].AppendValue(JSON_NULL);  -        v["key2"]["subkey1"].AppendValue(true);  -        v["key2"]["subkey2"] = "test";  -        TStringStream out;  -        WriteJson(&out, &v, true);  -        UNIT_ASSERT_STRINGS_EQUAL(out.Str(), expected);  -    }  -  +        TJsonValue v; +        v["key1"] = JSON_NULL; +        v["key2"]["subkey1"].AppendValue(1); +        v["key2"]["subkey1"].AppendValue(JSON_MAP)["subsubkey"] = "test2"; +        v["key2"]["subkey1"].AppendValue(JSON_NULL); +        v["key2"]["subkey1"].AppendValue(true); +        v["key2"]["subkey2"] = "test"; +        TStringStream out; +        WriteJson(&out, &v, true); +        UNIT_ASSERT_STRINGS_EQUAL(out.Str(), expected); +    } +      Y_UNIT_TEST(SortKeys) {          TString expected = "{\"a\":null,\"j\":null,\"n\":null,\"y\":null,\"z\":null}";          TJsonValue v; diff --git a/library/cpp/json/writer/json.cpp b/library/cpp/json/writer/json.cpp index 268722fe668..02370c2d79e 100644 --- a/library/cpp/json/writer/json.cpp +++ b/library/cpp/json/writer/json.cpp @@ -136,12 +136,12 @@ namespace NJsonWriter {          NeedComma = false;          NeedNewline = false;      } -  +      inline void TBuf::EndValue() {          if (StackTop() == JE_PAIR) {              StackPop();          } -    }  +    }      TValueContext TBuf::BeginList() {          NeedNewline = true; diff --git a/library/cpp/json/writer/json.h b/library/cpp/json/writer/json.h index e6693feb685..0aae2531b94 100644 --- a/library/cpp/json/writer/json.h +++ b/library/cpp/json/writer/json.h @@ -152,7 +152,7 @@ namespace NJsonWriter {          TVector<EJsonEntity> Stack;          bool NeedComma; -        bool NeedNewline;  +        bool NeedNewline;          const EHtmlEscapeMode EscapeMode;          int IndentSpaces;          bool WriteNanAsString; diff --git a/library/cpp/json/writer/json_ut.cpp b/library/cpp/json/writer/json_ut.cpp index 0c706e93056..9980555683f 100644 --- a/library/cpp/json/writer/json_ut.cpp +++ b/library/cpp/json/writer/json_ut.cpp @@ -118,8 +118,8 @@ Y_UNIT_TEST_SUITE(JsonWriter) {                            "  1,\n"                            "  \"hello\",\n"                            "  {\n" -                          "    \"abc\":3,\n"  -                          "    \"def\":4\n"  +                          "    \"abc\":3,\n" +                          "    \"def\":4\n"                            "  }\n"                            "]";          UNIT_ASSERT_STRINGS_EQUAL(exp, w.Str()); diff --git a/library/cpp/logger/log.cpp b/library/cpp/logger/log.cpp index 65fb603c5ec..e1d70cc3d28 100644 --- a/library/cpp/logger/log.cpp +++ b/library/cpp/logger/log.cpp @@ -72,7 +72,7 @@ public:          }          TPriorityLogStream ls(priority, this); -  +          Printf(ls, format, args);      } @@ -219,9 +219,9 @@ void TLog::ResetBackend(THolder<TLogBackend> backend) noexcept {  }  bool TLog::IsNullLog() const noexcept { -    return Impl_->IsNullLog();  -}  -  +    return Impl_->IsNullLog(); +} +  THolder<TLogBackend> TLog::ReleaseBackend() noexcept {      return Impl_->ReleaseBackend();  } diff --git a/library/cpp/messagebus/config/netaddr.cpp b/library/cpp/messagebus/config/netaddr.cpp index 239c178473a..962ac538e27 100644 --- a/library/cpp/messagebus/config/netaddr.cpp +++ b/library/cpp/messagebus/config/netaddr.cpp @@ -94,7 +94,7 @@ namespace NBus {                      } else if (!addr) {                          addr.Reset(new TNetworkAddressRef(na, &*it));                      } -                }  +                }              }              return addr;          } @@ -112,7 +112,7 @@ namespace NBus {              TNetworkAddress na(TString(hostPort, portStr), port);              return MakeAddress(na, requireVersion, preferVersion);          } -    }  +    }      TNetAddr::TNetAddr(const char* hostPort, EIpVersion requireVersion /*= EIP_VERSION_ANY*/, EIpVersion preferVersion /*= EIP_VERSION_ANY*/)          : Ptr(MakeAddress(hostPort, requireVersion, preferVersion)) @@ -120,15 +120,15 @@ namespace NBus {          if (!Ptr) {              ythrow TNetAddr::TError() << "cannot resolve " << hostPort << " into " << Describe(requireVersion);          } -    }  +    }      TNetAddr::TNetAddr(TStringBuf host, int port, EIpVersion requireVersion /*= EIP_VERSION_ANY*/, EIpVersion preferVersion /*= EIP_VERSION_ANY*/)          : Ptr(MakeAddress(host, port, requireVersion, preferVersion))      {          if (!Ptr) {              ythrow TNetAddr::TError() << "cannot resolve " << host << ":" << port << " into " << Describe(requireVersion); -        }  -    }  +        } +    }      TNetAddr::TNetAddr(const TNetworkAddress& na, EIpVersion requireVersion /*= EIP_VERSION_ANY*/, EIpVersion preferVersion /*= EIP_VERSION_ANY*/)          : Ptr(MakeAddress(na, requireVersion, preferVersion)) @@ -141,11 +141,11 @@ namespace NBus {      TNetAddr::TNetAddr(const TNetworkAddress& na, const TAddrInfo& ai)          : Ptr(new TNetworkAddressRef(na, ai))      { -    }  +    }      const sockaddr* TNetAddr::Addr() const {          return Ptr->Addr(); -    }  +    }      socklen_t TNetAddr::Len() const {          return Ptr->Len(); diff --git a/library/cpp/messagebus/config/netaddr.h b/library/cpp/messagebus/config/netaddr.h index 395e3bcae60..b79c0cc3551 100644 --- a/library/cpp/messagebus/config/netaddr.h +++ b/library/cpp/messagebus/config/netaddr.h @@ -25,8 +25,8 @@ namespace NBus {              return false;          }          return true; -    }  -  +    } +      const char* ToCString(EIpVersion);      int ToAddrFamily(EIpVersion); diff --git a/library/cpp/messagebus/locator.cpp b/library/cpp/messagebus/locator.cpp index 1b2fc635de6..e38a35c426f 100644 --- a/library/cpp/messagebus/locator.cpp +++ b/library/cpp/messagebus/locator.cpp @@ -395,7 +395,7 @@ namespace NBus {      }      int TBusLocator::Register(TBusService service, TBusKey start, TBusKey end, const TNetAddr& addr) { -        TGuard<TMutex> G(Lock);  +        TGuard<TMutex> G(Lock);          TServiceId serviceId = GetServiceId(service);          TItems::const_iterator it; diff --git a/library/cpp/messagebus/message.cpp b/library/cpp/messagebus/message.cpp index ae83c82e0f0..bfa7ed8e9ba 100644 --- a/library/cpp/messagebus/message.cpp +++ b/library/cpp/messagebus/message.cpp @@ -171,8 +171,8 @@ namespace NBus {          } else {              GetHeader()->FlagsInternal &= ~(MESSAGE_COMPRESS_RESPONSE);          } -    }  -  +    } +      TString TBusIdentity::ToString() const {          TStringStream ss;          ss << "msg-id=" << MessageId diff --git a/library/cpp/messagebus/oldmodule/startsession.cpp b/library/cpp/messagebus/oldmodule/startsession.cpp index e65df59e622..7c38801d626 100644 --- a/library/cpp/messagebus/oldmodule/startsession.cpp +++ b/library/cpp/messagebus/oldmodule/startsession.cpp @@ -48,7 +48,7 @@ namespace NBus {      }      void TBusStarter::Starter() { -        TGuard<TMutex> g(ExitLock);  +        TGuard<TMutex> g(ExitLock);          while (!Exiting) {              TAutoPtr<TBusMessage> empty(new TBusMessage(0)); | 
