Browse Source

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

albert 3 years ago
parent
commit
9f25ef3232

+ 46 - 46
build/scripts/touch.py

@@ -1,50 +1,50 @@
-#!/usr/bin/env python
-
-import optparse
-import os
-import sys
-import time
-
-
-def main(argv):
+#!/usr/bin/env python 
+ 
+import optparse 
+import os 
+import sys 
+import time 
+ 
+
+def main(argv): 
     parser = optparse.OptionParser(add_help_option=False)
-    parser.disable_interspersed_args()
-
+    parser.disable_interspersed_args() 
+ 
     parser.add_option('-?', '--help', dest='help',
                       action='store_true', default=None, help='print help')
     parser.add_option('-t', dest='t', action='store', default=None)
-
-    opts, argv_rest = parser.parse_args(argv)
-    if getattr(opts, 'help', False):
-        parser.print_help()
-        return 0
-
-    tspec = opts.t
-    if tspec is None:
-        times = None
-    else:
-        head, sep, tail = tspec.partition('.')
-        if 8 > len(head):
-            raise Exception("time spec must follow format [[CC]YY]MMDDhhmm[.SS]: " + tspec + '; ' + head)
-        tfmt = ''
-        if 12 == len(head):
-            tfmt += '%Y'
-        elif 10 == len(head):
-            tfmt += '%y'
-        tfmt += '%m%d%H%M'
-        if 2 == len(tail):
-            tfmt += '.%S'
-        mtime = time.mktime(time.strptime(tspec, tfmt))
-        times = (mtime, mtime)
-
-    for file in argv_rest:
-        try:
-            os.utime(file, times)
-        except:
-            open(file, 'w').close()
-            if times is not None:
-                os.utime(file, times)
-
-
-if __name__ == '__main__':
-    sys.exit(main(sys.argv[1:]))
+ 
+    opts, argv_rest = parser.parse_args(argv) 
+    if getattr(opts, 'help', False): 
+        parser.print_help() 
+        return 0 
+ 
+    tspec = opts.t 
+    if tspec is None: 
+        times = None 
+    else: 
+        head, sep, tail = tspec.partition('.') 
+        if 8 > len(head): 
+            raise Exception("time spec must follow format [[CC]YY]MMDDhhmm[.SS]: " + tspec + '; ' + head) 
+        tfmt = '' 
+        if 12 == len(head): 
+            tfmt += '%Y' 
+        elif 10 == len(head): 
+            tfmt += '%y' 
+        tfmt += '%m%d%H%M' 
+        if 2 == len(tail): 
+            tfmt += '.%S' 
+        mtime = time.mktime(time.strptime(tspec, tfmt)) 
+        times = (mtime, mtime) 
+ 
+    for file in argv_rest: 
+        try: 
+            os.utime(file, times) 
+        except: 
+            open(file, 'w').close() 
+            if times is not None: 
+                os.utime(file, times) 
+ 
+ 
+if __name__ == '__main__': 
+    sys.exit(main(sys.argv[1:])) 

+ 98 - 98
contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp

@@ -110,8 +110,8 @@ namespace NPlugins {
                 printer->Print(Variables_,
                     "inline const $type$& Get$rname$() const { return $name$(); }\n"
                     "inline $type$* Mutable$rname$() { return mutable_$name$(); }\n");
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline const $type$& Get$RName$() const { return $name$(); }\n"
                         "inline $type$* Mutable$RName$() { return mutable_$name$(); }\n");
             }
@@ -218,9 +218,9 @@ namespace NPlugins {
                     "    Get$rname$() const { return $name$(); }\n"
                     "inline ::google::protobuf::RepeatedPtrField< $type$ >*\n"
                     "    Mutable$rname$() { return mutable_$name$(); }\n");
-
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+ 
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline const $type$& Get$RName$(size_t _index) const {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); return $name$(int(_index)); }\n"
                         "inline $type$* Mutable$RName$(size_t _index) {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); return mutable_$name$(int(_index)); }\n"
                         "inline $type$* Add$RName$() { return add_$name$(); }\n"
@@ -228,7 +228,7 @@ namespace NPlugins {
                         "    Get$RName$() const { return $name$(); }\n"
                         "inline ::google::protobuf::RepeatedPtrField< $type$ >*\n"
                         "    Mutable$RName$() { return mutable_$name$(); }\n"
-                    );
+                    ); 
             }
 
             void GenerateJSONPrinting(io::Printer* printer) override {
@@ -262,16 +262,16 @@ namespace NPlugins {
                     "inline void Set$rname$(const $pointer_type$* value, size_t size) { set_$name$(value, size); }\n"
                     "inline TProtoStringType* Mutable$rname$() { return mutable_$name$(); }\n");
 
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline const TProtoStringType& Get$RName$() const { return $name$(); }\n"
                         "inline void Set$RName$(const TProtoStringType& value) { set_$name$(value); }\n"
                         "inline void Set$RName$(TProtoStringType&& value) { set_$name$(std::move(value)); }\n"
                         "inline void Set$RName$(const char* value) { set_$name$(value); }\n"
                         "inline void Set$RName$(const $pointer_type$* value, size_t size) { set_$name$(value, size); }\n"
                         "inline TProtoStringType* Mutable$RName$() { return mutable_$name$(); }\n"
-                    );
-
+                    ); 
+ 
                 if (Field_->options().ctype() != FieldOptions::STRING) {
                     printer->Outdent();
                     printer->Print(" public:\n");
@@ -317,14 +317,14 @@ namespace NPlugins {
                     "inline void Add$rname$(const $pointer_type$* value, size_t size) { add_$name$(value, size); }\n"
                     "inline const TProtoStringType& get_idx_$name$(int _index) const { return $name$(_index); }\n"
                     "inline const ::google::protobuf::RepeatedPtrField<TProtoStringType>& get_arr_$name$() const"
-                    "{ return $name$(); }\n"
+                    "{ return $name$(); }\n" 
                     "inline const ::google::protobuf::RepeatedPtrField<TProtoStringType>& Get$rname$() const"
                     "{ return $name$(); }\n"
                     "inline ::google::protobuf::RepeatedPtrField<TProtoStringType>* Mutable$rname$()"
                     "{ return mutable_$name$(); }\n");
 
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline const TProtoStringType& Get$RName$(size_t _index) const {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); return $name$(_index); }\n"
                         "inline TProtoStringType* Mutable$RName$(size_t _index) {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); return mutable_$name$(_index); }\n"
                         "inline void Set$RName$(size_t _index, const TProtoStringType& value) {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); set_$name$(_index, value); }\n"
@@ -337,11 +337,11 @@ namespace NPlugins {
                         "inline void Add$RName$(const char* value) { add_$name$(value); }\n"
                         "inline void Add$RName$(const $pointer_type$* value, size_t size) { add_$name$(value, size); }\n"
                         "inline const ::google::protobuf::RepeatedPtrField<TProtoStringType>& Get$RName$() const"
-                        "{ return $name$(); }\n"
+                        "{ return $name$(); }\n" 
                         "inline ::google::protobuf::RepeatedPtrField<TProtoStringType>* Mutable$RName$()"
-                        "{ return mutable_$name$(); }\n"
-                    );
-
+                        "{ return mutable_$name$(); }\n" 
+                    ); 
+ 
                 if (Field_->options().ctype() != FieldOptions::STRING) {
                     printer->Outdent();
                     printer->Print(" public:\n");
@@ -371,11 +371,11 @@ namespace NPlugins {
                     "inline $type$ Get$rname$() const { return $name$(); }\n"
                     "inline void Set$rname$($type$ value) { set_$name$(value); }\n");
 
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline $type$ Get$RName$() const { return $name$(); } \n"
                         "inline void Set$RName$($type$ value) { set_$name$(value); }\n"
-                    );
+                    ); 
             }
 
             void GenerateJSONPrinting(io::Printer* printer) override {
@@ -401,14 +401,14 @@ namespace NPlugins {
                     "inline const ::google::protobuf::RepeatedField<int>& get_arr_$name$() const { return $name$(); }\n"
                     "inline const ::google::protobuf::RepeatedField<int>& Get$rname$() const { return $name$(); }\n"
                     "inline ::google::protobuf::RepeatedField<int>* Mutable$rname$() { return mutable_$name$(); }\n");
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline $type$ Get$RName$(size_t _index) const {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); return $name$(_index); }\n"
                         "inline void Set$RName$(size_t _index, $type$ value) {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); set_$name$(_index, value); }\n"
                         "inline void Add$RName$($type$ value) { add_$name$(value); }\n"
                         "inline const ::google::protobuf::RepeatedField<int>& Get$RName$() const { return $name$(); }\n"
                         "inline ::google::protobuf::RepeatedField<int>* Mutable$RName$() { return mutable_$name$(); }\n"
-                    );
+                    ); 
             }
 
             void GenerateJSONPrinting(io::Printer* printer) override {
@@ -429,11 +429,11 @@ namespace NPlugins {
                 printer->Print(Variables_,
                     "inline $type$ Get$rname$() const { return $name$();}\n"
                     "inline void Set$rname$($type$ value) { set_$name$(value); }\n");
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline $type$ Get$RName$() const { return $name$();}\n"
                         "inline void Set$RName$($type$ value) { set_$name$(value); }\n"
-                    );
+                    ); 
             }
 
             void GenerateJSONPrinting(io::Printer* printer) override {
@@ -462,8 +462,8 @@ namespace NPlugins {
                     "    Get$rname$() const { return $name$(); }\n"
                     "inline ::google::protobuf::RepeatedField< $type$ >*\n"
                     "    Mutable$rname$() { return mutable_$name$(); }\n");
-                if (Variables_.end() != Variables_.find("RName"))
-                    printer->Print(Variables_,
+                if (Variables_.end() != Variables_.find("RName")) 
+                    printer->Print(Variables_, 
                         "inline $type$ Get$RName$(size_t _index) const {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); return $name$(_index); }\n"
                         "inline void Set$RName$(size_t _index, $type$ value) {Y_ASSERT(_index < static_cast<size_t>(::Max<int>())); set_$name$(_index, value); }\n"
                         "inline void Add$RName$($type$ value) { add_$name$(value); }\n"
@@ -471,7 +471,7 @@ namespace NPlugins {
                         "    Get$RName$() const { return $name$(); }\n"
                         "inline ::google::protobuf::RepeatedField< $type$ >*\n"
                         "    Mutable$RName$() { return mutable_$name$(); }\n"
-                    );
+                    ); 
             }
 
             void GenerateJSONPrinting(io::Printer* printer) override {
@@ -527,63 +527,63 @@ namespace NPlugins {
             }
     };
 
-    // borrowed mostly from protobuf/compiler/cpp/cpp_extension.cc
-    class TExtensionGenerator {
-    public:
-        TExtensionGenerator(const FieldDescriptor* descriptor)
-            : Descriptor_(descriptor)
-        {
-            if (Descriptor_->is_repeated()) {
-                type_traits_ = "Repeated";
-            }
-
-            TProtoStringType clsName;
-            switch (Descriptor_->cpp_type()) {
-            case FieldDescriptor::CPPTYPE_ENUM:
-                type_traits_.append("EnumTypeTraits< ");
-                clsName = ClassName(Descriptor_->enum_type(), true);
-                type_traits_.append(clsName);
-                type_traits_.append(", ");
-                type_traits_.append(clsName);
-                type_traits_.append("_IsValid>");
-                break;
-            case FieldDescriptor::CPPTYPE_STRING:
-                type_traits_.append("StringTypeTraits");
-                break;
-            case FieldDescriptor::CPPTYPE_MESSAGE:
-                type_traits_.append("MessageTypeTraits< ");
-                type_traits_.append(ClassName(Descriptor_->message_type(), true));
-                type_traits_.append(" >");
-                break;
-            default:
-                type_traits_.append("PrimitiveTypeTraits< ");
-                type_traits_.append(PrimitiveTypeName(Descriptor_->cpp_type()));
-                type_traits_.append(" >");
-                break;
-            }
-        }
-
-        void GenerateDeclaration(io::Printer* printer) const
-        {
-            TVariables vars;
-            vars["extendee"     ] = ClassName(Descriptor_->containing_type(), true);
-            vars["type_traits"  ] = type_traits_;
-            vars["name"         ] = Descriptor_->name();
-            vars["field_type"   ] = SimpleItoa(static_cast<int>(Descriptor_->type()));
-            vars["packed"       ] = Descriptor_->options().packed() ? "true" : "false";
-
-            printer->Print(vars,
-              "typedef ::google::protobuf::internal::ExtensionIdentifier< $extendee$,\n"
-              "    ::google::protobuf::internal::$type_traits$, $field_type$, $packed$ >\n"
-              "  Td$name$;\n"
-              );
-        }
-
-    private:
-        const FieldDescriptor* Descriptor_;
-        TProtoStringType type_traits_;
-    };
-
+    // borrowed mostly from protobuf/compiler/cpp/cpp_extension.cc 
+    class TExtensionGenerator { 
+    public: 
+        TExtensionGenerator(const FieldDescriptor* descriptor) 
+            : Descriptor_(descriptor) 
+        { 
+            if (Descriptor_->is_repeated()) { 
+                type_traits_ = "Repeated"; 
+            } 
+ 
+            TProtoStringType clsName; 
+            switch (Descriptor_->cpp_type()) { 
+            case FieldDescriptor::CPPTYPE_ENUM: 
+                type_traits_.append("EnumTypeTraits< "); 
+                clsName = ClassName(Descriptor_->enum_type(), true); 
+                type_traits_.append(clsName); 
+                type_traits_.append(", "); 
+                type_traits_.append(clsName); 
+                type_traits_.append("_IsValid>"); 
+                break; 
+            case FieldDescriptor::CPPTYPE_STRING: 
+                type_traits_.append("StringTypeTraits"); 
+                break; 
+            case FieldDescriptor::CPPTYPE_MESSAGE: 
+                type_traits_.append("MessageTypeTraits< "); 
+                type_traits_.append(ClassName(Descriptor_->message_type(), true)); 
+                type_traits_.append(" >"); 
+                break; 
+            default: 
+                type_traits_.append("PrimitiveTypeTraits< "); 
+                type_traits_.append(PrimitiveTypeName(Descriptor_->cpp_type())); 
+                type_traits_.append(" >"); 
+                break; 
+            } 
+        } 
+ 
+        void GenerateDeclaration(io::Printer* printer) const 
+        { 
+            TVariables vars; 
+            vars["extendee"     ] = ClassName(Descriptor_->containing_type(), true); 
+            vars["type_traits"  ] = type_traits_; 
+            vars["name"         ] = Descriptor_->name(); 
+            vars["field_type"   ] = SimpleItoa(static_cast<int>(Descriptor_->type())); 
+            vars["packed"       ] = Descriptor_->options().packed() ? "true" : "false"; 
+ 
+            printer->Print(vars, 
+              "typedef ::google::protobuf::internal::ExtensionIdentifier< $extendee$,\n" 
+              "    ::google::protobuf::internal::$type_traits$, $field_type$, $packed$ >\n" 
+              "  Td$name$;\n" 
+              ); 
+        } 
+ 
+    private: 
+        const FieldDescriptor* Descriptor_; 
+        TProtoStringType type_traits_; 
+    }; 
+ 
     class TOneofGenerator {
     public:
         TOneofGenerator(const OneofDescriptor* Descriptor_)
@@ -670,11 +670,11 @@ namespace NPlugins {
                 for (int i = 0; i < descriptor->field_count(); i++) {
                     FieldGenerators_.emplace_back(MakeGenerator(descriptor->field(i)));
                 }
-
+ 
                 ExtensionGenerators_.reserve(descriptor->extension_count());
-                for (int i = 0; i < descriptor->extension_count(); i++) {
+                for (int i = 0; i < descriptor->extension_count(); i++) { 
                     ExtensionGenerators_.emplace_back(descriptor->extension(i));
-                }
+                } 
 
                 OneofGenerators_.reserve(descriptor->real_oneof_decl_count());
                 for (int i = 0; i < descriptor->real_oneof_decl_count(); i++) {
@@ -737,31 +737,31 @@ namespace NPlugins {
                     OutputDirectory_->OpenForInsert(fileName, scope));
                 io::Printer printer(output.get(), '$');
 
-                printer.Print("// Yandex cpp-styleguide extension\n");
+                printer.Print("// Yandex cpp-styleguide extension\n"); 
                 for (int i = 0; i < Descriptor_->field_count(); i++) {
                     const FieldDescriptor* field = Descriptor_->field(i);
 
                     TVariables vars;
                     SetCommonFieldVariables(field, &vars);
 
-                    const bool hasRName = (vars.end() != vars.find("RName"));
+                    const bool hasRName = (vars.end() != vars.find("RName")); 
                     if (field->is_repeated()) {
                         printer.Print(vars,
                             "inline size_t $rname$Size() const { return (size_t)$name$_size(); }\n");
-                        if (hasRName)
-                            printer.Print(vars,
+                        if (hasRName) 
+                            printer.Print(vars, 
                                 "inline size_t $RName$Size() const { return (size_t)$name$_size(); }\n");
                     } else if (field->has_presence()) {
                         printer.Print(vars,
                             "inline bool Has$rname$() const { return has_$name$(); }\n");
-                        if (hasRName)
-                            printer.Print(vars,
+                        if (hasRName) 
+                            printer.Print(vars, 
                                 "inline bool Has$RName$() const { return has_$name$(); }\n");
                     }
 
                     printer.Print(vars, "inline void Clear$rname$() { clear_$name$(); }\n");
-                    if (hasRName)
-                        printer.Print(vars,
+                    if (hasRName) 
+                        printer.Print(vars, 
                             "inline void Clear$RName$() { clear_$name$(); }\n");
 
                     // Generate type-specific accessor declarations.
@@ -771,7 +771,7 @@ namespace NPlugins {
                 }
                 for (auto& extensionGenerator: ExtensionGenerators_) {
                     extensionGenerator.GenerateDeclaration(&printer);
-                }
+                } 
                 for (auto& oneofGenerator: OneofGenerators_) {
                     oneofGenerator.GenerateDeclarations(&printer);
                 }

+ 5 - 5
library/cpp/binsaver/bin_saver.h

@@ -602,7 +602,7 @@ struct TRegisterSaveLoadType {
 #define REGISTER_SAVELOAD_NM_CLASS(N, nmspace, className) \
     BASIC_REGISTER_CLASS(nmspace::className)              \
     static TRegisterSaveLoadType<nmspace::className> init_##nmspace##_##name##N(N);
-
+ 
 #define REGISTER_SAVELOAD_NM2_CLASS(N, nmspace1, nmspace2, className) \
     BASIC_REGISTER_CLASS(nmspace1::nmspace2::className)              \
     static TRegisterSaveLoadType<nmspace1::nmspace2::className> init_##nmspace1##_##nmspace2##_##name##N(N);
@@ -611,12 +611,12 @@ struct TRegisterSaveLoadType {
     typedef nmspace::className<T> temp_init##nmspace##className##T##temp; \
     BASIC_REGISTER_CLASS(nmspace::className<T>)                           \
     static TRegisterSaveLoadType<nmspace::className<T>> temp_init##nmspace##_##name##T##N(N);
-
-#define REGISTER_SAVELOAD_CLASS_NAME(N, cls, name) \
+ 
+#define REGISTER_SAVELOAD_CLASS_NAME(N, cls, name) \ 
     BASIC_REGISTER_CLASS(cls)                      \
     static TRegisterSaveLoadType<cls> init##name##N(N);
-
-#define REGISTER_SAVELOAD_CLASS_NS_PREF(N, cls, ns, pref) \
+ 
+#define REGISTER_SAVELOAD_CLASS_NS_PREF(N, cls, ns, pref) \ 
     REGISTER_SAVELOAD_CLASS_NAME(N, ns ::cls, _##pref##_##cls)
 
 #define SAVELOAD(...)             \

+ 38 - 38
library/cpp/bit_io/bitinout_ut.cpp

@@ -82,42 +82,42 @@ private:
     template <typename TBo>
     void DoWrite1(TBo& out, const TString& rem) {
         out.Write(0x0C, 3);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 1u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 1u, (rem + ", " + ToString(__LINE__))); 
         out.Write(0x18, 4);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 1u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 1u, (rem + ", " + ToString(__LINE__))); 
         out.Write(0x0C, 3);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 2u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 2u, (rem + ", " + ToString(__LINE__))); 
         out.Write(0x30000, 17);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 4u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 4u, (rem + ", " + ToString(__LINE__))); 
         out.Write(0x0C, 3);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 4u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 4u, (rem + ", " + ToString(__LINE__))); 
     }
 
     template <typename TBo>
     void DoWrite2(TBo& out, const TString& rem) {
         out.Write(0x0C, 3);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 8u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 8u, (rem + ", " + ToString(__LINE__))); 
 
         out.Write(0x42, 7);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 9u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 9u, (rem + ", " + ToString(__LINE__))); 
 
         DoWrite(out, 1637415112);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 13u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 13u, (rem + ", " + ToString(__LINE__))); 
 
         DoWrite(out, 897998715);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 17u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 17u, (rem + ", " + ToString(__LINE__))); 
 
         DoWrite(out, 201416527);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 21u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 21u, (rem + ", " + ToString(__LINE__))); 
 
         DoWrite(out, 432344219);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 25u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 25u, (rem + ", " + ToString(__LINE__))); 
 
         out.Write(0xAAAAAAAAAAAAAAAAULL, 64);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 33u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 33u, (rem + ", " + ToString(__LINE__))); 
 
         out.Write(0x5555555555555555ULL, 64);
-        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 41u, (rem + ", " + ToString(__LINE__)));
+        UNIT_ASSERT_VALUES_EQUAL_C(out.GetOffset(), 41u, (rem + ", " + ToString(__LINE__))); 
     }
 
     void DoBitOutput(NBitIO::TBitOutputYVector& out, const TString& rem) {
@@ -145,36 +145,36 @@ private:
             ui64 val;
 
             val = 0;
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 0u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 0u, (rem + ": " + NBitIO::PrintBits(val))); 
 
             UNIT_ASSERT_C(in.Read(val, 3), (rem + ": " + NBitIO::PrintBits(val)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 1u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 1u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
             val = 0;
             UNIT_ASSERT_C(in.Read(val, 4), (rem + ": " + NBitIO::PrintBits(val)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x8u, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 1u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x8u, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 1u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
             val = 0;
             UNIT_ASSERT_C(in.Read(val, 3), (rem + ": " + NBitIO::PrintBits(val)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 2u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 2u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
             val = 0;
             UNIT_ASSERT_C(in.Read(val, 17), (rem + ": " + NBitIO::PrintBits(val)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x10000u, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x10000u, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val))); 
 
             {
                 ui32 rt = 0;
@@ -184,56 +184,56 @@ private:
             val = 0;
             UNIT_ASSERT_C(in.Read(val, 3), (rem + ": " + NBitIO::PrintBits(val)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
             val = 0;
             UNIT_ASSERT_C(in.ReadWords<8>(val), (rem + ": " + NBitIO::PrintBits(val)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0xabcdefU, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 8u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0xabcdefU, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 8u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
             val = 0;
             UNIT_ASSERT_C(in.Read(val, 3), (rem + ", " + ToString(__LINE__)).data());
 
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 8u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x4u, (rem + ": " + NBitIO::PrintBits(val))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 8u, (rem + ": " + NBitIO::PrintBits(val))); 
             UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
 
             val = 0;
             in.Read(val, 7);
-            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x42u, (rem + ": " + NBitIO::PrintBits(val)));
+            UNIT_ASSERT_VALUES_EQUAL_C(val, 0x42u, (rem + ": " + NBitIO::PrintBits(val))); 
         }
 
         {
             ui32 v = 0;
 
             DoRead(in, v);
-            UNIT_ASSERT_VALUES_EQUAL_C(v, 1637415112ul, (rem + ": " + NBitIO::PrintBits(v)));
+            UNIT_ASSERT_VALUES_EQUAL_C(v, 1637415112ul, (rem + ": " + NBitIO::PrintBits(v))); 
             DoRead(in, v);
             UNIT_ASSERT_VALUES_EQUAL_C(v, 897998715u, (rem + ": " + NBitIO::PrintBits(v)));
             DoRead(in, v);
-            UNIT_ASSERT_VALUES_EQUAL_C(v, 201416527u, (rem + ": " + NBitIO::PrintBits(v)));
+            UNIT_ASSERT_VALUES_EQUAL_C(v, 201416527u, (rem + ": " + NBitIO::PrintBits(v))); 
             DoRead(in, v);
-            UNIT_ASSERT_VALUES_EQUAL_C(v, 432344219u, (rem + ": " + NBitIO::PrintBits(v)));
+            UNIT_ASSERT_VALUES_EQUAL_C(v, 432344219u, (rem + ": " + NBitIO::PrintBits(v))); 
 
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 25u, (rem + ": " + NBitIO::PrintBits(v)));
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 25u, (rem + ": " + NBitIO::PrintBits(v))); 
         }
 
         {
             ui64 v8 = 0;
             in.ReadSafe(v8, 64);
 
-            UNIT_ASSERT_VALUES_EQUAL_C(v8, 0xAAAAAAAAAAAAAAAAULL, (rem + ": " + NBitIO::PrintBits(v8)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 33u, (rem + ": " + NBitIO::PrintBits(v8)));
+            UNIT_ASSERT_VALUES_EQUAL_C(v8, 0xAAAAAAAAAAAAAAAAULL, (rem + ": " + NBitIO::PrintBits(v8))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 33u, (rem + ": " + NBitIO::PrintBits(v8))); 
 
             v8 = 0;
             in.ReadK<64>(v8);
 
-            UNIT_ASSERT_VALUES_EQUAL_C(v8, 0x5555555555555555ULL, (rem + ": " + NBitIO::PrintBits(v8)));
-            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 41u, (rem + ": " + NBitIO::PrintBits(v8)));
+            UNIT_ASSERT_VALUES_EQUAL_C(v8, 0x5555555555555555ULL, (rem + ": " + NBitIO::PrintBits(v8))); 
+            UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 41u, (rem + ": " + NBitIO::PrintBits(v8))); 
         }
 
         ui32 v = 0;

+ 27 - 27
library/cpp/cgiparam/cgiparam.cpp

@@ -21,13 +21,13 @@ bool TCgiParameters::Erase(const TStringBuf name, size_t pos) {
     const auto pair = equal_range(name);
 
     for (auto it = pair.first; it != pair.second; ++it, --pos) {
-        if (0 == pos) {
-            erase(it);
-            return true;
-        }
+        if (0 == pos) { 
+            erase(it); 
+            return true; 
+        } 
     }
 
-    return false;
+    return false; 
 }
 
 bool TCgiParameters::Erase(const TStringBuf name, const TStringBuf val) {
@@ -47,21 +47,21 @@ bool TCgiParameters::Erase(const TStringBuf name, const TStringBuf val) {
 }
 
 size_t TCgiParameters::EraseAll(const TStringBuf name) {
-    size_t num = 0;
+    size_t num = 0; 
 
     const auto pair = equal_range(name);
 
     for (auto it = pair.first; it != pair.second; erase(it++), ++num)
-        ;
-
-    return num;
-}
+        ; 
 
+    return num; 
+} 
+ 
 void TCgiParameters::JoinUnescaped(const TStringBuf key, char sep, TStringBuf val) {
     const auto pair = equal_range(key);
     auto it = pair.first;
 
-    if (it == pair.second) { // not found
+    if (it == pair.second) { // not found 
         if (val.IsInited()) {
             emplace_hint(it, TString(key), TString(val));
         }
@@ -69,17 +69,17 @@ void TCgiParameters::JoinUnescaped(const TStringBuf key, char sep, TStringBuf va
         TString& dst = it->second;
 
         for (++it; it != pair.second; erase(it++)) {
-            dst += sep;
+            dst += sep; 
             dst.AppendNoAlias(it->second.data(), it->second.size());
-        }
-
-        if (val.IsInited()) {
-            dst += sep;
-            dst += val;
-        }
-    }
-}
-
+        } 
+
+        if (val.IsInited()) { 
+            dst += sep; 
+            dst += val; 
+        } 
+    } 
+} 
+ 
 static inline TString DoUnescape(const TStringBuf s) {
     TString res;
 
@@ -155,18 +155,18 @@ char* TCgiParameters::Print(char* res) const {
     }
 
     for (auto i = begin();;) {
-        res = CGIEscape(res, i->first);
+        res = CGIEscape(res, i->first); 
         *res++ = '=';
-        res = CGIEscape(res, i->second);
+        res = CGIEscape(res, i->second); 
 
         if (++i == end()) {
-            break;
+            break; 
         }
 
         *res++ = '&';
     }
 
-    return res;
+    return res; 
 }
 
 size_t TCgiParameters::PrintSize() const noexcept {
@@ -209,11 +209,11 @@ TCgiParameters::const_iterator TCgiParameters::Find(const TStringBuf name, size_
 
     for (auto it = pair.first; it != pair.second; ++it, --pos) {
         if (0 == pos) {
-            return it;
+            return it; 
         }
     }
 
-    return end();
+    return end(); 
 }
 
 bool TCgiParameters::Has(const TStringBuf name, const TStringBuf value) const noexcept {

+ 20 - 20
library/cpp/cgiparam/cgiparam.h

@@ -4,7 +4,7 @@
 
 #include <util/generic/iterator_range.h>
 #include <util/generic/map.h>
-#include <util/generic/strbuf.h>
+#include <util/generic/strbuf.h> 
 #include <util/generic/string.h>
 
 #include <initializer_list>
@@ -17,28 +17,28 @@ struct TStringLess {
 };
 
 class TCgiParameters: public TMultiMap<TString, TString> {
-public:
+public: 
     TCgiParameters() = default;
 
     explicit TCgiParameters(const TStringBuf cgiParamStr) {
         Scan(cgiParamStr);
-    }
+    } 
 
     TCgiParameters(std::initializer_list<std::pair<TString, TString>> il);
 
-    void Flush() {
-        erase(begin(), end());
-    }
+    void Flush() { 
+        erase(begin(), end()); 
+    } 
 
     size_t EraseAll(const TStringBuf name);
 
     size_t NumOfValues(const TStringBuf name) const noexcept {
-        return count(name);
-    }
+        return count(name); 
+    } 
 
     TString operator()() const {
-        return Print();
-    }
+        return Print(); 
+    } 
 
     void Scan(const TStringBuf cgiParStr, bool form = true);
     void ScanAdd(const TStringBuf cgiParStr);
@@ -52,7 +52,7 @@ public:
      * @note Names and values in the returned string are CGI-escaped.
      */
     TString Print() const;
-    char* Print(char* res) const;
+    char* Print(char* res) const; 
 
     Y_PURE_FUNCTION
     size_t PrintSize() const noexcept;
@@ -65,7 +65,7 @@ public:
     Y_PURE_FUNCTION
     auto Range(const TStringBuf name) const noexcept {
         return IterateValues(MakeIteratorRange(equal_range(name)));
-    }
+    } 
 
     Y_PURE_FUNCTION
     const_iterator Find(const TStringBuf name, size_t numOfValue = 0) const noexcept;
@@ -95,7 +95,7 @@ public:
         // is not implicitly constructible from given type.
         // But libc++ pair allows this with C++14.
         emplace(std::forward<TName>(name), std::forward<TValue>(value));
-    }
+    } 
 #else
     template <typename TName, typename TValue>
     inline void InsertUnescaped(TName&& name, TValue&& value) {
@@ -106,7 +106,7 @@ public:
     // replace all values for a given key with new values
     template <typename TIter>
     void ReplaceUnescaped(const TStringBuf key, TIter valuesBegin, const TIter valuesEnd);
-
+ 
     void ReplaceUnescaped(const TStringBuf key, std::initializer_list<TStringBuf> values) {
         ReplaceUnescaped(key, values.begin(), values.end());
     }
@@ -116,21 +116,21 @@ public:
     }
 
     // join multiple values into a single one using a separator
-    // if val is a [possibly empty] non-NULL string, append it as well
+    // if val is a [possibly empty] non-NULL string, append it as well 
     void JoinUnescaped(const TStringBuf key, char sep, TStringBuf val = TStringBuf());
-
+ 
     bool Erase(const TStringBuf name, size_t numOfValue = 0);
     bool Erase(const TStringBuf name, const TStringBuf val);
 
     inline const char* FormField(const TStringBuf name, size_t numOfValue = 0) const {
-        const_iterator it = Find(name, numOfValue);
+        const_iterator it = Find(name, numOfValue); 
 
-        if (it == end()) {
+        if (it == end()) { 
             return nullptr;
         }
-
+ 
         return it->second.data();
-    }
+    } 
 };
 
 template <typename TIter>

+ 11 - 11
library/cpp/cgiparam/cgiparam_ut.cpp

@@ -60,7 +60,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
         TCgiParameters c;
         c.ScanAddAll("qw");
 
-        UNIT_ASSERT_VALUES_EQUAL(c.size(), 1u);
+        UNIT_ASSERT_VALUES_EQUAL(c.size(), 1u); 
         UNIT_ASSERT(c.Get("qw").empty());
     }
 
@@ -68,7 +68,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
         TCgiParameters c;
         c.ScanAddAll("qw&");
 
-        UNIT_ASSERT_VALUES_EQUAL(c.size(), 1u);
+        UNIT_ASSERT_VALUES_EQUAL(c.size(), 1u); 
         UNIT_ASSERT(c.Get("qw").empty());
     }
 
@@ -76,7 +76,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
         TCgiParameters c;
         c.ScanAddAll("qw=1&x");
 
-        UNIT_ASSERT_VALUES_EQUAL(c.size(), 2u);
+        UNIT_ASSERT_VALUES_EQUAL(c.size(), 2u); 
         UNIT_ASSERT_VALUES_EQUAL(c.Get("qw"), "1");
         UNIT_ASSERT(c.Get("x").empty());
     }
@@ -182,7 +182,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
         TCgiParameters c;
         c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3");
 
-        UNIT_ASSERT_VALUES_EQUAL(c.NumOfValues("par"), 3u);
+        UNIT_ASSERT_VALUES_EQUAL(c.NumOfValues("par"), 3u); 
     }
 
     Y_UNIT_TEST(TestUnscape) {
@@ -193,16 +193,16 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
     Y_UNIT_TEST(TestEmpty) {
         UNIT_ASSERT(TCgiParameters().Print().empty());
     }
-
+ 
     Y_UNIT_TEST(TestJoinUnescaped) {
-        TCgiParameters c;
-
+        TCgiParameters c; 
+ 
         c.Scan("foo=1&foo=2");
         c.JoinUnescaped("foo", ';', "0");
-
-        UNIT_ASSERT_VALUES_EQUAL(c.Print(), "foo=1;2;0");
-    }
-
+ 
+        UNIT_ASSERT_VALUES_EQUAL(c.Print(), "foo=1;2;0"); 
+    } 
+ 
     Y_UNIT_TEST(TestContInit) {
         TCgiParameters c = {std::make_pair("a", "a1"), std::make_pair("b", "b1"), std::make_pair("a", "a2")};
 

+ 11 - 11
library/cpp/charset/codepage_ut.cpp

@@ -69,7 +69,7 @@ public:
     }
 
     void TestBrokenRune() {
-        UNIT_ASSERT_VALUES_EQUAL(BROKEN_RUNE, 0xFFFDu);
+        UNIT_ASSERT_VALUES_EQUAL(BROKEN_RUNE, 0xFFFDu); 
     }
 };
 
@@ -198,17 +198,17 @@ void TCodepageTest::TestUTFFromUnknownPlane() {
     UNIT_ASSERT(res == RECODE_OK);
     UNIT_ASSERT(samplelen == readchars);
 
-    size_t writtenbytes2 = 0;
-    char bytebuffer2[BUFFER_SIZE];
-    for (size_t i = 0; i != samplelen; ++i) {
-        size_t nwr = 0;
+    size_t writtenbytes2 = 0; 
+    char bytebuffer2[BUFFER_SIZE]; 
+    for (size_t i = 0; i != samplelen; ++i) { 
+        size_t nwr = 0; 
         const int res = RecodeFromUnicode(CODES_UTF8, sampletext[i], bytebuffer2 + writtenbytes2, BUFFER_SIZE - writtenbytes2, nwr);
-        UNIT_ASSERT_VALUES_EQUAL(res, int(RECODE_OK));
-        writtenbytes2 += nwr;
-        UNIT_ASSERT(BUFFER_SIZE > writtenbytes2);
-    }
-    UNIT_ASSERT_VALUES_EQUAL(TStringBuf(bytebuffer, writtenbytes), TStringBuf(bytebuffer2, writtenbytes2));
-
+        UNIT_ASSERT_VALUES_EQUAL(res, int(RECODE_OK)); 
+        writtenbytes2 += nwr; 
+        UNIT_ASSERT(BUFFER_SIZE > writtenbytes2); 
+    } 
+    UNIT_ASSERT_VALUES_EQUAL(TStringBuf(bytebuffer, writtenbytes), TStringBuf(bytebuffer2, writtenbytes2)); 
+ 
     wchar32 charbuffer[BUFFER_SIZE];
     size_t readbytes = 0;
     size_t writtenchars = 0;

+ 18 - 18
library/cpp/charset/recyr.hh

@@ -30,8 +30,8 @@ inline RECODE_RESULT RecodeFromUnicode(ECharset to, const TCharType* in, char* o
 
 inline RECODE_RESULT RecodeFromUnicode(ECharset to, wchar32 rune, char* out, size_t outSize, size_t& outWritten) {
     return NCodepagePrivate::_recodeFromUnicode(to, rune, out, outSize, outWritten);
-}
-
+} 
+ 
 template <class TCharType>
 inline RECODE_RESULT RecodeToUnicode(ECharset from, const char* in, TCharType* out, size_t inSize, size_t outSize) {
     size_t inRead = 0;
@@ -101,36 +101,36 @@ inline RECODE_RESULT Recode(ECharset from, ECharset to, const char* in, char* ou
     return Recode(from, to, in, out, inSize, outSize, inRead, outWritten);
 }
 
-/**
- * Recode from one charset to another; throw an exception if conversion failed
+/** 
+ * Recode from one charset to another; throw an exception if conversion failed 
  * @param[in] from the source character set
  * @param[in] to the target character set
- * @param[in] in    the input string buffer
- * @param[out] out  the output string object if conversion was successful
- * @return false if conversion was not attempted (charsets were the same),
- *         true if successful
- */
+ * @param[in] in    the input string buffer 
+ * @param[out] out  the output string object if conversion was successful 
+ * @return false if conversion was not attempted (charsets were the same), 
+ *         true if successful 
+ */ 
 inline bool Recode(ECharset from, ECharset to, const TStringBuf& in, TString& out) {
     if (to == from)
-        return false;
-
+        return false; 
+ 
     const size_t inSize = in.length();
     const size_t outSize = SingleByteCodepage(to) ? inSize : 3 * inSize;
-    out.clear(); // so we don't copy stuff around when resizing
+    out.clear(); // so we don't copy stuff around when resizing 
     out.ReserveAndResize(outSize);
-
+ 
     size_t inRead = 0;
     size_t outWritten = 0;
     const RECODE_RESULT res = Recode(from, to, in.data(), out.begin(), inSize, outSize, inRead, outWritten);
     Y_ENSURE(RECODE_OK == res, "Recode failed. ");
     if (outWritten > outSize)
-        ythrow yexception() << "Recode overrun the buffer: size="
+        ythrow yexception() << "Recode overrun the buffer: size=" 
                             << outSize << " need=" << outWritten;
-
+ 
     out.remove(outWritten);
-    return true;
-}
-
+    return true; 
+} 
+ 
 ///////////////////////////////////////////////////////////////////////////////////////
 //     TString -> TString                                                              //
 ///////////////////////////////////////////////////////////////////////////////////////

+ 6 - 6
library/cpp/charset/recyr_int.hh

@@ -172,7 +172,7 @@ namespace NCodepagePrivate {
     inline RECODE_RESULT _recodeUnicodeToUTF8(wchar32 rune, char* out, size_t out_size, size_t& nwritten) {
         return SafeWriteUTF8Char(rune, nwritten, (unsigned char*)out, out_size);
     }
-
+ 
     template <class TCharType, int Size = sizeof(TCharType)>
     struct TCharTypeSwitch;
 
@@ -223,7 +223,7 @@ namespace NCodepagePrivate {
         nwritten = 1;
         return RECODE_OK;
     }
-
+ 
     inline RECODE_RESULT _rune2hex(wchar32 in, char* out, size_t out_size, size_t& out_writed) {
         static const char hex_digs[] = "0123456789ABCDEF";
         out_writed = 0;
@@ -301,17 +301,17 @@ namespace NCodepagePrivate {
             return NCodepagePrivate::_recodeUnicodeToUTF8(in, out, in_size, out_size, in_readed, out_writed);
 
         return NCodepagePrivate::_recodeUnicodeToSB(To, in, out, in_size, out_size, in_readed, out_writed);
-    }
-
+    } 
+ 
     inline RECODE_RESULT _recodeFromUnicode(ECharset To, wchar32 rune, char* out, size_t out_size, size_t& nwritten) {
         if (!ValidCodepage(To))
             return RECODE_ERROR;
-
+ 
         if (!NCodepagePrivate::NativeCodepage(To)) {
             size_t nread = 0;
             return NICONVPrivate::RecodeFromUnicodeNoThrow(To, &rune, out, 1, out_size, nread, nwritten);
         }
-
+ 
         if (To == CODES_UTF8)
             return NCodepagePrivate::_recodeUnicodeToUTF8(rune, out, out_size, nwritten);
 

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