diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /util/stream | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r-- | util/stream/buffer.cpp | 2 | ||||
-rw-r--r-- | util/stream/buffer_ut.cpp | 6 | ||||
-rw-r--r-- | util/stream/buffered_ut.cpp | 2 | ||||
-rw-r--r-- | util/stream/format.h | 2 | ||||
-rw-r--r-- | util/stream/hex_ut.cpp | 6 | ||||
-rw-r--r-- | util/stream/input_ut.cpp | 2 | ||||
-rw-r--r-- | util/stream/ios_ut.cpp | 20 | ||||
-rw-r--r-- | util/stream/length_ut.cpp | 2 | ||||
-rw-r--r-- | util/stream/mem.cpp | 4 | ||||
-rw-r--r-- | util/stream/output.cpp | 2 | ||||
-rw-r--r-- | util/stream/output.h | 6 | ||||
-rw-r--r-- | util/stream/pipe.cpp | 2 | ||||
-rw-r--r-- | util/stream/printf_ut.cpp | 2 | ||||
-rw-r--r-- | util/stream/str.h | 4 | ||||
-rw-r--r-- | util/stream/tokenizer_ut.cpp | 2 | ||||
-rw-r--r-- | util/stream/zlib.cpp | 4 |
16 files changed, 34 insertions, 34 deletions
diff --git a/util/stream/buffer.cpp b/util/stream/buffer.cpp index 2facece4ea..d42b193a5f 100644 --- a/util/stream/buffer.cpp +++ b/util/stream/buffer.cpp @@ -109,7 +109,7 @@ void TBufferInput::Rewind() noexcept { size_t TBufferInput::DoNext(const void** ptr, size_t len) { len = Min(Buf_.Size() - Readed_, len); - *ptr = Buf_.data() + Readed_; + *ptr = Buf_.data() + Readed_; Readed_ += len; return len; } diff --git a/util/stream/buffer_ut.cpp b/util/stream/buffer_ut.cpp index 3494696190..28fe961809 100644 --- a/util/stream/buffer_ut.cpp +++ b/util/stream/buffer_ut.cpp @@ -67,12 +67,12 @@ Y_UNIT_TEST_SUITE(TBufferTest) { << "4444" << "55555"; - UNIT_ASSERT(0 == memcmp(buffer.data(), "1" + UNIT_ASSERT(0 == memcmp(buffer.data(), "1" "22" "333" "4444" "55555", - buffer.size())); + buffer.size())); } Y_UNIT_TEST(WriteChars) { @@ -80,6 +80,6 @@ Y_UNIT_TEST_SUITE(TBufferTest) { TBufferOutput output(buffer); output << '1' << '2' << '3' << '4' << '5' << '6' << '7' << '8' << '9' << '0'; - UNIT_ASSERT(0 == memcmp(buffer.data(), "1234567890", buffer.size())); + UNIT_ASSERT(0 == memcmp(buffer.data(), "1234567890", buffer.size())); } } diff --git a/util/stream/buffered_ut.cpp b/util/stream/buffered_ut.cpp index 41d2fc3030..ebcd31ae3f 100644 --- a/util/stream/buffered_ut.cpp +++ b/util/stream/buffered_ut.cpp @@ -18,7 +18,7 @@ Y_UNIT_TEST_SUITE(TestBufferedIO) { s.append('A' + (r.GenRand() % 10)); } - out.Write(s.data(), s.size()); + out.Write(s.data(), s.size()); } } diff --git a/util/stream/format.h b/util/stream/format.h index b033208a1b..c88ea3a1e0 100644 --- a/util/stream/format.h +++ b/util/stream/format.h @@ -144,7 +144,7 @@ namespace NFormatPrivate { template <typename Char, size_t Base> IOutputStream& operator<<(IOutputStream& os, const TBaseText<Char, Base>& text) { - for (size_t i = 0; i < text.Text.size(); ++i) { + for (size_t i = 0; i < text.Text.size(); ++i) { if (i != 0) { os << ' '; } diff --git a/util/stream/hex_ut.cpp b/util/stream/hex_ut.cpp index 5074a0b616..f788d38233 100644 --- a/util/stream/hex_ut.cpp +++ b/util/stream/hex_ut.cpp @@ -7,13 +7,13 @@ Y_UNIT_TEST_SUITE(THexCodingTest) { void TestImpl(const TString& data) { TString encoded; TStringOutput encodedOut(encoded); - HexEncode(data.data(), data.size(), encodedOut); + HexEncode(data.data(), data.size(), encodedOut); - UNIT_ASSERT_EQUAL(encoded.size(), data.size() * 2); + UNIT_ASSERT_EQUAL(encoded.size(), data.size() * 2); TString decoded; TStringOutput decodedOut(decoded); - HexDecode(encoded.data(), encoded.size(), decodedOut); + HexDecode(encoded.data(), encoded.size(), decodedOut); UNIT_ASSERT_EQUAL(decoded, data); } diff --git a/util/stream/input_ut.cpp b/util/stream/input_ut.cpp index 4a93f5458e..8d3b1bad0d 100644 --- a/util/stream/input_ut.cpp +++ b/util/stream/input_ut.cpp @@ -23,7 +23,7 @@ public: template <typename FuncType> void ForInput(const TStringBuf text, const FuncType& func) { TFile tempFile(TFile::Temporary("input_ut")); - tempFile.Write(text.data(), text.size()); + tempFile.Write(text.data(), text.size()); tempFile.FlushData(); tempFile.Seek(0, sSet); diff --git a/util/stream/ios_ut.cpp b/util/stream/ios_ut.cpp index 139f4296e5..2f08fc57ba 100644 --- a/util/stream/ios_ut.cpp +++ b/util/stream/ios_ut.cpp @@ -191,7 +191,7 @@ public: s.append((const char*)p[i].buf, p[i].len); } - DoWrite(s.data(), s.size()); + DoWrite(s.data(), s.size()); } private: @@ -210,13 +210,13 @@ void TStreamsTest::TestBufferedIO() { TString str(" "); str += ToString(i % 10); - bo.Write(str.data(), str.size()); + bo.Write(str.data(), str.size()); } bo.Finish(); } - UNIT_ASSERT_EQUAL(s.size(), 2000); + UNIT_ASSERT_EQUAL(s.size(), 2000); { const size_t buflen = 11; @@ -248,7 +248,7 @@ void TStreamsTest::TestBufferedIO() { } for (size_t i = 0; i < 1000; ++i) { - bo.Write(f.data(), i); + bo.Write(f.data(), i); } bo.Finish(); @@ -259,13 +259,13 @@ void TStreamsTest::TestBufferStream() { TBufferStream stream; TString s = "test"; - stream.Write(s.data(), s.size()); + stream.Write(s.data(), s.size()); char buf[5]; size_t bytesRead = stream.Read(buf, 4); UNIT_ASSERT_EQUAL(4, bytesRead); - UNIT_ASSERT_EQUAL(0, strncmp(s.data(), buf, 4)); + UNIT_ASSERT_EQUAL(0, strncmp(s.data(), buf, 4)); - stream.Write(s.data(), s.size()); + stream.Write(s.data(), s.size()); bytesRead = stream.Read(buf, 2); UNIT_ASSERT_EQUAL(2, bytesRead); UNIT_ASSERT_EQUAL(0, strncmp("te", buf, 2)); @@ -382,9 +382,9 @@ namespace { void TestStreamReadTo(const TString& text, T test) { TStringInput is(text); test(is, "TStringInput"); - TMemoryInput mi(text.data(), text.size()); + TMemoryInput mi(text.data(), text.size()); test(mi, "TMemoryInput"); - TBuffer b(text.data(), text.size()); + TBuffer b(text.data(), text.size()); TBufferInput bi(b); test(bi, "TBufferInput"); TStringInput slave(text); @@ -409,7 +409,7 @@ void TStreamsTest::TestStrokaInput() { TString s; for (ui32 i = 0; i < 100000; ++i) { TVector<char> d(i % 1000, 'a'); - s.append(d.data(), d.size()); + s.append(d.data(), d.size()); s.append('\n'); } TestStreamReadTo(s, ::TestStrokaInput); diff --git a/util/stream/length_ut.cpp b/util/stream/length_ut.cpp index 8968448954..11ff8e8c8a 100644 --- a/util/stream/length_ut.cpp +++ b/util/stream/length_ut.cpp @@ -45,7 +45,7 @@ Y_UNIT_TEST_SUITE(TestLengthIO) { UNIT_ASSERT_VALUES_EQUAL(l1.Counter(), 5); TString buf("aaa"); - IOutputStream::TPart parts[] = {{buf.data(), buf.size()}, {buf.data(), buf.size()}, {buf.data(), buf.size()}}; + IOutputStream::TPart parts[] = {{buf.data(), buf.size()}, {buf.data(), buf.size()}, {buf.data(), buf.size()}}; l1.Write(parts, 3); UNIT_ASSERT_VALUES_EQUAL(l1.Counter(), 14); } diff --git a/util/stream/mem.cpp b/util/stream/mem.cpp index 22a3339e27..279a276ee8 100644 --- a/util/stream/mem.cpp +++ b/util/stream/mem.cpp @@ -15,8 +15,8 @@ TMemoryInput::TMemoryInput(const void* buf, size_t len) noexcept } TMemoryInput::TMemoryInput(const TStringBuf buf) noexcept - : Buf_(buf.data()) - , Len_(buf.size()) + : Buf_(buf.data()) + , Len_(buf.size()) { } diff --git a/util/stream/output.cpp b/util/stream/output.cpp index db81b81b70..2ca09137f8 100644 --- a/util/stream/output.cpp +++ b/util/stream/output.cpp @@ -91,7 +91,7 @@ static void WriteString(IOutputStream& o, const wchar32* w, size_t n) { template <> void Out<TString>(IOutputStream& o, const TString& p) { - o.Write(p.data(), p.size()); + o.Write(p.data(), p.size()); } template <> diff --git a/util/stream/output.h b/util/stream/output.h index 00eef50b95..cf45957b99 100644 --- a/util/stream/output.h +++ b/util/stream/output.h @@ -31,8 +31,8 @@ public: } inline TPart(const TStringBuf s) noexcept - : buf(s.data()) - , len(s.size()) + : buf(s.data()) + , len(s.size()) { } @@ -80,7 +80,7 @@ public: * @param st String to write. */ inline void Write(const TStringBuf st) { - Write(st.data(), st.size()); + Write(st.data(), st.size()); } /** diff --git a/util/stream/pipe.cpp b/util/stream/pipe.cpp index 51be1934a7..ecbb9b96d3 100644 --- a/util/stream/pipe.cpp +++ b/util/stream/pipe.cpp @@ -15,7 +15,7 @@ public: ythrow TSystemError(EINVAL) << "pipe \"r+\" mode is implemented only on FreeBSD"; } #endif - Pipe_ = ::popen(command.data(), mode); + Pipe_ = ::popen(command.data(), mode); if (Pipe_ == nullptr) { ythrow TSystemError() << "failed to open pipe: " << command.Quote(); } diff --git a/util/stream/printf_ut.cpp b/util/stream/printf_ut.cpp index 0eab167062..847c45cfb3 100644 --- a/util/stream/printf_ut.cpp +++ b/util/stream/printf_ut.cpp @@ -26,7 +26,7 @@ Y_UNIT_TEST_SUITE(TStreamPrintfTest) { TString s = NUnitTest::RandomString(1000000); TStringStream ss; - Printf(ss, "%s", s.data()); + Printf(ss, "%s", s.data()); UNIT_ASSERT_EQUAL(ss.Str(), s); } diff --git a/util/stream/str.h b/util/stream/str.h index 028bd572c0..a956d1597d 100644 --- a/util/stream/str.h +++ b/util/stream/str.h @@ -169,7 +169,7 @@ public: * to be null-terminated. */ inline const char* Data() const noexcept { - return Ptr()->data(); + return Ptr()->data(); } /** @@ -179,7 +179,7 @@ public: * available for reading. */ inline size_t Size() const noexcept { - return Ptr()->size(); + return Ptr()->size(); } /** diff --git a/util/stream/tokenizer_ut.cpp b/util/stream/tokenizer_ut.cpp index afc566da86..f149209fb0 100644 --- a/util/stream/tokenizer_ut.cpp +++ b/util/stream/tokenizer_ut.cpp @@ -8,7 +8,7 @@ #include "tokenizer.h" static inline void CheckIfNullTerminated(const TStringBuf str) { - UNIT_ASSERT_VALUES_EQUAL('\0', *(str.data() + str.size())); + UNIT_ASSERT_VALUES_EQUAL('\0', *(str.data() + str.size())); } Y_UNIT_TEST_SUITE(TStreamTokenizerTests) { diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 60f4e9439f..c672177880 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -215,8 +215,8 @@ public: deflateSetHeader(Z(), GZHeader_.Get()); } - if (p.Dict.size()) { - if (deflateSetDictionary(Z(), (const Bytef*)p.Dict.data(), p.Dict.size())) { + if (p.Dict.size()) { + if (deflateSetDictionary(Z(), (const Bytef*)p.Dict.data(), p.Dict.size())) { ythrow TZLibCompressorError() << "can not set deflate dictionary"; } } |