Просмотр исходного кода

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

svshevtsov 3 лет назад
Родитель
Сommit
de89752358

+ 1 - 1
build/rules/contrib_restricted.policy

@@ -142,7 +142,7 @@ ALLOW orgvisits/library/soc -> contrib/restricted/boost
 ALLOW quasar/backend -> contrib/restricted/boost
 ALLOW regulargeo/research -> contrib/restricted/boost
 ALLOW rem/python/geobase30 -> contrib/restricted/boost
-ALLOW drive/contrib/cpp/telemetry -> contrib/restricted/boost 
+ALLOW drive/contrib/cpp/telemetry -> contrib/restricted/boost
 ALLOW smart_devices -> contrib/restricted/boost
 ALLOW statbox/libstatbox -> contrib/restricted/boost
 ALLOW taxi/uservices -> contrib/restricted/boost

+ 6 - 6
library/cpp/http/misc/httpcodes.h

@@ -84,11 +84,11 @@ inline TStringBuf HttpCodeStr(int code) noexcept {
 inline bool IsHttpCode(int code) noexcept {
     return HttpCodeStrEx(code).data() != HttpCodeStrEx(0).data();
 }
- 
+
 inline bool IsUserError(int code) noexcept {
-    return code >= 400 && code < 500; 
-} 
- 
+    return code >= 400 && code < 500;
+}
+
 inline bool IsServerError(int code) noexcept {
-    return code >= 500; 
-} 
+    return code >= 500;
+}

+ 2 - 2
library/cpp/http/misc/ya.make

@@ -5,8 +5,8 @@ OWNER(
     mvel
 )
 
-GENERATE_ENUM_SERIALIZATION(httpcodes.h) 
- 
+GENERATE_ENUM_SERIALIZATION(httpcodes.h)
+
 SRCS(
     httpcodes.cpp
     httpdate.cpp

+ 4 - 4
library/cpp/http/server/http.cpp

@@ -212,7 +212,7 @@ public:
 
     void Wait() {
         Cb_->OnWait();
-        TGuard<TMutex> g(StopMutex); 
+        TGuard<TMutex> g(StopMutex);
         if (ListenThread) {
             ListenThread->Join();
             ListenThread.Reset(nullptr);
@@ -222,7 +222,7 @@ public:
     void Stop() {
         Shutdown();
 
-        TGuard<TMutex> g(StopMutex); 
+        TGuard<TMutex> g(StopMutex);
         if (ListenThread) {
             ListenThread->Join();
             ListenThread.Reset(nullptr);
@@ -457,7 +457,7 @@ public:
     ICallBack* Cb_ = nullptr;
     THttpServer* Parent_ = nullptr;
     TWakeupPollAble WakeupPollAble;
-    TMutex StopMutex; 
+    TMutex StopMutex;
 
 private:
     template <class TThreadPool_>
@@ -629,7 +629,7 @@ bool TClientRequest::Reply(void* /*ThreadSpecificResource*/) {
     return true;
 }
 
-bool TClientRequest::IsLocal() const { 
+bool TClientRequest::IsLocal() const {
     return HasLocalAddress(Socket());
 }
 

+ 1 - 1
library/cpp/http/server/http.h

@@ -122,7 +122,7 @@ public:
     NAddr::IRemoteAddrRef GetListenerSockAddrRef() const noexcept;
     TInstant AcceptMoment() const noexcept;
 
-    bool IsLocal() const; 
+    bool IsLocal() const;
     bool CheckLoopback();
     void ProcessFailRequest(int failstate);
 

+ 1 - 1
library/cpp/http/server/options.cpp

@@ -38,6 +38,6 @@ void THttpServerOptions::BindAddresses(TBindAddresses& ret) const {
     }
 
     if (ret.empty()) {
-        ret.push_back(Host ? TNetworkAddress(Host, Port) : TNetworkAddress(Port)); 
+        ret.push_back(Host ? TNetworkAddress(Host, Port) : TNetworkAddress(Port));
     }
 }

+ 2 - 2
library/cpp/http/server/options.h

@@ -68,14 +68,14 @@ public:
         return *this;
     }
 
-    /// Default interface name to bind the server. Used when none of BindAddress are provided. 
+    /// Default interface name to bind the server. Used when none of BindAddress are provided.
     inline THttpServerOptions& SetHost(const TString& host) noexcept {
         Host = host;
 
         return *this;
     }
 
-    /// Default port to bind the server. Used when none of BindAddress are provided. 
+    /// Default port to bind the server. Used when none of BindAddress are provided.
     inline THttpServerOptions& SetPort(ui16 port) noexcept {
         Port = port;
 

+ 9 - 9
library/cpp/json/json_writer.cpp

@@ -9,9 +9,9 @@ namespace NJson {
     TJsonWriter::TJsonWriter(IOutputStream* out, bool formatOutput, bool sortkeys, bool validateUtf8)
         : Out(out)
         , Buf(NJsonWriter::HEM_UNSAFE)
-        , DoubleNDigits(TJsonWriterConfig::DefaultDoubleNDigits) 
-        , FloatNDigits(TJsonWriterConfig::DefaultFloatNDigits) 
-        , FloatToStringMode(TJsonWriterConfig::DefaultFloatToStringMode) 
+        , DoubleNDigits(TJsonWriterConfig::DefaultDoubleNDigits)
+        , FloatNDigits(TJsonWriterConfig::DefaultFloatNDigits)
+        , FloatToStringMode(TJsonWriterConfig::DefaultFloatToStringMode)
         , SortKeys(sortkeys)
         , ValidateUtf8(validateUtf8)
         , DontEscapeStrings(false)
@@ -23,9 +23,9 @@ namespace NJson {
     TJsonWriter::TJsonWriter(IOutputStream* out, const TJsonWriterConfig& config, bool DFID)
         : Out(config.Unbuffered ? nullptr : out)
         , Buf(NJsonWriter::HEM_UNSAFE, config.Unbuffered ? out : nullptr)
-        , DoubleNDigits(config.DoubleNDigits) 
-        , FloatNDigits(config.FloatNDigits) 
-        , FloatToStringMode(config.FloatToStringMode) 
+        , DoubleNDigits(config.DoubleNDigits)
+        , FloatNDigits(config.FloatNDigits)
+        , FloatToStringMode(config.FloatToStringMode)
         , SortKeys(config.SortKeys)
         , ValidateUtf8(config.ValidateUtf8)
         , DontEscapeStrings(config.DontEscapeStrings)
@@ -87,11 +87,11 @@ namespace NJson {
     }
 
     void TJsonWriter::Write(float value) {
-        Buf.WriteFloat(value, FloatToStringMode, FloatNDigits); 
+        Buf.WriteFloat(value, FloatToStringMode, FloatNDigits);
     }
 
     void TJsonWriter::Write(double value) {
-        Buf.WriteDouble(value, FloatToStringMode, DoubleNDigits); 
+        Buf.WriteDouble(value, FloatToStringMode, DoubleNDigits);
     }
 
     void TJsonWriter::Write(long long value) {
@@ -115,7 +115,7 @@ namespace NJson {
     }
 
     void TJsonWriter::Write(const TJsonValue* v) {
-        Buf.WriteJsonValue(v, SortKeys, FloatToStringMode, DoubleNDigits); 
+        Buf.WriteJsonValue(v, SortKeys, FloatToStringMode, DoubleNDigits);
     }
 
     void TJsonWriter::Write(const TJsonValue& v) {

+ 10 - 10
library/cpp/json/json_writer.h

@@ -13,10 +13,10 @@
 
 namespace NJson {
     struct TJsonWriterConfig {
-        constexpr static ui32 DefaultDoubleNDigits = 10; 
-        constexpr static ui32 DefaultFloatNDigits = 6; 
-        constexpr static EFloatToStringMode DefaultFloatToStringMode = PREC_NDIGITS; 
- 
+        constexpr static ui32 DefaultDoubleNDigits = 10;
+        constexpr static ui32 DefaultFloatNDigits = 6;
+        constexpr static EFloatToStringMode DefaultFloatToStringMode = PREC_NDIGITS;
+
         inline TJsonWriterConfig& SetUnbuffered(bool v) noexcept {
             Unbuffered = v;
 
@@ -35,9 +35,9 @@ namespace NJson {
             return *this;
         }
 
-        ui32 DoubleNDigits = DefaultDoubleNDigits; 
-        ui32 FloatNDigits = DefaultFloatNDigits; 
-        EFloatToStringMode FloatToStringMode = DefaultFloatToStringMode; 
+        ui32 DoubleNDigits = DefaultDoubleNDigits;
+        ui32 FloatNDigits = DefaultFloatNDigits;
+        EFloatToStringMode FloatToStringMode = DefaultFloatToStringMode;
         bool FormatOutput = false;
         bool SortKeys = false;
         bool ValidateUtf8 = true;
@@ -49,9 +49,9 @@ namespace NJson {
     class TJsonWriter {
         IOutputStream* Out;
         NJsonWriter::TBuf Buf;
-        const ui32 DoubleNDigits; 
-        const ui32 FloatNDigits; 
-        const EFloatToStringMode FloatToStringMode; 
+        const ui32 DoubleNDigits;
+        const ui32 FloatNDigits;
+        const EFloatToStringMode FloatToStringMode;
         const bool SortKeys;
         const bool ValidateUtf8;
         const bool DontEscapeStrings;

+ 37 - 37
library/cpp/json/ut/json_writer_ut.cpp

@@ -187,42 +187,42 @@ Y_UNIT_TEST_SUITE(TJsonWriterTest) {
         UNIT_ASSERT_VALUES_EQUAL(WrapJsonToCallback(json, ""), "\"A\"");
         UNIT_ASSERT_VALUES_EQUAL(WrapJsonToCallback(json, "Foo"), "Foo(\"A\")");
     }
- 
+
     Y_UNIT_TEST(FloatPrecision) {
-        const double value = 1517933989.4242; 
-        const NJson::TJsonValue json(value); 
-        NJson::TJsonWriterConfig config; 
-        { 
-            TString expected = "1517933989"; 
-            TString actual = NJson::WriteJson(json); 
-            UNIT_ASSERT_VALUES_EQUAL(actual, expected); 
-        } 
-        { 
-            TString expected = "1517933989"; 
- 
-            TStringStream ss; 
-            NJson::WriteJson(&ss, &json, config); 
-            TString actual = ss.Str(); 
-            UNIT_ASSERT_VALUES_EQUAL(actual, expected); 
-        } 
-        { 
-            config.DoubleNDigits = 13; 
-            TString expected = "1517933989.424"; 
- 
-            TStringStream ss; 
-            NJson::WriteJson(&ss, &json, config); 
-            TString actual = ss.Str(); 
-            UNIT_ASSERT_VALUES_EQUAL(actual, expected); 
-        } 
-        { 
-            config.DoubleNDigits = 6; 
-            config.FloatToStringMode = PREC_POINT_DIGITS; 
-            TString expected = "1517933989.424200"; 
- 
-            TStringStream ss; 
-            NJson::WriteJson(&ss, &json, config); 
-            TString actual = ss.Str(); 
-            UNIT_ASSERT_VALUES_EQUAL(actual, expected); 
-        } 
-    } 
+        const double value = 1517933989.4242;
+        const NJson::TJsonValue json(value);
+        NJson::TJsonWriterConfig config;
+        {
+            TString expected = "1517933989";
+            TString actual = NJson::WriteJson(json);
+            UNIT_ASSERT_VALUES_EQUAL(actual, expected);
+        }
+        {
+            TString expected = "1517933989";
+
+            TStringStream ss;
+            NJson::WriteJson(&ss, &json, config);
+            TString actual = ss.Str();
+            UNIT_ASSERT_VALUES_EQUAL(actual, expected);
+        }
+        {
+            config.DoubleNDigits = 13;
+            TString expected = "1517933989.424";
+
+            TStringStream ss;
+            NJson::WriteJson(&ss, &json, config);
+            TString actual = ss.Str();
+            UNIT_ASSERT_VALUES_EQUAL(actual, expected);
+        }
+        {
+            config.DoubleNDigits = 6;
+            config.FloatToStringMode = PREC_POINT_DIGITS;
+            TString expected = "1517933989.424200";
+
+            TStringStream ss;
+            NJson::WriteJson(&ss, &json, config);
+            TString actual = ss.Str();
+            UNIT_ASSERT_VALUES_EQUAL(actual, expected);
+        }
+    }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов