diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /tools | |
parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
download | ydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/archiver/alignment_test/alignment_ut.cpp | 16 | ||||
-rw-r--r-- | tools/archiver/main.cpp | 20 | ||||
-rw-r--r-- | tools/enum_parser/enum_parser/main.cpp | 4 | ||||
-rw-r--r-- | tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp | 2 | ||||
-rw-r--r-- | tools/fix_elf/patch.cpp | 2 | ||||
-rw-r--r-- | tools/rescompressor/main.cpp | 8 | ||||
-rw-r--r-- | tools/rorescompiler/main.cpp | 4 |
7 files changed, 28 insertions, 28 deletions
diff --git a/tools/archiver/alignment_test/alignment_ut.cpp b/tools/archiver/alignment_test/alignment_ut.cpp index a40e2e28c5..88b07e19b0 100644 --- a/tools/archiver/alignment_test/alignment_ut.cpp +++ b/tools/archiver/alignment_test/alignment_ut.cpp @@ -20,10 +20,10 @@ Y_UNIT_TEST_SUITE(AlignmentTest) { ); auto dataFile1 = dataArchive.BlobByKey("/data_file.txt"); auto dataFile2 = dataArchive.BlobByKey("/data_file2.txt"); - UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile1.AsCharPtr(), dataFile1.Size()), "some text\n"); - UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile2.AsCharPtr(), dataFile2.Size()), "second file content\n"); - UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile1.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); - UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile2.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); + UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile1.AsCharPtr(), dataFile1.Size()), "some text\n"); + UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile2.AsCharPtr(), dataFile2.Size()), "second file content\n"); + UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile1.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); + UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile2.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); } Y_UNIT_TEST(ArchiveAsmCheck) { @@ -33,9 +33,9 @@ Y_UNIT_TEST_SUITE(AlignmentTest) { ); auto dataFile1 = dataArchive.BlobByKey("/data_file.txt"); auto dataFile2 = dataArchive.BlobByKey("/data_file2.txt"); - UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile1.AsCharPtr(), dataFile1.Size()), "some text\n"); - UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile2.AsCharPtr(), dataFile2.Size()), "second file content\n"); - UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile1.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); - UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile2.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); + UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile1.AsCharPtr(), dataFile1.Size()), "some text\n"); + UNIT_ASSERT_NO_DIFF(TStringBuf(dataFile2.AsCharPtr(), dataFile2.Size()), "second file content\n"); + UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile1.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); + UNIT_ASSERT_VALUES_EQUAL(size_t(dataFile2.AsCharPtr()) % ArchiveWriterDefaultDataAlignment, 0); } } diff --git a/tools/archiver/main.cpp b/tools/archiver/main.cpp index 3648d6647f..6cda54c1ea 100644 --- a/tools/archiver/main.cpp +++ b/tools/archiver/main.cpp @@ -34,7 +34,7 @@ namespace { void DoWrite(const void* data, size_t len) override { for (const char* p = (const char*)data; len > 0; ++p, --len) { Buf.append(*p); - if (Buf.size() == Stride) + if (Buf.size() == Stride) WriteBuf(); } } @@ -319,7 +319,7 @@ static inline TString GetFile(const TString& s) { } static inline TString Fix(TString f) { - if (!f.empty() && IsDelim(f[f.size() - 1])) { + if (!f.empty() && IsDelim(f[f.size() - 1])) { f.pop_back(); } @@ -374,7 +374,7 @@ namespace { if (IsDir(Path)) { DoRecurse(w, "/"); } else { - Append(w, Path, Key.size() ? Key : Prefix + "/" + GetFile(Path)); + Append(w, Path, Key.size() ? Key : Prefix + "/" + GetFile(Path)); } } @@ -605,15 +605,15 @@ int main(int argc, char** argv) { const auto& files = optsRes.GetFreeArgs(); TVector<TStringBuf> keys; - if (forceKeys.size()) - StringSplitter(forceKeys).Split(':').SkipEmpty().Collect(&keys); + if (forceKeys.size()) + StringSplitter(forceKeys).Split(':').SkipEmpty().Collect(&keys); - if (keys.size() && keys.size() != files.size()) { + if (keys.size() && keys.size() != files.size()) { Cerr << "Invalid number of keys=" << keys.size() << " (!= number of files=" << files.size() << ")" << Endl; return 1; } - for (size_t i = 0; i < files.size(); ++i) { + for (size_t i = 0; i < files.size(); ++i) { const auto& path = files[i]; size_t off = 0; #ifdef _win_ @@ -625,7 +625,7 @@ int main(int argc, char** argv) { cur.Path = path.substr(0, pos); if (pos != TString::npos) cur.Prefix = path.substr(pos + 1); - if (keys.size()) + if (keys.size()) cur.Key = keys[i]; cur.Recursive = recursive; cur.Fix(); @@ -665,7 +665,7 @@ int main(int argc, char** argv) { out = hexout.Get(); } - outf->Write(prepend.data(), prepend.size()); + outf->Write(prepend.data(), prepend.size()); if (cat) { for (const auto& rec: recs) { @@ -691,7 +691,7 @@ int main(int argc, char** argv) { } catch (...) { } - outf->Write(append.data(), append.size()); + outf->Write(append.data(), append.size()); } } catch (...) { Cerr << CurrentExceptionMessage() << Endl; diff --git a/tools/enum_parser/enum_parser/main.cpp b/tools/enum_parser/enum_parser/main.cpp index f851579ffb..0943c69c1d 100644 --- a/tools/enum_parser/enum_parser/main.cpp +++ b/tools/enum_parser/enum_parser/main.cpp @@ -104,7 +104,7 @@ void OutItem(IOutputStream& out, const T& value, bool escape = true) { static inline void FinishItems(TStringStream& out) { TString& s = out.Str(); if (s.EndsWith(",\n")) { - s.remove(s.size() - 2, 2); + s.remove(s.size() - 2, 2); } if (s.EndsWith(",")) { s.pop_back(); @@ -141,7 +141,7 @@ void GenerateEnum( TStringStream jEnum; OpenMap(jEnum); - size_t count = en.Items.size(); + size_t count = en.Items.size(); OutKey(jEnum, "count", count); const TString name = TEnumParser::ScopeStr(en.Scope) + en.CppName; OutKey(jEnum, "full_name", name); diff --git a/tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp b/tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp index 30cd077c84..73d38b396a 100644 --- a/tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp +++ b/tools/enum_parser/enum_serialization_runtime/enum_runtime.cpp @@ -76,7 +76,7 @@ namespace NEnumSerializationRuntime { AllValues.reserve(Names.size()); for (const auto& it : Names) { - if (!AllNames.empty()) { + if (!AllNames.empty()) { AllNames += ", "; } AllNames += TString::Join('\'', it.second, '\''); diff --git a/tools/fix_elf/patch.cpp b/tools/fix_elf/patch.cpp index e31567ae90..d49ebab307 100644 --- a/tools/fix_elf/patch.cpp +++ b/tools/fix_elf/patch.cpp @@ -61,7 +61,7 @@ void ReadNum(TStringBuf& src, TStringBuf& dst) { } int NumericStrCmp(TStringBuf s1, TStringBuf s2) { - while (!s1.empty() || !s2.empty()) { + while (!s1.empty() || !s2.empty()) { char c1 = *s1.data(); char c2 = *s2.data(); diff --git a/tools/rescompressor/main.cpp b/tools/rescompressor/main.cpp index 1dfad1fe28..9aba1002c5 100644 --- a/tools/rescompressor/main.cpp +++ b/tools/rescompressor/main.cpp @@ -51,17 +51,17 @@ private: void WriteIncBin(TStringBuf constname, TStringBuf filename, const TString& data) { AsmOut << AsmPrefix << constname << ":\nincbin \"" << Basename(filename) << "\"\n"; AsmOut << ".end:\n"; - TFixedBufferFileOutput out(filename.data()); + TFixedBufferFileOutput out(filename.data()); out << data; } void WriteRaw(TStringBuf constname, const TString& data) { AsmOut << AsmPrefix << constname << ":\ndb "; - for (size_t i = 0; i < data.size() - 1; i++) { + for (size_t i = 0; i < data.size() - 1; i++) { unsigned char c = static_cast<unsigned char>(data[i]); AsmOut << IntToString<10, unsigned char>(c) << ","; } - AsmOut << IntToString<10, unsigned char>(static_cast<unsigned char>(data[data.size() - 1])) << "\n"; + AsmOut << IntToString<10, unsigned char>(static_cast<unsigned char>(data[data.size() - 1])) << "\n"; AsmOut << ".end:\n"; } @@ -131,7 +131,7 @@ int main(int argc, char** argv) { else { TUnbufferedFileInput inp(argv[ind]); TString data = inp.ReadAll(); - compressed = Compress(TStringBuf(data.data(), data.size())); + compressed = Compress(TStringBuf(data.data(), data.size())); raw = false; } ind++; diff --git a/tools/rorescompiler/main.cpp b/tools/rorescompiler/main.cpp index 2cff76725b..7ca5346e4c 100644 --- a/tools/rorescompiler/main.cpp +++ b/tools/rorescompiler/main.cpp @@ -5,7 +5,7 @@ #include <util/stream/file.h> #include <util/string/escape.h> #include <util/string/vector.h> -#include <util/string/split.h> +#include <util/string/split.h> using namespace NResource; @@ -32,7 +32,7 @@ int main(int argc, char** argv) { out << "#include <library/cpp/resource/registry.h>\n\n"; while (*argv) { - TVector<TString> items = StringSplitter(TString(*(argv))).Split('=').Limit(2).ToList<TString>(); + TVector<TString> items = StringSplitter(TString(*(argv))).Split('=').Limit(2).ToList<TString>(); GenOne(items[0], items[1], out); argv++; } |