aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authordanlark <danlark@yandex-team.ru>2022-02-10 16:46:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:08 +0300
commit3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch)
tree26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp
parentcb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff)
downloadydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/actors/core/event.h2
-rw-r--r--library/cpp/actors/core/event_local.h4
-rw-r--r--library/cpp/actors/core/log.cpp6
-rw-r--r--library/cpp/actors/core/log.h10
-rw-r--r--library/cpp/actors/core/log_settings.cpp4
-rw-r--r--library/cpp/actors/core/log_settings.h2
-rw-r--r--library/cpp/actors/core/process_stats.cpp10
-rw-r--r--library/cpp/actors/http/http.h2
-rw-r--r--library/cpp/actors/interconnect/interconnect_handshake.cpp14
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp4
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp38
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_proxy.h14
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_server.cpp2
-rw-r--r--library/cpp/actors/interconnect/interconnect_tcp_session.cpp12
-rw-r--r--library/cpp/actors/interconnect/load.cpp6
-rw-r--r--library/cpp/actors/interconnect/packet.h2
-rw-r--r--library/cpp/actors/interconnect/ut/lib/interrupter.h14
-rw-r--r--library/cpp/actors/testlib/test_runtime.cpp2
-rw-r--r--library/cpp/archive/directory_models_archive_reader.cpp28
-rw-r--r--library/cpp/archive/yarchive.cpp6
-rw-r--r--library/cpp/balloc/balloc.cpp56
-rw-r--r--library/cpp/balloc/optional/ya.make4
-rw-r--r--library/cpp/balloc/ya.make8
-rw-r--r--library/cpp/binsaver/ut/binsaver_ut.cpp2
-rw-r--r--library/cpp/bit_io/bitinout_ut.cpp40
-rw-r--r--library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp4
-rw-r--r--library/cpp/blockcodecs/codecs_ut.cpp12
-rw-r--r--library/cpp/blockcodecs/core/codecs.h24
-rw-r--r--library/cpp/blockcodecs/core/common.h22
-rw-r--r--library/cpp/blockcodecs/core/stream.cpp4
-rw-r--r--library/cpp/cgiparam/cgiparam.cpp18
-rw-r--r--library/cpp/cgiparam/cgiparam.h2
-rw-r--r--library/cpp/charset/ci_string.cpp2
-rw-r--r--library/cpp/charset/ci_string.h4
-rw-r--r--library/cpp/charset/codepage.cpp8
-rw-r--r--library/cpp/charset/codepage_ut.cpp8
-rw-r--r--library/cpp/charset/recyr.hh2
-rw-r--r--library/cpp/charset/wide.h16
-rw-r--r--library/cpp/charset/wide_ut.cpp28
-rw-r--r--library/cpp/codecs/codecs.cpp24
-rw-r--r--library/cpp/codecs/codecs.h2
-rw-r--r--library/cpp/codecs/codecs_registry.cpp4
-rw-r--r--library/cpp/codecs/delta_codec.h8
-rw-r--r--library/cpp/codecs/greedy_dict/gd_builder.cpp2
-rw-r--r--library/cpp/codecs/greedy_dict/gd_entry.cpp4
-rw-r--r--library/cpp/codecs/greedy_dict/gd_entry.h12
-rw-r--r--library/cpp/codecs/huffman_codec.cpp12
-rw-r--r--library/cpp/codecs/pfor_codec.h20
-rw-r--r--library/cpp/codecs/sample.h2
-rw-r--r--library/cpp/codecs/solar_codec.cpp8
-rw-r--r--library/cpp/codecs/solar_codec.h14
-rw-r--r--library/cpp/codecs/static/common.h4
-rw-r--r--library/cpp/codecs/static/static.cpp12
-rw-r--r--library/cpp/codecs/static/tools/common/ct_common.cpp12
-rw-r--r--library/cpp/codecs/static/ut/static_ut.cpp4
-rw-r--r--library/cpp/codecs/ut/codecs_ut.cpp10
-rw-r--r--library/cpp/codecs/ut/tls_cache_ut.cpp2
-rw-r--r--library/cpp/codecs/zstd_dict_codec.cpp36
-rw-r--r--library/cpp/compproto/compproto_ut.cpp2
-rw-r--r--library/cpp/comptable/comptable.cpp8
-rw-r--r--library/cpp/comptable/usage/usage.cpp2
-rw-r--r--library/cpp/comptable/ut/comptable_ut.cpp2
-rw-r--r--library/cpp/containers/comptrie/chunked_helpers_trie.h4
-rw-r--r--library/cpp/containers/comptrie/comptrie_builder.h10
-rw-r--r--library/cpp/containers/comptrie/comptrie_builder.inl14
-rw-r--r--library/cpp/containers/comptrie/comptrie_trie.h16
-rw-r--r--library/cpp/containers/comptrie/comptrie_ut.cpp36
-rw-r--r--library/cpp/containers/comptrie/loader/loader_ut.cpp2
-rw-r--r--library/cpp/containers/comptrie/search_iterator.h2
-rw-r--r--library/cpp/containers/comptrie/set.h2
-rw-r--r--library/cpp/containers/stack_array/ut/tests_ut.cpp2
-rw-r--r--library/cpp/containers/str_map/str_map.h2
-rw-r--r--library/cpp/coroutine/engine/poller.cpp6
-rw-r--r--library/cpp/dbg_output/dump.h4
-rw-r--r--library/cpp/dbg_output/engine.cpp2
-rw-r--r--library/cpp/dbg_output/engine.h2
-rw-r--r--library/cpp/deprecated/kmp/kmp.cpp2
-rw-r--r--library/cpp/deprecated/kmp/kmp.h10
-rw-r--r--library/cpp/deprecated/kmp/kmp_ut.cpp4
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.cpp6
-rw-r--r--library/cpp/deprecated/split/split_iterator.cpp6
-rw-r--r--library/cpp/deprecated/split/split_iterator.h2
-rw-r--r--library/cpp/diff/diff.cpp4
-rw-r--r--library/cpp/digest/lower_case/hash_ops.cpp2
-rw-r--r--library/cpp/digest/lower_case/lchash.h2
-rw-r--r--library/cpp/digest/md5/md5.cpp2
-rw-r--r--library/cpp/digest/md5/md5_ut.cpp6
-rw-r--r--library/cpp/dns/cache.cpp2
-rw-r--r--library/cpp/dns/thread.cpp2
-rw-r--r--library/cpp/enumbitset/enumbitset.h2
-rw-r--r--library/cpp/getopt/small/last_getopt.h2
-rw-r--r--library/cpp/getopt/small/last_getopt_opts.cpp4
-rw-r--r--library/cpp/getopt/small/opt2.cpp8
-rw-r--r--library/cpp/getopt/small/ygetopt.cpp2
-rw-r--r--library/cpp/getopt/ut/last_getopt_ut.cpp8
-rw-r--r--library/cpp/grpc/server/grpc_request.h2
-rw-r--r--library/cpp/http/fetch/httpfsm_ut.cpp6
-rw-r--r--library/cpp/http/fetch/httpparser_ut.cpp20
-rw-r--r--library/cpp/http/io/chunk.cpp2
-rw-r--r--library/cpp/http/io/chunk_ut.cpp2
-rw-r--r--library/cpp/http/io/stream.cpp36
-rw-r--r--library/cpp/http/io/stream_ut.cpp32
-rw-r--r--library/cpp/http/io/stream_ut_medium.cpp2
-rw-r--r--library/cpp/http/misc/httpcodes.h2
-rw-r--r--library/cpp/http/misc/httpreqdata.cpp18
-rw-r--r--library/cpp/http/misc/httpreqdata_ut.cpp2
-rw-r--r--library/cpp/http/server/http.cpp10
-rw-r--r--library/cpp/http/server/http_ut.cpp26
-rw-r--r--library/cpp/http/server/response.cpp8
-rw-r--r--library/cpp/json/easy_parse/json_easy_parser.cpp10
-rw-r--r--library/cpp/json/fast_sax/parser.rl66
-rw-r--r--library/cpp/json/fast_sax/unescape.cpp2
-rw-r--r--library/cpp/json/flex_buffers/cvt.cpp6
-rw-r--r--library/cpp/json/json_prettifier.cpp2
-rw-r--r--library/cpp/json/json_reader.h2
-rw-r--r--library/cpp/json/rapidjson_helpers.h2
-rw-r--r--library/cpp/json/ut/json_reader_fast_ut.cpp14
-rw-r--r--library/cpp/json/writer/json.cpp2
-rw-r--r--library/cpp/lcs/lcs_via_lis_ut.cpp4
-rw-r--r--library/cpp/logger/global/global.cpp2
-rw-r--r--library/cpp/logger/global/global.h2
-rw-r--r--library/cpp/logger/log_ut.cpp4
-rw-r--r--library/cpp/logger/system.cpp2
-rw-r--r--library/cpp/lwtrace/lwprobe.h12
-rw-r--r--library/cpp/lwtrace/mon/mon_lwtrace.cpp68
-rw-r--r--library/cpp/lwtrace/trace.cpp2
-rw-r--r--library/cpp/messagebus/config/session_config.cpp6
-rw-r--r--library/cpp/messagebus/message.cpp2
-rw-r--r--library/cpp/messagebus/oldmodule/module.cpp4
-rw-r--r--library/cpp/messagebus/rain_check/http/client.cpp2
-rw-r--r--library/cpp/messagebus/rain_check/http/client_ut.cpp6
-rw-r--r--library/cpp/messagebus/remote_connection.cpp2
-rw-r--r--library/cpp/messagebus/session.cpp6
-rw-r--r--library/cpp/messagebus/storage.cpp2
-rw-r--r--library/cpp/messagebus/test/helper/example.cpp10
-rw-r--r--library/cpp/messagebus/test/helper/message_handler_error.cpp4
-rw-r--r--library/cpp/messagebus/test/perftest/perftest.cpp12
-rw-r--r--library/cpp/messagebus/test/ut/messagebus_ut.cpp22
-rw-r--r--library/cpp/messagebus/test/ut/module_client_ut.cpp2
-rw-r--r--library/cpp/messagebus/ybus.h2
-rw-r--r--library/cpp/monlib/dynamic_counters/encode.cpp4
-rw-r--r--library/cpp/monlib/dynamic_counters/golovan_page.cpp2
-rw-r--r--library/cpp/monlib/dynamic_counters/page.cpp2
-rw-r--r--library/cpp/monlib/encode/buffered/string_pool.cpp2
-rw-r--r--library/cpp/monlib/encode/format.cpp2
-rw-r--r--library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp6
-rw-r--r--library/cpp/monlib/encode/spack/compression.cpp50
-rw-r--r--library/cpp/monlib/encode/unistat/unistat_decoder.cpp6
-rw-r--r--library/cpp/monlib/service/format.h2
-rw-r--r--library/cpp/monlib/service/pages/index_mon_page.cpp2
-rw-r--r--library/cpp/monlib/service/pages/mon_page.h2
-rw-r--r--library/cpp/monlib/service/pages/registry_mon_page.cpp2
-rw-r--r--library/cpp/monlib/service/pages/templates.h54
-rw-r--r--library/cpp/monlib/service/service.cpp16
-rw-r--r--library/cpp/on_disk/chunks/chunked_helpers.h24
-rw-r--r--library/cpp/on_disk/chunks/writer.cpp2
-rw-r--r--library/cpp/openssl/io/stream.cpp4
-rw-r--r--library/cpp/packedtypes/longs_ut.cpp2
-rw-r--r--library/cpp/packers/ut/region_packer_ut.cpp2
-rw-r--r--library/cpp/pop_count/popcount.h62
-rw-r--r--library/cpp/random_provider/random_provider.cpp4
-rw-r--r--library/cpp/regex/pcre/regexp.cpp10
-rw-r--r--library/cpp/regex/pire/pcre2pire.cpp6
-rw-r--r--library/cpp/regex/pire/regexp.h6
-rw-r--r--library/cpp/scheme/scimpl_json_read.cpp2
-rw-r--r--library/cpp/scheme/scimpl_select.rl64
-rw-r--r--library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp2
-rw-r--r--library/cpp/scheme/tests/ut/scheme_merge_ut.cpp6
-rw-r--r--library/cpp/scheme/ut_utils/scheme_ut_utils.h4
-rw-r--r--library/cpp/sse/powerpc.h1662
-rw-r--r--library/cpp/sse/sse.cpp2
-rw-r--r--library/cpp/sse/sse.h6
-rw-r--r--library/cpp/sse/sse2neon.h406
-rw-r--r--library/cpp/sse/ut/test.cpp510
-rw-r--r--library/cpp/sse/ut/ya.make10
-rw-r--r--library/cpp/sse/ya.make10
-rw-r--r--library/cpp/streams/brotli/brotli_ut.cpp4
-rw-r--r--library/cpp/streams/bzip2/bzip2_ut.cpp2
-rw-r--r--library/cpp/streams/lz/lz.cpp2
-rw-r--r--library/cpp/streams/lz/lz_ut.cpp8
-rw-r--r--library/cpp/streams/lzma/lzma_ut.cpp8
-rw-r--r--library/cpp/string_utils/base64/base64.h4
-rw-r--r--library/cpp/string_utils/base64/base64_ut.cpp4
-rw-r--r--library/cpp/string_utils/base64/bench/main.cpp12
-rw-r--r--library/cpp/string_utils/indent_text/indent_text.cpp2
-rw-r--r--library/cpp/string_utils/parse_size/parse_size.cpp6
-rw-r--r--library/cpp/string_utils/quote/quote.cpp30
-rw-r--r--library/cpp/string_utils/quote/quote.h6
-rw-r--r--library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h8
-rw-r--r--library/cpp/string_utils/scan/scan.h4
-rw-r--r--library/cpp/string_utils/url/url.cpp12
-rw-r--r--library/cpp/testing/benchmark/bench.cpp20
-rw-r--r--library/cpp/testing/benchmark/examples/main.cpp8
-rw-r--r--library/cpp/testing/unittest/registar.cpp8
-rw-r--r--library/cpp/testing/unittest/registar.h2
-rw-r--r--library/cpp/testing/unittest/registar_ut.cpp2
-rw-r--r--library/cpp/testing/unittest/utmain.cpp48
-rw-r--r--library/cpp/unicode/punycode/punycode.cpp4
-rw-r--r--library/cpp/uri/assign.cpp24
-rw-r--r--library/cpp/uri/common.cpp2
-rw-r--r--library/cpp/uri/other.h6
-rw-r--r--library/cpp/uri/uri.cpp22
-rw-r--r--library/cpp/uri/uri.h4
-rw-r--r--library/cpp/xml/document/xml-document-decl.h2
-rw-r--r--library/cpp/xml/document/xml-document.cpp2
-rw-r--r--library/cpp/xml/document/xml-textreader.cpp10
-rw-r--r--library/cpp/yson/detail.h6
-rw-r--r--library/cpp/yson/writer.cpp2
208 files changed, 2203 insertions, 2203 deletions
diff --git a/library/cpp/actors/core/event.h b/library/cpp/actors/core/event.h
index 6ff02aaf94..4ad6d5c26a 100644
--- a/library/cpp/actors/core/event.h
+++ b/library/cpp/actors/core/event.h
@@ -77,7 +77,7 @@ namespace NActors {
return static_cast<TEventType*>(Event.Get());
}
- Y_FAIL("Failed to Load() event type %" PRIu32 " class %s", Type, TypeName<TEventType>().data());
+ Y_FAIL("Failed to Load() event type %" PRIu32 " class %s", Type, TypeName<TEventType>().data());
}
template <typename T>
diff --git a/library/cpp/actors/core/event_local.h b/library/cpp/actors/core/event_local.h
index 2845aa94dd..6623fe9d42 100644
--- a/library/cpp/actors/core/event_local.h
+++ b/library/cpp/actors/core/event_local.h
@@ -14,7 +14,7 @@ namespace NActors {
}
bool SerializeToArcadiaStream(TChunkSerializer* /*serializer*/) const override {
- Y_FAIL("Serialization of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType);
+ Y_FAIL("Serialization of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType);
}
bool IsSerializable() const override {
@@ -22,7 +22,7 @@ namespace NActors {
}
static IEventBase* Load(TEventSerializedData*) {
- Y_FAIL("Loading of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType);
+ Y_FAIL("Loading of local event %s type %" PRIu32, TypeName<TEv>().data(), TEventType);
}
};
diff --git a/library/cpp/actors/core/log.cpp b/library/cpp/actors/core/log.cpp
index 5f63b5af58..b14d95e38b 100644
--- a/library/cpp/actors/core/log.cpp
+++ b/library/cpp/actors/core/log.cpp
@@ -490,7 +490,7 @@ namespace NActors {
}
HTML(str) {
- if (!explanation.empty()) {
+ if (!explanation.empty()) {
DIV_CLASS("row") {
DIV_CLASS("col-md-12 alert alert-info") {
str << explanation;
@@ -609,7 +609,7 @@ namespace NActors {
NJsonWriter::TBuf json;
json.BeginObject()
.WriteKey("@timestamp")
- .WriteString(Settings->UseLocalTimestamps ? FormatLocalTimestamp(time, buf) : time.ToString().data())
+ .WriteString(Settings->UseLocalTimestamps ? FormatLocalTimestamp(time, buf) : time.ToString().data())
.WriteKey("microseconds")
.WriteULongLong(time.MicroSeconds())
.WriteKey("host")
@@ -665,7 +665,7 @@ namespace NActors {
if (logCons)
flags |= TSysLogBackend::LogCons;
- return new TSysLogBackend(ident.data(), TSysLogBackend::TSYSLOG_LOCAL1, flags);
+ return new TSysLogBackend(ident.data(), TSysLogBackend::TSYSLOG_LOCAL1, flags);
}
class TStderrBackend: public TLogBackend {
diff --git a/library/cpp/actors/core/log.h b/library/cpp/actors/core/log.h
index c11a7cf3c1..a57a479e9c 100644
--- a/library/cpp/actors/core/log.h
+++ b/library/cpp/actors/core/log.h
@@ -44,11 +44,11 @@
} while (0) /**/
#define LOG_LOG_S_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, stream) \
- LOG_LOG_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, "%s", [&]() { \
+ LOG_LOG_SAMPLED_BY(actorCtxOrSystem, priority, component, sampleBy, "%s", [&]() { \
TStringBuilder logStringBuilder; \
logStringBuilder << stream; \
return static_cast<TString>(logStringBuilder); \
- }().data())
+ }().data())
#define LOG_LOG(actorCtxOrSystem, priority, component, ...) LOG_LOG_SAMPLED_BY(actorCtxOrSystem, priority, component, 0ull, __VA_ARGS__)
#define LOG_LOG_S(actorCtxOrSystem, priority, component, stream) LOG_LOG_S_SAMPLED_BY(actorCtxOrSystem, priority, component, 0ull, stream)
@@ -109,7 +109,7 @@
__FUNCTION__, ev->Type, ev->Sender.ToString().data(), SelfId().ToString().data(), ev->GetBase()->ToString().substr(0, 1000).data()); \
} else { \
LOG_TRACE(*TlsActivationContext, currentTracer, "%s, received event# %" PRIu32 ", Sender %s, Recipient %s", \
- __FUNCTION__, ev->Type, ev->Sender.ToString().data(), ev->Recipient.ToString().data()); \
+ __FUNCTION__, ev->Type, ev->Sender.ToString().data(), ev->Recipient.ToString().data()); \
}
#define TRACE_EVENT_TYPE(eventType) LOG_TRACE(*TlsActivationContext, currentTracer, "%s, processing event %s", __FUNCTION__, eventType)
@@ -341,7 +341,7 @@ namespace NActors {
NDetail::PrintfV(Formatted, "%s", format);
}
- MemLogWrite(Formatted.data(), Formatted.size(), true);
+ MemLogWrite(Formatted.data(), Formatted.size(), true);
DeliverLogMessage(actorCtxOrSystem, mPriority, mComponent, std::move(Formatted));
}
@@ -352,7 +352,7 @@ namespace NActors {
NLog::EComponent mComponent,
const TString& str) {
- MemLogWrite(str.data(), str.size(), true);
+ MemLogWrite(str.data(), str.size(), true);
DeliverLogMessage(actorCtxOrSystem, mPriority, mComponent, TString(str));
}
diff --git a/library/cpp/actors/core/log_settings.cpp b/library/cpp/actors/core/log_settings.cpp
index f52f2fc5d2..2f03410c30 100644
--- a/library/cpp/actors/core/log_settings.cpp
+++ b/library/cpp/actors/core/log_settings.cpp
@@ -198,7 +198,7 @@ namespace NActors {
}
bool TSettings::IsValidComponent(EComponent component) {
- return (MinVal <= component) && (component <= MaxVal) && !ComponentNames[component].empty();
+ return (MinVal <= component) && (component <= MaxVal) && !ComponentNames[component].empty();
}
void TSettings::SetAllowDrop(bool val) {
@@ -214,7 +214,7 @@ namespace NActors {
}
EComponent TSettings::FindComponent(const TStringBuf& componentName) const {
- if (componentName.empty())
+ if (componentName.empty())
return InvalidComponent;
for (EComponent component = MinVal; component <= MaxVal; ++component) {
diff --git a/library/cpp/actors/core/log_settings.h b/library/cpp/actors/core/log_settings.h
index 7fe4504edd..326412073e 100644
--- a/library/cpp/actors/core/log_settings.h
+++ b/library/cpp/actors/core/log_settings.h
@@ -151,7 +151,7 @@ namespace NActors {
const char* ComponentName(EComponent component) const {
Y_VERIFY_DEBUG((component & Mask) == component);
- return ComponentNames[component & Mask].data();
+ return ComponentNames[component & Mask].data();
}
int SetLevel(EPriority priority, EComponent component, TString& explanation);
diff --git a/library/cpp/actors/core/process_stats.cpp b/library/cpp/actors/core/process_stats.cpp
index 0e1dbd0031..3edbaded63 100644
--- a/library/cpp/actors/core/process_stats.cpp
+++ b/library/cpp/actors/core/process_stats.cpp
@@ -25,11 +25,11 @@ namespace NActors {
static bool ExtractVal(const TString& str, const TString& name, TVal& res) {
if (!str.StartsWith(name))
return false;
- size_t pos = name.size();
- while (pos < str.size() && (str[pos] == ' ' || str[pos] == '\t')) {
+ size_t pos = name.size();
+ while (pos < str.size() && (str[pos] == ' ' || str[pos] == '\t')) {
pos++;
}
- res = atol(str.data() + pos);
+ res = atol(str.data() + pos);
return true;
}
@@ -63,7 +63,7 @@ namespace NActors {
TFileInput procStat("/proc/" + strPid + "/stat");
procStat.ReadLine(str);
if (!str.empty()) {
- sscanf(str.data(),
+ sscanf(str.data(),
"%d %*s %c %d %d %d %d %d %u %lu %lu "
"%lu %lu %lu %lu %ld %ld %ld %ld %ld "
"%ld %llu %lu %ld %lu",
@@ -81,7 +81,7 @@ namespace NActors {
TFileInput statm("/proc/" + strPid + "/statm");
statm.ReadLine(str);
TVector<TString> fields;
- StringSplitter(str).Split(' ').SkipEmpty().Collect(&fields);
+ StringSplitter(str).Split(' ').SkipEmpty().Collect(&fields);
if (fields.size() >= 7) {
ui64 resident = FromString<ui64>(fields[1]);
ui64 shared = FromString<ui64>(fields[2]);
diff --git a/library/cpp/actors/http/http.h b/library/cpp/actors/http/http.h
index 96c5c1ec48..50f282e057 100644
--- a/library/cpp/actors/http/http.h
+++ b/library/cpp/actors/http/http.h
@@ -225,7 +225,7 @@ public:
if (delim.size() == 1) {
return ProcessData(target, source, delim[0], maxLen);
}
- if (ProcessData(target, source, delim.back(), maxLen + 1)) {
+ if (ProcessData(target, source, delim.back(), maxLen + 1)) {
for (signed i = delim.size() - 2; i >= 0; --i) {
TrimEnd(target, delim[i]);
}
diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp
index 9ede998d8e..2f0399fd9e 100644
--- a/library/cpp/actors/interconnect/interconnect_handshake.cpp
+++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp
@@ -128,7 +128,7 @@ namespace NActors {
Y_VERIFY(Socket);
PeerAddr = TString::Uninitialized(1024);
if (GetRemoteAddr(*Socket, PeerAddr.Detach(), PeerAddr.size())) {
- PeerAddr.resize(strlen(PeerAddr.data()));
+ PeerAddr.resize(strlen(PeerAddr.data()));
} else {
PeerAddr.clear();
}
@@ -223,7 +223,7 @@ namespace NActors {
void ProcessUnexpectedEvent(TAutoPtr<IEventHandle> ev) override {
switch (const ui32 type = ev->GetTypeRewrite()) {
case TEvents::TSystem::Wakeup:
- Fail(TEvHandshakeFail::HANDSHAKE_FAIL_TRANSIENT, Sprintf("Handshake timed out, State# %s", State.data()), true);
+ Fail(TEvHandshakeFail::HANDSHAKE_FAIL_TRANSIENT, Sprintf("Handshake timed out, State# %s", State.data()), true);
[[fallthrough]];
case ui32(ENetwork::NodeInfo):
@@ -318,7 +318,7 @@ namespace NActors {
}
}
if (!matching) {
- errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", uuid->data(), formatList(Common->AcceptUUID).data()));
+ errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", uuid->data(), formatList(Common->AcceptUUID).data()));
}
}
return; // remote side did not fill in this field -- old version, symmetric protocol is not supported
@@ -342,7 +342,7 @@ namespace NActors {
}
// no match
- errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", remoteUUID.data(), formatList(Common->AcceptUUID).data()));
+ errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", remoteUUID.data(), formatList(Common->AcceptUUID).data()));
}
void ParsePeerScopeId(const NActorsInterconnect::TScopeId& proto) {
@@ -562,7 +562,7 @@ namespace NActors {
// extract peer node id from the peer
PeerNodeId = request.Header.SelfVirtualId.NodeId();
if (!PeerNodeId) {
- Y_VERIFY_DEBUG(false, "PeerNodeId is zero request# %s", request.ToString().data());
+ Y_VERIFY_DEBUG(false, "PeerNodeId is zero request# %s", request.ToString().data());
Fail(TEvHandshakeFail::HANDSHAKE_FAIL_PERMANENT, "SelfVirtualId.NodeId is empty in initial packet");
}
UpdatePrefix();
@@ -646,8 +646,8 @@ namespace NActors {
generateError(Sprintf("Incorrect ReceiverNodeId# %" PRIu32 " from the peer, expected# %" PRIu32,
request.GetReceiverNodeId(), SelfActorId.NodeId()));
} else if (request.GetReceiverHostName() != Common->TechnicalSelfHostName) {
- generateError(Sprintf("ReceiverHostName# %s mismatch, expected# %s", request.GetReceiverHostName().data(),
- Common->TechnicalSelfHostName.data()));
+ generateError(Sprintf("ReceiverHostName# %s mismatch, expected# %s", request.GetReceiverHostName().data(),
+ Common->TechnicalSelfHostName.data()));
}
ValidateVersionTag(request, generateError);
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp
index 0abe9fe659..01e3ecb24c 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp
+++ b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp
@@ -36,7 +36,7 @@ namespace NActors {
}
void TInputSessionTCP::Bootstrap() {
- SetPrefix(Sprintf("InputSession %s [node %" PRIu32 "]", SelfId().ToString().data(), NodeId));
+ SetPrefix(Sprintf("InputSession %s [node %" PRIu32 "]", SelfId().ToString().data(), NodeId));
Become(&TThis::WorkingState, DeadPeerTimeout, new TEvCheckDeadPeer);
LOG_DEBUG_IC_SESSION("ICIS01", "InputSession created");
LastReceiveTimestamp = TActivationContext::Now();
@@ -371,7 +371,7 @@ namespace NActors {
: recvres == 0 ? "connection closed by peer"
: err ? err
: Sprintf("socket: %s", strerror(-recvres));
- LOG_NOTICE_NET(NodeId, "%s", message.data());
+ LOG_NOTICE_NET(NodeId, "%s", message.data());
ReestablishConnection(CloseInputSessionRequested ? TDisconnectReason::Debug() :
recvres == 0 ? TDisconnectReason::EndOfStream() : TDisconnectReason::FromErrno(-recvres));
} else if (PollerToken && !std::exchange(Context->ReadPending, true)) {
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp
index 7e2d8ccb94..3ddc50129d 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp
+++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp
@@ -37,7 +37,7 @@ namespace NActors {
}
void TInterconnectProxyTCP::Bootstrap() {
- SetPrefix(Sprintf("Proxy %s [node %" PRIu32 "]", SelfId().ToString().data(), PeerNodeId));
+ SetPrefix(Sprintf("Proxy %s [node %" PRIu32 "]", SelfId().ToString().data(), PeerNodeId));
SwitchToInitialState();
PassAwayTimestamp = TActivationContext::Now() + TDuration::Seconds(15);
@@ -197,7 +197,7 @@ namespace NActors {
if (OutgoingHandshakeActor && SelfId().NodeId() < PeerNodeId) {
// Both outgoing and incoming handshake are in progress. To prevent race condition during semultanous handshake
// incoming handshake must be held till outgoing handshake is complete or failed
- LOG_DEBUG_IC("ICP06", "reply for incoming handshake (actor %s) is held", IncomingHandshakeActor.ToString().data());
+ LOG_DEBUG_IC("ICP06", "reply for incoming handshake (actor %s) is held", IncomingHandshakeActor.ToString().data());
HeldHandshakeReply = std::move(event);
// Check that we are in one of acceptable states that would properly handle handshake statuses.
@@ -227,19 +227,19 @@ namespace NActors {
TEvHandshakeAsk *msg = ev->Get();
// TEvHandshakeAsk is only applicable for continuation requests
- LOG_DEBUG_IC("ICP09", "(actor %s) from: %s for: %s", ev->Sender.ToString().data(),
- ev->Get()->Self.ToString().data(), ev->Get()->Peer.ToString().data());
+ LOG_DEBUG_IC("ICP09", "(actor %s) from: %s for: %s", ev->Sender.ToString().data(),
+ ev->Get()->Self.ToString().data(), ev->Get()->Peer.ToString().data());
if (!Session) {
// if there is no open session, report error -- continuation request works only with open sessions
LOG_NOTICE_IC("ICP12", "(actor %s) peer tries to resume nonexistent session Self# %s Peer# %s",
- ev->Sender.ToString().data(), msg->Self.ToString().data(), msg->Peer.ToString().data());
+ ev->Sender.ToString().data(), msg->Self.ToString().data(), msg->Peer.ToString().data());
} else if (SessionVirtualId != ev->Get()->Peer || RemoteSessionVirtualId != ev->Get()->Self) {
// check session virtual ids for continuation
LOG_NOTICE_IC("ICP13", "(actor %s) virtual id mismatch with existing session (Peer: %s Self: %s"
- " SessionVirtualId: %s RemoteSessionVirtualId: %s)", ev->Sender.ToString().data(),
- ev->Get()->Peer.ToString().data(), ev->Get()->Self.ToString().data(), SessionVirtualId.ToString().data(),
- RemoteSessionVirtualId.ToString().data());
+ " SessionVirtualId: %s RemoteSessionVirtualId: %s)", ev->Sender.ToString().data(),
+ ev->Get()->Peer.ToString().data(), ev->Get()->Self.ToString().data(), SessionVirtualId.ToString().data(),
+ RemoteSessionVirtualId.ToString().data());
} else {
// if we already have incoming handshake, then terminate existing one
DropIncomingHandshake();
@@ -256,7 +256,7 @@ namespace NActors {
void TInterconnectProxyTCP::IncomingHandshake(TEvHandshakeRequest::TPtr& ev) {
ICPROXY_PROFILED;
- LOG_DEBUG_IC("ICP17", "incoming handshake (actor %s)", ev->Sender.ToString().data());
+ LOG_DEBUG_IC("ICP17", "incoming handshake (actor %s)", ev->Sender.ToString().data());
const auto& record = ev->Get()->Record;
ui64 remotePID = record.GetProgramPID();
@@ -265,7 +265,7 @@ namespace NActors {
if (RemoteProgramInfo && remotePID == RemoteProgramInfo->PID && remoteStartTime == RemoteProgramInfo->StartTime) {
if (remoteSerial < RemoteProgramInfo->Serial) {
- LOG_INFO_IC("ICP18", "handshake (actor %s) is too old", ev->Sender.ToString().data());
+ LOG_INFO_IC("ICP18", "handshake (actor %s) is too old", ev->Sender.ToString().data());
Send(ev->Sender, new TEvents::TEvPoisonPill);
return;
} else {
@@ -290,13 +290,13 @@ namespace NActors {
const ui64 serial = record.GetSerial();
if (serial < *LastSerialFromIncomingHandshake) {
LOG_NOTICE_IC("ICP15", "Handshake# %s has duplicate serial# %" PRIu64
- " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(),
+ " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(),
serial, *LastSerialFromIncomingHandshake);
Send(ev->Sender, new TEvHandshakeReplyError("duplicate serial"));
return;
} else if (serial == *LastSerialFromIncomingHandshake) {
LOG_NOTICE_IC("ICP15", "Handshake# %s is obsolete, serial# %" PRIu64
- " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(),
+ " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(),
serial, *LastSerialFromIncomingHandshake);
Send(ev->Sender, new TEvents::TEvPoisonPill);
return;
@@ -368,7 +368,7 @@ namespace NActors {
IActor::InvokeOtherActor(*Session, &TInterconnectSessionTCP::Init);
SessionVirtualId = msg->Self;
RemoteSessionVirtualId = msg->Peer;
- LOG_INFO_IC("ICP22", "created new session: %s", SessionID.ToString().data());
+ LOG_INFO_IC("ICP22", "created new session: %s", SessionID.ToString().data());
}
// ensure that we have session local/peer virtual ids
@@ -394,17 +394,17 @@ namespace NActors {
if (ev->Sender == IncomingHandshakeActor) {
LOG_NOTICE_IC("ICP24", "incoming handshake failed, temporary: %" PRIu32 " explanation: %s outgoing: %s",
- ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), OutgoingHandshakeActor.ToString().data());
+ ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), OutgoingHandshakeActor.ToString().data());
DropIncomingHandshake(false);
} else if (ev->Sender == OutgoingHandshakeActor) {
LOG_NOTICE_IC("ICP25", "outgoing handshake failed, temporary: %" PRIu32 " explanation: %s incoming: %s held: %s",
- ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), IncomingHandshakeActor.ToString().data(),
+ ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), IncomingHandshakeActor.ToString().data(),
HeldHandshakeReply ? "yes" : "no");
DropOutgoingHandshake(false);
if (IEventBase* reply = HeldHandshakeReply.Release()) {
Y_VERIFY(IncomingHandshakeActor);
- LOG_DEBUG_IC("ICP26", "sent held handshake reply to %s", IncomingHandshakeActor.ToString().data());
+ LOG_DEBUG_IC("ICP26", "sent held handshake reply to %s", IncomingHandshakeActor.ToString().data());
Send(IncomingHandshakeActor, reply);
}
@@ -532,8 +532,8 @@ namespace NActors {
Y_VERIFY(Session && Session == session && SessionID);
- LOG_INFO_IC("ICP30", "unregister session Session# %s VirtualId# %s", SessionID.ToString().data(),
- SessionVirtualId.ToString().data());
+ LOG_INFO_IC("ICP30", "unregister session Session# %s VirtualId# %s", SessionID.ToString().data(),
+ SessionVirtualId.ToString().data());
Session = nullptr;
SessionID = TActorId();
@@ -739,7 +739,7 @@ namespace NActors {
void TInterconnectProxyTCP::TransitToErrorState(TString explanation, bool updateErrorLog) {
ICPROXY_PROFILED;
- LOG_NOTICE_IC("ICP32", "transit to hold-by-error state Explanation# %s", explanation.data());
+ LOG_NOTICE_IC("ICP32", "transit to hold-by-error state Explanation# %s", explanation.data());
LOG_INFO(*TlsActivationContext, NActorsServices::INTERCONNECT_STATUS, "[%u] error state: %s", PeerNodeId, explanation.data());
if (updateErrorLog) {
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h
index 023e5bd1ee..2bea6c68c3 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h
+++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h
@@ -186,7 +186,7 @@ namespace NActors {
ICPROXY_PROFILED;
Y_VERIFY(!PendingSessionEvents && !PendingIncomingHandshakeEvents, "%s PendingSessionEvents# %zu"
- " PendingIncomingHandshakeEvents# %zu State# %s", LogPrefix.data(), PendingSessionEvents.size(),
+ " PendingIncomingHandshakeEvents# %zu State# %s", LogPrefix.data(), PendingSessionEvents.size(),
PendingIncomingHandshakeEvents.size(), State);
SwitchToState(__LINE__, "PendingActivation", &TThis::PendingActivation);
if (DynamicPtr && !PassAwayScheduled && PassAwayTimestamp != TInstant::Max()) {
@@ -351,14 +351,14 @@ namespace NActors {
TString msg = Sprintf("Event Type# 0x%08" PRIx32 " TypeRewrite# 0x%08" PRIx32
" from Sender# %s sent to the proxy for the node itself via Interconnect;"
" THIS IS NOT A BUG IN INTERCONNECT, check the event sender instead",
- ev->Type, ev->GetTypeRewrite(), ev->Sender.ToString().data());
- LOG_ERROR_IC("ICP03", "%s", msg.data());
- Y_VERIFY_DEBUG(false, "%s", msg.data());
+ ev->Type, ev->GetTypeRewrite(), ev->Sender.ToString().data());
+ LOG_ERROR_IC("ICP03", "%s", msg.data());
+ Y_VERIFY_DEBUG(false, "%s", msg.data());
}
Y_VERIFY(ev->GetTypeRewrite() != TEvInterconnect::EvForward || ev->Recipient.NodeId() == PeerNodeId,
"Recipient/Proxy NodeId mismatch Recipient# %s Type# 0x%08" PRIx32 " PeerNodeId# %" PRIu32 " Func# %s",
- ev->Recipient.ToString().data(), ev->Type, PeerNodeId, func);
+ ev->Recipient.ToString().data(), ev->Type, PeerNodeId, func);
}
// Common with helpers
@@ -430,7 +430,7 @@ namespace NActors {
ICPROXY_PROFILED;
if (const TActorId& actorId = std::exchange(IncomingHandshakeActor, TActorId())) {
- LOG_DEBUG_IC("ICP111", "dropped incoming handshake: %s poison: %s", actorId.ToString().data(),
+ LOG_DEBUG_IC("ICP111", "dropped incoming handshake: %s poison: %s", actorId.ToString().data(),
poison ? "true" : "false");
if (poison) {
Send(actorId, new TEvents::TEvPoisonPill);
@@ -445,7 +445,7 @@ namespace NActors {
ICPROXY_PROFILED;
if (const TActorId& actorId = std::exchange(OutgoingHandshakeActor, TActorId())) {
- LOG_DEBUG_IC("ICP112", "dropped outgoing handshake: %s poison: %s", actorId.ToString().data(),
+ LOG_DEBUG_IC("ICP112", "dropped outgoing handshake: %s poison: %s", actorId.ToString().data(),
poison ? "true" : "false");
if (poison) {
Send(actorId, new TEvents::TEvPoisonPill);
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp
index b95c994598..b36f0a98dd 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp
+++ b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp
@@ -9,7 +9,7 @@
namespace NActors {
TInterconnectListenerTCP::TInterconnectListenerTCP(const TString& address, ui16 port, TInterconnectProxyCommon::TPtr common, const TMaybe<SOCKET>& socket)
: TActor(&TThis::Initial)
- , TInterconnectLoggingBase(Sprintf("ICListener: %s", SelfId().ToString().data()))
+ , TInterconnectLoggingBase(Sprintf("ICListener: %s", SelfId().ToString().data()))
, Address(address.c_str(), port)
, Listener(
socket
diff --git a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp
index 2ded7f9f53..51fb4bf9f5 100644
--- a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp
+++ b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp
@@ -60,7 +60,7 @@ namespace NActors {
Proxy->Common->Settings.MaxSerializedEventSize, Params);
LOG_INFO(*TlsActivationContext, NActorsServices::INTERCONNECT_STATUS, "[%u] session created", Proxy->PeerNodeId);
- SetPrefix(Sprintf("Session %s [node %" PRIu32 "]", SelfId().ToString().data(), Proxy->PeerNodeId));
+ SetPrefix(Sprintf("Session %s [node %" PRIu32 "]", SelfId().ToString().data(), Proxy->PeerNodeId));
SendUpdateToWhiteboard();
}
@@ -117,7 +117,7 @@ namespace NActors {
void TInterconnectSessionTCP::Forward(STATEFN_SIG) {
Proxy->ValidateEvent(ev, "Forward");
- LOG_DEBUG_IC_SESSION("ICS02", "send event from: %s to: %s", ev->Sender.ToString().data(), ev->Recipient.ToString().data());
+ LOG_DEBUG_IC_SESSION("ICS02", "send event from: %s to: %s", ev->Sender.ToString().data(), ev->Recipient.ToString().data());
++MessagesGot;
if (ev->Flags & IEventHandle::FlagSubscribeOnSession) {
@@ -185,7 +185,7 @@ namespace NActors {
}
void TInterconnectSessionTCP::Subscribe(STATEFN_SIG) {
- LOG_DEBUG_IC_SESSION("ICS04", "subscribe for session state for %s", ev->Sender.ToString().data());
+ LOG_DEBUG_IC_SESSION("ICS04", "subscribe for session state for %s", ev->Sender.ToString().data());
const auto [it, inserted] = Subscribers.emplace(ev->Sender, ev->Cookie);
if (inserted) {
Proxy->Metrics->IncSubscribersCount();
@@ -196,7 +196,7 @@ namespace NActors {
}
void TInterconnectSessionTCP::Unsubscribe(STATEFN_SIG) {
- LOG_DEBUG_IC_SESSION("ICS05", "unsubscribe for session state for %s", ev->Sender.ToString().data());
+ LOG_DEBUG_IC_SESSION("ICS05", "unsubscribe for session state for %s", ev->Sender.ToString().data());
Proxy->Metrics->SubSubscribersCount( Subscribers.erase(ev->Sender));
}
@@ -291,7 +291,7 @@ namespace NActors {
}
const ui64 serial = s.GetOrElse(Max<ui64>());
- Y_VERIFY(serial > LastConfirmed, "%s serial# %" PRIu64 " LastConfirmed# %" PRIu64, LogPrefix.data(), serial, LastConfirmed);
+ Y_VERIFY(serial > LastConfirmed, "%s serial# %" PRIu64 " LastConfirmed# %" PRIu64, LogPrefix.data(), serial, LastConfirmed);
LOG_DEBUG_IC_SESSION("ICS06", "rewind SendQueue size# %zu LastConfirmed# %" PRIu64 " SendQueuePos.Serial# %" PRIu64 "\n",
SendQueue.size(), LastConfirmed, serial);
@@ -619,7 +619,7 @@ namespace NActors {
const TString message = r == 0 ? "connection closed by peer"
: err ? err
: Sprintf("socket: %s", strerror(-r));
- LOG_NOTICE_NET(Proxy->PeerNodeId, "%s", message.data());
+ LOG_NOTICE_NET(Proxy->PeerNodeId, "%s", message.data());
if (written) {
Proxy->Metrics->AddTotalBytesWritten(written);
}
diff --git a/library/cpp/actors/interconnect/load.cpp b/library/cpp/actors/interconnect/load.cpp
index 2a8443da71..6ec989f241 100644
--- a/library/cpp/actors/interconnect/load.cpp
+++ b/library/cpp/actors/interconnect/load.cpp
@@ -186,7 +186,7 @@ namespace NInterconnect {
}
void GenerateMessages(const TActorContext& ctx) {
- while (InFly.size() < Params.InFlyMax && ctx.Now() >= NextMessageTimestamp) {
+ while (InFly.size() < Params.InFlyMax && ctx.Now() >= NextMessageTimestamp) {
// generate payload
const ui32 size = Params.SizeMin + RandomNumber(Params.SizeMax - Params.SizeMin + 1);
@@ -360,7 +360,7 @@ namespace NInterconnect {
std::sort(v.begin(), v.end());
for (double q : {0.5, 0.9, 0.99, 0.999, 0.9999, 1.0}) {
const size_t pos = q * (v.size() - 1);
- msg << Sprintf(" %.4f# %s", q, v[pos].ToString().data());
+ msg << Sprintf(" %.4f# %s", q, v[pos].ToString().data());
}
msg << "}";
} else {
@@ -373,7 +373,7 @@ namespace NInterconnect {
msg << " final";
}
- LOG_NOTICE(ctx, NActorsServices::INTERCONNECT_SPEED_TEST, "%s", msg.Str().data());
+ LOG_NOTICE(ctx, NActorsServices::INTERCONNECT_SPEED_TEST, "%s", msg.Str().data());
if (schedule) {
SchedulePublishResults(ctx);
diff --git a/library/cpp/actors/interconnect/packet.h b/library/cpp/actors/interconnect/packet.h
index 4ba50a2b5f..592f9d5623 100644
--- a/library/cpp/actors/interconnect/packet.h
+++ b/library/cpp/actors/interconnect/packet.h
@@ -260,7 +260,7 @@ public:
}
bool DropBufs(size_t& amount) {
- while (BufferIndex != Bufs.size()) {
+ while (BufferIndex != Bufs.size()) {
TConstIoVec& item = Bufs[BufferIndex];
// calculate number of bytes to the end in current buffer
const size_t remain = item.Size - FirstBufferOffset;
diff --git a/library/cpp/actors/interconnect/ut/lib/interrupter.h b/library/cpp/actors/interconnect/ut/lib/interrupter.h
index 48851de2c5..c645054fff 100644
--- a/library/cpp/actors/interconnect/ut/lib/interrupter.h
+++ b/library/cpp/actors/interconnect/ut/lib/interrupter.h
@@ -85,13 +85,13 @@ public:
, RejectingTraffic(false)
{
SetReuseAddressAndPort(ListenSocket);
- TSockAddrInet6 addr(Address.data(), listenPort);
+ TSockAddrInet6 addr(Address.data(), listenPort);
Y_VERIFY(ListenSocket.Bind(&addr) == 0);
Y_VERIFY(ListenSocket.Listen(5) == 0);
DelayTraffic = (Bandwidth == 0.0) ? false : true;
- ForwardAddrress.Reset(new TSockAddrInet6(Address.data(), ForwardPort));
+ ForwardAddrress.Reset(new TSockAddrInet6(Address.data(), ForwardPort));
const ui32 BufSize = DelayTraffic ? 4096 : 65536 + 4096;
Buf.resize(BufSize);
}
@@ -164,7 +164,7 @@ private:
updateTimout(it.ForwardConnection);
updateTimout(it.BackwardConnection);
}
- pollReadyCount = SocketPoller.WaitT(Events.data(), Events.size(), timeout);
+ pollReadyCount = SocketPoller.WaitT(Events.data(), Events.size(), timeout);
if (pollReadyCount > 0) {
for (int i = 0; i < pollReadyCount; i++) {
HandleSocketPollEvent(Events[i]);
@@ -182,7 +182,7 @@ private:
if (TInstant::Now() >= frontPackage.first) {
TInet6StreamSocket* sock = frontPackage.second.ForwardSocket;
if (sock) {
- sock->Send(frontPackage.second.Data.data(), frontPackage.second.Data.size());
+ sock->Send(frontPackage.second.Data.data(), frontPackage.second.Data.size());
}
conn.DelayedQueue.pop();
} else {
@@ -222,7 +222,7 @@ private:
TDirectedConnection* directedConnection = static_cast<TDirectedConnection*>(ev);
int recvSize = 0;
do {
- recvSize = directedConnection->Source->Recv(Buf.data(), Buf.size());
+ recvSize = directedConnection->Source->Recv(Buf.data(), Buf.size());
} while (recvSize == -EINTR);
if (recvSize > 0) {
@@ -234,10 +234,10 @@ private:
TDelayedPacket pkt;
pkt.ForwardSocket = directedConnection->Destination;
pkt.Data.resize(recvSize);
- memcpy(pkt.Data.data(), Buf.data(), recvSize);
+ memcpy(pkt.Data.data(), Buf.data(), recvSize);
directedConnection->DelayedQueue.emplace(directedConnection->Timestamp, std::move(pkt));
} else {
- directedConnection->Destination->Send(Buf.data(), recvSize);
+ directedConnection->Destination->Send(Buf.data(), recvSize);
}
} else {
SocketPoller.Unwait(static_cast<SOCKET>(*directedConnection->Source));
diff --git a/library/cpp/actors/testlib/test_runtime.cpp b/library/cpp/actors/testlib/test_runtime.cpp
index 6fa25b9965..39904527e8 100644
--- a/library/cpp/actors/testlib/test_runtime.cpp
+++ b/library/cpp/actors/testlib/test_runtime.cpp
@@ -1426,7 +1426,7 @@ namespace NActors {
ui32 dispatchCount = 0;
if (!edgeFilter.empty()) {
for (auto edgeActor : edgeFilter) {
- Y_VERIFY(EdgeActors.contains(edgeActor), "%s is not an edge actor", ToString(edgeActor).data());
+ Y_VERIFY(EdgeActors.contains(edgeActor), "%s is not an edge actor", ToString(edgeActor).data());
}
}
const TSet<TActorId>& edgeActors = edgeFilter.empty() ? EdgeActors : edgeFilter;
diff --git a/library/cpp/archive/directory_models_archive_reader.cpp b/library/cpp/archive/directory_models_archive_reader.cpp
index 6de9424c7c..f37fbdc613 100644
--- a/library/cpp/archive/directory_models_archive_reader.cpp
+++ b/library/cpp/archive/directory_models_archive_reader.cpp
@@ -1,5 +1,5 @@
#include "directory_models_archive_reader.h"
-#include "yarchive.h"
+#include "yarchive.h"
#include <util/folder/dirut.h>
#include <util/folder/filelist.h>
@@ -81,29 +81,29 @@ void TDirectoryModelsArchiveReader::LoadFilesAndSubdirs(const TString& subPath,
while ((file = fileList.Next()) != nullptr) {
TString key = JoinFsPaths(subPath, TString(file));
TString fullPath = JoinFsPaths(Path_, key);
- TBlob fileBlob;
+ TBlob fileBlob;
if (lockMemory) {
fileBlob = TBlob::LockedFromFile(fullPath);
} else {
fileBlob = TBlob::FromFile(fullPath);
}
- if (key.EndsWith(".archive")) {
- TArchiveReader reader(fileBlob);
- for (size_t i = 0, iEnd = reader.Count(); i < iEnd; ++i) {
- const TString archiveKey = reader.KeyByIndex(i);
- const TString normalizedPath = NormalizePath(JoinFsPaths(subPath, archiveKey.substr(1)));
- BlobByKey_.emplace(normalizedPath, reader.ObjectBlobByKey(archiveKey));
- Recs_.push_back(normalizedPath);
- }
- } else {
- const TString normalizedPath = NormalizePath(key);
+ if (key.EndsWith(".archive")) {
+ TArchiveReader reader(fileBlob);
+ for (size_t i = 0, iEnd = reader.Count(); i < iEnd; ++i) {
+ const TString archiveKey = reader.KeyByIndex(i);
+ const TString normalizedPath = NormalizePath(JoinFsPaths(subPath, archiveKey.substr(1)));
+ BlobByKey_.emplace(normalizedPath, reader.ObjectBlobByKey(archiveKey));
+ Recs_.push_back(normalizedPath);
+ }
+ } else {
+ const TString normalizedPath = NormalizePath(key);
if (lockMemory || ownBlobs) {
BlobByKey_.emplace(normalizedPath, fileBlob);
} else {
PathByKey_.emplace(normalizedPath, RealPath(fullPath));
}
- Recs_.push_back(normalizedPath);
- }
+ Recs_.push_back(normalizedPath);
+ }
}
TDirsList dirsList;
diff --git a/library/cpp/archive/yarchive.cpp b/library/cpp/archive/yarchive.cpp
index 1becc3e5da..1a885c1408 100644
--- a/library/cpp/archive/yarchive.cpp
+++ b/library/cpp/archive/yarchive.cpp
@@ -23,8 +23,8 @@ static inline void ESSave(IOutputStream* out, const T& t_in) {
}
static inline void ESSave(IOutputStream* out, const TString& s) {
- ESSave(out, (ui32) s.size());
- out->Write(s.data(), s.size());
+ ESSave(out, (ui32) s.size());
+ out->Write(s.data(), s.size());
}
template <class T>
@@ -339,7 +339,7 @@ public:
inline TBlob BlobByKey(const TStringBuf key) const {
const auto it = Dict_.find(key);
- Y_ENSURE(it != Dict_.end(), "key " << key.data() << " not found");
+ Y_ENSURE(it != Dict_.end(), "key " << key.data() << " not found");
const size_t off = it->second->Offset();
const size_t len = it->second->Length();
diff --git a/library/cpp/balloc/balloc.cpp b/library/cpp/balloc/balloc.cpp
index fab489db4c..5d1584273e 100644
--- a/library/cpp/balloc/balloc.cpp
+++ b/library/cpp/balloc/balloc.cpp
@@ -13,24 +13,24 @@ namespace NBalloc {
static Y_FORCE_INLINE void* Malloc(size_t size) {
TLS& ltls = tls;
- size = Align(size, sizeof(TAllocHeader));
+ size = Align(size, sizeof(TAllocHeader));
if (Y_UNLIKELY(ltls.Mode == Empty || ltls.Mode == ToBeEnabled)) {
- Init(ltls);
+ Init(ltls);
}
if (Y_LIKELY(ltls.Mode != Disabled)) {
- TAllocHeader* allocHeader = AllocateRaw(size, ALIVE_SIGNATURE);
- return allocHeader + 1;
+ TAllocHeader* allocHeader = AllocateRaw(size, ALIVE_SIGNATURE);
+ return allocHeader + 1;
} else {
// ltls.Mode == Disabled
const size_t extsize = size + sizeof(TAllocHeader);
- TAllocHeader* allocHeader = (TAllocHeader*)LibcMalloc(extsize);
+ TAllocHeader* allocHeader = (TAllocHeader*)LibcMalloc(extsize);
allocHeader->Encode(allocHeader, size, DISABLED_SIGNATURE);
- return allocHeader + 1;
+ return allocHeader + 1;
}
}
static void Y_FORCE_INLINE Free(void* ptr) {
- if (ptr == nullptr) {
+ if (ptr == nullptr) {
return;
}
TAllocHeader* allocHeader = ((TAllocHeader*)ptr) - 1;
@@ -38,9 +38,9 @@ namespace NBalloc {
const size_t signature = size & SIGNATURE_MASK;
if (Y_LIKELY(signature == ALIVE_SIGNATURE)) {
allocHeader->AllocSize = 0; // abort later on double free
-#ifdef DBG_FILL_MEMORY
- memset(ptr, 0xde, size - signature);
-#endif
+#ifdef DBG_FILL_MEMORY
+ memset(ptr, 0xde, size - signature);
+#endif
FreeRaw(allocHeader->Block);
if (NAllocStats::IsEnabled()) {
NAllocStats::DecThreadAllocStats(size - signature);
@@ -66,15 +66,15 @@ namespace NBalloc {
}
static void Y_FORCE_INLINE Disable() {
-#if defined(_musl_)
+#if defined(_musl_)
// just skip it
-#else
+#else
tls.Mode = Disabled;
-#endif
+#endif
}
static void Y_FORCE_INLINE Enable() {
- tls.Mode = ToBeEnabled;
+ tls.Mode = ToBeEnabled;
}
static bool Y_FORCE_INLINE IsDisabled() {
@@ -103,12 +103,12 @@ extern "C" void free(void* data) {
#endif
}
-#if defined(USE_INTELCC) || defined(_darwin_) || defined(_freebsd_) || defined(_STLPORT_VERSION)
-#define OP_THROWNOTHING noexcept
-#else
-#define OP_THROWNOTHING
-#endif
-
+#if defined(USE_INTELCC) || defined(_darwin_) || defined(_freebsd_) || defined(_STLPORT_VERSION)
+#define OP_THROWNOTHING noexcept
+#else
+#define OP_THROWNOTHING
+#endif
+
void* operator new(size_t size) {
#if defined(Y_COVER_PTR)
return malloc(size);
@@ -132,8 +132,8 @@ int posix_memalign(void** memptr, const size_t alignment, const size_t size) {
}
size_t bigSize = size + alignment - NBalloc::MINIMAL_ALIGNMENT;
void* res = NBalloc::Malloc(bigSize);
- void* alignedPtr = (void*)NBalloc::Align((size_t)res, alignment);
- if (alignedPtr != res) {
+ void* alignedPtr = (void*)NBalloc::Align((size_t)res, alignment);
+ if (alignedPtr != res) {
auto oldAllocHeader = (NBalloc::TAllocHeader*)res - 1;
auto newAllocHeader = (NBalloc::TAllocHeader*)alignedPtr - 1;
void* block = oldAllocHeader->Block;
@@ -144,7 +144,7 @@ int posix_memalign(void** memptr, const size_t alignment, const size_t size) {
#endif
}
-void* operator new(size_t size, const std::nothrow_t&) OP_THROWNOTHING {
+void* operator new(size_t size, const std::nothrow_t&) OP_THROWNOTHING {
#if defined(Y_COVER_PTR)
return malloc(size);
#else
@@ -152,7 +152,7 @@ void* operator new(size_t size, const std::nothrow_t&) OP_THROWNOTHING {
#endif
}
-void operator delete(void* p)OP_THROWNOTHING {
+void operator delete(void* p)OP_THROWNOTHING {
#if defined(Y_COVER_PTR)
free(p);
#else
@@ -160,7 +160,7 @@ void operator delete(void* p)OP_THROWNOTHING {
#endif
}
-void operator delete(void* p, const std::nothrow_t&)OP_THROWNOTHING {
+void operator delete(void* p, const std::nothrow_t&)OP_THROWNOTHING {
#if defined(Y_COVER_PTR)
free(p);
#else
@@ -176,7 +176,7 @@ void* operator new[](size_t size) {
#endif
}
-void* operator new[](size_t size, const std::nothrow_t&) OP_THROWNOTHING {
+void* operator new[](size_t size, const std::nothrow_t&) OP_THROWNOTHING {
#if defined(Y_COVER_PTR)
return malloc(size);
#else
@@ -184,7 +184,7 @@ void* operator new[](size_t size, const std::nothrow_t&) OP_THROWNOTHING {
#endif
}
-void operator delete[](void* p) OP_THROWNOTHING {
+void operator delete[](void* p) OP_THROWNOTHING {
#if defined(Y_COVER_PTR)
free(p);
#else
@@ -192,7 +192,7 @@ void operator delete[](void* p) OP_THROWNOTHING {
#endif
}
-void operator delete[](void* p, const std::nothrow_t&) OP_THROWNOTHING {
+void operator delete[](void* p, const std::nothrow_t&) OP_THROWNOTHING {
#if defined(Y_COVER_PTR)
free(p);
#else
diff --git a/library/cpp/balloc/optional/ya.make b/library/cpp/balloc/optional/ya.make
index f740fc0b7d..9993894b41 100644
--- a/library/cpp/balloc/optional/ya.make
+++ b/library/cpp/balloc/optional/ya.make
@@ -11,5 +11,5 @@ PEERDIR(
)
END()
-
-NEED_CHECK()
+
+NEED_CHECK()
diff --git a/library/cpp/balloc/ya.make b/library/cpp/balloc/ya.make
index d4457fbba9..6080917c18 100644
--- a/library/cpp/balloc/ya.make
+++ b/library/cpp/balloc/ya.make
@@ -6,7 +6,7 @@ OWNER(
)
NO_UTIL()
-NO_COMPILER_WARNINGS()
+NO_COMPILER_WARNINGS()
IF (OS_WINDOWS)
PEERDIR(
@@ -17,12 +17,12 @@ ELSE()
balloc.cpp
malloc-info.cpp
)
-
+
PEERDIR(
library/cpp/balloc/lib
)
ENDIF()
END()
-
-NEED_CHECK()
+
+NEED_CHECK()
diff --git a/library/cpp/binsaver/ut/binsaver_ut.cpp b/library/cpp/binsaver/ut/binsaver_ut.cpp
index 37eba5406f..0d6f7ad820 100644
--- a/library/cpp/binsaver/ut/binsaver_ut.cpp
+++ b/library/cpp/binsaver/ut/binsaver_ut.cpp
@@ -64,7 +64,7 @@ template <typename T, typename = std::enable_if_t<std::is_base_of<TCustomOuterSe
int operator&(T& s, IBinSaver& f);
static bool operator==(const TBlob& l, const TBlob& r) {
- return TStringBuf(l.AsCharPtr(), l.Size()) == TStringBuf(r.AsCharPtr(), r.Size());
+ return TStringBuf(l.AsCharPtr(), l.Size()) == TStringBuf(r.AsCharPtr(), r.Size());
}
Y_UNIT_TEST_SUITE(BinSaver){
diff --git a/library/cpp/bit_io/bitinout_ut.cpp b/library/cpp/bit_io/bitinout_ut.cpp
index 23a1ddf344..09e45310cc 100644
--- a/library/cpp/bit_io/bitinout_ut.cpp
+++ b/library/cpp/bit_io/bitinout_ut.cpp
@@ -147,60 +147,60 @@ private:
val = 0;
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_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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ 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_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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ 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_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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ 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_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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
UNIT_ASSERT_VALUES_EQUAL_C(in.GetOffset(), 4u, (rem + ": " + NBitIO::PrintBits(val)));
{
ui32 rt = 0;
in.ReadRandom(30, rt, 10, 20);
- UNIT_ASSERT_STRINGS_EQUAL(NBitIO::PrintBits(rt).data(), "00000000 00000000 00001111 01111100");
+ UNIT_ASSERT_STRINGS_EQUAL(NBitIO::PrintBits(rt).data(), "00000000 00000000 00001111 01111100");
}
val = 0;
- UNIT_ASSERT_C(in.Read(val, 3), (rem + ": " + NBitIO::PrintBits(val)).data());
+ 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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ 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_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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
val = 0;
- UNIT_ASSERT_C(in.Read(val, 3), (rem + ", " + ToString(__LINE__)).data());
+ 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_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
val = 0;
in.Read(val, 7);
@@ -237,9 +237,9 @@ private:
}
ui32 v = 0;
- UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
- UNIT_ASSERT_C(in.Read(v, 5), (rem + ", " + ToString(__LINE__)).data());
- UNIT_ASSERT_C(in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ UNIT_ASSERT_C(!in.Eof(), (rem + ", " + ToString(__LINE__)).data());
+ UNIT_ASSERT_C(in.Read(v, 5), (rem + ", " + ToString(__LINE__)).data());
+ UNIT_ASSERT_C(in.Eof(), (rem + ", " + ToString(__LINE__)).data());
}
void TestBitIO() {
@@ -251,7 +251,7 @@ private:
DoBitOutput(out, ToString(__LINE__));
}
- CheckBits(vec, NBitIO::BITS_REF, ToString(__LINE__).data());
+ CheckBits(vec, NBitIO::BITS_REF, ToString(__LINE__).data());
{
TBi in(vec);
@@ -266,7 +266,7 @@ private:
DoBitOutput(out, ToString(__LINE__));
}
- CheckBits(vec, NBitIO::BITS_REF, ToString(__LINE__).data());
+ CheckBits(vec, NBitIO::BITS_REF, ToString(__LINE__).data());
{
TBi in(vec);
diff --git a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp
index 042f031679..f2b16b2f7d 100644
--- a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp
+++ b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp
@@ -28,11 +28,11 @@ namespace {
}
inline size_t DoCompress(const TData& in, void* out) const {
- return CheckError(ZSTD_compress(out, DoMaxCompressedLength(in.size()), in.data(), in.size(), Level), "compress");
+ return CheckError(ZSTD_compress(out, DoMaxCompressedLength(in.size()), in.data(), in.size(), Level), "compress");
}
inline void DoDecompress(const TData& in, void* out, size_t dsize) const {
- const size_t res = CheckError(ZSTD_decompress(out, dsize, in.data(), in.size()), "decompress");
+ const size_t res = CheckError(ZSTD_decompress(out, dsize, in.data(), in.size()), "decompress");
if (res != dsize) {
ythrow TDecompressError(dsize, res);
diff --git a/library/cpp/blockcodecs/codecs_ut.cpp b/library/cpp/blockcodecs/codecs_ut.cpp
index bfe5a23690..6e02232d5d 100644
--- a/library/cpp/blockcodecs/codecs_ut.cpp
+++ b/library/cpp/blockcodecs/codecs_ut.cpp
@@ -12,7 +12,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) {
TBuffer Buffer(TStringBuf b) {
TBuffer bb;
- bb.Assign(b.data(), b.size());
+ bb.Assign(b.data(), b.size());
return bb;
}
@@ -39,7 +39,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) {
TCodecList lst = ListAllCodecs();
- for (size_t i = 0; i < lst.size(); ++i) {
+ for (size_t i = 0; i < lst.size(); ++i) {
const ICodec* c = Codec(lst[i]);
const auto h = MultiHash(c->Name(), i, 1);
@@ -48,7 +48,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) {
continue;
}
- for (size_t j = 0; j < datas.size(); ++j) {
+ for (size_t j = 0; j < datas.size(); ++j) {
const TBuffer& data = datas[j];
TString res;
@@ -151,13 +151,13 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) {
datas.push_back(TString(i, (char)(i % 128)));
}
- for (size_t i = 0; i < datas.size(); ++i) {
+ for (size_t i = 0; i < datas.size(); ++i) {
res += datas[i];
}
TCodecList lst = ListAllCodecs();
- for (size_t i = 0; i < lst.size(); ++i) {
+ for (size_t i = 0; i < lst.size(); ++i) {
TStringStream ss;
const ICodec* c = Codec(lst[i]);
@@ -171,7 +171,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) {
{
TCodedOutput out(&ss, c, 1234);
- for (size_t j = 0; j < datas.size(); ++j) {
+ for (size_t j = 0; j < datas.size(); ++j) {
out << datas[j];
}
diff --git a/library/cpp/blockcodecs/core/codecs.h b/library/cpp/blockcodecs/core/codecs.h
index 9c93c00274..d6606775e2 100644
--- a/library/cpp/blockcodecs/core/codecs.h
+++ b/library/cpp/blockcodecs/core/codecs.h
@@ -3,26 +3,26 @@
#include <util/generic/buffer.h>
#include <util/generic/strbuf.h>
#include <util/generic/string.h>
-#include <util/generic/typetraits.h>
+#include <util/generic/typetraits.h>
#include <util/generic/vector.h>
#include <util/generic/yexception.h>
namespace NBlockCodecs {
struct TData: public TStringBuf {
- inline TData() = default;
-
- Y_HAS_MEMBER(Data);
- Y_HAS_MEMBER(Size);
-
- template <class T, std::enable_if_t<!THasSize<T>::value || !THasData<T>::value, int> = 0>
- inline TData(const T& t)
- : TStringBuf((const char*)t.data(), t.size())
- {
+ inline TData() = default;
+
+ Y_HAS_MEMBER(Data);
+ Y_HAS_MEMBER(Size);
+
+ template <class T, std::enable_if_t<!THasSize<T>::value || !THasData<T>::value, int> = 0>
+ inline TData(const T& t)
+ : TStringBuf((const char*)t.data(), t.size())
+ {
}
- template <class T, std::enable_if_t<THasSize<T>::value && THasData<T>::value, int> = 0>
+ template <class T, std::enable_if_t<THasSize<T>::value && THasData<T>::value, int> = 0>
inline TData(const T& t)
- : TStringBuf((const char*)t.Data(), t.Size())
+ : TStringBuf((const char*)t.Data(), t.Size())
{
}
};
diff --git a/library/cpp/blockcodecs/core/common.h b/library/cpp/blockcodecs/core/common.h
index f05df4d334..5389f71726 100644
--- a/library/cpp/blockcodecs/core/common.h
+++ b/library/cpp/blockcodecs/core/common.h
@@ -36,23 +36,23 @@ namespace NBlockCodecs {
struct TNullCodec: public ICodec {
size_t DecompressedLength(const TData& in) const override {
- return in.size();
+ return in.size();
}
size_t MaxCompressedLength(const TData& in) const override {
- return in.size();
+ return in.size();
}
size_t Compress(const TData& in, void* out) const override {
- MemCopy((char*)out, in.data(), in.size());
+ MemCopy((char*)out, in.data(), in.size());
- return in.size();
+ return in.size();
}
size_t Decompress(const TData& in, void* out) const override {
- MemCopy((char*)out, in.data(), in.size());
+ MemCopy((char*)out, in.data(), in.size());
- return in.size();
+ return in.size();
}
TStringBuf Name() const noexcept override {
@@ -63,7 +63,7 @@ namespace NBlockCodecs {
template <class T>
struct TAddLengthCodec: public ICodec {
static inline void Check(const TData& in) {
- if (in.size() < sizeof(ui64)) {
+ if (in.size() < sizeof(ui64)) {
ythrow TDataError() << "too small input";
}
}
@@ -71,17 +71,17 @@ namespace NBlockCodecs {
size_t DecompressedLength(const TData& in) const override {
Check(in);
- return ReadUnaligned<ui64>(in.data());
+ return ReadUnaligned<ui64>(in.data());
}
size_t MaxCompressedLength(const TData& in) const override {
- return T::DoMaxCompressedLength(in.size()) + sizeof(ui64);
+ return T::DoMaxCompressedLength(in.size()) + sizeof(ui64);
}
size_t Compress(const TData& in, void* out) const override {
ui64* ptr = (ui64*)out;
- WriteUnaligned<ui64>(ptr, (ui64) in.size());
+ WriteUnaligned<ui64>(ptr, (ui64) in.size());
return Base()->DoCompress(!in ? TData(TStringBuf("")) : in, ptr + 1) + sizeof(*ptr);
}
@@ -89,7 +89,7 @@ namespace NBlockCodecs {
size_t Decompress(const TData& in, void* out) const override {
Check(in);
- const auto len = ReadUnaligned<ui64>(in.data());
+ const auto len = ReadUnaligned<ui64>(in.data());
if (!len)
return 0;
diff --git a/library/cpp/blockcodecs/core/stream.cpp b/library/cpp/blockcodecs/core/stream.cpp
index 4f7db3c32b..99f2f554ea 100644
--- a/library/cpp/blockcodecs/core/stream.cpp
+++ b/library/cpp/blockcodecs/core/stream.cpp
@@ -21,7 +21,7 @@ namespace {
inline TIds() {
const TCodecList lst = ListAllCodecs();
- for (size_t i = 0; i < lst.size(); ++i) {
+ for (size_t i = 0; i < lst.size(); ++i) {
const ICodec* c = Codec(lst[i]);
ByID[CodecID(c)] = c;
@@ -36,7 +36,7 @@ namespace {
ui32 Data;
} x;
- x.Data = MurmurHash<ui32>(name.data(), name.size());
+ x.Data = MurmurHash<ui32>(name.data(), name.size());
return x.Parts[1] ^ x.Parts[0];
}
diff --git a/library/cpp/cgiparam/cgiparam.cpp b/library/cpp/cgiparam/cgiparam.cpp
index f3277b8e4b..bd72f394bc 100644
--- a/library/cpp/cgiparam/cgiparam.cpp
+++ b/library/cpp/cgiparam/cgiparam.cpp
@@ -70,7 +70,7 @@ void TCgiParameters::JoinUnescaped(const TStringBuf key, char sep, TStringBuf va
for (++it; it != pair.second; erase(it++)) {
dst += sep;
- dst.AppendNoAlias(it->second.data(), it->second.size());
+ dst.AppendNoAlias(it->second.data(), it->second.size());
}
if (val.IsInited()) {
@@ -83,8 +83,8 @@ void TCgiParameters::JoinUnescaped(const TStringBuf key, char sep, TStringBuf va
static inline TString DoUnescape(const TStringBuf s) {
TString res;
- res.reserve(CgiUnescapeBufLen(s.size()));
- res.ReserveAndResize(CgiUnescape(res.begin(), s).size());
+ res.reserve(CgiUnescapeBufLen(s.size()));
+ res.ReserveAndResize(CgiUnescape(res.begin(), s).size());
return res;
}
@@ -144,7 +144,7 @@ TString TCgiParameters::Print() const {
res.reserve(PrintSize());
const char* end = Print(res.begin());
- res.ReserveAndResize(end - res.data());
+ res.ReserveAndResize(end - res.data());
return res;
}
@@ -173,7 +173,7 @@ size_t TCgiParameters::PrintSize() const noexcept {
size_t res = size(); // for '&'
for (const auto& i : *this) {
- res += CgiEscapeBufLen(i.first.size() + i.second.size()); // extra zero will be used for '='
+ res += CgiEscapeBufLen(i.first.size() + i.second.size()); // extra zero will be used for '='
}
return res;
@@ -200,7 +200,7 @@ TString TCgiParameters::QuotedPrint(const char* safe) const {
*ptr++ = '&';
}
- res.ReserveAndResize(ptr - res.data());
+ res.ReserveAndResize(ptr - res.data());
return res;
}
@@ -229,14 +229,14 @@ bool TCgiParameters::Has(const TStringBuf name, const TStringBuf value) const no
}
TQuickCgiParam::TQuickCgiParam(const TStringBuf cgiParamStr) {
- UnescapeBuf.reserve(CgiUnescapeBufLen(cgiParamStr.size()));
+ UnescapeBuf.reserve(CgiUnescapeBufLen(cgiParamStr.size()));
char* buf = UnescapeBuf.begin();
auto f = [this, &buf](const TStringBuf key, const TStringBuf val) {
TStringBuf name = CgiUnescapeBuf(buf, key);
- buf += name.size() + 1;
+ buf += name.size() + 1;
TStringBuf value = CgiUnescapeBuf(buf, val);
- buf += value.size() + 1;
+ buf += value.size() + 1;
Y_ASSERT(buf <= UnescapeBuf.begin() + UnescapeBuf.capacity() + 1 /*trailing zero*/);
emplace(name, value);
};
diff --git a/library/cpp/cgiparam/cgiparam.h b/library/cpp/cgiparam/cgiparam.h
index 87d1ab0ad4..25fa670c97 100644
--- a/library/cpp/cgiparam/cgiparam.h
+++ b/library/cpp/cgiparam/cgiparam.h
@@ -129,7 +129,7 @@ public:
return nullptr;
}
- return it->second.data();
+ return it->second.data();
}
};
diff --git a/library/cpp/charset/ci_string.cpp b/library/cpp/charset/ci_string.cpp
index 6097e40131..4ec5ea6ab9 100644
--- a/library/cpp/charset/ci_string.cpp
+++ b/library/cpp/charset/ci_string.cpp
@@ -37,5 +37,5 @@ size_t TCiString::hashVal(const char* s, size_t len, const CodePage& cp) {
template <>
void Out<TCiString>(IOutputStream& o, const TCiString& p) {
- o.Write(p.data(), p.size());
+ o.Write(p.data(), p.size());
}
diff --git a/library/cpp/charset/ci_string.h b/library/cpp/charset/ci_string.h
index edf24c1b6f..7ee4b5ab3e 100644
--- a/library/cpp/charset/ci_string.h
+++ b/library/cpp/charset/ci_string.h
@@ -248,14 +248,14 @@ struct TCIHash<const char*> {
template <>
struct TCIHash<TStringBuf> {
inline size_t operator()(const TStringBuf& s) const {
- return TCiString::hashVal(s.data(), s.size());
+ return TCiString::hashVal(s.data(), s.size());
}
};
template <>
struct TCIHash<TString> {
inline size_t operator()(const TString& s) const {
- return TCiString::hashVal(s.data(), s.size());
+ return TCiString::hashVal(s.data(), s.size());
}
};
diff --git a/library/cpp/charset/codepage.cpp b/library/cpp/charset/codepage.cpp
index 0431bef31b..c880c972c7 100644
--- a/library/cpp/charset/codepage.cpp
+++ b/library/cpp/charset/codepage.cpp
@@ -136,7 +136,7 @@ private:
private:
inline void AddNameWithCheck(const TString& name, ECharset code) {
if (Data.find(name.c_str()) == Data.end()) {
- Data.insert(TData::value_type(Pool.Append(name.data(), name.size() + 1), code));
+ Data.insert(TData::value_type(Pool.Append(name.data(), name.size() + 1), code));
} else {
Y_ASSERT(Data.find(name.c_str())->second == code);
}
@@ -294,12 +294,12 @@ void DoDecodeUnknownPlane(TxChar* str, TxChar*& ee, const ECharset enc) {
buf.push_back(Lo8(Lo16(*s)));
} else {
if (!buf.empty()) {
- if (RecodeToUnicode(enc, buf.data(), d, buf.size(), e - d, read, written) == RECODE_OK) {
+ if (RecodeToUnicode(enc, buf.data(), d, buf.size(), e - d, read, written) == RECODE_OK) {
Y_ASSERT(read == buf.size());
d += written;
} else { // just copying broken symbols
Y_ASSERT(buf.size() <= static_cast<size_t>(e - d));
- Copy(buf.data(), buf.size(), d);
+ Copy(buf.data(), buf.size(), d);
d += buf.size();
}
buf.clear();
@@ -413,7 +413,7 @@ static inline void NormalizeEncodingPrefixes(TString& enc) {
TString enccopy = enc.substr(preflen);
enccopy.prepend("latin");
const TLatinToIsoHash* latinhash = Singleton<TLatinToIsoHash>();
- TLatinToIsoHash::const_iterator it = latinhash->find(enccopy.data());
+ TLatinToIsoHash::const_iterator it = latinhash->find(enccopy.data());
if (it != latinhash->end())
enc.assign(it->second);
return;
diff --git a/library/cpp/charset/codepage_ut.cpp b/library/cpp/charset/codepage_ut.cpp
index c3ac3ac478..975b75376f 100644
--- a/library/cpp/charset/codepage_ut.cpp
+++ b/library/cpp/charset/codepage_ut.cpp
@@ -254,11 +254,11 @@ void TCodepageTest::TestUTFFromUnknownPlane() {
// test TChar version
// bytebuffer of len writtenbytes contains sampletext of len samplelen chars in utf8
TUtf16String wtr = CharToWide(TStringBuf(bytebuffer, writtenbytes), CODES_UNKNOWNPLANE);
- TChar* strend = wtr.begin() + wtr.size();
+ TChar* strend = wtr.begin() + wtr.size();
DecodeUnknownPlane(wtr.begin(), strend, CODES_UTF8);
- wtr.resize(strend - wtr.data(), 'Q');
- UNIT_ASSERT_VALUES_EQUAL(wtr.size(), samplelen);
- for (size_t i = 0; i < wtr.size(); ++i) {
+ wtr.resize(strend - wtr.data(), 'Q');
+ UNIT_ASSERT_VALUES_EQUAL(wtr.size(), samplelen);
+ for (size_t i = 0; i < wtr.size(); ++i) {
if (sampletext[i] >= 0x10000) {
UNIT_ASSERT_VALUES_EQUAL(wtr[i], ' ');
} else {
diff --git a/library/cpp/charset/recyr.hh b/library/cpp/charset/recyr.hh
index 5ec8734bcf..ffa04835a3 100644
--- a/library/cpp/charset/recyr.hh
+++ b/library/cpp/charset/recyr.hh
@@ -121,7 +121,7 @@ inline bool Recode(ECharset from, ECharset to, const TStringBuf& in, TString& ou
size_t inRead = 0;
size_t outWritten = 0;
- const RECODE_RESULT res = Recode(from, to, in.data(), out.begin(), inSize, outSize, inRead, outWritten);
+ 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="
diff --git a/library/cpp/charset/wide.h b/library/cpp/charset/wide.h
index 32d30e849e..cbbfe40b58 100644
--- a/library/cpp/charset/wide.h
+++ b/library/cpp/charset/wide.h
@@ -58,15 +58,15 @@ namespace NDetail {
template <typename TCharType>
inline TBasicStringBuf<TCharType> RecodeSingleByteChar(const TStringBuf src, TCharType* dst, const CodePage& cp) {
Y_ASSERT(cp.SingleByteCodepage());
- ::CharToWide(src.data(), src.size(), dst, cp);
+ ::CharToWide(src.data(), src.size(), dst, cp);
return TBasicStringBuf<TCharType>(dst, src.size());
}
template <typename TCharType>
inline TStringBuf RecodeSingleByteChar(const TBasicStringBuf<TCharType> src, char* dst, const CodePage& cp) {
Y_ASSERT(cp.SingleByteCodepage());
- ::WideToChar(src.data(), src.size(), dst, cp.CPEnum);
- return TStringBuf(dst, src.size());
+ ::WideToChar(src.data(), src.size(), dst, cp.CPEnum);
+ return TStringBuf(dst, src.size());
}
template <typename TCharType>
@@ -74,7 +74,7 @@ namespace NDetail {
Y_ASSERT(!NCodepagePrivate::NativeCodepage(encoding));
size_t read = 0;
size_t written = 0;
- ::NICONVPrivate::RecodeToUnicode(encoding, src.data(), dst, src.size(), src.size(), read, written);
+ ::NICONVPrivate::RecodeToUnicode(encoding, src.data(), dst, src.size(), src.size(), read, written);
return TBasicStringBuf<TCharType>(dst, written);
}
@@ -83,14 +83,14 @@ namespace NDetail {
Y_ASSERT(!NCodepagePrivate::NativeCodepage(encoding));
size_t read = 0;
size_t written = 0;
- ::NICONVPrivate::RecodeFromUnicode(encoding, src.data(), dst, src.size(), src.size() * 3, read, written);
+ ::NICONVPrivate::RecodeFromUnicode(encoding, src.data(), dst, src.size(), src.size() * 3, read, written);
return TStringBuf(dst, written);
}
template <typename TCharType>
inline TBasicStringBuf<TCharType> RecodeUtf8(const TStringBuf src, TCharType* dst) {
size_t len = 0;
- if (!::UTF8ToWide(src.data(), src.size(), dst, len))
+ if (!::UTF8ToWide(src.data(), src.size(), dst, len))
ythrow yexception() << "Invalid UTF8: \"" << src.SubStr(0, 50) << (src.size() > 50 ? "...\"" : "\"");
return TBasicStringBuf<TCharType>(dst, len);
}
@@ -98,7 +98,7 @@ namespace NDetail {
template <typename TCharType>
inline TStringBuf RecodeUtf8(const TBasicStringBuf<TCharType> src, char* dst) {
size_t len = 0;
- ::WideToUTF8(src.data(), src.size(), dst, len);
+ ::WideToUTF8(src.data(), src.size(), dst, len);
return TStringBuf(dst, len);
}
@@ -190,7 +190,7 @@ namespace NDetail {
// do re-coding
size_t written = 0;
- UTF8ToWide<true>(src.data(), src.size(), dstbuf, written);
+ UTF8ToWide<true>(src.data(), src.size(), dstbuf, written);
// truncate result back to proper size
TRecodeResultOps<TResult>::Truncate(dst, written);
diff --git a/library/cpp/charset/wide_ut.cpp b/library/cpp/charset/wide_ut.cpp
index 78947d51ba..742db7cf95 100644
--- a/library/cpp/charset/wide_ut.cpp
+++ b/library/cpp/charset/wide_ut.cpp
@@ -230,42 +230,42 @@ void TConversionTest::TestYandexEncoding() {
void TConversionTest::TestRecodeIntoString() {
TString sYandex(UnicodeText.size() * 4, 'x');
- const char* sdata = sYandex.data();
+ const char* sdata = sYandex.data();
TStringBuf sres = NDetail::Recode<wchar16>(UnicodeText, sYandex, CODES_YANDEX);
UNIT_ASSERT(sYandex == YandexText); // same content
- UNIT_ASSERT(sYandex.data() == sdata); // reserved buffer reused
- UNIT_ASSERT(sYandex.data() == sres.data()); // same buffer
- UNIT_ASSERT(sYandex.size() == sres.size()); // same size
+ UNIT_ASSERT(sYandex.data() == sdata); // reserved buffer reused
+ UNIT_ASSERT(sYandex.data() == sres.data()); // same buffer
+ UNIT_ASSERT(sYandex.size() == sres.size()); // same size
TEST_WCHAR32(sYandex, UnicodeText, CODES_YANDEX);
TUtf16String sUnicode;
sUnicode.reserve(YandexText.size() * 4);
- const wchar16* wdata = sUnicode.data();
+ const wchar16* wdata = sUnicode.data();
TWtringBuf wres = NDetail::Recode<char>(YandexText, sUnicode, CODES_YANDEX);
UNIT_ASSERT(sUnicode == UnicodeText); // same content
- UNIT_ASSERT(sUnicode.data() == wdata); // reserved buffer reused
- UNIT_ASSERT(sUnicode.data() == wres.data()); // same buffer
- UNIT_ASSERT(sUnicode.size() == wres.size()); // same size
+ UNIT_ASSERT(sUnicode.data() == wdata); // reserved buffer reused
+ UNIT_ASSERT(sUnicode.data() == wres.data()); // same buffer
+ UNIT_ASSERT(sUnicode.size() == wres.size()); // same size
TString sUtf8 = " ";
size_t scap = sUtf8.capacity();
sres = NDetail::Recode<wchar16>(UnicodeText, sUtf8, CODES_UTF8);
UNIT_ASSERT(sUtf8 == UTF8Text); // same content
UNIT_ASSERT(sUtf8.capacity() > scap); // increased buffer capacity (supplied was too small)
- UNIT_ASSERT(sUtf8.data() == sres.data()); // same buffer
- UNIT_ASSERT(sUtf8.size() == sres.size()); // same size
+ UNIT_ASSERT(sUtf8.data() == sres.data()); // same buffer
+ UNIT_ASSERT(sUtf8.size() == sres.size()); // same size
TEST_WCHAR32(sUtf8, UnicodeText, CODES_UTF8);
sUnicode.clear();
- wdata = sUnicode.data();
+ wdata = sUnicode.data();
TUtf16String copy = sUnicode; // increase ref-counter
wres = NDetail::Recode<char>(UTF8Text, sUnicode, CODES_UTF8);
UNIT_ASSERT(sUnicode == UnicodeText); // same content
#ifndef TSTRING_IS_STD_STRING
- UNIT_ASSERT(sUnicode.data() != wdata); // re-allocated (shared buffer supplied)
- UNIT_ASSERT(sUnicode.data() == wres.data()); // same buffer
+ UNIT_ASSERT(sUnicode.data() != wdata); // re-allocated (shared buffer supplied)
+ UNIT_ASSERT(sUnicode.data() == wres.data()); // same buffer
#endif
- UNIT_ASSERT(sUnicode.size() == wres.size()); // same content
+ UNIT_ASSERT(sUnicode.size() == wres.size()); // same content
}
static TString GenerateJunk(size_t seed) {
diff --git a/library/cpp/codecs/codecs.cpp b/library/cpp/codecs/codecs.cpp
index b17a3156d2..2bc9f8b909 100644
--- a/library/cpp/codecs/codecs.cpp
+++ b/library/cpp/codecs/codecs.cpp
@@ -12,9 +12,9 @@ namespace NCodecs {
Y_ENSURE_EX(p->AlreadyTrained(), TCodecException() << "untrained codec " << p->GetName());
const TString& n = p->GetName();
- Y_VERIFY(n.size() <= Max<ui16>());
- ::Save(out, (ui16)n.size());
- out->Write(n.data(), n.size());
+ Y_VERIFY(n.size() <= Max<ui16>());
+ ::Save(out, (ui16)n.size());
+ out->Write(n.data(), n.size());
p->Save(out);
}
@@ -38,7 +38,7 @@ namespace NCodecs {
}
TCodecPtr ICodec::RestoreFromString(TStringBuf s) {
- TMemoryInput minp{s.data(), s.size()};
+ TMemoryInput minp{s.data(), s.size()};
return Restore(&minp);
}
@@ -47,12 +47,12 @@ namespace NCodecs {
}
ui8 TPipelineCodec::Encode(TStringBuf in, TBuffer& out) const {
- size_t res = Traits().ApproximateSizeOnEncode(in.size());
+ size_t res = Traits().ApproximateSizeOnEncode(in.size());
out.Reserve(res);
out.Clear();
if (Pipeline.empty()) {
- out.Append(in.data(), in.size());
+ out.Append(in.data(), in.size());
return 0;
} else if (Pipeline.size() == 1) {
return Pipeline.front()->Encode(in, out);
@@ -68,7 +68,7 @@ namespace NCodecs {
if (it != Pipeline.begin()) {
tmp.Clear();
tmp.Swap(out);
- in = TStringBuf{tmp.data(), tmp.size()};
+ in = TStringBuf{tmp.data(), tmp.size()};
}
freelastbits = (*it)->Encode(in, out);
}
@@ -77,12 +77,12 @@ namespace NCodecs {
}
void TPipelineCodec::Decode(TStringBuf in, TBuffer& out) const {
- size_t res = Traits().ApproximateSizeOnDecode(in.size());
+ size_t res = Traits().ApproximateSizeOnDecode(in.size());
out.Reserve(res);
out.Clear();
if (Pipeline.empty()) {
- out.Append(in.data(), in.size());
+ out.Append(in.data(), in.size());
return;
} else if (Pipeline.size() == 1) {
Pipeline.front()->Decode(in, out);
@@ -98,7 +98,7 @@ namespace NCodecs {
if (it != Pipeline.rbegin()) {
tmp.Clear();
tmp.Swap(out);
- in = TStringBuf{tmp.data(), tmp.size()};
+ in = TStringBuf{tmp.data(), tmp.size()};
}
(*it)->Decode(in, out);
}
@@ -163,7 +163,7 @@ namespace NCodecs {
TStringBuf r;
while (in.NextRegion(r)) {
- trainingInput.emplace_back(r.data(), r.size());
+ trainingInput.emplace_back(r.data(), r.size());
}
TBuffer buff;
@@ -172,7 +172,7 @@ namespace NCodecs {
for (auto& bit : trainingInput) {
buff.Clear();
- it->Encode(TStringBuf{bit.data(), bit.size()}, buff);
+ it->Encode(TStringBuf{bit.data(), bit.size()}, buff);
buff.Swap(bit);
}
}
diff --git a/library/cpp/codecs/codecs.h b/library/cpp/codecs/codecs.h
index cc5e72b285..2197488589 100644
--- a/library/cpp/codecs/codecs.h
+++ b/library/cpp/codecs/codecs.h
@@ -144,7 +144,7 @@ namespace NCodecs {
class TBasicTrivialCodec: public ICodec {
public:
ui8 Encode(TStringBuf in, TBuffer& out) const override {
- out.Assign(in.data(), in.size());
+ out.Assign(in.data(), in.size());
return 0;
}
diff --git a/library/cpp/codecs/codecs_registry.cpp b/library/cpp/codecs/codecs_registry.cpp
index 17d07062ab..2536195d75 100644
--- a/library/cpp/codecs/codecs_registry.cpp
+++ b/library/cpp/codecs/codecs_registry.cpp
@@ -73,9 +73,9 @@ namespace NCodecs {
return new TSolarCodec();
}
if (name.EndsWith(TStringBuf("-a"))) {
- return MakeCodecImpl<TAdaptiveSolarCodec>(name, name.SubStr(TSolarCodec::MyName().size()).Chop(2));
+ return MakeCodecImpl<TAdaptiveSolarCodec>(name, name.SubStr(TSolarCodec::MyName().size()).Chop(2));
} else {
- return MakeCodecImpl<TSolarCodec>(name, name.SubStr(TSolarCodec::MyName().size()));
+ return MakeCodecImpl<TSolarCodec>(name, name.SubStr(TSolarCodec::MyName().size()));
}
}
diff --git a/library/cpp/codecs/delta_codec.h b/library/cpp/codecs/delta_codec.h
index 21325825e6..0f42d22ebb 100644
--- a/library/cpp/codecs/delta_codec.h
+++ b/library/cpp/codecs/delta_codec.h
@@ -80,11 +80,11 @@ namespace NCodecs {
ui8 Encode(TStringBuf s, TBuffer& b) const override {
b.Clear();
- if (s.empty()) {
+ if (s.empty()) {
return 0;
}
- b.Reserve(s.size());
+ b.Reserve(s.size());
TArrayRef<const T> tin{(const T*)s.data(), s.size() / sizeof(T)};
const T* it = tin.begin();
@@ -117,11 +117,11 @@ namespace NCodecs {
void Decode(TStringBuf s, TBuffer& b) const override {
b.Clear();
- if (s.empty()) {
+ if (s.empty()) {
return;
}
- b.Reserve(s.size());
+ b.Reserve(s.size());
TArrayRef<const T> tin{(const T*)s.data(), s.size() / sizeof(T)};
TDecoder dec;
diff --git a/library/cpp/codecs/greedy_dict/gd_builder.cpp b/library/cpp/codecs/greedy_dict/gd_builder.cpp
index 561bfbca01..ea4ec0d65c 100644
--- a/library/cpp/codecs/greedy_dict/gd_builder.cpp
+++ b/library/cpp/codecs/greedy_dict/gd_builder.cpp
@@ -116,7 +116,7 @@ namespace NGreedyDict {
ui32 TDictBuilder::Build(ui32 maxentries, ui32 maxiters, ui32 mindiff) {
size_t totalsz = 0;
for (auto it : Input)
- totalsz += it.size();
+ totalsz += it.size();
while (maxiters) {
maxiters--;
diff --git a/library/cpp/codecs/greedy_dict/gd_entry.cpp b/library/cpp/codecs/greedy_dict/gd_entry.cpp
index 2c315c7f7c..0580d14e1d 100644
--- a/library/cpp/codecs/greedy_dict/gd_entry.cpp
+++ b/library/cpp/codecs/greedy_dict/gd_entry.cpp
@@ -41,11 +41,11 @@ namespace NGreedyDict {
size_t len = 0;
ui32 val = 0;
- if (builder.FindLongestPrefix(suff.data(), suff.size(), &len, &val) && len) {
+ if (builder.FindLongestPrefix(suff.data(), suff.size(), &len, &val) && len) {
it->NearestPrefix = val;
}
- builder.Add(suff.data(), suff.size(), it->Number);
+ builder.Add(suff.data(), suff.size(), it->Number);
}
TBufferOutput bout;
diff --git a/library/cpp/codecs/greedy_dict/gd_entry.h b/library/cpp/codecs/greedy_dict/gd_entry.h
index 18b5be0e15..2ddbd7531b 100644
--- a/library/cpp/codecs/greedy_dict/gd_entry.h
+++ b/library/cpp/codecs/greedy_dict/gd_entry.h
@@ -34,7 +34,7 @@ namespace NGreedyDict {
return NearestPrefix != NoPrefix;
}
ui32 Len() const {
- return Str.size();
+ return Str.size();
}
static bool StrLess(const TEntry& a, const TEntry& b) {
@@ -58,14 +58,14 @@ namespace NGreedyDict {
void InitWithAlpha();
void Add(TStringBuf a) {
- push_back(TStringBuf(Pool.Append(a.data(), a.size()), a.size()));
+ push_back(TStringBuf(Pool.Append(a.data(), a.size()), a.size()));
}
void Add(TStringBuf a, TStringBuf b) {
- size_t sz = a.size() + b.size();
+ size_t sz = a.size() + b.size();
char* p = (char*)Pool.Allocate(sz);
- memcpy(p, a.data(), a.size());
- memcpy(p + a.size(), b.data(), b.size());
+ memcpy(p, a.data(), a.size());
+ memcpy(p + a.size(), b.data(), b.size());
push_back(TStringBuf(p, sz));
}
@@ -92,7 +92,7 @@ namespace NGreedyDict {
const TEntry& p = Get(e.NearestPrefix);
suff = e.Str;
- suff.Skip(p.Str.size());
+ suff.Skip(p.Str.size());
return &p;
}
diff --git a/library/cpp/codecs/huffman_codec.cpp b/library/cpp/codecs/huffman_codec.cpp
index 650fe7cdfd..a78c10d0b4 100644
--- a/library/cpp/codecs/huffman_codec.cpp
+++ b/library/cpp/codecs/huffman_codec.cpp
@@ -69,7 +69,7 @@ namespace NCodecs {
TStringBuf r;
while (in->NextRegion(r)) {
- for (ui64 i = 0; i < r.size(); ++i)
+ for (ui64 i = 0; i < r.size(); ++i)
++freqs[(ui8)r[i]];
}
@@ -249,11 +249,11 @@ namespace NCodecs {
ui8 Encode(TStringBuf in, TBuffer& out) const {
out.Clear();
- if (in.empty()) {
+ if (in.empty()) {
return 0;
}
- out.Reserve(in.size() * 2);
+ out.Reserve(in.size() * 2);
{
NBitIO::TBitOutputVector<TBuffer> bout(&out);
@@ -282,7 +282,7 @@ namespace NCodecs {
void Decode(TStringBuf in, TBuffer& out) const {
out.Clear();
- if (in.empty()) {
+ if (in.empty()) {
return;
}
@@ -293,9 +293,9 @@ namespace NCodecs {
// if data is uncompressed
if (!f) {
in.Skip(1);
- out.Append(in.data(), in.size());
+ out.Append(in.data(), in.size());
} else {
- out.Reserve(in.size() * 8);
+ out.Reserve(in.size() * 8);
if (Cache.Get()) {
Cache->Decode(bin, out);
diff --git a/library/cpp/codecs/pfor_codec.h b/library/cpp/codecs/pfor_codec.h
index d7d4bb8bf4..4b51eafa51 100644
--- a/library/cpp/codecs/pfor_codec.h
+++ b/library/cpp/codecs/pfor_codec.h
@@ -37,19 +37,19 @@ namespace NCodecs {
ui8 Encode(TStringBuf s, TBuffer& b) const override {
b.Clear();
- if (s.empty()) {
+ if (s.empty()) {
return 0;
}
- b.Reserve(2 * s.size() + b.Size());
+ b.Reserve(2 * s.size() + b.Size());
if (WithDelta) {
auto buffer = TBufferTlsCache::TlsInstance().Item();
TBuffer& db = buffer.Get();
db.Clear();
- db.Reserve(2 * s.size());
+ db.Reserve(2 * s.size());
DeltaCodec.Encode(s, db);
- s = TStringBuf{db.data(), db.size()};
+ s = TStringBuf{db.data(), db.size()};
}
TArrayRef<const TValue> tin{(const TValue*)s.data(), s.size() / sizeof(TValue)};
@@ -97,7 +97,7 @@ namespace NCodecs {
if (!optimalbits || BitsInT == optimalbits) {
b.Append((ui8)-1);
- b.Append(s.data(), s.size());
+ b.Append(s.data(), s.size());
return 0;
} else {
NBitIO::TBitOutputVector<TBuffer> bout(&b);
@@ -124,11 +124,11 @@ namespace NCodecs {
void Decode(TStringBuf s, TBuffer& b) const override {
b.Clear();
- if (s.empty()) {
+ if (s.empty()) {
return;
}
- b.Reserve(s.size() * sizeof(T) + b.Size());
+ b.Reserve(s.size() * sizeof(T) + b.Size());
ui64 isplain = 0;
ui64 hasexceptions = 0;
@@ -145,7 +145,7 @@ namespace NCodecs {
if (WithDelta) {
DeltaCodec.Decode(s, b);
} else {
- b.Append(s.data(), s.size());
+ b.Append(s.data(), s.size());
}
} else {
typename TDCodec::TDecoder decoder;
@@ -161,11 +161,11 @@ namespace NCodecs {
if (WithDelta) {
if (decoder.Decode(t)) {
TStringBuf r{(char*)&decoder.Result, sizeof(decoder.Result)};
- b.Append(r.data(), r.size());
+ b.Append(r.data(), r.size());
}
} else {
TStringBuf r{(char*)&t, sizeof(t)};
- b.Append(r.data(), r.size());
+ b.Append(r.data(), r.size());
}
}
}
diff --git a/library/cpp/codecs/sample.h b/library/cpp/codecs/sample.h
index 15f03afcc5..0b454c1a60 100644
--- a/library/cpp/codecs/sample.h
+++ b/library/cpp/codecs/sample.h
@@ -74,7 +74,7 @@ namespace NCodecs {
for (TIter iter = begin; iter != end; ++iter) {
if (sampleProb >= 1 || rng.GenRandReal1() < sampleProb) {
TStringBuf reg = getter(iter);
- result.emplace_back(reg.data(), reg.size());
+ result.emplace_back(reg.data(), reg.size());
}
}
Shuffle(result.begin(), result.end(), rng);
diff --git a/library/cpp/codecs/solar_codec.cpp b/library/cpp/codecs/solar_codec.cpp
index d0692fe2a4..d524eacd45 100644
--- a/library/cpp/codecs/solar_codec.cpp
+++ b/library/cpp/codecs/solar_codec.cpp
@@ -10,7 +10,7 @@
namespace NCodecs {
static inline ui32 Append(TBuffer& pool, TStringBuf data) {
- pool.Append(data.data(), data.size());
+ pool.Append(data.data(), data.size());
return pool.Size();
}
@@ -74,7 +74,7 @@ namespace NCodecs {
for (ui32 i = 1, sz = Decoder.size(); i < sz; ++i) {
TStringBuf s = DoDecode(i);
tmp2.push_back(std::make_pair(s, i - 1));
- Y_ENSURE(s.size() == (Decoder[i] - Decoder[i - 1]), "learning invariant failed");
+ Y_ENSURE(s.size() == (Decoder[i] - Decoder[i - 1]), "learning invariant failed");
}
Sort(tmp2.begin(), tmp2.end());
@@ -82,7 +82,7 @@ namespace NCodecs {
{
TEncoder::TBuilder builder(CTBF_PREFIX_GROUPED);
for (const auto& it : tmp2) {
- builder.Add(it.first.data(), it.first.size(), it.second);
+ builder.Add(it.first.data(), it.first.size(), it.second);
}
builder.Save(bout);
@@ -112,7 +112,7 @@ namespace NCodecs {
for (TEncoder::TConstIterator it = Encoder.Begin(); it != Encoder.End(); ++it) {
const TString& s = it.GetKey();
tmp.push_back(std::make_pair(it.GetValue(), !s ? TString("\0", 1) : s));
- poolsz += Max<ui32>(s.size(), 1);
+ poolsz += Max<ui32>(s.size(), 1);
}
Sort(tmp.begin(), tmp.end());
diff --git a/library/cpp/codecs/solar_codec.h b/library/cpp/codecs/solar_codec.h
index 7158ae7926..71d606a01c 100644
--- a/library/cpp/codecs/solar_codec.h
+++ b/library/cpp/codecs/solar_codec.h
@@ -31,7 +31,7 @@ namespace NCodecs {
if (!(b & 0x80)) {
value = result;
return;
- } else if (Y_UNLIKELY(r.empty())) {
+ } else if (Y_UNLIKELY(r.empty())) {
break;
}
}
@@ -54,7 +54,7 @@ namespace NCodecs {
ui32 result = static_cast<ui8>(r[0]);
r.Skip(1);
if (result >= 0x80) {
- Y_ENSURE_EX(!r.empty(), TCodecException() << "Bad data");
+ Y_ENSURE_EX(!r.empty(), TCodecException() << "Bad data");
result = ((result << 8) & 0x7FFF) | static_cast<ui8>(r[0]);
r.Skip(1);
}
@@ -140,8 +140,8 @@ namespace NCodecs {
template <class TTraits>
Y_FORCE_INLINE void EncodeImpl(TStringBuf r, TBuffer& b) const {
b.Clear();
- b.Reserve(r.size());
- while (!r.empty()) {
+ b.Reserve(r.size());
+ while (!r.empty()) {
size_t sz = 0;
ui32 val = (ui32)-1;
Encoder.FindLongestPrefix(r, &sz, &val);
@@ -153,12 +153,12 @@ namespace NCodecs {
template <class TTraits>
Y_FORCE_INLINE void DecodeImpl(TStringBuf r, TBuffer& b) const {
b.Clear();
- b.Reserve(r.size());
+ b.Reserve(r.size());
ui32 v = 0;
- while (!r.empty()) {
+ while (!r.empty()) {
TTraits::Read(r, v);
TStringBuf s = DoDecode(v);
- b.Append(s.data(), s.size());
+ b.Append(s.data(), s.size());
}
}
diff --git a/library/cpp/codecs/static/common.h b/library/cpp/codecs/static/common.h
index 211de2a27d..dec4046a21 100644
--- a/library/cpp/codecs/static/common.h
+++ b/library/cpp/codecs/static/common.h
@@ -8,7 +8,7 @@ namespace NCodecs {
template <class T>
ui64 DataSignature(const T& t) {
static_assert(!std::is_scalar<T>::value, "no scalars");
- return CityHash64(t.data(), t.size());
+ return CityHash64(t.data(), t.size());
}
template <class T>
@@ -24,7 +24,7 @@ namespace NCodecs {
T HexReadScalar(TStringBuf s) {
static_assert(std::is_scalar<T>::value, "scalars only");
T t = 0;
- HexDecode(s.data(), Min(s.size(), sizeof(T)), &t);
+ HexDecode(s.data(), Min(s.size(), sizeof(T)), &t);
t = BigToLittle(t);
return t;
}
diff --git a/library/cpp/codecs/static/static.cpp b/library/cpp/codecs/static/static.cpp
index 44a07dd73a..71d1f1cce0 100644
--- a/library/cpp/codecs/static/static.cpp
+++ b/library/cpp/codecs/static/static.cpp
@@ -31,10 +31,10 @@ namespace NCodecs {
TStaticCodecInfo LoadCodecInfoFromStream(IInputStream& in) {
{
TBuffer magic;
- magic.Resize(GetStaticCodecInfoMagic().size());
- Y_ENSURE_EX(in.Read(magic.Data(), GetStaticCodecInfoMagic().size()) == GetStaticCodecInfoMagic().size(),
+ magic.Resize(GetStaticCodecInfoMagic().size());
+ Y_ENSURE_EX(in.Read(magic.Data(), GetStaticCodecInfoMagic().size()) == GetStaticCodecInfoMagic().size(),
TCodecException() << "bad codec info");
- Y_ENSURE_EX(TStringBuf(magic.data(), magic.size()) == GetStaticCodecInfoMagic(),
+ Y_ENSURE_EX(TStringBuf(magic.data(), magic.size()) == GetStaticCodecInfoMagic(),
TCodecException() << "bad codec info");
}
@@ -45,7 +45,7 @@ namespace NCodecs {
Y_ENSURE_EX(hash == DataSignature(info), TCodecException() << "bad codec info");
TStaticCodecInfo result;
- Y_ENSURE_EX(result.ParseFromArray(info.data(), info.size()), TCodecException() << "bad codec info");
+ Y_ENSURE_EX(result.ParseFromArray(info.data(), info.size()), TCodecException() << "bad codec info");
return result;
}
@@ -57,7 +57,7 @@ namespace NCodecs {
}
TStaticCodecInfo LoadCodecInfoFromString(TStringBuf data) {
- TMemoryInput m{data.data(), data.size()};
+ TMemoryInput m{data.data(), data.size()};
return LoadCodecInfoFromStream(m);
}
@@ -81,7 +81,7 @@ namespace NCodecs {
TArchiveReader ar(TBlob::NoCopy(begin, size));
Y_VERIFY(ar.Count() == 1, "invalid number of entries");
auto blob = ar.ObjectBlobByKey(ar.KeyByIndex(0));
- return TString{blob.AsCharPtr(), blob.Size()};
+ return TString{blob.AsCharPtr(), blob.Size()};
}
TCodecConstPtr RestoreCodecFromCodecInfo(const TStaticCodecInfo& info) {
diff --git a/library/cpp/codecs/static/tools/common/ct_common.cpp b/library/cpp/codecs/static/tools/common/ct_common.cpp
index fe77691280..ded3a503ff 100644
--- a/library/cpp/codecs/static/tools/common/ct_common.cpp
+++ b/library/cpp/codecs/static/tools/common/ct_common.cpp
@@ -36,23 +36,23 @@ namespace NCodecs {
decodeBuffer.Clear();
stats.Records += 1;
- stats.RawSize += data.size();
+ stats.RawSize += data.size();
THPTimer timer;
c.Encode(data, encodeBuffer);
- stats.EncSize += encodeBuffer.size();
+ stats.EncSize += encodeBuffer.size();
stats.EncSeconds += timer.PassedReset();
- c.Decode(TStringBuf{encodeBuffer.data(), encodeBuffer.size()}, decodeBuffer);
+ c.Decode(TStringBuf{encodeBuffer.data(), encodeBuffer.size()}, decodeBuffer);
stats.DecSeconds += timer.PassedReset();
- Y_ENSURE(data == TStringBuf(decodeBuffer.data(), decodeBuffer.size()), "invalid encoding at record " << stats.Records);
+ Y_ENSURE(data == TStringBuf(decodeBuffer.data(), decodeBuffer.size()), "invalid encoding at record " << stats.Records);
}
return stats;
}
void ParseBlob(TVector<TString>& result, EDataStreamFormat fmt, const TBlob& blob) {
- TStringBuf bin(blob.AsCharPtr(), blob.Size());
+ TStringBuf bin(blob.AsCharPtr(), blob.Size());
TStringBuf line;
TString buffer;
while (bin.ReadLine(line)) {
@@ -63,7 +63,7 @@ namespace NCodecs {
if (!line) {
continue;
}
- result.emplace_back(line.data(), line.size());
+ result.emplace_back(line.data(), line.size());
}
}
diff --git a/library/cpp/codecs/static/ut/static_ut.cpp b/library/cpp/codecs/static/ut/static_ut.cpp
index 57e1e62887..ae11e2f2d2 100644
--- a/library/cpp/codecs/static/ut/static_ut.cpp
+++ b/library/cpp/codecs/static/ut/static_ut.cpp
@@ -12,10 +12,10 @@ private:
TBuffer outEnc, outDec;
NStaticCodecExample::Encode(outEnc, letov, dv);
- NStaticCodecExample::Decode(outDec, TStringBuf{outEnc.data(), outEnc.size()});
+ NStaticCodecExample::Decode(outDec, TStringBuf{outEnc.data(), outEnc.size()});
UNIT_ASSERT_VALUES_EQUAL(outEnc.Size(), expectedSize);
- UNIT_ASSERT_EQUAL(TStringBuf(outDec.data(), outDec.size()), letov);
+ UNIT_ASSERT_EQUAL(TStringBuf(outDec.data(), outDec.size()), letov);
}
void TestUsage() {
diff --git a/library/cpp/codecs/ut/codecs_ut.cpp b/library/cpp/codecs/ut/codecs_ut.cpp
index caf6089aef..6c8d6e10a7 100644
--- a/library/cpp/codecs/ut/codecs_ut.cpp
+++ b/library/cpp/codecs/ut/codecs_ut.cpp
@@ -877,9 +877,9 @@ private:
TStringOutput sout(s);
sout << codec << ": " << i << ", "
<< "\n";
- sout << HexEncode(learn.data(), learn.size()); //NEscJ::EscapeJ<true>(learn, sout);
+ sout << HexEncode(learn.data(), learn.size()); //NEscJ::EscapeJ<true>(learn, sout);
sout << " != \n";
- sout << HexEncode(test.data(), test.size()); //NEscJ::EscapeJ<true>(test, sout);
+ sout << HexEncode(test.data(), test.size()); //NEscJ::EscapeJ<true>(test, sout);
if (s.Size() > 1536) {
TString res = s.substr(0, 512);
@@ -891,7 +891,7 @@ private:
}
TStringBuf AsStrBuf(const TBuffer& b) {
- return TStringBuf(b.data(), b.size());
+ return TStringBuf(b.data(), b.size());
}
template <typename TCodec, bool testsaveload>
@@ -936,7 +936,7 @@ private:
c->Decode(AsStrBuf(out[i]), vecl);
UNIT_ASSERT_EQUAL_C(AsStrBuf(inlearn[i]), AsStrBuf(vecl),
- PrintError(TStringBuf(inlearn[i].data(), inlearn[i].size()),
+ PrintError(TStringBuf(inlearn[i].data(), inlearn[i].size()),
TStringBuf(vecl.data(), vecl.size()), c->GetName(), i));
}
}
@@ -960,7 +960,7 @@ private:
outsz += out.Size();
c->Decode(AsStrBuf(out), in1);
UNIT_ASSERT_EQUAL_C(AsStrBuf(in[i]), AsStrBuf(in1),
- PrintError(TStringBuf(in[i].data(), in[i].size()),
+ PrintError(TStringBuf(in[i].data(), in[i].size()),
TStringBuf(in1.data(), in1.size()), c->GetName(), i));
}
}
diff --git a/library/cpp/codecs/ut/tls_cache_ut.cpp b/library/cpp/codecs/ut/tls_cache_ut.cpp
index 8101af761f..1a30de92c9 100644
--- a/library/cpp/codecs/ut/tls_cache_ut.cpp
+++ b/library/cpp/codecs/ut/tls_cache_ut.cpp
@@ -3,7 +3,7 @@
Y_UNIT_TEST_SUITE(CodecsBufferFactoryTest){
void AssignToBuffer(TBuffer & buf, TStringBuf val){
- buf.Assign(val.data(), val.size());
+ buf.Assign(val.data(), val.size());
}
TStringBuf AsStringBuf(const TBuffer& b) {
diff --git a/library/cpp/codecs/zstd_dict_codec.cpp b/library/cpp/codecs/zstd_dict_codec.cpp
index c42a2879e6..a053f28e85 100644
--- a/library/cpp/codecs/zstd_dict_codec.cpp
+++ b/library/cpp/codecs/zstd_dict_codec.cpp
@@ -71,7 +71,7 @@ namespace NCodecs {
{
const size_t zeroSz = TSizePacker().MeasureLeaf(0);
Zero.Resize(zeroSz);
- TSizePacker().PackLeaf(Zero.data(), 0, zeroSz);
+ TSizePacker().PackLeaf(Zero.data(), 0, zeroSz);
}
ui32 GetCompressionLevel() const {
@@ -81,32 +81,32 @@ namespace NCodecs {
ui8 Encode(TStringBuf in, TBuffer& outbuf) const {
outbuf.Clear();
- if (in.empty()) {
+ if (in.empty()) {
return 0;
}
TSizePacker packer;
- const char* rawBeg = in.data();
- const size_t rawSz = in.size();
+ const char* rawBeg = in.data();
+ const size_t rawSz = in.size();
const size_t szSz = packer.MeasureLeaf(rawSz);
const size_t maxDatSz = ZSTD_compressBound(rawSz);
outbuf.Resize(szSz + maxDatSz);
- packer.PackLeaf(outbuf.data(), rawSz, szSz);
+ packer.PackLeaf(outbuf.data(), rawSz, szSz);
TCCtx ctx{CheckPtr(ZSTD_createCCtx(), __LOCATION__)};
const size_t resSz = CheckSize(ZSTD_compress_usingCDict(
- ctx.Get(), outbuf.data() + szSz, maxDatSz, rawBeg, rawSz, CDict.Get()),
+ ctx.Get(), outbuf.data() + szSz, maxDatSz, rawBeg, rawSz, CDict.Get()),
__LOCATION__);
if (resSz < rawSz) {
outbuf.Resize(resSz + szSz);
} else {
- outbuf.Resize(Zero.size() + rawSz);
- memcpy(outbuf.data(), Zero.data(), Zero.size());
- memcpy(outbuf.data() + Zero.size(), rawBeg, rawSz);
+ outbuf.Resize(Zero.size() + rawSz);
+ memcpy(outbuf.data(), Zero.data(), Zero.size());
+ memcpy(outbuf.data() + Zero.size(), rawBeg, rawSz);
}
return 0;
}
@@ -114,14 +114,14 @@ namespace NCodecs {
void Decode(TStringBuf in, TBuffer& outbuf) const {
outbuf.Clear();
- if (in.empty()) {
+ if (in.empty()) {
return;
}
TSizePacker packer;
- const char* rawBeg = in.data();
- size_t rawSz = in.size();
+ const char* rawBeg = in.data();
+ size_t rawSz = in.size();
const size_t szSz = packer.SkipLeaf(rawBeg);
ui64 datSz = 0;
@@ -132,14 +132,14 @@ namespace NCodecs {
if (!datSz) {
outbuf.Resize(rawSz);
- memcpy(outbuf.data(), rawBeg, rawSz);
+ memcpy(outbuf.data(), rawBeg, rawSz);
} else {
// size_t zSz = ZSTD_getDecompressedSize(rawBeg, rawSz);
// Y_ENSURE_EX(datSz == zSz, TCodecException() << datSz << " != " << zSz);
outbuf.Resize(datSz);
TDCtx ctx{CheckPtr(ZSTD_createDCtx(), __LOCATION__)};
CheckSize(ZSTD_decompress_usingDDict(
- ctx.Get(), outbuf.data(), outbuf.size(), rawBeg, rawSz, DDict.Get()),
+ ctx.Get(), outbuf.data(), outbuf.size(), rawBeg, rawSz, DDict.Get()),
__LOCATION__);
outbuf.Resize(datSz);
}
@@ -155,8 +155,8 @@ namespace NCodecs {
if (!r) {
continue;
}
- data.Append(r.data(), r.size());
- lens.push_back(r.size());
+ data.Append(r.data(), r.size());
+ lens.push_back(r.size());
}
ZDICT_legacy_params_t params;
@@ -193,8 +193,8 @@ namespace NCodecs {
}
void InitContexts() {
- CDict.Reset(CheckPtr(ZSTD_createCDict(Dict.data(), Dict.size(), CompressionLevel), __LOCATION__));
- DDict.Reset(CheckPtr(ZSTD_createDDict(Dict.data(), Dict.size()), __LOCATION__));
+ CDict.Reset(CheckPtr(ZSTD_createCDict(Dict.data(), Dict.size(), CompressionLevel), __LOCATION__));
+ DDict.Reset(CheckPtr(ZSTD_createDDict(Dict.data(), Dict.size()), __LOCATION__));
}
static size_t CheckSize(size_t sz, TSourceLocation loc) {
diff --git a/library/cpp/compproto/compproto_ut.cpp b/library/cpp/compproto/compproto_ut.cpp
index 9393be967a..22565c09a6 100644
--- a/library/cpp/compproto/compproto_ut.cpp
+++ b/library/cpp/compproto/compproto_ut.cpp
@@ -84,7 +84,7 @@ void TestWithParams(const TString& metainfo, const ECompMode mode, const TTestPa
ui8* dataEnd = pageStart + busyPages * PAGESIZEX;
ProtectMemory(dataEnd, PAGESIZEX, PM_NONE);
// memory copying should be performed without any problems
- memcpy(dataStart, buffer.Out.data(), byteSize);
+ memcpy(dataStart, buffer.Out.data(), byteSize);
ui64 position = 0;
TMetaIterator<TDecompressor> instance;
diff --git a/library/cpp/comptable/comptable.cpp b/library/cpp/comptable/comptable.cpp
index 8a92d4d1aa..add15d8cec 100644
--- a/library/cpp/comptable/comptable.cpp
+++ b/library/cpp/comptable/comptable.cpp
@@ -96,11 +96,11 @@ namespace NCompTable {
size_t i = 0;
iterator.Visit(ui32(data.size()));
for (; i + 3 < data.size(); i += 4) {
- iterator.Visit(reinterpret_cast<const ui32*>(data.data() + i)[0]);
+ iterator.Visit(reinterpret_cast<const ui32*>(data.data() + i)[0]);
}
if (i != data.size()) {
ui32 buffer[1] = {0};
- memcpy(buffer, data.data() + i, data.size() - i);
+ memcpy(buffer, data.data() + i, data.size() - i);
iterator.Visit(buffer[0]);
}
}
@@ -317,8 +317,8 @@ namespace NCompTable {
if (dataBuf.empty()) {
return;
}
- const ui8* src = reinterpret_cast<const ui8*>(dataBuf.data());
- ui64 border = dataBuf.size();
+ const ui8* src = reinterpret_cast<const ui8*>(dataBuf.data());
+ ui64 border = dataBuf.size();
ui32 len = 0;
ui32 nullTerm = 1;
if (HQ) {
diff --git a/library/cpp/comptable/usage/usage.cpp b/library/cpp/comptable/usage/usage.cpp
index 9997c83686..7670d15913 100644
--- a/library/cpp/comptable/usage/usage.cpp
+++ b/library/cpp/comptable/usage/usage.cpp
@@ -26,7 +26,7 @@ void DoTest(const TCompressorTable& table, const TVector<TString>& lines) {
compSize += compressed.size();
TStringBuf in(compressed.data(), compressed.size());
deCompressor.Decompress(in, &decompressed);
- if (decompressed.size() != line.size() || memcmp(decompressed.data(), line.data(), decompressed.size())) {
+ if (decompressed.size() != line.size() || memcmp(decompressed.data(), line.data(), decompressed.size())) {
Cout << i << "\n";
Cout << line << "\n"
<< TString(decompressed.data(), decompressed.size()) << "\n";
diff --git a/library/cpp/comptable/ut/comptable_ut.cpp b/library/cpp/comptable/ut/comptable_ut.cpp
index 5901d0246f..cd5b507176 100644
--- a/library/cpp/comptable/ut/comptable_ut.cpp
+++ b/library/cpp/comptable/ut/comptable_ut.cpp
@@ -28,7 +28,7 @@ void DoTest(const TCompressorTable& table, const TVector<TString>& lines) {
compSize += compressed.size();
TStringBuf in(compressed.data(), compressed.size());
deCompressor.Decompress(in, &decompressed);
- UNIT_ASSERT(decompressed.size() == line.size() && memcmp(decompressed.data(), line.data(), decompressed.size()) == 0);
+ UNIT_ASSERT(decompressed.size() == line.size() && memcmp(decompressed.data(), line.data(), decompressed.size()) == 0);
}
UNIT_ASSERT_EQUAL(origSize, 45491584);
if (HQ) {
diff --git a/library/cpp/containers/comptrie/chunked_helpers_trie.h b/library/cpp/containers/comptrie/chunked_helpers_trie.h
index cfa35f5ba2..c95cee2322 100644
--- a/library/cpp/containers/comptrie/chunked_helpers_trie.h
+++ b/library/cpp/containers/comptrie/chunked_helpers_trie.h
@@ -36,7 +36,7 @@ public:
void Add(const char* key, size_t keylen) {
Builder.Add(key, keylen, 0);
- assert(Has(((TString)key).substr(0, keylen).data()));
+ assert(Has(((TString)key).substr(0, keylen).data()));
}
void Add(const char* key) {
@@ -195,7 +195,7 @@ public:
Sort(Values.begin(), Values.end());
TTrieMapWriter<T, true> writer;
for (typename TValues::const_iterator toValue = Values.begin(); toValue != Values.end(); ++toValue)
- writer.Add(toValue->first.data(), toValue->second);
+ writer.Add(toValue->first.data(), toValue->second);
writer.Save(out);
}
diff --git a/library/cpp/containers/comptrie/comptrie_builder.h b/library/cpp/containers/comptrie/comptrie_builder.h
index cf7d2e39a3..bc7068faa0 100644
--- a/library/cpp/containers/comptrie/comptrie_builder.h
+++ b/library/cpp/containers/comptrie/comptrie_builder.h
@@ -52,7 +52,7 @@ public:
bool Add(const TSymbol* key, size_t keylen, const TData& value);
bool Add(const TKeyBuf& key, const TData& value) {
- return Add(key.data(), key.size(), value);
+ return Add(key.data(), key.size(), value);
}
// add already serialized data
@@ -63,22 +63,22 @@ public:
bool AddSubtreeInFile(const TSymbol* key, size_t keylen, const TString& filename);
bool AddSubtreeInFile(const TKeyBuf& key, const TString& filename) {
- return AddSubtreeInFile(key.data(), key.size(), filename);
+ return AddSubtreeInFile(key.data(), key.size(), filename);
}
bool AddSubtreeInBuffer(const TSymbol* key, size_t keylen, TArrayWithSizeHolder<char>&& buffer);
bool AddSubtreeInBuffer(const TKeyBuf& key, TArrayWithSizeHolder<char>&& buffer) {
- return AddSubtreeInBuffer(key.data(), key.size(), std::move(buffer));
+ return AddSubtreeInBuffer(key.data(), key.size(), std::move(buffer));
}
bool Find(const TSymbol* key, size_t keylen, TData* value) const;
bool Find(const TKeyBuf& key, TData* value = nullptr) const {
- return Find(key.data(), key.size(), value);
+ return Find(key.data(), key.size(), value);
}
bool FindLongestPrefix(const TSymbol* key, size_t keylen, size_t* prefixLen, TData* value = nullptr) const;
bool FindLongestPrefix(const TKeyBuf& key, size_t* prefixLen, TData* value = nullptr) const {
- return FindLongestPrefix(key.data(), key.size(), prefixLen, value);
+ return FindLongestPrefix(key.data(), key.size(), prefixLen, value);
}
size_t Save(IOutputStream& os) const;
diff --git a/library/cpp/containers/comptrie/comptrie_builder.inl b/library/cpp/containers/comptrie/comptrie_builder.inl
index f273fa6571..350938ea65 100644
--- a/library/cpp/containers/comptrie/comptrie_builder.inl
+++ b/library/cpp/containers/comptrie/comptrie_builder.inl
@@ -232,7 +232,7 @@ public:
}
TCompactTrie<char, D, S> trie(Buffer.Get(), Buffer.Size(), packer);
- result = trie.Find(key.data(), key.size(), value);
+ result = trie.Find(key.data(), key.size(), value);
return nullptr;
}
@@ -245,7 +245,7 @@ public:
TCompactTrie<char, D, S> trie(Buffer.Get(), Buffer.Size(), packer);
size_t prefixLen = 0;
- result = trie.FindLongestPrefix(key.data(), key.size(), &prefixLen, value);
+ result = trie.FindLongestPrefix(key.data(), key.size(), &prefixLen, value);
key = key.SubStr(prefixLen);
return nullptr;
@@ -298,7 +298,7 @@ public:
}
TCompactTrie<char, D, S> trie(TBlob::FromFile(Data->FileName), packer);
- result = trie.Find(key.data(), key.size(), value);
+ result = trie.Find(key.data(), key.size(), value);
return nullptr;
}
@@ -310,7 +310,7 @@ public:
TCompactTrie<char, D, S> trie(TBlob::FromFile(Data->FileName), packer);
size_t prefixLen = 0;
- result = trie.FindLongestPrefix(key.data(), key.size(), &prefixLen, value);
+ result = trie.FindLongestPrefix(key.data(), key.size(), &prefixLen, value);
key = key.SubStr(prefixLen);
return nullptr;
@@ -735,7 +735,7 @@ bool TCompactTrieBuilder<T, D, S>::TCompactTrieBuilderImpl::FindLongestPrefixImp
endResult = true;
}
if (endResult && prefixLen)
- *prefixLen = keyTail ? key.size() - keyTail.size() : key.size();
+ *prefixLen = keyTail ? key.size() - keyTail.size() : key.size();
return endResult;
}
@@ -1021,11 +1021,11 @@ const typename TCompactTrieBuilder<T, D, S>::TCompactTrieBuilderImpl::TNode*
if (it != this->end()) {
const char* const arcLabel = it->Label.AsCharPtr();
const size_t arcLabelLen = it->Label.Length();
- if (key.size() >= arcLabelLen && memcmp(key.data(), arcLabel, arcLabelLen) == 0) {
+ if (key.size() >= arcLabelLen && memcmp(key.data(), arcLabel, arcLabelLen) == 0) {
const TStringBuf srcKey = key;
key = key.SubStr(arcLabelLen);
const TNode* const node = it->Node;
- if (srcKey.size() == arcLabelLen) {
+ if (srcKey.size() == arcLabelLen) {
// unpack value of it->Node, if it has value
if (!node->IsFinal())
return nullptr;
diff --git a/library/cpp/containers/comptrie/comptrie_trie.h b/library/cpp/containers/comptrie/comptrie_trie.h
index 40ec1e52b3..8f18b66d2a 100644
--- a/library/cpp/containers/comptrie/comptrie_trie.h
+++ b/library/cpp/containers/comptrie/comptrie_trie.h
@@ -82,7 +82,7 @@ public:
bool Find(const TSymbol* key, size_t keylen, TData* value = nullptr) const;
bool Find(const TKeyBuf& key, TData* value = nullptr) const {
- return Find(key.data(), key.size(), value);
+ return Find(key.data(), key.size(), value);
}
TData Get(const TSymbol* key, size_t keylen) const {
@@ -92,11 +92,11 @@ public:
return value;
}
TData Get(const TKeyBuf& key) const {
- return Get(key.data(), key.size());
+ return Get(key.data(), key.size());
}
TData GetDefault(const TKeyBuf& key, const TData& def) const {
TData value;
- if (!Find(key.data(), key.size(), &value))
+ if (!Find(key.data(), key.size(), &value))
return def;
else
return value;
@@ -120,21 +120,21 @@ public:
void FindPhrases(const TSymbol* key, size_t keylen, TPhraseMatchVector& matches, TSymbol separator = TSymbol(' ')) const;
void FindPhrases(const TKeyBuf& key, TPhraseMatchVector& matches, TSymbol separator = TSymbol(' ')) const {
- return FindPhrases(key.data(), key.size(), matches, separator);
+ return FindPhrases(key.data(), key.size(), matches, separator);
}
bool FindLongestPrefix(const TSymbol* key, size_t keylen, size_t* prefixLen, TData* value = nullptr, bool* hasNext = nullptr) const;
bool FindLongestPrefix(const TKeyBuf& key, size_t* prefixLen, TData* value = nullptr, bool* hasNext = nullptr) const {
- return FindLongestPrefix(key.data(), key.size(), prefixLen, value, hasNext);
+ return FindLongestPrefix(key.data(), key.size(), prefixLen, value, hasNext);
}
// Return trie, containing all tails for the given key
inline TCompactTrie<T, D, S> FindTails(const TSymbol* key, size_t keylen) const;
TCompactTrie<T, D, S> FindTails(const TKeyBuf& key) const {
- return FindTails(key.data(), key.size());
+ return FindTails(key.data(), key.size());
}
bool FindTails(const TSymbol* key, size_t keylen, TCompactTrie<T, D, S>& res) const;
bool FindTails(const TKeyBuf& key, TCompactTrie<T, D, S>& res) const {
- return FindTails(key.data(), key.size(), res);
+ return FindTails(key.data(), key.size(), res);
}
// same as FindTails(&key, 1), a bit faster
@@ -455,7 +455,7 @@ template <class T, class D, class S>
void TCompactTrie<T, D, S>::Print(IOutputStream& os) {
typedef typename ::TCompactTrieKeySelector<T>::TKeyBuf TSBuffer;
for (TConstIterator it = Begin(); it != End(); ++it) {
- os << TSBuffer((*it).first.data(), (*it).first.size()) << "\t" << (*it).second << Endl;
+ os << TSBuffer((*it).first.data(), (*it).first.size()) << "\t" << (*it).second << Endl;
}
}
diff --git a/library/cpp/containers/comptrie/comptrie_ut.cpp b/library/cpp/containers/comptrie/comptrie_ut.cpp
index 74bee09b5d..8b405d9b40 100644
--- a/library/cpp/containers/comptrie/comptrie_ut.cpp
+++ b/library/cpp/containers/comptrie/comptrie_ut.cpp
@@ -404,7 +404,7 @@ void TCompactTrieTest::CheckData(const char* data, size_t datalen) {
typename TCompactTrie<T>::TKey key = MakeWideKey<T>(testkey);
ui64 value = 0;
size_t prefixLen = 0;
- UNIT_ASSERT(trie.FindLongestPrefix(key.data(), testkey.length() - 1, &prefixLen, &value));
+ UNIT_ASSERT(trie.FindLongestPrefix(key.data(), testkey.length() - 1, &prefixLen, &value));
UNIT_ASSERT_EQUAL(prefixLen, 3);
UNIT_ASSERT_EQUAL(6, value);
@@ -671,9 +671,9 @@ void TCompactTrieTest::TestRandom(const size_t n, const size_t maxKeySize) {
if (key != EMPTY_KEY && keys.find(key) == keys.end()) {
const typename T::TData val = T::Data(key);
keys[key] = val;
- UNIT_ASSERT_C(!builder.Find(key.data(), key.size(), &dummy), "key = " << HexEncode(TString(key)));
- builder.Add(key.data(), key.size(), val);
- UNIT_ASSERT_C(builder.Find(key.data(), key.size(), &dummy), "key = " << HexEncode(TString(key)));
+ UNIT_ASSERT_C(!builder.Find(key.data(), key.size(), &dummy), "key = " << HexEncode(TString(key)));
+ builder.Add(key.data(), key.size(), val);
+ UNIT_ASSERT_C(builder.Find(key.data(), key.size(), &dummy), "key = " << HexEncode(TString(key)));
UNIT_ASSERT(dummy == val);
}
}
@@ -737,7 +737,7 @@ void TCompactTrieTest::TestFindTailsImpl(const TString& prefix) {
for (auto& i : SampleData) {
TString temp = i;
ui64 val = temp.size() * 2;
- builder.Add(temp.data(), temp.size(), val);
+ builder.Add(temp.data(), temp.size(), val);
if (temp.StartsWith(prefix)) {
input[temp.substr(prefix.size())] = val;
}
@@ -749,13 +749,13 @@ void TCompactTrieTest::TestFindTailsImpl(const TString& prefix) {
size_t len = builder.Save(stream);
TTrie trie(stream.Buffer().Data(), len);
- TTrie subtrie = trie.FindTails(prefix.data(), prefix.size());
+ TTrie subtrie = trie.FindTails(prefix.data(), prefix.size());
TMap<TString, ui64> output;
for (TTrie::TConstIterator i = subtrie.Begin(), mi = subtrie.End(); i != mi; ++i) {
TTrie::TValueType val = *i;
- output[TString(val.first.data(), val.first.size())] = val.second;
+ output[TString(val.first.data(), val.first.size())] = val.second;
}
UNIT_ASSERT(input.size() == output.size());
UNIT_ASSERT(input == output);
@@ -764,12 +764,12 @@ void TCompactTrieTest::TestFindTailsImpl(const TString& prefix) {
CompactTrieMinimize<TTrie::TPacker>(buftmp, stream.Buffer().Data(), len, false);
TTrie trieMin(buftmp.Buffer().Data(), buftmp.Buffer().Size());
- subtrie = trieMin.FindTails(prefix.data(), prefix.size());
+ subtrie = trieMin.FindTails(prefix.data(), prefix.size());
output.clear();
for (TTrie::TConstIterator i = subtrie.Begin(), mi = subtrie.End(); i != mi; ++i) {
TTrie::TValueType val = *i;
- output[TString(val.first.data(), val.first.size())] = val.second;
+ output[TString(val.first.data(), val.first.size())] = val.second;
}
UNIT_ASSERT(input.size() == output.size());
UNIT_ASSERT(input == output);
@@ -878,9 +878,9 @@ void TCompactTrieTest::TestMergeFromFile() {
UNIT_ASSERT_VALUES_EQUAL(113u, trie.Get("com.google"));
UNIT_ASSERT_VALUES_EQUAL(114u, trie.Get("com.yahoo"));
- unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMerge-res").data());
- unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMerge-com").data());
- unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMerge-ru").data());
+ unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMerge-res").data());
+ unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMerge-com").data());
+ unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMerge-ru").data());
}
void TCompactTrieTest::TestMergeFromBuffer() {
@@ -926,7 +926,7 @@ void TCompactTrieTest::TestMergeFromBuffer() {
UNIT_ASSERT_VALUES_EQUAL(2u, trie.Get("com.bbbbb"));
UNIT_ASSERT_VALUES_EQUAL(3u, trie.Get("com.ccccc"));
- unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMergeFromBuffer-res").data());
+ unlink((GetSystemTempDir() + "/TCompactTrieTest-TestMergeFromBuffer-res").data());
}
void TCompactTrieTest::TestUnique() {
@@ -1168,7 +1168,7 @@ void TCompactTrieTest::TestTrieWithContainers(const TVector<TUtf16String>& keys,
CheckEquality<typename TContainer::value_type>(*p, *p1);
}
- unlink(fileName.data());
+ unlink(fileName.data());
}
template <>
@@ -1190,7 +1190,7 @@ void TCompactTrieTest::TestTrieWithContainers<std::pair<TUtf16String, TVector<i6
CheckEquality<TContainer::second_type>(value.second, sampleData[i].second);
}
- unlink(fileName.data());
+ unlink(fileName.data());
}
void TCompactTrieTest::TestTrieForVectorInt64() {
@@ -1525,7 +1525,7 @@ void TCompactTrieTest::TestBuilderFindLongestPrefix(size_t keysCount, double bra
size_t prefixSize = 0xfcfcfc;
TString value = "abcd";
const bool expectedResult = hasEmptyKey || expectedSize != 0;
- UNIT_ASSERT_VALUES_EQUAL_C(expectedResult, builder.FindLongestPrefix(otherKey.data(), otherKey.size(), &prefixSize, &value), "otherKey = " << HexEncode(otherKey));
+ UNIT_ASSERT_VALUES_EQUAL_C(expectedResult, builder.FindLongestPrefix(otherKey.data(), otherKey.size(), &prefixSize, &value), "otherKey = " << HexEncode(otherKey));
if (expectedResult) {
UNIT_ASSERT_VALUES_EQUAL(expectedSize, prefixSize);
if (expectedSize) {
@@ -1543,7 +1543,7 @@ void TCompactTrieTest::TestBuilderFindLongestPrefix(size_t keysCount, double bra
extendedKey += RandChar();
size_t extendedPrefixSize = 0xdddddd;
TString extendedValue = "dcba";
- UNIT_ASSERT_VALUES_EQUAL(expectedResult, builder.FindLongestPrefix(extendedKey.data(), extendedKey.size(), &extendedPrefixSize, &extendedValue));
+ UNIT_ASSERT_VALUES_EQUAL(expectedResult, builder.FindLongestPrefix(extendedKey.data(), extendedKey.size(), &extendedPrefixSize, &extendedValue));
if (expectedResult) {
UNIT_ASSERT_VALUES_EQUAL(value, extendedValue);
UNIT_ASSERT_VALUES_EQUAL(prefixSize, extendedPrefixSize);
@@ -1553,7 +1553,7 @@ void TCompactTrieTest::TestBuilderFindLongestPrefix(size_t keysCount, double bra
}
}
}
- builder.Add(key.data(), key.size(), key);
+ builder.Add(key.data(), key.size(), key);
}
TBufferOutput buffer;
diff --git a/library/cpp/containers/comptrie/loader/loader_ut.cpp b/library/cpp/containers/comptrie/loader/loader_ut.cpp
index 345063a31e..cd7976755f 100644
--- a/library/cpp/containers/comptrie/loader/loader_ut.cpp
+++ b/library/cpp/containers/comptrie/loader/loader_ut.cpp
@@ -19,7 +19,7 @@ Y_UNIT_TEST_SUITE(ArchiveLoaderTests) {
"zero", "one", "two"};
i32 val = -1;
for (i32 i = 0; i < 3; ++i) {
- UNIT_ASSERT(trie.Find(TrieKyes[i].data(), TrieKyes[i].size(), &val));
+ UNIT_ASSERT(trie.Find(TrieKyes[i].data(), TrieKyes[i].size(), &val));
UNIT_ASSERT_EQUAL(i, val);
}
diff --git a/library/cpp/containers/comptrie/search_iterator.h b/library/cpp/containers/comptrie/search_iterator.h
index 247f7e5936..1f6eeb241e 100644
--- a/library/cpp/containers/comptrie/search_iterator.h
+++ b/library/cpp/containers/comptrie/search_iterator.h
@@ -60,7 +60,7 @@ public:
return NCompactTrie::Advance(DataPos, DataEnd, ValuePos, label, Trie->Packer);
}
inline bool Advance(const TKeyBuf& key) {
- return Advance(key.data(), key.size());
+ return Advance(key.data(), key.size());
}
bool Advance(const TSymbol* key, size_t keylen);
bool GetValue(TData* value = nullptr) const;
diff --git a/library/cpp/containers/comptrie/set.h b/library/cpp/containers/comptrie/set.h
index acd43338f0..205a96ef46 100644
--- a/library/cpp/containers/comptrie/set.h
+++ b/library/cpp/containers/comptrie/set.h
@@ -31,7 +31,7 @@ public:
}
bool Has(const typename TBase::TKeyBuf& key) const {
- return TBase::Find(key.data(), key.size());
+ return TBase::Find(key.data(), key.size());
}
bool FindTails(const typename TBase::TKeyBuf& key, TCompactTrieSet<T>& res) const {
diff --git a/library/cpp/containers/stack_array/ut/tests_ut.cpp b/library/cpp/containers/stack_array/ut/tests_ut.cpp
index 3e96384f0e..6a585611cc 100644
--- a/library/cpp/containers/stack_array/ut/tests_ut.cpp
+++ b/library/cpp/containers/stack_array/ut/tests_ut.cpp
@@ -25,7 +25,7 @@ Y_UNIT_TEST_SUITE(TestStackArray) {
UNIT_ASSERT_VALUES_EQUAL(x, 0xCCCCCCCC);
}
- for (size_t i = 0; i < s.size(); ++i) {
+ for (size_t i = 0; i < s.size(); ++i) {
s[i] = i;
}
diff --git a/library/cpp/containers/str_map/str_map.h b/library/cpp/containers/str_map/str_map.h
index 31b00d1b99..fc53fe01f6 100644
--- a/library/cpp/containers/str_map/str_map.h
+++ b/library/cpp/containers/str_map/str_map.h
@@ -6,7 +6,7 @@
#include <util/generic/buffer.h>
#include <util/str_stl.h> // less<> and equal_to<> for const char*
#include <utility>
-#include <util/generic/noncopyable.h>
+#include <util/generic/noncopyable.h>
template <class T, class HashFcn = THash<const char*>, class EqualTo = TEqualTo<const char*>, class Alloc = std::allocator<const char*>>
class string_hash;
diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp
index 61164fa56b..8b6d532de7 100644
--- a/library/cpp/coroutine/engine/poller.cpp
+++ b/library/cpp/coroutine/engine/poller.cpp
@@ -246,15 +246,15 @@ namespace {
T_.push_back(pfd);
}
- const ssize_t ret = PollD(T_.data(), (nfds_t) T_.size(), deadLine);
+ const ssize_t ret = PollD(T_.data(), (nfds_t) T_.size(), deadLine);
if (ret <= 0) {
return;
}
- events.reserve(T_.size());
+ events.reserve(T_.size());
- for (size_t i = 0; i < T_.size(); ++i) {
+ for (size_t i = 0; i < T_.size(); ++i) {
const pollfd& pfd = T_[i];
const short ev = pfd.revents;
diff --git a/library/cpp/dbg_output/dump.h b/library/cpp/dbg_output/dump.h
index c7efa105ee..6ef60753cc 100644
--- a/library/cpp/dbg_output/dump.h
+++ b/library/cpp/dbg_output/dump.h
@@ -33,7 +33,7 @@ namespace NPrivate {
if (v) {
*this << DumpRaw("(") << DumpRaw(TypeName(v).data()) << DumpRaw(")") << Hex((size_t)v);
} else {
- *this << DumpRaw("(") << DumpRaw(TypeName<V>().data()) << DumpRaw("*)nullptr");
+ *this << DumpRaw("(") << DumpRaw(TypeName<V>().data()) << DumpRaw("*)nullptr");
}
}
};
@@ -55,7 +55,7 @@ namespace NPrivate {
*this << DumpRaw("(") << DumpRaw(TypeName(v).data()) << DumpRaw(")") << Hex((size_t)v) << DumpRaw(" -> ") << *v;
Visited.erase((size_t)v);
} else {
- *this << DumpRaw("(") << DumpRaw(TypeName<V>().data()) << DumpRaw("*)nullptr");
+ *this << DumpRaw("(") << DumpRaw(TypeName<V>().data()) << DumpRaw("*)nullptr");
}
}
diff --git a/library/cpp/dbg_output/engine.cpp b/library/cpp/dbg_output/engine.cpp
index dcb9f02522..dca3443a3b 100644
--- a/library/cpp/dbg_output/engine.cpp
+++ b/library/cpp/dbg_output/engine.cpp
@@ -21,7 +21,7 @@ DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::String(const TWtringBuf& s) {
}
DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::Raw(const TStringBuf& s) {
- Stream().Write(s.data(), s.size());
+ Stream().Write(s.data(), s.size());
}
DBGDUMP_INLINE_IF_INCLUDED void TDumpBase::Char(char ch) {
diff --git a/library/cpp/dbg_output/engine.h b/library/cpp/dbg_output/engine.h
index f13c728c39..8296c14b40 100644
--- a/library/cpp/dbg_output/engine.h
+++ b/library/cpp/dbg_output/engine.h
@@ -104,7 +104,7 @@ struct TDumper<TIndentNewLine> {
template <class S>
static inline void Dump(S& s, const TIndentNewLine&) {
if (s.Indent) {
- s << DumpRaw("\n") << DumpRaw(TString(s.IndentLevel * 4, ' ').data());
+ s << DumpRaw("\n") << DumpRaw(TString(s.IndentLevel * 4, ' ').data());
}
}
};
diff --git a/library/cpp/deprecated/kmp/kmp.cpp b/library/cpp/deprecated/kmp/kmp.cpp
index d02074c94a..c2a35a2878 100644
--- a/library/cpp/deprecated/kmp/kmp.cpp
+++ b/library/cpp/deprecated/kmp/kmp.cpp
@@ -16,6 +16,6 @@ TKMPMatcher::TKMPMatcher(const TString& pattern)
void TKMPMatcher::ComputePrefixFunction() {
ssize_t* pf;
- ::ComputePrefixFunction(Pattern.data(), Pattern.data() + Pattern.size(), &pf);
+ ::ComputePrefixFunction(Pattern.data(), Pattern.data() + Pattern.size(), &pf);
PrefixFunction.Reset(pf);
}
diff --git a/library/cpp/deprecated/kmp/kmp.h b/library/cpp/deprecated/kmp/kmp.h
index a7f72eece6..85090f6b2b 100644
--- a/library/cpp/deprecated/kmp/kmp.h
+++ b/library/cpp/deprecated/kmp/kmp.h
@@ -42,7 +42,7 @@ public:
bool SubStr(const char* begin, const char* end, const char*& result) const {
Y_ASSERT(begin <= end);
- ssize_t m = Pattern.size();
+ ssize_t m = Pattern.size();
ssize_t n = end - begin;
ssize_t i, j;
for (i = 0, j = 0; (i < n) && (j < m); ++i, ++j) {
@@ -80,7 +80,7 @@ public:
: Callback(callback)
, Pattern(patternBegin, patternEnd)
, State(0)
- , Candidate(Pattern.size())
+ , Candidate(Pattern.size())
{
ssize_t* pf;
ComputePrefixFunction(patternBegin, patternEnd, &pf);
@@ -89,14 +89,14 @@ public:
void Push(const T& symbol) {
while ((State >= 0) && (Pattern[State] != symbol)) {
- Y_ASSERT(State <= (ssize_t) Pattern.size());
+ Y_ASSERT(State <= (ssize_t) Pattern.size());
State = PrefixFunction[State];
- Y_ASSERT(State <= (ssize_t) Pattern.size());
+ Y_ASSERT(State <= (ssize_t) Pattern.size());
}
if (State >= 0)
Candidate[State] = symbol;
++State;
- if (State == (ssize_t) Pattern.size()) {
+ if (State == (ssize_t) Pattern.size()) {
Callback->OnMatch(Candidate.begin(), Candidate.end());
State = 0;
}
diff --git a/library/cpp/deprecated/kmp/kmp_ut.cpp b/library/cpp/deprecated/kmp/kmp_ut.cpp
index c2eda83c57..f3bcf8f4a6 100644
--- a/library/cpp/deprecated/kmp/kmp_ut.cpp
+++ b/library/cpp/deprecated/kmp/kmp_ut.cpp
@@ -11,8 +11,8 @@ static TVector<int> FindAll(const TString& pattern, const TString& string) {
const char* begin = string.begin();
const char* end = string.end();
while (kmp.SubStr(begin, end, pResult)) {
- result.push_back(int(pResult - string.data()));
- begin = pResult + pattern.size();
+ result.push_back(int(pResult - string.data()));
+ begin = pResult + pattern.size();
}
return result;
}
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.cpp b/library/cpp/deprecated/mapped_file/mapped_file.cpp
index b0e4511299..50f1c98056 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.cpp
+++ b/library/cpp/deprecated/mapped_file/mapped_file.cpp
@@ -29,7 +29,7 @@ void TMappedFile::precharge(size_t off, size_t size) const {
void TMappedFile::init(const TString& name) {
THolder<TFileMap> map(new TFileMap(name));
- TMappedFile newFile(map.Get(), name.data());
+ TMappedFile newFile(map.Get(), name.data());
Y_UNUSED(map.Release());
newFile.swap(*this);
newFile.term();
@@ -37,7 +37,7 @@ void TMappedFile::init(const TString& name) {
void TMappedFile::init(const TString& name, size_t length, TFileMap::EOpenMode om) {
THolder<TFileMap> map(new TFileMap(name, length, om));
- TMappedFile newFile(map.Get(), name.data());
+ TMappedFile newFile(map.Get(), name.data());
Y_UNUSED(map.Release());
newFile.swap(*this);
newFile.term();
@@ -53,7 +53,7 @@ void TMappedFile::init(const TFile& file, TFileMap::EOpenMode om, const char* db
void TMappedFile::init(const TString& name, TFileMap::EOpenMode om) {
THolder<TFileMap> map(new TFileMap(name, om));
- TMappedFile newFile(map.Get(), name.data());
+ TMappedFile newFile(map.Get(), name.data());
Y_UNUSED(map.Release());
newFile.swap(*this);
newFile.term();
diff --git a/library/cpp/deprecated/split/split_iterator.cpp b/library/cpp/deprecated/split/split_iterator.cpp
index 32262d25bd..659889a70f 100644
--- a/library/cpp/deprecated/split/split_iterator.cpp
+++ b/library/cpp/deprecated/split/split_iterator.cpp
@@ -22,8 +22,8 @@ TSplitBase::TSplitBase(const char* str, size_t length)
}
TSplitBase::TSplitBase(const TString& s)
- : Str(s.data())
- , Len(s.size())
+ : Str(s.data())
+ , Len(s.size())
{
}
@@ -276,7 +276,7 @@ TCharSplitWithoutTags::TIterator TCharSplitWithoutTags::Iterator() const {
TSubstringSplitDelimiter::TSubstringSplitDelimiter(const TString& s)
: Matcher(s)
- , Len(s.size())
+ , Len(s.size())
{
}
diff --git a/library/cpp/deprecated/split/split_iterator.h b/library/cpp/deprecated/split/split_iterator.h
index 0eacc29228..1081ae13c0 100644
--- a/library/cpp/deprecated/split/split_iterator.h
+++ b/library/cpp/deprecated/split/split_iterator.h
@@ -52,7 +52,7 @@ inline TString ToString(const TUi32Region& r) {
template <>
inline TUi32Region FromString(const TString& s) {
TUi32Region result;
- sscanf(s.data(), "(%" PRIu32 ", %" PRIu32 ")", &result.Begin, &result.End);
+ sscanf(s.data(), "(%" PRIu32 ", %" PRIu32 ")", &result.Begin, &result.End);
return result;
}
diff --git a/library/cpp/diff/diff.cpp b/library/cpp/diff/diff.cpp
index be57da7f39..d516de5a6a 100644
--- a/library/cpp/diff/diff.cpp
+++ b/library/cpp/diff/diff.cpp
@@ -43,7 +43,7 @@ struct TCollection {
template <>
struct TCollection<char>: public TCollectionImpl<char> {
TCollection(const TStringBuf& str, const TString& delims) {
- TSetDelimiter<const char> set(delims.data());
+ TSetDelimiter<const char> set(delims.data());
TKeepDelimiters<TCollection<char>> c(this);
SplitString(str.begin(), str.end(), set, c);
}
@@ -60,7 +60,7 @@ struct TCollection<wchar16>: public TCollectionImpl<wchar16> {
size_t NDiff::InlineDiff(TVector<TChunk<char>>& chunks, const TStringBuf& left, const TStringBuf& right, const TString& delims) {
if (delims.empty()) {
- return InlineDiff<char>(chunks, TConstArrayRef<char>(left.data(), left.size()), TConstArrayRef<char>(right.data(), right.size()));
+ return InlineDiff<char>(chunks, TConstArrayRef<char>(left.data(), left.size()), TConstArrayRef<char>(right.data(), right.size()));
}
TCollection<char> c1(left, delims);
TCollection<char> c2(right, delims);
diff --git a/library/cpp/digest/lower_case/hash_ops.cpp b/library/cpp/digest/lower_case/hash_ops.cpp
index 3f1746d830..cdf08a4427 100644
--- a/library/cpp/digest/lower_case/hash_ops.cpp
+++ b/library/cpp/digest/lower_case/hash_ops.cpp
@@ -15,7 +15,7 @@ size_t TCIOps::operator()(const char* s) const noexcept {
bool TCIOps::operator()(const TStringBuf& f, const TStringBuf& s) const noexcept {
using TIter = TLowerCaseIterator<const char>;
- return (f.size() == s.size()) && Equal(TIter(f.begin()), TIter(f.end()), TIter(s.begin()));
+ return (f.size() == s.size()) && Equal(TIter(f.begin()), TIter(f.end()), TIter(s.begin()));
}
bool TCIOps::operator()(const char* f, const char* s) const noexcept {
diff --git a/library/cpp/digest/lower_case/lchash.h b/library/cpp/digest/lower_case/lchash.h
index 6a287d9479..923b7ac137 100644
--- a/library/cpp/digest/lower_case/lchash.h
+++ b/library/cpp/digest/lower_case/lchash.h
@@ -14,5 +14,5 @@ static inline T FnvCaseLess(const char* b, size_t l, T t = 0) noexcept {
template <class T>
static inline T FnvCaseLess(const TStringBuf& s, T t = 0) noexcept {
- return FnvCaseLess(s.data(), s.size(), t);
+ return FnvCaseLess(s.data(), s.size(), t);
}
diff --git a/library/cpp/digest/md5/md5.cpp b/library/cpp/digest/md5/md5.cpp
index 24a5b69eef..dbc9a48b02 100644
--- a/library/cpp/digest/md5/md5.cpp
+++ b/library/cpp/digest/md5/md5.cpp
@@ -248,7 +248,7 @@ bool MD5::IsMD5(TStringBuf data) {
}
bool MD5::IsMD5(const TArrayRef<const ui8>& data) {
- if (data.size() != 32) {
+ if (data.size() != 32) {
return false;
}
for (const ui8 *p = data.data(), *e = data.data() + data.size(); p != e; ++p) {
diff --git a/library/cpp/digest/md5/md5_ut.cpp b/library/cpp/digest/md5/md5_ut.cpp
index 1c3e4ad0a9..35462b8e4d 100644
--- a/library/cpp/digest/md5/md5_ut.cpp
+++ b/library/cpp/digest/md5/md5_ut.cpp
@@ -31,13 +31,13 @@ Y_UNIT_TEST_SUITE(TMD5Test) {
{
TFixedBufferFileOutput fo(tmpFile);
- fo.Write(s.data(), s.size());
+ fo.Write(s.data(), s.size());
}
char fileBuf[100];
char memBuf[100];
- TString fileHash = MD5::File(tmpFile.data(), fileBuf);
- TString memoryHash = MD5::Data((const unsigned char*)s.data(), s.size(), memBuf);
+ TString fileHash = MD5::File(tmpFile.data(), fileBuf);
+ TString memoryHash = MD5::Data((const unsigned char*)s.data(), s.size(), memBuf);
UNIT_ASSERT_NO_DIFF(fileHash, memoryHash);
diff --git a/library/cpp/dns/cache.cpp b/library/cpp/dns/cache.cpp
index 05c14e82fc..62cdc92caf 100644
--- a/library/cpp/dns/cache.cpp
+++ b/library/cpp/dns/cache.cpp
@@ -110,7 +110,7 @@ namespace {
}
if (host.length() > 2 && host[0] == '[') {
- TString unbracedIpV6(host.data() + 1, host.size() - 2);
+ TString unbracedIpV6(host.data() + 1, host.size() - 2);
host.swap(unbracedIpV6);
}
diff --git a/library/cpp/dns/thread.cpp b/library/cpp/dns/thread.cpp
index 8b27d2d527..8426a1ebd1 100644
--- a/library/cpp/dns/thread.cpp
+++ b/library/cpp/dns/thread.cpp
@@ -67,7 +67,7 @@ namespace {
inline ~TThreadedResolver() override {
Schedule(nullptr);
- for (size_t i = 0; i < T_.size(); ++i) {
+ for (size_t i = 0; i < T_.size(); ++i) {
T_[i]->Join();
}
diff --git a/library/cpp/enumbitset/enumbitset.h b/library/cpp/enumbitset/enumbitset.h
index 41864c3a04..a4603e558d 100644
--- a/library/cpp/enumbitset/enumbitset.h
+++ b/library/cpp/enumbitset/enumbitset.h
@@ -295,7 +295,7 @@ public:
for (int pos = numOfChunks * chunkSize; pos >= 0; pos -= chunkSize) {
ui64 t = 0;
this->Export(pos, t);
- ret += Sprintf(templ.data(), t);
+ ret += Sprintf(templ.data(), t);
}
size_t n = 0;
diff --git a/library/cpp/getopt/small/last_getopt.h b/library/cpp/getopt/small/last_getopt.h
index 07687bc914..dc795741c4 100644
--- a/library/cpp/getopt/small/last_getopt.h
+++ b/library/cpp/getopt/small/last_getopt.h
@@ -5,7 +5,7 @@
#include "last_getopt_parse_result.h"
#include <util/generic/function.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
/// see some documentation in
/// https://wiki.yandex-team.ru/development/poisk/arcadia/util/lastgetopt/
diff --git a/library/cpp/getopt/small/last_getopt_opts.cpp b/library/cpp/getopt/small/last_getopt_opts.cpp
index 03c432849f..27a3dee5b2 100644
--- a/library/cpp/getopt/small/last_getopt_opts.cpp
+++ b/library/cpp/getopt/small/last_getopt_opts.cpp
@@ -297,7 +297,7 @@ namespace NLastGetopt {
static const TString metavarDef("VAL");
const TString& title = option->GetArgTitle();
- const TString& metavar = title.empty() ? metavarDef : title;
+ const TString& metavar = title.empty() ? metavarDef : title;
if (option->GetHasArg() == OPTIONAL_ARGUMENT) {
result << " [" << metavar;
@@ -414,7 +414,7 @@ namespace NLastGetopt {
} else {
os << SPad << leftColumn[i] << ' ';
if (leftColumnSizes[i] < leftWidth)
- os << TStringBuf(leftPadding.data(), leftWidth - leftColumnSizes[i]);
+ os << TStringBuf(leftPadding.data(), leftWidth - leftColumnSizes[i]);
}
TStringBuf help = opt->GetHelp();
diff --git a/library/cpp/getopt/small/opt2.cpp b/library/cpp/getopt/small/opt2.cpp
index 0cdc774e78..f53d8c132d 100644
--- a/library/cpp/getopt/small/opt2.cpp
+++ b/library/cpp/getopt/small/opt2.cpp
@@ -106,9 +106,9 @@ void Opt2::EatArgv(const char* optspec, const char* long_alias) {
// long option always spans one argv (--switch or --option-name=value)
const char* eq = strchr(s, '=');
TString lname(s, eq ? (size_t)(eq - s) : (size_t)strlen(s));
- THashMap<const char*, char>::iterator i = long2short.find(lname.data());
+ THashMap<const char*, char>::iterator i = long2short.find(lname.data());
if (i == long2short.end()) {
- UnknownLongOption = strdup(lname.data()); // free'd in AutoUsage()
+ UnknownLongOption = strdup(lname.data()); // free'd in AutoUsage()
HasErrors = true;
return;
}
@@ -273,7 +273,7 @@ int Opt2::AutoUsage(const char* free_arg_names) {
nreq ? " [-" : "", nreq_str, nreq ? "]" : "",
free_arg_names && *free_arg_names ? " " : "", free_arg_names);
for (auto& spec : Specs) {
- const char* hlp = !spec.HelpUsage.empty() ? spec.HelpUsage.data() : spec.HasArg ? "<arg>" : "";
+ const char* hlp = !spec.HelpUsage.empty() ? spec.HelpUsage.data() : spec.HasArg ? "<arg>" : "";
if (!spec.HasArg || spec.IsRequired)
fprintf(where, " -%c %s\n", spec.opt, hlp);
else if (!spec.IsNumeric)
@@ -301,7 +301,7 @@ int Opt2::AutoUsage(const char* free_arg_names) {
if (BadPosCount && MinArgs == MaxArgs)
fprintf(where, " *** %i free argument(s) supplied, expected %i\n", (int)Pos.size(), MinArgs);
for (const auto& userErrorMessage : UserErrorMessages)
- fprintf(where, " *** %s\n", userErrorMessage.data());
+ fprintf(where, " *** %s\n", userErrorMessage.data());
return UnknownOption == '?' ? 1 : 2;
}
diff --git a/library/cpp/getopt/small/ygetopt.cpp b/library/cpp/getopt/small/ygetopt.cpp
index 1f52827f74..78c3f9fe6d 100644
--- a/library/cpp/getopt/small/ygetopt.cpp
+++ b/library/cpp/getopt/small/ygetopt.cpp
@@ -36,7 +36,7 @@ public:
}
ArgsPtrs_.Get()[Args_.size()] = nullptr;
- Opt_.Reset(new Opt((int)Args_.size(), ArgsPtrs_.Get(), Format_.data()));
+ Opt_.Reset(new Opt((int)Args_.size(), ArgsPtrs_.Get(), Format_.data()));
}
inline ~TIterImpl() = default;
diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp
index c99a1d053d..8b6bd4221e 100644
--- a/library/cpp/getopt/ut/last_getopt_ut.cpp
+++ b/library/cpp/getopt/ut/last_getopt_ut.cpp
@@ -6,7 +6,7 @@
#include <util/generic/array_size.h>
#include <util/string/subst.h>
#include <util/string/vector.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
using namespace NLastGetopt;
@@ -25,7 +25,7 @@ namespace {
TOptsParseResultTestWrapper(const TOpts* opts, TVector<const char*> argv)
: Argv_(argv)
{
- Init(opts, (int)Argv_.size(), Argv_.data());
+ Init(opts, (int)Argv_.size(), Argv_.data());
}
};
@@ -40,7 +40,7 @@ struct TOptsParserTester {
void Initialize() {
if (!Parser_)
- Parser_.Reset(new TOptsParser(&Opts_, (int)Argv_.size(), Argv_.data()));
+ Parser_.Reset(new TOptsParser(&Opts_, (int)Argv_.size(), Argv_.data()));
}
void Accept() {
@@ -684,7 +684,7 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) {
SubstGlobal(printed, TString(colors.OldColor()), "");
}
TVector<TString> lines;
- StringSplitter(printed).Split('\n').SkipEmpty().Collect(&lines);
+ StringSplitter(printed).Split('\n').SkipEmpty().Collect(&lines);
UNIT_ASSERT(!lines.empty());
TVector<size_t> indents;
for (const TString& line : lines) {
diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h
index 5bd8d3902b..310d7c711e 100644
--- a/library/cpp/grpc/server/grpc_request.h
+++ b/library/cpp/grpc/server/grpc_request.h
@@ -343,7 +343,7 @@ private:
return resp;
};
GRPC_LOG_DEBUG(Logger_, "[%p] received request Name# %s ok# %s data# %s peer# %s", this, Name_,
- ok ? "true" : "false", makeRequestString().data(), this->Context.peer().c_str());
+ ok ? "true" : "false", makeRequestString().data(), this->Context.peer().c_str());
if (this->Context.c_call() == nullptr) {
Y_VERIFY(!ok);
diff --git a/library/cpp/http/fetch/httpfsm_ut.cpp b/library/cpp/http/fetch/httpfsm_ut.cpp
index b018e80101..575f269af5 100644
--- a/library/cpp/http/fetch/httpfsm_ut.cpp
+++ b/library/cpp/http/fetch/httpfsm_ut.cpp
@@ -404,7 +404,7 @@ void THttpHeaderParserTestSuite::TestHreflangOnLongInput() {
httpHeaderParser->Init(&httpHeader);
TStringBuf testInput(hreflang_ut_in);
TStringBuf testOut(hreflang_ut_out);
- i32 result = httpHeaderParser->Execute(testInput.data(), testInput.size());
+ i32 result = httpHeaderParser->Execute(testInput.data(), testInput.size());
UNIT_ASSERT_VALUES_EQUAL(result, 2);
UNIT_ASSERT_VALUES_EQUAL(httpHeader.hreflangs, testOut);
TestFinish();
@@ -496,11 +496,11 @@ Y_UNIT_TEST_SUITE(TestHttpChunkParser) {
}
static THttpChunkParser parseByteByByte(const TStringBuf& blob, const TVector<int>& states) {
- UNIT_ASSERT(states.size() <= blob.size());
+ UNIT_ASSERT(states.size() <= blob.size());
THttpChunkParser parser{initParser()};
for (size_t n = 0; n < states.size(); n++) {
const TStringBuf d{blob, n, 1};
- int code = parser.Execute(d.data(), d.size());
+ int code = parser.Execute(d.data(), d.size());
Cout << TString(d).Quote() << " " << code << Endl;
UNIT_ASSERT_EQUAL(code, states[n]);
}
diff --git a/library/cpp/http/fetch/httpparser_ut.cpp b/library/cpp/http/fetch/httpparser_ut.cpp
index 3b3b938e7a..067c88f010 100644
--- a/library/cpp/http/fetch/httpparser_ut.cpp
+++ b/library/cpp/http/fetch/httpparser_ut.cpp
@@ -55,7 +55,7 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
THttpParser<> parser;
parser.Init(&hdr);
- parser.Parse((void*)blob.data(), blob.size());
+ parser.Parse((void*)blob.data(), blob.size());
UNIT_ASSERT_EQUAL(parser.GetState(), parser.hp_error); // can't parse request as response
}
@@ -69,7 +69,7 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
TTestHttpParser parser;
parser.Init(&hdr);
- parser.Parse((void*)blob.data(), blob.size());
+ parser.Parse((void*)blob.data(), blob.size());
UNIT_ASSERT_EQUAL(parser.GetState(), parser.hp_eof);
UNIT_ASSERT_EQUAL(parser.Body(), "OK");
UNIT_ASSERT_EQUAL(hdr.header_size, strlen(
@@ -94,7 +94,7 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
TTestHttpParser parser;
parser.Init(&hdr);
- parser.Parse((void*)blob.data(), blob.size());
+ parser.Parse((void*)blob.data(), blob.size());
UNIT_ASSERT_EQUAL(parser.GetState(), parser.hp_eof);
UNIT_ASSERT_EQUAL(parser.Body(), "OkAllRight");
UNIT_ASSERT_EQUAL(hdr.header_size, strlen(
@@ -135,9 +135,9 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
TTestHttpParser parser;
parser.Init(&hdr);
- for (size_t i = 0; i < blob.size(); ++i) {
+ for (size_t i = 0; i < blob.size(); ++i) {
const TStringBuf d{blob, i, 1};
- parser.Parse((void*)d.data(), d.size());
+ parser.Parse((void*)d.data(), d.size());
Cout << TString(d).Quote() << " -> " << parser.GetState() << Endl;
}
AssertPipelineClen(parser, hdr);
@@ -151,7 +151,7 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
TTestHttpParser parser;
parser.Init(&hdr);
- parser.Parse((void*)blob.data(), blob.size());
+ parser.Parse((void*)blob.data(), blob.size());
AssertPipelineClen(parser, hdr);
UNIT_ASSERT_EQUAL(parser.Body(),
"OK\r\n"
@@ -210,11 +210,11 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
TTestHttpParser parser;
parser.Init(&hdr);
- for (size_t i = 0; i < blob.size(); ++i) {
+ for (size_t i = 0; i < blob.size(); ++i) {
const TStringBuf d{blob, i, 1};
- parser.Parse((void*)d.data(), d.size());
+ parser.Parse((void*)d.data(), d.size());
Cout << TString(d).Quote() << " -> " << parser.GetState() << Endl;
- if (blob.size() / 2 - 1 <= i) // last \n sets EOF
+ if (blob.size() / 2 - 1 <= i) // last \n sets EOF
UNIT_ASSERT_EQUAL(parser.GetState(), parser.hp_eof);
}
AssertPipelineChunked(parser, hdr);
@@ -225,7 +225,7 @@ Y_UNIT_TEST_SUITE(TestHttpParser) {
THttpHeader hdr;
TTestHttpParser parser;
parser.Init(&hdr);
- parser.Parse((void*)blob.data(), blob.size());
+ parser.Parse((void*)blob.data(), blob.size());
AssertPipelineChunked(parser, hdr);
}
}
diff --git a/library/cpp/http/io/chunk.cpp b/library/cpp/http/io/chunk.cpp
index 6975d9eac1..631b79c5af 100644
--- a/library/cpp/http/io/chunk.cpp
+++ b/library/cpp/http/io/chunk.cpp
@@ -30,7 +30,7 @@ static inline size_t ParseHex(const TString& s) {
} else if (isspace(ch)) {
continue;
} else {
- ythrow yexception() << "can not parse chunk length(" << s.data() << ")";
+ ythrow yexception() << "can not parse chunk length(" << s.data() << ")";
}
}
diff --git a/library/cpp/http/io/chunk_ut.cpp b/library/cpp/http/io/chunk_ut.cpp
index da283f8568..308d98ade0 100644
--- a/library/cpp/http/io/chunk_ut.cpp
+++ b/library/cpp/http/io/chunk_ut.cpp
@@ -93,7 +93,7 @@ Y_UNIT_TEST_SUITE(TestChunkedIO) {
try {
TString badChunk = "10\r\nqwerty";
- TMemoryInput mi(badChunk.data(), badChunk.size());
+ TMemoryInput mi(badChunk.data(), badChunk.size());
TChunkedInput ci(&mi);
TransferData(&ci, &Cnull);
} catch (...) {
diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp
index 6689be684f..8c7729cae2 100644
--- a/library/cpp/http/io/stream.cpp
+++ b/library/cpp/http/io/stream.cpp
@@ -24,7 +24,7 @@
#define HEADERCMP(header, str) \
case sizeof(str) - 1: \
- if (!stricmp((header).Name().data(), str))
+ if (!stricmp((header).Name().data(), str))
namespace {
inline size_t SuggestBufferSize() {
@@ -274,12 +274,12 @@ private:
}
inline bool IsRequest() const {
- return strnicmp(FirstLine().data(), "get", 3) == 0 ||
- strnicmp(FirstLine().data(), "post", 4) == 0 ||
- strnicmp(FirstLine().data(), "put", 3) == 0 ||
+ return strnicmp(FirstLine().data(), "get", 3) == 0 ||
+ strnicmp(FirstLine().data(), "post", 4) == 0 ||
+ strnicmp(FirstLine().data(), "put", 3) == 0 ||
strnicmp(FirstLine().data(), "patch", 5) == 0 ||
- strnicmp(FirstLine().data(), "head", 4) == 0 ||
- strnicmp(FirstLine().data(), "delete", 6) == 0;
+ strnicmp(FirstLine().data(), "head", 4) == 0 ||
+ strnicmp(FirstLine().data(), "delete", 6) == 0;
}
inline void BuildInputChain() {
@@ -289,13 +289,13 @@ private:
// In HTTP/1.1 Keep-Alive is turned on by default
if (pos != TString::npos && strcmp(FirstLine_.c_str() + pos + 1, "HTTP/1.1") == 0) {
p.KeepAlive = true; //request
- } else if (strnicmp(FirstLine_.data(), "HTTP/1.1", 8) == 0) {
+ } else if (strnicmp(FirstLine_.data(), "HTTP/1.1", 8) == 0) {
p.KeepAlive = true; //reply
}
for (THttpHeaders::TConstIterator h = Headers_.Begin(); h != Headers_.End(); ++h) {
const THttpInputHeader& header = *h;
- switch (header.Name().size()) {
+ switch (header.Name().size()) {
HEADERCMP(header, "transfer-encoding") {
TTrEnc f = {&p};
ForEach(header.Value(), f);
@@ -317,16 +317,16 @@ private:
break;
HEADERCMP(header, "connection") {
// accept header "Connection: Keep-Alive, TE"
- if (strnicmp(header.Value().data(), "keep-alive", 10) == 0) {
+ if (strnicmp(header.Value().data(), "keep-alive", 10) == 0) {
p.KeepAlive = true;
- } else if (stricmp(header.Value().data(), "close") == 0) {
+ } else if (stricmp(header.Value().data(), "close") == 0) {
p.KeepAlive = false;
}
}
[[fallthrough]];
HEADERCMP(header, "expect") {
auto findContinue = [&](const TStringBuf& s) {
- if (strnicmp(s.data(), "100-continue", 13) == 0) {
+ if (strnicmp(s.data(), "100-continue", 13) == 0) {
Expect100Continue_ = true;
}
};
@@ -629,7 +629,7 @@ public:
private:
static inline bool IsResponse(const TString& s) noexcept {
- return strnicmp(s.data(), "HTTP/", 5) == 0;
+ return strnicmp(s.data(), "HTTP/", 5) == 0;
}
static inline bool IsRequest(const TString& s) noexcept {
@@ -644,7 +644,7 @@ private:
if (IsHttpResponse()) {
if (Request_ && Request_->FirstLine().StartsWith(TStringBuf("HEAD")))
return false;
- if (FirstLine_.size() > 9 && strncmp(FirstLine_.data() + 9, "204", 3) == 0)
+ if (FirstLine_.size() > 9 && strncmp(FirstLine_.data() + 9, "204", 3) == 0)
return false;
return true;
}
@@ -656,9 +656,9 @@ private:
}
inline bool HasRequestBody() const noexcept {
- return strnicmp(FirstLine_.data(), "POST", 4) == 0 ||
+ return strnicmp(FirstLine_.data(), "POST", 4) == 0 ||
strnicmp(FirstLine_.data(), "PATCH", 5) == 0 ||
- strnicmp(FirstLine_.data(), "PUT", 3) == 0;
+ strnicmp(FirstLine_.data(), "PUT", 3) == 0;
}
static inline size_t ParseHttpVersion(const TString& s) {
if (s.empty()) {
@@ -668,7 +668,7 @@ private:
size_t parsed_version = 0;
if (IsResponse(s)) {
- const char* b = s.data() + 5;
+ const char* b = s.data() + 5;
while (*b && *b != ' ') {
if (*b != '.') {
@@ -728,7 +728,7 @@ private:
}
inline void WriteCachedImpl(IOutputStream* s) const {
- s->Write(FirstLine_.data(), FirstLine_.size());
+ s->Write(FirstLine_.data(), FirstLine_.size());
s->Write("\r\n", 2);
Headers_.OutTo(s);
s->Write("\r\n", 2);
@@ -969,7 +969,7 @@ size_t THttpOutput::SentSize() const noexcept {
unsigned ParseHttpRetCode(const TStringBuf& ret) {
const TStringBuf code = StripString(StripString(ret.After(' ')).Before(' '));
- return FromString<unsigned>(code.data(), code.size());
+ return FromString<unsigned>(code.data(), code.size());
}
void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf& request, const TStringBuf& agent, const TStringBuf& from) {
diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp
index 1ea35df675..d743552762 100644
--- a/library/cpp/http/io/stream_ut.cpp
+++ b/library/cpp/http/io/stream_ut.cpp
@@ -42,8 +42,8 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
"\r\n";
} else {
Output() << "HTTP/1.1 200 Ok\r\n\r\n";
- if (Buf.Size()) {
- Output().Write(Buf.AsCharPtr(), Buf.Size());
+ if (Buf.Size()) {
+ Output().Write(Buf.AsCharPtr(), Buf.Size());
} else {
Output() << Parent_->Res_;
}
@@ -79,7 +79,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
};
Y_UNIT_TEST(TestCodings1) {
- UNIT_ASSERT(SupportedCodings().size() > 0);
+ UNIT_ASSERT(SupportedCodings().size() > 0);
}
Y_UNIT_TEST(TestHttpInput) {
@@ -113,7 +113,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
r += "\r\n";
r += "\r\n";
- output.Write(r.data(), r.size());
+ output.Write(r.data(), r.size());
output.Finish();
}
@@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
r += "\r\n";
r += "\r\n";
- output.Write(r.data(), r.size());
+ output.Write(r.data(), r.size());
output.Finish();
}
@@ -299,12 +299,12 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
const char* header = "GET / HTTP/1.1\r\nHost: yandex.ru\r\n\r\n";
httpOut << header;
- unsigned curLen = str.size();
+ unsigned curLen = str.size();
const char* body = "<html>Hello</html>";
httpOut << body;
- UNIT_ASSERT_VALUES_EQUAL(curLen, str.size());
+ UNIT_ASSERT_VALUES_EQUAL(curLen, str.size());
httpOut.Flush();
- UNIT_ASSERT_VALUES_EQUAL(curLen + strlen(body), str.size());
+ UNIT_ASSERT_VALUES_EQUAL(curLen + strlen(body), str.size());
}
Y_UNIT_TEST(TestOutputPostFlush) {
@@ -322,14 +322,14 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
const char* header = "POST / HTTP/1.1\r\nHost: yandex.ru\r\n\r\n";
httpOut << header;
- UNIT_ASSERT_VALUES_EQUAL(str.size(), 0u);
+ UNIT_ASSERT_VALUES_EQUAL(str.size(), 0u);
const char* body = "<html>Hello</html>";
httpOut << body;
- UNIT_ASSERT_VALUES_EQUAL(str.size(), 0u);
+ UNIT_ASSERT_VALUES_EQUAL(str.size(), 0u);
httpOut.Flush();
- UNIT_ASSERT_VALUES_EQUAL(checkStr.size(), str.size());
+ UNIT_ASSERT_VALUES_EQUAL(checkStr.size(), str.size());
}
TString MakeHttpOutputBody(const char* body, bool encodingEnabled) {
@@ -348,7 +348,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
httpOut << "Content-Encoding: gzip\r\n";
httpOut << "\r\n";
- UNIT_ASSERT_VALUES_EQUAL(str.size(), 0u);
+ UNIT_ASSERT_VALUES_EQUAL(str.size(), 0u);
httpOut << body;
}
const char* bodyDelimiter = "\r\n\r\n";
@@ -384,12 +384,12 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
const char* header = "GET / HTTP/1.1\r\nHost: yandex.ru\r\n\r\n";
httpOut << header;
- unsigned curLen = str.size();
+ unsigned curLen = str.size();
const char* body = "<html>Hello</html>";
httpOut << body;
- UNIT_ASSERT_VALUES_EQUAL(curLen, str.size());
+ UNIT_ASSERT_VALUES_EQUAL(curLen, str.size());
httpOut.Finish();
- UNIT_ASSERT_VALUES_EQUAL(curLen + strlen(body), str.size());
+ UNIT_ASSERT_VALUES_EQUAL(curLen + strlen(body), str.size());
}
Y_UNIT_TEST(TestMultilineHeaders) {
@@ -622,7 +622,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
ythrow yexception() << "should not read after EOF";
}
- const size_t toWrite = Min(len, Data_.size() - Pos_);
+ const size_t toWrite = Min(len, Data_.size() - Pos_);
if (toWrite == 0) {
Eof_ = true;
return 0;
diff --git a/library/cpp/http/io/stream_ut_medium.cpp b/library/cpp/http/io/stream_ut_medium.cpp
index 2c125eb21e..7bda54f66b 100644
--- a/library/cpp/http/io/stream_ut_medium.cpp
+++ b/library/cpp/http/io/stream_ut_medium.cpp
@@ -32,7 +32,7 @@ Y_UNIT_TEST_SUITE(THttpTestMedium) {
}
try {
- UNIT_ASSERT(s.size() > 10);
+ UNIT_ASSERT(s.size() > 10);
UNIT_ASSERT(s.find(data) == TString::npos);
} catch (...) {
Cerr << codec << " " << s << Endl;
diff --git a/library/cpp/http/misc/httpcodes.h b/library/cpp/http/misc/httpcodes.h
index cbfbaa1188..79953dcc22 100644
--- a/library/cpp/http/misc/httpcodes.h
+++ b/library/cpp/http/misc/httpcodes.h
@@ -82,7 +82,7 @@ inline TStringBuf HttpCodeStr(int code) noexcept {
}
inline bool IsHttpCode(int code) noexcept {
- return HttpCodeStrEx(code).data() != HttpCodeStrEx(0).data();
+ return HttpCodeStrEx(code).data() != HttpCodeStrEx(0).data();
}
inline bool IsUserError(int code) noexcept {
diff --git a/library/cpp/http/misc/httpreqdata.cpp b/library/cpp/http/misc/httpreqdata.cpp
index f6951f68cd..3d4c73d0de 100644
--- a/library/cpp/http/misc/httpreqdata.cpp
+++ b/library/cpp/http/misc/httpreqdata.cpp
@@ -42,8 +42,8 @@ void TBaseServerRequestData::AppendQueryString(const char* str, size_t length) {
ModifiedQueryString.Assign(str, length);
}
ModifiedQueryString.Append('\0');
- Search = ModifiedQueryString.data();
- SearchLength = ModifiedQueryString.size() - 1; // ignore terminator
+ Search = ModifiedQueryString.data();
+ SearchLength = ModifiedQueryString.size() - 1; // ignore terminator
}
void TBaseServerRequestData::SetRemoteAddr(TStringBuf addr) {
@@ -71,7 +71,7 @@ const char* TBaseServerRequestData::HeaderIn(TStringBuf key) const {
return nullptr;
}
- return it->second.data();
+ return it->second.data();
}
TString TBaseServerRequestData::HeaderByIndex(size_t n) const noexcept {
@@ -98,9 +98,9 @@ const char* TBaseServerRequestData::Environment(const char* key) const {
} else if (stricmp(key, "QUERY_STRING") == 0) {
return QueryString();
} else if (stricmp(key, "SERVER_NAME") == 0) {
- return ServerName().data();
+ return ServerName().data();
} else if (stricmp(key, "SERVER_PORT") == 0) {
- return ServerPort().data();
+ return ServerPort().data();
} else if (stricmp(key, "SCRIPT_NAME") == 0) {
return ScriptName();
}
@@ -133,7 +133,7 @@ const char* TBaseServerRequestData::GetCurPage() const {
CurPage += Search;
}
}
- return CurPage.data();
+ return CurPage.data();
}
bool TBaseServerRequestData::Parse(const char* origReq) {
@@ -182,8 +182,8 @@ bool TBaseServerRequestData::Parse(const char* origReq) {
void TBaseServerRequestData::AddHeader(const TString& name, const TString& value) {
HeadersIn_[name] = value;
- if (stricmp(name.data(), "Host") == 0) {
- size_t hostLen = strcspn(value.data(), ":");
+ if (stricmp(name.data(), "Host") == 0) {
+ size_t hostLen = strcspn(value.data(), ":");
if (value[hostLen] == ':')
Port = value.substr(hostLen + 1);
Host = value.substr(0, hostLen);
@@ -191,6 +191,6 @@ void TBaseServerRequestData::AddHeader(const TString& name, const TString& value
}
void TBaseServerRequestData::SetPath(const TString& path) {
- PathStorage = TBuffer(path.data(), path.size() + 1);
+ PathStorage = TBuffer(path.data(), path.size() + 1);
Path = PathStorage.Data();
}
diff --git a/library/cpp/http/misc/httpreqdata_ut.cpp b/library/cpp/http/misc/httpreqdata_ut.cpp
index e7f16ef27c..dcfa2a18fa 100644
--- a/library/cpp/http/misc/httpreqdata_ut.cpp
+++ b/library/cpp/http/misc/httpreqdata_ut.cpp
@@ -123,7 +123,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) {
UNIT_ASSERT_STRINGS_EQUAL(rd.QueryStringBuf(), rd.OrigQueryStringBuf());
constexpr TStringBuf appendix = "gta=true&gta=new";
- rd.AppendQueryString(appendix.data(), appendix.size());
+ rd.AppendQueryString(appendix.data(), appendix.size());
UNIT_ASSERT_STRINGS_EQUAL(rd.QueryStringBuf(), qs + '&' + appendix);
UNIT_ASSERT_STRINGS_EQUAL(rd.OrigQueryStringBuf(), qs);
diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp
index 128583bdd7..8aa7ccb08a 100644
--- a/library/cpp/http/server/http.cpp
+++ b/library/cpp/http/server/http.cpp
@@ -352,7 +352,7 @@ public:
for (;;) {
try {
const TInstant deadline = Options_.PollTimeout == TDuration::Zero() ? TInstant::Max() : now + Options_.PollTimeout;
- const size_t ret = Poller->WaitD(events.data(), events.size(), deadline);
+ const size_t ret = Poller->WaitD(events.data(), events.size(), deadline);
now = TInstant::Now();
for (size_t i = 0; i < ret; ++i) {
@@ -368,7 +368,7 @@ public:
// poller. Thus in this case we can safely process only one
// event from the poller at a time.
if (!Options_.MaxConnections && Options_.ExpirationTimeout == TDuration::Zero()) {
- if (ret >= events.size()) {
+ if (ret >= events.size()) {
events.resize(ret * 2);
}
}
@@ -617,7 +617,7 @@ TClientRequest::~TClientRequest() {
}
bool TClientRequest::Reply(void* /*ThreadSpecificResource*/) {
- if (strnicmp(RequestString.data(), "GET ", 4)) {
+ if (strnicmp(RequestString.data(), "GET ", 4)) {
Output() << "HTTP/1.0 501 Not Implemented\r\n\r\n";
} else {
Output() << "HTTP/1.0 200 OK\r\n"
@@ -732,9 +732,9 @@ void TClientRequest::ProcessFailRequest(int failstate) {
TString url;
- if (!strnicmp(RequestString.data(), "GET ", 4)) {
+ if (!strnicmp(RequestString.data(), "GET ", 4)) {
// Trying to extract url...
- const char* str = RequestString.data();
+ const char* str = RequestString.data();
// Skipping spaces before url...
size_t start = 3;
diff --git a/library/cpp/http/server/http_ut.cpp b/library/cpp/http/server/http_ut.cpp
index cc62bb988e..6c1748b7ad 100644
--- a/library/cpp/http/server/http_ut.cpp
+++ b/library/cpp/http/server/http_ut.cpp
@@ -25,8 +25,8 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
}
Output() << "HTTP/1.1 200 Ok\r\n\r\n";
- if (Buf.Size()) {
- Output().Write(Buf.AsCharPtr(), Buf.Size());
+ if (Buf.Size()) {
+ Output().Write(Buf.AsCharPtr(), Buf.Size());
} else {
Output() << Parent_->Res_;
}
@@ -153,7 +153,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
for (;;) {
TString buf;
si.ReadLine(buf);
- if (buf.size() == 0) {
+ if (buf.size() == 0) {
break;
}
ss << buf << CrLf;
@@ -189,7 +189,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
r << Type << " / HTTP/1.1" << CrLf;
r << "Host: localhost:" + ToString(Port) << CrLf;
if (isPost) {
- if (ContentEncoding.size()) {
+ if (ContentEncoding.size()) {
r << "Content-Encoding: " << ContentEncoding << CrLf;
} else {
r << "Transfer-Encoding: chunked" << CrLf;
@@ -225,34 +225,34 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
if (isPost && Expect100Continue) {
r << "Expect: 100-continue" << CrLf;
}
- if (isPost && ContentEncoding.size() && Content.size()) {
+ if (isPost && ContentEncoding.size() && Content.size()) {
r << "Content-Encoding: " << ContentEncoding << CrLf;
TStringStream compressedContent;
{
TZLibCompress zlib(&compressedContent);
- zlib.Write(Content.data(), Content.size());
+ zlib.Write(Content.data(), Content.size());
zlib.Flush();
zlib.Finish();
}
r << "Content-Length: " << compressedContent.Size() << CrLf;
r << CrLf;
- s->Send(r.Data(), r.Size());
+ s->Send(r.Data(), r.Size());
CheckContinue(si);
Hdr = r.Str();
TString tosend = compressedContent.Str();
- s->Send(tosend.data(), tosend.size());
+ s->Send(tosend.data(), tosend.size());
} else {
if (isPost) {
- r << "Content-Length: " << Content.size() << CrLf;
+ r << "Content-Length: " << Content.size() << CrLf;
r << CrLf;
- s->Send(r.Data(), r.Size());
+ s->Send(r.Data(), r.Size());
CheckContinue(si);
Hdr = r.Str();
- s->Send(Content.data(), Content.size());
+ s->Send(Content.data(), Content.size());
} else {
r << CrLf;
Hdr = r.Str();
- s->Send(r.Data(), r.Size());
+ s->Send(r.Data(), r.Size());
}
}
}
@@ -268,7 +268,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
if (UseHttpOutput) {
TStringStream ss;
ss << (KeepAliveConnection ? "keep-alive " : "") << Type;
- if (ContentEncoding.size()) {
+ if (ContentEncoding.size()) {
ss << " with encoding=" << ContentEncoding;
}
return ss.Str();
diff --git a/library/cpp/http/server/response.cpp b/library/cpp/http/server/response.cpp
index 52d64c91ce..0a89709d44 100644
--- a/library/cpp/http/server/response.cpp
+++ b/library/cpp/http/server/response.cpp
@@ -39,10 +39,10 @@ void THttpResponse::OutTo(IOutputStream& os) const {
char buf[50];
- if (!Content.empty()) {
+ if (!Content.empty()) {
TMemoryOutput mo(buf, sizeof(buf));
- mo << Content.size();
+ mo << Content.size();
parts.push_back(IOutputStream::TPart(TStringBuf("Content-Length: ")));
parts.push_back(IOutputStream::TPart(buf, mo.Buf() - buf));
@@ -52,11 +52,11 @@ void THttpResponse::OutTo(IOutputStream& os) const {
// content
parts.push_back(IOutputStream::TPart::CrLf());
- if (!Content.empty()) {
+ if (!Content.empty()) {
parts.push_back(IOutputStream::TPart(Content));
}
- os.Write(parts.data(), parts.size());
+ os.Write(parts.data(), parts.size());
}
template <>
diff --git a/library/cpp/json/easy_parse/json_easy_parser.cpp b/library/cpp/json/easy_parse/json_easy_parser.cpp
index 3c781f544b..c2193ea553 100644
--- a/library/cpp/json/easy_parse/json_easy_parser.cpp
+++ b/library/cpp/json/easy_parse/json_easy_parser.cpp
@@ -66,7 +66,7 @@ namespace NJson {
bool CheckFilter(const TVector<TPathElem>& path) const {
if (Stack.size() < path.size())
return false;
- for (size_t n = 0; n < path.size(); ++n) {
+ for (size_t n = 0; n < path.size(); ++n) {
if (!PathElementMatch(path[n], Stack[n]))
return false;
}
@@ -74,7 +74,7 @@ namespace NJson {
}
void UpdateRule() {
- for (size_t n = 0; n < Parent.Fields.size(); ++n) {
+ for (size_t n = 0; n < Parent.Fields.size(); ++n) {
if (FieldValues[n].empty() && CheckFilter(Parent.Fields[n].Path)) {
CurrentFieldIdx = n;
return;
@@ -113,7 +113,7 @@ namespace NJson {
, CurrentFieldIdx(-1)
, HasFormatError(false)
{
- for (size_t n = 0; n < Parent.Fields.size(); ++n) {
+ for (size_t n = 0; n < Parent.Fields.size(); ++n) {
if (!Parent.Fields[n].Path.empty() && Parent.Fields[n].Path.back().Type == NImpl::ARRAY)
ShouldUpdateOnArrayChange = true;
}
@@ -187,14 +187,14 @@ namespace NJson {
bool IsOK() const {
if (HasFormatError)
return false;
- for (size_t n = 0; n < FieldValues.size(); ++n)
+ for (size_t n = 0; n < FieldValues.size(); ++n)
if (Parent.Fields[n].NonEmpty && FieldValues[n].empty())
return false;
return true;
}
void WriteTo(IOutputStream& out) const {
- for (size_t n = 0; n < FieldValues.size(); ++n)
+ for (size_t n = 0; n < FieldValues.size(); ++n)
out << "\t" << FieldValues[n];
}
diff --git a/library/cpp/json/fast_sax/parser.rl6 b/library/cpp/json/fast_sax/parser.rl6
index edb4e9ee1b..ef3cfb5110 100644
--- a/library/cpp/json/fast_sax/parser.rl6
+++ b/library/cpp/json/fast_sax/parser.rl6
@@ -31,8 +31,8 @@ struct TParserCtx {
TParserCtx(TJsonCallbacks& h, TStringBuf data)
: Hndl(h)
- , p0(data.data())
- , p(data.data())
+ , p0(data.data())
+ , p(data.data())
, pe(data.end())
, eof(data.end())
{}
@@ -145,7 +145,7 @@ struct TParserCtx {
Buffer.Clear();
Buffer.Reserve(2 * (te - ts));
- return OnString(UnescapeJsonUnicode(TStringBuf(ts + 1, te - ts - 2), Buffer.data()), SS_MUSTCOPY);
+ return OnString(UnescapeJsonUnicode(TStringBuf(ts + 1, te - ts - 2), Buffer.data()), SS_MUSTCOPY);
}
bool OnMapClose() {
diff --git a/library/cpp/json/fast_sax/unescape.cpp b/library/cpp/json/fast_sax/unescape.cpp
index 72109b0b5e..bf07db23dd 100644
--- a/library/cpp/json/fast_sax/unescape.cpp
+++ b/library/cpp/json/fast_sax/unescape.cpp
@@ -3,5 +3,5 @@
#include <util/string/escape.h>
TStringBuf UnescapeJsonUnicode(TStringBuf data, char* scratch) {
- return TStringBuf(scratch, UnescapeC(data.data(), data.size(), scratch));
+ return TStringBuf(scratch, UnescapeC(data.data(), data.size(), scratch));
}
diff --git a/library/cpp/json/flex_buffers/cvt.cpp b/library/cpp/json/flex_buffers/cvt.cpp
index fee0cea0b8..399871bf68 100644
--- a/library/cpp/json/flex_buffers/cvt.cpp
+++ b/library/cpp/json/flex_buffers/cvt.cpp
@@ -50,7 +50,7 @@ namespace {
}
bool OnString(const TStringBuf& v) override {
- B.String(v.data(), v.size());
+ B.String(v.data(), v.size());
return true;
}
@@ -64,7 +64,7 @@ namespace {
bool OnMapKey(const TStringBuf& v) override {
auto iv = P.AppendCString(v);
- B.Key(iv.data(), iv.size());
+ B.Key(iv.data(), iv.size());
return true;
}
@@ -133,7 +133,7 @@ void NJson::ConvertJsonToFlexBuffers(TStringBuf input, TFlexBuffersData& result)
}
TString NJson::FlexToString(const TFlexBuffersData& v) {
- auto root = flexbuffers::GetRoot(v.data(), v.size());
+ auto root = flexbuffers::GetRoot(v.data(), v.size());
return TString(root.ToString());
}
diff --git a/library/cpp/json/json_prettifier.cpp b/library/cpp/json/json_prettifier.cpp
index bb16aab44e..705773dd14 100644
--- a/library/cpp/json/json_prettifier.cpp
+++ b/library/cpp/json/json_prettifier.cpp
@@ -260,7 +260,7 @@ namespace NJson {
bool TJsonPrettifier::Prettify(TStringBuf in, IOutputStream& out) const {
TPrettifier p(out, *this);
if (Strict) {
- TMemoryInput mIn(in.data(), in.size());
+ TMemoryInput mIn(in.data(), in.size());
return ReadJson(&mIn, &p);
} else {
return ReadJsonFast(in, &p);
diff --git a/library/cpp/json/json_reader.h b/library/cpp/json/json_reader.h
index b673788330..10ff3b543b 100644
--- a/library/cpp/json/json_reader.h
+++ b/library/cpp/json/json_reader.h
@@ -66,7 +66,7 @@ namespace NJson {
}
inline bool ValidateJson(TStringBuf in, const TJsonReaderConfig& config = TJsonReaderConfig(), bool throwOnError = false) {
- TMemoryInput min(in.data(), in.size());
+ TMemoryInput min(in.data(), in.size());
return ValidateJson(&min, &config, throwOnError);
}
diff --git a/library/cpp/json/rapidjson_helpers.h b/library/cpp/json/rapidjson_helpers.h
index aeb96ff670..92cb86d1e1 100644
--- a/library/cpp/json/rapidjson_helpers.h
+++ b/library/cpp/json/rapidjson_helpers.h
@@ -79,7 +79,7 @@ namespace NJson {
struct TStringBufStreamWrapper : TReadOnlyStreamBase {
Ch Peek() const {
- return Pos < Data.size() ? Data[Pos] : 0;
+ return Pos < Data.size() ? Data[Pos] : 0;
}
Ch Take() {
diff --git a/library/cpp/json/ut/json_reader_fast_ut.cpp b/library/cpp/json/ut/json_reader_fast_ut.cpp
index 60dffc91c7..4c551ec853 100644
--- a/library/cpp/json/ut/json_reader_fast_ut.cpp
+++ b/library/cpp/json/ut/json_reader_fast_ut.cpp
@@ -59,7 +59,7 @@ namespace NJson {
default:
return "YOUFAILED";
case E_ERROR:
- return Sprintf("error: %s", Str.data());
+ return Sprintf("error: %s", Str.data());
case E_DICT_OPEN:
return "{";
case E_DICT_CLOSE:
@@ -77,9 +77,9 @@ namespace NJson {
case E_FLT:
return ::ToString(DNum);
case E_STR:
- return Sprintf("%s", Str.data());
+ return Sprintf("%s", Str.data());
case E_KEY:
- return Sprintf("key: %s", Str.data());
+ return Sprintf("key: %s", Str.data());
}
}
};
@@ -152,10 +152,10 @@ namespace NJson {
UNIT_ASSERT_VALUES_EQUAL_C(e.size(), Events.size(), str);
for (ui32 i = 0, sz = e.size(); i < sz; ++i) {
- UNIT_ASSERT_VALUES_EQUAL_C((int)e[i].Type, (int)Events[i].Type, Sprintf("'%s' %u", str.data(), i));
- UNIT_ASSERT_VALUES_EQUAL_C(e[i].INum, Events[i].INum, Sprintf("'%s' %u", str.data(), i));
- UNIT_ASSERT_VALUES_EQUAL_C(e[i].DNum, Events[i].DNum, Sprintf("'%s' %u", str.data(), i));
- UNIT_ASSERT_VALUES_EQUAL_C(e[i].Str, Events[i].Str, Sprintf("'%s' %u", str.data(), i));
+ UNIT_ASSERT_VALUES_EQUAL_C((int)e[i].Type, (int)Events[i].Type, Sprintf("'%s' %u", str.data(), i));
+ UNIT_ASSERT_VALUES_EQUAL_C(e[i].INum, Events[i].INum, Sprintf("'%s' %u", str.data(), i));
+ UNIT_ASSERT_VALUES_EQUAL_C(e[i].DNum, Events[i].DNum, Sprintf("'%s' %u", str.data(), i));
+ UNIT_ASSERT_VALUES_EQUAL_C(e[i].Str, Events[i].Str, Sprintf("'%s' %u", str.data(), i));
}
} catch (const yexception&) {
Clog << "Exception at '" << str << "'" << Endl;
diff --git a/library/cpp/json/writer/json.cpp b/library/cpp/json/writer/json.cpp
index 02370c2d79..940eaef8c9 100644
--- a/library/cpp/json/writer/json.cpp
+++ b/library/cpp/json/writer/json.cpp
@@ -467,7 +467,7 @@ namespace NJsonWriter {
}
void TBuf::UnsafeWriteRawBytes(const TStringBuf& s) {
- UnsafeWriteRawBytes(s.data(), s.size());
+ UnsafeWriteRawBytes(s.data(), s.size());
}
const TString& TBuf::Str() const {
diff --git a/library/cpp/lcs/lcs_via_lis_ut.cpp b/library/cpp/lcs/lcs_via_lis_ut.cpp
index f6ad5152b6..1480b88959 100644
--- a/library/cpp/lcs/lcs_via_lis_ut.cpp
+++ b/library/cpp/lcs/lcs_via_lis_ut.cpp
@@ -39,10 +39,10 @@ private:
void CheckLCSString(TStringBuf s1, TStringBuf s2, TStringBuf reflcs) {
TString lcs;
size_t len = NLCS::MakeLCS<char>(s1, s2, &lcs);
- const char* comment = Sprintf("%s & %s = %s", s1.data(), s2.data(), reflcs.data()).c_str();
+ const char* comment = Sprintf("%s & %s = %s", s1.data(), s2.data(), reflcs.data()).c_str();
UNIT_ASSERT_VALUES_EQUAL_C(Length(s1, s2), len, comment);
- UNIT_ASSERT_VALUES_EQUAL_C(lcs.size(), len, comment);
+ UNIT_ASSERT_VALUES_EQUAL_C(lcs.size(), len, comment);
UNIT_ASSERT_VALUES_EQUAL_C(NLCS::MeasureLCS<char>(s1, s2), len, comment);
UNIT_ASSERT_VALUES_EQUAL_C(reflcs, TStringBuf(lcs), comment);
}
diff --git a/library/cpp/logger/global/global.cpp b/library/cpp/logger/global/global.cpp
index 9fbd10f666..abdf189dbf 100644
--- a/library/cpp/logger/global/global.cpp
+++ b/library/cpp/logger/global/global.cpp
@@ -39,5 +39,5 @@ TNullLog* CreateDefaultLogger<TNullLog>() {
NPrivateGlobalLogger::TVerifyEvent::~TVerifyEvent() {
const TString info = Str();
FATAL_LOG << info << Endl;
- Y_FAIL("%s", info.data());
+ Y_FAIL("%s", info.data());
}
diff --git a/library/cpp/logger/global/global.h b/library/cpp/logger/global/global.h
index cbe71b16ea..a9ac71c824 100644
--- a/library/cpp/logger/global/global.h
+++ b/library/cpp/logger/global/global.h
@@ -70,7 +70,7 @@ public:
#define DEBUG_LOG SINGLETON_CHECKED_GENERIC_LOG(TGlobalLog, TRTYLogPreprocessor, TLOG_DEBUG, "DEBUG")
#define RESOURCES_LOG SINGLETON_CHECKED_GENERIC_LOG(TGlobalLog, TRTYLogPreprocessor, TLOG_RESOURCES, "RESOURCES")
-#define TEMPLATE_LOG(logLevel) SINGLETON_CHECKED_GENERIC_LOG(TGlobalLog, TRTYLogPreprocessor, logLevel, ToString(logLevel).data())
+#define TEMPLATE_LOG(logLevel) SINGLETON_CHECKED_GENERIC_LOG(TGlobalLog, TRTYLogPreprocessor, logLevel, ToString(logLevel).data())
#define IS_LOG_ACTIVE(logLevel) (TLoggerOperator<TGlobalLog>::Log().FiltrationLevel() >= logLevel)
diff --git a/library/cpp/logger/log_ut.cpp b/library/cpp/logger/log_ut.cpp
index 8de46f17f5..9cf1ae712f 100644
--- a/library/cpp/logger/log_ut.cpp
+++ b/library/cpp/logger/log_ut.cpp
@@ -174,8 +174,8 @@ void TLogTest::TestWrite() {
for (size_t i = 0; i < 1000; ++i) {
TVector<char> buf(i, (char)i);
- test.append(buf.data(), buf.size());
- log.Write(buf.data(), buf.size());
+ test.append(buf.data(), buf.size());
+ log.Write(buf.data(), buf.size());
}
}
diff --git a/library/cpp/logger/system.cpp b/library/cpp/logger/system.cpp
index 42233f63d2..74b093771b 100644
--- a/library/cpp/logger/system.cpp
+++ b/library/cpp/logger/system.cpp
@@ -42,7 +42,7 @@ TSysLogBackend::TSysLogBackend(const char* ident, EFacility facility, int flags)
sysflags |= LOG_CONS;
}
- openlog(Ident.data(), sysflags, f2sf[(size_t)facility]);
+ openlog(Ident.data(), sysflags, f2sf[(size_t)facility]);
#endif
}
diff --git a/library/cpp/lwtrace/lwprobe.h b/library/cpp/lwtrace/lwprobe.h
index 801fc3861b..8f61300be4 100644
--- a/library/cpp/lwtrace/lwprobe.h
+++ b/library/cpp/lwtrace/lwprobe.h
@@ -33,28 +33,28 @@ namespace NLWTrace {
probe.Init();
// initialize TEvent
- Y_VERIFY(IsCppIdentifier(Name), "probe '%s' is not C++ identifier", Name.data());
- Y_VERIFY(IsCppIdentifier(Provider), "provider '%s' is not C++ identifier in probe %s", Provider.data(), Name.data());
+ Y_VERIFY(IsCppIdentifier(Name), "probe '%s' is not C++ identifier", Name.data());
+ Y_VERIFY(IsCppIdentifier(Provider), "provider '%s' is not C++ identifier in probe %s", Provider.data(), Name.data());
probe.Event.Name = Name.c_str();
Zero(probe.Event.Groups);
probe.Event.Groups[0] = Provider.c_str();
auto i = Groups.begin(), ie = Groups.end();
- Y_VERIFY(Groups.size() < LWTRACE_MAX_GROUPS, "too many groups in probe %s", Name.data());
+ Y_VERIFY(Groups.size() < LWTRACE_MAX_GROUPS, "too many groups in probe %s", Name.data());
for (size_t n = 1; n < LWTRACE_MAX_GROUPS && i != ie; n++, ++i) {
- Y_VERIFY(IsCppIdentifier(*i), "group '%s' is not C++ identifier in probe %s", i->data(), Name.data());
+ Y_VERIFY(IsCppIdentifier(*i), "group '%s' is not C++ identifier in probe %s", i->data(), Name.data());
probe.Event.Groups[n] = i->c_str();
}
// initialize TSignature
using TUsrSign = TUserSignature<LWTRACE_TEMPLATE_ARGS>;
Y_VERIFY(TUsrSign::ParamCount == (int)Params.size(), "param count mismatch in probe %s: %d != %d",
- Name.data(), int(Params.size()), TUsrSign::ParamCount);
+ Name.data(), int(Params.size()), TUsrSign::ParamCount);
TSignature& signature = probe.Event.Signature;
signature.ParamTypes = TUsrSign::ParamTypes;
Zero(signature.ParamNames);
auto j = Params.begin(), je = Params.end();
for (size_t n = 0; n < LWTRACE_MAX_PARAMS && j != je; n++, ++j) {
- Y_VERIFY(IsCppIdentifier(*j), "param '%s' is not C++ identifier in probe %s", j->data(), Name.data());
+ Y_VERIFY(IsCppIdentifier(*j), "param '%s' is not C++ identifier in probe %s", j->data(), Name.data());
signature.ParamNames[n] = j->c_str();
}
signature.ParamCount = TUsrSign::ParamCount;
diff --git a/library/cpp/lwtrace/mon/mon_lwtrace.cpp b/library/cpp/lwtrace/mon/mon_lwtrace.cpp
index a61ee9ce22..b20a66e9f9 100644
--- a/library/cpp/lwtrace/mon/mon_lwtrace.cpp
+++ b/library/cpp/lwtrace/mon/mon_lwtrace.cpp
@@ -354,7 +354,7 @@ private:
{
auto parts = SplitString(s, ".");
WWW_CHECK(parts.size() <= 3, "too many name specifiers");
- ParseParamSelector(parts.back());
+ ParseParamSelector(parts.back());
if (parts.size() >= 2) {
ParseProbeSelector(parts[parts.size() - 2]);
}
@@ -396,7 +396,7 @@ private:
for (const auto& p : specials) {
if (paramName.StartsWith(p.first)) {
SpecialParam = p.second;
- paramName.erase(0, p.first.size());
+ paramName.erase(0, p.first.size());
break;
}
}
@@ -418,7 +418,7 @@ private:
for (const auto& p : timeUnits) {
if (paramName.EndsWith(p.first)) {
TimeUnitSec = p.second;
- paramName.erase(paramName.size() - p.first.size());
+ paramName.erase(paramName.size() - p.first.size());
break;
}
}
@@ -437,14 +437,14 @@ private:
for (const auto& p : timeZeros) {
if (paramName.EndsWith(p.first)) {
ZeroTs = p.second;
- paramName.erase(paramName.size() - p.first.size());
+ paramName.erase(paramName.size() - p.first.size());
break;
}
}
- WWW_CHECK(ZeroTs != -1, "wrong special param name (postfix '*Time' required): %s", s.data());
+ WWW_CHECK(ZeroTs != -1, "wrong special param name (postfix '*Time' required): %s", s.data());
}
- WWW_CHECK(paramName.empty(), "wrong special param name: %s", s.data());
+ WWW_CHECK(paramName.empty(), "wrong special param name: %s", s.data());
}
void ParseProbeSelector(const TString& s)
@@ -581,7 +581,7 @@ struct TAdHocTraceConfig {
}
size_t cutPos = (block[0] == '.'? 1: 0);
TVector<TString> parts = SplitString(block.substr(cutPos), ".");
- WWW_CHECK(parts.size() >= 2, "too few parts in adhoc trace id '%s' block '%s'", id.data(), block.data());
+ WWW_CHECK(parts.size() >= 2, "too few parts in adhoc trace id '%s' block '%s'", id.data(), block.data());
auto blockPb = Cfg.AddBlocks();
auto pdescPb = blockPb->MutableProbeDesc();
if (parts[0] == "Group") {
@@ -602,7 +602,7 @@ struct TAdHocTraceConfig {
case 's': blockPb->MutablePredicate()->SetSampleRate(1.0 / Max<ui64>(1, FromString<ui64>(part.substr(1)))); break;
case 'p': ParsePredicate(blockPb->MutablePredicate()->AddOperators(), part.substr(1)); break;
case 'a': ParseAction(blockPb->AddAction(), part.substr(1)); defaultAction = false; break;
- default: WWW_CHECK(false, "unknown adhoc trace part type '%s' in '%s'", part.data(), id.data());
+ default: WWW_CHECK(false, "unknown adhoc trace part type '%s' in '%s'", part.data(), id.data());
}
}
if (defaultAction) {
@@ -622,7 +622,7 @@ private:
void ParsePredicate(NLWTrace::TOperator* op, const TString& p)
{
size_t sign = p.find_first_of("=!><");
- WWW_CHECK(sign != TString::npos, "wrong predicate format in adhoc trace: %s", p.data());
+ WWW_CHECK(sign != TString::npos, "wrong predicate format in adhoc trace: %s", p.data());
op->AddArgument()->SetParam(p.substr(0, sign));
size_t value = sign + 1;
switch (p[sign]) {
@@ -630,14 +630,14 @@ private:
op->SetType(NLWTrace::OT_EQ);
break;
case '!': {
- WWW_CHECK(p.size() > sign + 1, "wrong predicate operator format in adhoc trace: %s", p.data());
- WWW_CHECK(p[sign + 1] == '=', "wrong predicate operator format in adhoc trace: %s", p.data());
+ WWW_CHECK(p.size() > sign + 1, "wrong predicate operator format in adhoc trace: %s", p.data());
+ WWW_CHECK(p[sign + 1] == '=', "wrong predicate operator format in adhoc trace: %s", p.data());
value++;
op->SetType(NLWTrace::OT_NE);
break;
}
case '<': {
- WWW_CHECK(p.size() > sign + 1, "wrong predicate operator format in adhoc trace: %s", p.data());
+ WWW_CHECK(p.size() > sign + 1, "wrong predicate operator format in adhoc trace: %s", p.data());
if (p[sign + 1] == '=') {
value++;
op->SetType(NLWTrace::OT_LE);
@@ -647,7 +647,7 @@ private:
break;
}
case '>': {
- WWW_CHECK(p.size() > sign + 1, "wrong predicate operator format in adhoc trace: %s", p.data());
+ WWW_CHECK(p.size() > sign + 1, "wrong predicate operator format in adhoc trace: %s", p.data());
if (p[sign + 1] == '=') {
value++;
op->SetType(NLWTrace::OT_GE);
@@ -656,7 +656,7 @@ private:
}
break;
}
- default: WWW_CHECK(false, "wrong predicate operator format in adhoc trace: %s", p.data());
+ default: WWW_CHECK(false, "wrong predicate operator format in adhoc trace: %s", p.data());
}
op->AddArgument()->SetValue(p.substr(value));
}
@@ -672,7 +672,7 @@ private:
case 'i': pb->SetIgnore(true); break;
case 's': pb->SetShuttlesCount(FromString<ui64>(opt.substr(1))); break;
case 't': pb->SetMaxTrackLength(FromString<ui64>(opt.substr(1))); break;
- default: WWW_CHECK(false, "unknown adhoc trace log shuttle opt '%s' in '%s'", opt.data(), a.data());
+ default: WWW_CHECK(false, "unknown adhoc trace log shuttle opt '%s' in '%s'", opt.data(), a.data());
}
}
}
@@ -682,7 +682,7 @@ private:
if (!opt.empty()) {
switch (opt[0]) {
case 'i': pb->SetIgnore(true); break;
- default: WWW_CHECK(false, "unknown adhoc trace log shuttle opt '%s' in '%s'", opt.data(), a.data());
+ default: WWW_CHECK(false, "unknown adhoc trace log shuttle opt '%s' in '%s'", opt.data(), a.data());
}
}
}
@@ -695,12 +695,12 @@ private:
switch (opt[0]) {
case 't': pb->SetLogTimestamp(true); break;
case 'r': pb->SetMaxRecords(FromString<ui32>(opt.substr(1))); break;
- default: WWW_CHECK(false, "unknown adhoc trace log opt '%s' in '%s'", opt.data(), a.data());
+ default: WWW_CHECK(false, "unknown adhoc trace log opt '%s' in '%s'", opt.data(), a.data());
}
}
}
} else {
- WWW_CHECK(false, "wrong action format in adhoc trace: %s", a.data());
+ WWW_CHECK(false, "wrong action format in adhoc trace: %s", a.data());
}
}
@@ -984,8 +984,8 @@ TString MakeUrlErase(const TCgiParameters& e, const TString& key, const TString&
TString EscapeSubvalue(const TString& s)
{
TString ret;
- ret.reserve(s.size());
- for (size_t i = 0; i < s.size(); i++) {
+ ret.reserve(s.size());
+ for (size_t i = 0; i < s.size(); i++) {
char c = s[i];
if (c == ':') {
ret.append("^c");
@@ -1001,10 +1001,10 @@ TString EscapeSubvalue(const TString& s)
TString UnescapeSubvalue(const TString& s)
{
TString ret;
- ret.reserve(s.size());
- for (size_t i = 0; i < s.size(); i++) {
+ ret.reserve(s.size());
+ for (size_t i = 0; i < s.size(); i++) {
char c = s[i];
- if (c == '^' && i + 1 < s.size()) {
+ if (c == '^' && i + 1 < s.size()) {
char c2 = s[++i];
if (c2 == 'c') {
ret.append(':');
@@ -1234,8 +1234,8 @@ public:
BuildResponse();
}
- virtual const char* what() const noexcept { return HttpResponse.data(); }
- operator bool() const { return !Content.empty(); }
+ virtual const char* what() const noexcept { return HttpResponse.data(); }
+ operator bool() const { return !Content.empty(); }
};
enum EStyleFlags {
@@ -2547,7 +2547,7 @@ private:
TString paramValues[LWTRACE_MAX_PARAMS];
item.Probe->Event.Signature.SerializeParams(item.Params, paramValues);
for (size_t i = 0; i < item.SavedParamsCount; i++) {
- double value = FromString<double>(paramValues[i].data(), paramValues[i].size(), NAN);
+ double value = FromString<double>(paramValues[i].data(), paramValues[i].size(), NAN);
// If value cannot be cast to double or is inf/nan -- assume it's a string
if (isfinite(value)) {
row[item.Probe->Event.Signature.ParamNames[i]] = value;
@@ -2756,7 +2756,7 @@ struct TPatternNode {
if (bn == "resTotal") {
filterTotal = true;
} else {
- WWW_CHECK(bn == "resLast", "wrong sample filter param: %s", bn.data());
+ WWW_CHECK(bn == "resLast", "wrong sample filter param: %s", bn.data());
}
size_t spaceLeft = opts.SizeLimit;
@@ -2860,10 +2860,10 @@ public:
TPatternNode* Classify(TTrackIter cur, const TTrack& track) override
{
WWW_CHECK((i64)Rollbacks >= 0 && std::distance(TTrackTr::begin(track), cur) >= (i64)Rollbacks, "wrong rollbacks in node '%s'",
- Node->GetPath().data());
+ Node->GetPath().data());
const NLWTrace::TLogItem& item = *(cur - Rollbacks);
WWW_CHECK(item.SavedParamsCount > 0, "classify by params on probe w/o param loggging in node '%s'",
- Node->GetPath().data());
+ Node->GetPath().data());
TString paramValues[LWTRACE_MAX_PARAMS];
TString* paramValue = nullptr;
item.Probe->Event.Signature.SerializeParams(item.Params, paramValues);
@@ -2873,7 +2873,7 @@ public:
}
}
WWW_CHECK(paramValue, "param '%s' not found in probe '%s' at path '%s'",
- ParamName.data(), GetProbeName(item.Probe).data(), Node->GetPath().data());
+ ParamName.data(), GetProbeName(item.Probe).data(), Node->GetPath().data());
TPatternNode* node = &Children[*paramValue];
// Path example: "//Provider1.Probe1/Provider2.Probe2@1.xxx=123@2.type=harakiri"
@@ -3014,8 +3014,8 @@ public:
bool MatchTrack(const TTrack& track, const TString& patternStr)
{
- const char* pi = patternStr.data();
- const char* pe = pi + patternStr.size();
+ const char* pi = patternStr.data();
+ const char* pe = pi + patternStr.size();
WWW_CHECK_PATTERN("/");
for (TTrackIter i = TTrackTr::begin(track), e = TTrackTr::end(track); i != e; ++i) {
if (pi == pe) {
@@ -3603,7 +3603,7 @@ private:
}
TPatternNode* n = node;
for (auto i = ret.rbegin(), e = ret.rend(); i != e; ++i) {
- WWW_CHECK(n, "internal bug: wrong timeline length at pattern node '%s'", node->GetPath().data());
+ WWW_CHECK(n, "internal bug: wrong timeline length at pattern node '%s'", node->GetPath().data());
i->first = n;
n = n->Parent;
}
@@ -4540,7 +4540,7 @@ private:
TraceMngr->New(id, query);
Cleaner.Postpone(id, timeout, false);
} else {
- WWW_CHECK(!request.GetPostParams().Has("query"), "trace id '%s' is reserved for ad-hoc traces", id.data());
+ WWW_CHECK(!request.GetPostParams().Has("query"), "trace id '%s' is reserved for ad-hoc traces", id.data());
}
if (ui) {
WWW_HTML(out) {
diff --git a/library/cpp/lwtrace/trace.cpp b/library/cpp/lwtrace/trace.cpp
index 3c974c85a0..9c0443088e 100644
--- a/library/cpp/lwtrace/trace.cpp
+++ b/library/cpp/lwtrace/trace.cpp
@@ -50,7 +50,7 @@ namespace NLWTrace {
return; // silently skip probe double registration
}
TIds::key_type key(probe->Event.GetProvider(), probe->Event.Name);
- Y_VERIFY(Ids.count(key) == 0, "duplicate provider:probe pair %s:%s", key.first.data(), key.second.data());
+ Y_VERIFY(Ids.count(key) == 0, "duplicate provider:probe pair %s:%s", key.first.data(), key.second.data());
Probes.emplace(probe, box);
Ids.insert(key);
}
diff --git a/library/cpp/messagebus/config/session_config.cpp b/library/cpp/messagebus/config/session_config.cpp
index fbbbb106c9..e4b30278ff 100644
--- a/library/cpp/messagebus/config/session_config.cpp
+++ b/library/cpp/messagebus/config/session_config.cpp
@@ -46,13 +46,13 @@ static T ParseWithKmgSuffixT(const char* option) {
T multiplier = 1;
if (str.EndsWith('k')) {
multiplier = 1024;
- str = str.Head(str.size() - 1);
+ str = str.Head(str.size() - 1);
} else if (str.EndsWith('m')) {
multiplier = 1024 * 1024;
- str = str.Head(str.size() - 1);
+ str = str.Head(str.size() - 1);
} else if (str.EndsWith('g')) {
multiplier = 1024 * 1024 * 1024;
- str = str.Head(str.size() - 1);
+ str = str.Head(str.size() - 1);
}
return FromString<T>(str) * multiplier;
}
diff --git a/library/cpp/messagebus/message.cpp b/library/cpp/messagebus/message.cpp
index bfa7ed8e9b..7a81871d0d 100644
--- a/library/cpp/messagebus/message.cpp
+++ b/library/cpp/messagebus/message.cpp
@@ -112,7 +112,7 @@ namespace NBus {
if (Y_UNLIKELY(LocalFlags != 0)) {
TString describe = Describe();
TString localFlags = LocalFlagSetToString(LocalFlags);
- Y_FAIL("message local flags must be zero, got: %s, message: %s", localFlags.data(), describe.data());
+ Y_FAIL("message local flags must be zero, got: %s, message: %s", localFlags.data(), describe.data());
}
}
diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp
index 24bd778799..51e524c3aa 100644
--- a/library/cpp/messagebus/oldmodule/module.cpp
+++ b/library/cpp/messagebus/oldmodule/module.cpp
@@ -595,7 +595,7 @@ namespace NBus {
(int)(Now() - Message->GetHeader()->SendTime) / 1000,
(int)Pending.size(),
(int)Finished.size(),
- Status != MESSAGE_OK ? ToString(Status).data() : "");
+ Status != MESSAGE_OK ? ToString(Status).data() : "");
TJobStateVec::iterator it;
for (it = Pending.begin(); it != Pending.end(); ++it) {
@@ -613,7 +613,7 @@ namespace NBus {
(int)Message->GetHeader()->Type,
Session->GetProto()->GetService(),
(int)(Now() - Message->GetHeader()->SendTime) / 1000,
- ToString(Status).data());
+ ToString(Status).data());
return strReturn;
}
diff --git a/library/cpp/messagebus/rain_check/http/client.cpp b/library/cpp/messagebus/rain_check/http/client.cpp
index 5ef5ceeece..f27f4d0346 100644
--- a/library/cpp/messagebus/rain_check/http/client.cpp
+++ b/library/cpp/messagebus/rain_check/http/client.cpp
@@ -74,7 +74,7 @@ namespace NRainCheck {
THolder<THttpCallback> callback(new THttpCallback(future));
NNeh::TServiceStatRef stat;
try {
- NNeh::TMessage msg(addr.replace(0, NNeh::TParsedLocation(addr).Scheme.size(), "post"), data);
+ NNeh::TMessage msg(addr.replace(0, NNeh::TParsedLocation(addr).Scheme.size(), "post"), data);
TStringStream headersText;
headers.OutTo(&headersText);
NNeh::NHttp::MakeFullRequest(msg, headersText.Str(), TString());
diff --git a/library/cpp/messagebus/rain_check/http/client_ut.cpp b/library/cpp/messagebus/rain_check/http/client_ut.cpp
index 1628114391..95cf61d9db 100644
--- a/library/cpp/messagebus/rain_check/http/client_ut.cpp
+++ b/library/cpp/messagebus/rain_check/http/client_ut.cpp
@@ -41,11 +41,11 @@ namespace {
const TString TEST_POST_RECV = "POST was ok.";
TString BuildServiceLocation(ui32 port) {
- return Sprintf("http://*:%" PRIu32 "/%s", port, TEST_SERVICE.data());
+ return Sprintf("http://*:%" PRIu32 "/%s", port, TEST_SERVICE.data());
}
TString BuildPostServiceLocation(ui32 port) {
- return Sprintf("post://*:%" PRIu32 "/%s", port + 1, TEST_SERVICE.data());
+ return Sprintf("post://*:%" PRIu32 "/%s", port + 1, TEST_SERVICE.data());
}
TString BuildGetTestRequest(ui32 port) {
@@ -74,7 +74,7 @@ namespace {
const int THR_POOL_SIZE = 2;
runner->ForkLoop(THR_POOL_SIZE);
} catch (...) {
- Y_FAIL("Can't run server: %s", CurrentExceptionMessage().data());
+ Y_FAIL("Can't run server: %s", CurrentExceptionMessage().data());
}
return runner;
diff --git a/library/cpp/messagebus/remote_connection.cpp b/library/cpp/messagebus/remote_connection.cpp
index 22932569db..bdadf7e2e5 100644
--- a/library/cpp/messagebus/remote_connection.cpp
+++ b/library/cpp/messagebus/remote_connection.cpp
@@ -704,7 +704,7 @@ namespace NBus {
dataSize = sizeof(TBusHeader) + plaindata.Size();
NCodecs::TCodecPtr c = Proto->GetTransportCodec();
- c->Encode(TStringBuf{plaindata.data(), plaindata.size()}, compdata);
+ c->Encode(TStringBuf{plaindata.data(), plaindata.size()}, compdata);
if (compdata.Size() < plaindata.Size()) {
plaindata.Clear();
diff --git a/library/cpp/messagebus/session.cpp b/library/cpp/messagebus/session.cpp
index 46a7ece6a8..7436d2327f 100644
--- a/library/cpp/messagebus/session.cpp
+++ b/library/cpp/messagebus/session.cpp
@@ -53,7 +53,7 @@ namespace NBus {
// Simple check that we have to deal with ipv6 address specification or
// just host name or ipv4 address.
- if (!host.empty() && (host[0] == '[')) {
+ if (!host.empty() && (host[0] == '[')) {
size_t pos = host.find(']');
if (pos < 2 || pos == TString::npos) {
// '[]' and '[<address>' are errors.
@@ -98,7 +98,7 @@ namespace NBus {
hostName = host;
}
- if (port.empty()) {
+ if (port.empty()) {
portNum = GetProto()->GetPort();
} else {
try {
@@ -109,7 +109,7 @@ namespace NBus {
}
TBusService service = GetProto()->GetService();
- return GetQueue()->GetLocator()->Register(service, hostName.data(), portNum, start, end, ipVersion);
+ return GetQueue()->GetLocator()->Register(service, hostName.data(), portNum, start, end, ipVersion);
}
TBusSession::~TBusSession() {
diff --git a/library/cpp/messagebus/storage.cpp b/library/cpp/messagebus/storage.cpp
index efefc87340..f015624672 100644
--- a/library/cpp/messagebus/storage.cpp
+++ b/library/cpp/messagebus/storage.cpp
@@ -77,7 +77,7 @@ namespace NBus {
TValue value = {m.MessagePtr.Release()};
std::pair<TKeyToMessage::iterator, bool> p = KeyToMessage.insert(TKeyToMessage::value_type(m.Header.Id, value));
- Y_VERIFY(p.second, "non-unique id; %s", value.Message->Describe().data());
+ Y_VERIFY(p.second, "non-unique id; %s", value.Message->Describe().data());
TTimedItem item = {m.Header.Id, m.Header.SendTime};
TimedItems.push_back(item);
diff --git a/library/cpp/messagebus/test/helper/example.cpp b/library/cpp/messagebus/test/helper/example.cpp
index 7c6d704042..0d3000b81c 100644
--- a/library/cpp/messagebus/test/helper/example.cpp
+++ b/library/cpp/messagebus/test/helper/example.cpp
@@ -14,8 +14,8 @@ static void FillWithJunk(TArrayRef<char> data) {
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789012345678901234567890123456789";
- for (size_t i = 0; i < data.size(); i += junk.size()) {
- memcpy(data.data() + i, junk.data(), Min(junk.size(), data.size() - i));
+ for (size_t i = 0; i < data.size(); i += junk.size()) {
+ memcpy(data.data() + i, junk.data(), Min(junk.size(), data.size() - i));
}
}
@@ -79,9 +79,9 @@ void TExampleProtocol::Serialize(const TBusMessage* message, TBuffer& buffer) {
// Messages have no data, we recreate them from scratch
// instead of sending, so we don't need to serialize them.
if (const TExampleRequest* exampleMessage = dynamic_cast<const TExampleRequest*>(message)) {
- buffer.Append(exampleMessage->Data.data(), exampleMessage->Data.size());
+ buffer.Append(exampleMessage->Data.data(), exampleMessage->Data.size());
} else if (const TExampleResponse* exampleReply = dynamic_cast<const TExampleResponse*>(message)) {
- buffer.Append(exampleReply->Data.data(), exampleReply->Data.size());
+ buffer.Append(exampleReply->Data.data(), exampleReply->Data.size());
} else {
Y_FAIL("unknown message type");
}
@@ -277,5 +277,5 @@ void TExampleServer::OnMessage(TOnMessageContext& mess) {
status = mess.SendReplyMove(reply);
}
- Y_VERIFY(status == MESSAGE_OK, "failed to send reply: %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "failed to send reply: %s", ToString(status).data());
}
diff --git a/library/cpp/messagebus/test/helper/message_handler_error.cpp b/library/cpp/messagebus/test/helper/message_handler_error.cpp
index c09811ec67..97c73a101d 100644
--- a/library/cpp/messagebus/test/helper/message_handler_error.cpp
+++ b/library/cpp/messagebus/test/helper/message_handler_error.cpp
@@ -6,7 +6,7 @@ using namespace NBus;
using namespace NBus::NTest;
void TBusClientHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) {
- Y_FAIL("must not be called, status: %s", ToString(status).data());
+ Y_FAIL("must not be called, status: %s", ToString(status).data());
}
void TBusClientHandlerError::OnReply(TAutoPtr<TBusMessage>, TAutoPtr<TBusMessage>) {
@@ -18,7 +18,7 @@ void TBusClientHandlerError::OnMessageSentOneWay(TAutoPtr<TBusMessage>) {
}
void TBusServerHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) {
- Y_FAIL("must not be called, status: %s", ToString(status).data());
+ Y_FAIL("must not be called, status: %s", ToString(status).data());
}
void TBusServerHandlerError::OnMessage(TOnMessageContext&) {
diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp
index 8489319278..dbbddf6ef9 100644
--- a/library/cpp/messagebus/test/perftest/perftest.cpp
+++ b/library/cpp/messagebus/test/perftest/perftest.cpp
@@ -157,7 +157,7 @@ void CheckRequest(TPerftestRequest* request) {
TAutoPtr<TPerftestResponse> NewResponse(TPerftestRequest* request) {
TAutoPtr<TPerftestResponse> r(new TPerftestResponse);
r->SetCompressed(TheConfig->UseCompression);
- r->Record.SetData(TString(request->Record.GetData().size(), '.'));
+ r->Record.SetData(TString(request->Record.GetData().size(), '.'));
return r;
}
@@ -475,10 +475,10 @@ TVector<TNetAddr> ParseNodes(const TString nodes) {
TVector<TString> hosts;
- size_t numh = Split(nodes.data(), ",", hosts);
+ size_t numh = Split(nodes.data(), ",", hosts);
for (int i = 0; i < int(numh); i++) {
- const TNetworkAddress& networkAddress = ParseNetworkAddress(hosts[i].data());
+ const TNetworkAddress& networkAddress = ParseNetworkAddress(hosts[i].data());
Y_VERIFY(networkAddress.Begin() != networkAddress.End(), "no addresses");
r.push_back(TNetAddr(networkAddress, &*networkAddress.Begin()));
}
@@ -542,17 +542,17 @@ void TTestStats::PeriodicallyPrint() {
if (!!Server) {
fprintf(stderr, "server: q: %u %s\n",
(unsigned)Server->Bus->GetExecutor()->GetWorkQueueSize(),
- Server->Session->GetStatusSingleLine().data());
+ Server->Session->GetStatusSingleLine().data());
}
if (!!ServerUsingModule) {
fprintf(stderr, "server: q: %u %s\n",
(unsigned)ServerUsingModule->Bus->GetExecutor()->GetWorkQueueSize(),
- ServerUsingModule->Session->GetStatusSingleLine().data());
+ ServerUsingModule->Session->GetStatusSingleLine().data());
}
for (const auto& client : clients) {
fprintf(stderr, "client: q: %u %s\n",
(unsigned)client->Bus->GetExecutor()->GetWorkQueueSize(),
- client->Session->GetStatusSingleLine().data());
+ client->Session->GetStatusSingleLine().data());
}
TStringStream stats;
diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp
index 040f9b7702..a79b266a12 100644
--- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp
+++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp
@@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override {
Y_UNUSED(message);
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
TestSync.CheckAndIncrement((failures++) * 2);
}
@@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
status = client.Session->SendMessageAutoPtr(message, &noServerAddr);
}
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
if (count == 0) {
// lame way to wait until it is connected
@@ -266,7 +266,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
TSystemEvent ErrorHappened;
void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override {
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data());
ErrorHappened.Signal();
}
};
@@ -378,7 +378,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override {
Y_UNUSED(mess);
- Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data());
}
};
@@ -697,7 +697,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override {
TestSync.WaitForAndIncrement(0);
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data());
mess.Destroy();
TestSync.CheckAndIncrement(1);
}
@@ -726,7 +726,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override {
TestSync.CheckAndIncrement(0);
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
// check reset is possible here
message->Reset();
@@ -755,7 +755,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
client.Session->Shutdown();
ok = client.Session->SendMessageOneWay(message);
- Y_VERIFY(ok == MESSAGE_SHUTDOWN, "must be shutdown when sending during shutdown, got %s", ToString(ok).data());
+ Y_VERIFY(ok == MESSAGE_SHUTDOWN, "must be shutdown when sending during shutdown, got %s", ToString(ok).data());
// check reset is possible here
message->Reset();
@@ -1074,7 +1074,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
@@ -1085,7 +1085,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
@@ -1107,7 +1107,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
@@ -1134,7 +1134,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
diff --git a/library/cpp/messagebus/test/ut/module_client_ut.cpp b/library/cpp/messagebus/test/ut/module_client_ut.cpp
index ebfe185cc6..4e107ecd2d 100644
--- a/library/cpp/messagebus/test/ut/module_client_ut.cpp
+++ b/library/cpp/messagebus/test/ut/module_client_ut.cpp
@@ -178,7 +178,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) {
}
void ReplyHandler(TBusJob*, EMessageStatus status, TBusMessage* req, TBusMessage* resp) {
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got wrong status: %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got wrong status: %s", ToString(status).data());
Y_VERIFY(req == SentMessage, "checking request");
Y_VERIFY(resp == nullptr, "checking response");
GotReplyLatch.CountDown();
diff --git a/library/cpp/messagebus/ybus.h b/library/cpp/messagebus/ybus.h
index de21ad8521..6e286471ca 100644
--- a/library/cpp/messagebus/ybus.h
+++ b/library/cpp/messagebus/ybus.h
@@ -67,7 +67,7 @@ namespace NBus {
/// returns service type for this protocol and message
TBusService GetService() const {
- return ServiceName.data();
+ return ServiceName.data();
}
/// returns port number for destination session to open socket
diff --git a/library/cpp/monlib/dynamic_counters/encode.cpp b/library/cpp/monlib/dynamic_counters/encode.cpp
index ffa48d276e..cf09311cc6 100644
--- a/library/cpp/monlib/dynamic_counters/encode.cpp
+++ b/library/cpp/monlib/dynamic_counters/encode.cpp
@@ -53,7 +53,7 @@ namespace NMonitoring {
void OnGroupBegin(
const TString& labelName, const TString& labelValue,
const TDynamicCounters*) override {
- if (labelName.empty() && labelValue.empty()) {
+ if (labelName.empty() && labelValue.empty()) {
// root group has empty label name and value
EncoderImpl_->OnStreamBegin();
} else {
@@ -64,7 +64,7 @@ namespace NMonitoring {
void OnGroupEnd(
const TString& labelName, const TString& labelValue,
const TDynamicCounters*) override {
- if (labelName.empty() && labelValue.empty()) {
+ if (labelName.empty() && labelValue.empty()) {
// root group has empty label name and value
EncoderImpl_->OnStreamEnd();
EncoderImpl_->Close();
diff --git a/library/cpp/monlib/dynamic_counters/golovan_page.cpp b/library/cpp/monlib/dynamic_counters/golovan_page.cpp
index 49cf2d39bb..b33e4c3871 100644
--- a/library/cpp/monlib/dynamic_counters/golovan_page.cpp
+++ b/library/cpp/monlib/dynamic_counters/golovan_page.cpp
@@ -44,7 +44,7 @@ public:
void OnGroupBegin(const TString&, const TString& value, const TDynamicCounters*) override {
prefix += value;
- if (!value.empty()) {
+ if (!value.empty()) {
prefix += "_";
}
}
diff --git a/library/cpp/monlib/dynamic_counters/page.cpp b/library/cpp/monlib/dynamic_counters/page.cpp
index 5124a47bb3..a3517a4556 100644
--- a/library/cpp/monlib/dynamic_counters/page.cpp
+++ b/library/cpp/monlib/dynamic_counters/page.cpp
@@ -4,7 +4,7 @@
#include <library/cpp/monlib/service/pages/templates.h>
#include <library/cpp/string_utils/quote/quote.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <util/system/tls.h>
using namespace NMonitoring;
diff --git a/library/cpp/monlib/encode/buffered/string_pool.cpp b/library/cpp/monlib/encode/buffered/string_pool.cpp
index b4c7988ba3..35b0b6d114 100644
--- a/library/cpp/monlib/encode/buffered/string_pool.cpp
+++ b/library/cpp/monlib/encode/buffered/string_pool.cpp
@@ -9,7 +9,7 @@ namespace NMonitoring {
auto [it, isInserted] = StrMap_.try_emplace(str, Max<ui32>(), 0);
if (isInserted) {
- BytesSize_ += str.size();
+ BytesSize_ += str.size();
it->second.Index = StrVector_.size();
StrVector_.emplace_back(it->first, &it->second);
}
diff --git a/library/cpp/monlib/encode/format.cpp b/library/cpp/monlib/encode/format.cpp
index 400ce5a643..b093f03516 100644
--- a/library/cpp/monlib/encode/format.cpp
+++ b/library/cpp/monlib/encode/format.cpp
@@ -1,7 +1,7 @@
#include "format.h"
#include <util/string/ascii.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <util/string/strip.h>
#include <util/stream/output.h>
#include <util/string/cast.h>
diff --git a/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp b/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp
index f87a2d7e8f..d9e39d516a 100644
--- a/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp
+++ b/library/cpp/monlib/encode/legacy_protobuf/legacy_proto_decoder.cpp
@@ -7,7 +7,7 @@
#include <util/generic/yexception.h>
#include <util/generic/maybe.h>
#include <util/datetime/base.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <google/protobuf/reflection.h>
@@ -256,7 +256,7 @@ namespace NMonitoring {
return !maybeMeta->HasPath() || maybeMeta->GetPath();
};
- if (!name.empty() && (!maybeMeta || usePath())) {
+ if (!name.empty() && (!maybeMeta || usePath())) {
child.AppendPath(name);
}
@@ -495,7 +495,7 @@ namespace NMonitoring {
Consumer_->OnLabel(label.Name(), label.Value());
}
- const auto fullPath = name.empty()
+ const auto fullPath = name.empty()
? ctx.Path()
: ctx.Path() + '/' + name;
diff --git a/library/cpp/monlib/encode/spack/compression.cpp b/library/cpp/monlib/encode/spack/compression.cpp
index 0d2152fc85..595af2b504 100644
--- a/library/cpp/monlib/encode/spack/compression.cpp
+++ b/library/cpp/monlib/encode/spack/compression.cpp
@@ -44,13 +44,13 @@ namespace NMonitoring {
struct TBlock: public TStringBuf {
template <typename T>
TBlock(T&& t)
- : TStringBuf(t.data(), t.size())
+ : TStringBuf(t.data(), t.size())
{
Y_ENSURE(t.data() != nullptr);
}
- char* data() noexcept {
- return const_cast<char*>(TStringBuf::data());
+ char* data() noexcept {
+ return const_cast<char*>(TStringBuf::data());
}
};
@@ -73,7 +73,7 @@ namespace NMonitoring {
///////////////////////////////////////////////////////////////////////////////
struct TAdler32 {
static TCheckSum Calc(TBlock in) {
- return adler32(1L, reinterpret_cast<const Bytef*>(in.data()), in.size());
+ return adler32(1L, reinterpret_cast<const Bytef*>(in.data()), in.size());
}
static bool Check(TBlock in, TCheckSum checksum) {
@@ -93,20 +93,20 @@ namespace NMonitoring {
static size_t Compress(TBlock in, TBlock out) {
int rc = LZ4_compress_default(
- in.data(),
- out.data(),
- SafeIntegerCast<int>(in.size()),
- SafeIntegerCast<int>(out.size()));
+ in.data(),
+ out.data(),
+ SafeIntegerCast<int>(in.size()),
+ SafeIntegerCast<int>(out.size()));
Y_ENSURE(rc != 0, "lz4 compression failed");
return rc;
}
static void Decompress(TBlock in, TBlock out) {
int rc = LZ4_decompress_safe(
- in.data(),
- out.data(),
- SafeIntegerCast<int>(in.size()),
- SafeIntegerCast<int>(out.size()));
+ in.data(),
+ out.data(),
+ SafeIntegerCast<int>(in.size()),
+ SafeIntegerCast<int>(out.size()));
Y_ENSURE(rc >= 0, "the lz4 stream is detected malformed");
}
};
@@ -122,7 +122,7 @@ namespace NMonitoring {
}
static size_t Compress(TBlock in, TBlock out) {
- size_t rc = ZSTD_compress(out.data(), out.size(), in.data(), in.size(), LEVEL);
+ size_t rc = ZSTD_compress(out.data(), out.size(), in.data(), in.size(), LEVEL);
if (Y_UNLIKELY(ZSTD_isError(rc))) {
ythrow yexception() << TStringBuf("zstd compression failed: ")
<< ZSTD_getErrorName(rc);
@@ -131,12 +131,12 @@ namespace NMonitoring {
}
static void Decompress(TBlock in, TBlock out) {
- size_t rc = ZSTD_decompress(out.data(), out.size(), in.data(), in.size());
+ size_t rc = ZSTD_decompress(out.data(), out.size(), in.data(), in.size());
if (Y_UNLIKELY(ZSTD_isError(rc))) {
ythrow yexception() << TStringBuf("zstd decompression failed: ")
<< ZSTD_getErrorName(rc);
}
- Y_ENSURE(rc == out.size(), "zstd decompressed wrong size");
+ Y_ENSURE(rc == out.size(), "zstd decompressed wrong size");
}
};
@@ -151,26 +151,26 @@ namespace NMonitoring {
}
static size_t Compress(TBlock in, TBlock out) {
- uLong ret = out.size();
+ uLong ret = out.size();
int rc = compress2(
- reinterpret_cast<Bytef*>(out.data()),
+ reinterpret_cast<Bytef*>(out.data()),
&ret,
- reinterpret_cast<const Bytef*>(in.data()),
- in.size(),
+ reinterpret_cast<const Bytef*>(in.data()),
+ in.size(),
LEVEL);
Y_ENSURE(rc == Z_OK, "zlib compression failed");
return ret;
}
static void Decompress(TBlock in, TBlock out) {
- uLong ret = out.size();
+ uLong ret = out.size();
int rc = uncompress(
- reinterpret_cast<Bytef*>(out.data()),
+ reinterpret_cast<Bytef*>(out.data()),
&ret,
- reinterpret_cast<const Bytef*>(in.data()),
- in.size());
+ reinterpret_cast<const Bytef*>(in.data()),
+ in.size());
Y_ENSURE(rc == Z_OK, "zlib decompression failed");
- Y_ENSURE(ret == out.size(), "zlib decompressed wrong size");
+ Y_ENSURE(ret == out.size(), "zlib decompressed wrong size");
}
};
@@ -321,7 +321,7 @@ namespace NMonitoring {
// add header
auto header = reinterpret_cast<TFrameHeader*>(Frame_.Data());
- header->CompressedSize = SafeIntegerCast<TCompressedSize>(compressedBlock.size());
+ header->CompressedSize = SafeIntegerCast<TCompressedSize>(compressedBlock.size());
header->UncompressedSize = SafeIntegerCast<TUncompressedSize>(Uncompressed_.Size());
// add footer
diff --git a/library/cpp/monlib/encode/unistat/unistat_decoder.cpp b/library/cpp/monlib/encode/unistat/unistat_decoder.cpp
index b2344b0905..4f45106e60 100644
--- a/library/cpp/monlib/encode/unistat/unistat_decoder.cpp
+++ b/library/cpp/monlib/encode/unistat/unistat_decoder.cpp
@@ -9,7 +9,7 @@
#include <library/cpp/json/json_reader.h>
#include <util/datetime/base.h>
-#include <util/string/split.h>
+#include <util/string/split.h>
#include <contrib/libs/re2/re2/re2.h>
@@ -174,7 +174,7 @@ namespace NMonitoring {
TStringBuf name = parts.back();
parts.pop_back();
- Y_ENSURE(RE2::FullMatch(re2::StringPiece{name.data(), name.size()}, NAME_RE),
+ Y_ENSURE(RE2::FullMatch(re2::StringPiece{name.data(), name.size()}, NAME_RE),
"Metric name " << name << " doesn't match regex " << NAME_RE.pattern());
MetricContext_.Name = name;
@@ -246,7 +246,7 @@ namespace NMonitoring {
}
void DecodeUnistatToStream(TStringBuf data, IMetricConsumer* c, TInstant ts) {
- TMemoryInput in{data.data(), data.size()};
+ TMemoryInput in{data.data(), data.size()};
TDecoderUnistat decoder(c, &in, ts);
decoder.Decode();
}
diff --git a/library/cpp/monlib/service/format.h b/library/cpp/monlib/service/format.h
index 0044b586b1..990b953945 100644
--- a/library/cpp/monlib/service/format.h
+++ b/library/cpp/monlib/service/format.h
@@ -48,7 +48,7 @@ namespace NMonitoring {
auto&& formatStr = req.GetParams()
.Get(TStringBuf("format"));
- if (!formatStr.empty()) {
+ if (!formatStr.empty()) {
if (formatStr == TStringBuf("SPACK")) {
return EFormat::SPACK;
} else if (formatStr == TStringBuf("TEXT")) {
diff --git a/library/cpp/monlib/service/pages/index_mon_page.cpp b/library/cpp/monlib/service/pages/index_mon_page.cpp
index 83ff8b529a..582eac2908 100644
--- a/library/cpp/monlib/service/pages/index_mon_page.cpp
+++ b/library/cpp/monlib/service/pages/index_mon_page.cpp
@@ -32,7 +32,7 @@ void TIndexMonPage::Output(IMonHttpRequest& request) {
if (i != PagesByPath.end()) {
found = i->second;
pathInfo = request.GetPathInfo().substr(pathTmp.size());
- Y_VERIFY(pathInfo.empty() || pathInfo.StartsWith('/'));
+ Y_VERIFY(pathInfo.empty() || pathInfo.StartsWith('/'));
break;
}
size_t slash = pathTmp.find_last_of('/');
diff --git a/library/cpp/monlib/service/pages/mon_page.h b/library/cpp/monlib/service/pages/mon_page.h
index e396612bb0..9903a16670 100644
--- a/library/cpp/monlib/service/pages/mon_page.h
+++ b/library/cpp/monlib/service/pages/mon_page.h
@@ -57,7 +57,7 @@ namespace NMonitoring {
}
bool IsInIndex() const {
- return !Title.empty();
+ return !Title.empty();
}
virtual void Output(IMonHttpRequest& request) = 0;
diff --git a/library/cpp/monlib/service/pages/registry_mon_page.cpp b/library/cpp/monlib/service/pages/registry_mon_page.cpp
index c59e50f622..294e140d92 100644
--- a/library/cpp/monlib/service/pages/registry_mon_page.cpp
+++ b/library/cpp/monlib/service/pages/registry_mon_page.cpp
@@ -11,7 +11,7 @@ namespace NMonitoring {
const auto formatStr = TStringBuf{request.GetPathInfo()}.RNextTok('/');
auto& out = request.Output();
- if (!formatStr.empty()) {
+ if (!formatStr.empty()) {
IMetricEncoderPtr encoder;
TString resp;
diff --git a/library/cpp/monlib/service/pages/templates.h b/library/cpp/monlib/service/pages/templates.h
index b4656f059f..f1479b643f 100644
--- a/library/cpp/monlib/service/pages/templates.h
+++ b/library/cpp/monlib/service/pages/templates.h
@@ -204,33 +204,33 @@ namespace NMonitoring {
IOutputStream& Str;
};
- extern const char HtmlTag[5];
- extern const char HeadTag[5];
- extern const char BodyTag[5];
- extern const char DivTag[4];
- extern const char TableTag[6];
- extern const char TableHeadTag[6];
- extern const char TableBodyTag[6];
- extern const char TableRTag[3];
- extern const char TableDTag[3];
- extern const char TableHTag[3];
- extern const char FormTag[5];
- extern const char LabelTag[6];
- extern const char SpanTag[5];
- extern const char CaptionTag[8];
- extern const char PreTag[4];
- extern const char ParaTag[2];
- extern const char H1Tag[3];
- extern const char H2Tag[3];
- extern const char H3Tag[3];
- extern const char H4Tag[3];
- extern const char H5Tag[3];
- extern const char H6Tag[3];
- extern const char SmallTag[6];
- extern const char StrongTag[7];
- extern const char ListTag[3];
- extern const char UListTag[3];
- extern const char OListTag[3];
+ extern const char HtmlTag[5];
+ extern const char HeadTag[5];
+ extern const char BodyTag[5];
+ extern const char DivTag[4];
+ extern const char TableTag[6];
+ extern const char TableHeadTag[6];
+ extern const char TableBodyTag[6];
+ extern const char TableRTag[3];
+ extern const char TableDTag[3];
+ extern const char TableHTag[3];
+ extern const char FormTag[5];
+ extern const char LabelTag[6];
+ extern const char SpanTag[5];
+ extern const char CaptionTag[8];
+ extern const char PreTag[4];
+ extern const char ParaTag[2];
+ extern const char H1Tag[3];
+ extern const char H2Tag[3];
+ extern const char H3Tag[3];
+ extern const char H4Tag[3];
+ extern const char H5Tag[3];
+ extern const char H6Tag[3];
+ extern const char SmallTag[6];
+ extern const char StrongTag[7];
+ extern const char ListTag[3];
+ extern const char UListTag[3];
+ extern const char OListTag[3];
extern const char DListTag[3];
extern const char DTermTag[3];
extern const char DDescTag[3];
diff --git a/library/cpp/monlib/service/service.cpp b/library/cpp/monlib/service/service.cpp
index 929efbf816..8a7d8b01ea 100644
--- a/library/cpp/monlib/service/service.cpp
+++ b/library/cpp/monlib/service/service.cpp
@@ -21,11 +21,11 @@ namespace NMonitoring {
RemoteAddr = remoteAddr;
THttpHeaderParser parser;
parser.Init(&Header);
- if (parser.Execute(in.FirstLine().data(), in.FirstLine().size()) < 0) {
+ if (parser.Execute(in.FirstLine().data(), in.FirstLine().size()) < 0) {
out << "HTTP/1.1 400 Bad request\r\nConnection: Close\r\n\r\n";
return;
}
- if (Url.Parse(Header.GetUrl().data()) != THttpURL::ParsedOK) {
+ if (Url.Parse(Header.GetUrl().data()) != THttpURL::ParsedOK) {
out << "HTTP/1.1 400 Invalid url\r\nConnection: Close\r\n\r\n";
return;
}
@@ -38,7 +38,7 @@ namespace NMonitoring {
CgiParams.Scan(Url.Get(THttpURL::FieldQuery));
} catch (...) {
out << "HTTP/1.1 500 Internal server error\r\nConnection: Close\r\n\r\n";
- YSYSLOG(TLOG_ERR, "THttpClient: internal error while serving monitoring request: %s", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_ERR, "THttpClient: internal error while serving monitoring request: %s", CurrentExceptionMessage().data());
}
if (Header.http_method == HTTP_METHOD_POST)
@@ -75,7 +75,7 @@ namespace NMonitoring {
return (HTTP_METHOD)Header.http_method;
}
void ScanPostParams() {
- PostParams.Scan(TStringBuf(PostContent.Buffer().data(), PostContent.Buffer().size()));
+ PostParams.Scan(TStringBuf(PostContent.Buffer().data(), PostContent.Buffer().size()));
}
const THttpHeaders& GetHeaders() const override {
@@ -123,7 +123,7 @@ namespace NMonitoring {
out << s.Str();
out.Finish();
} catch (...) {
- YSYSLOG(TLOG_WARNING, "TCoHttpServer::TConnection: error: %s\n", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_WARNING, "TCoHttpServer::TConnection: error: %s\n", CurrentExceptionMessage().data());
}
}
@@ -143,7 +143,7 @@ namespace NMonitoring {
try {
Listener.Bind(TIpAddress(bindAddr, port));
} catch (yexception e) {
- Y_FAIL("TCoHttpServer::TCoHttpServer: couldn't bind to %s:%d\n", bindAddr.data(), port);
+ Y_FAIL("TCoHttpServer::TCoHttpServer: couldn't bind to %s:%d\n", bindAddr.data(), port);
}
}
@@ -177,11 +177,11 @@ namespace NMonitoring {
out << "HTTP/1.1 200 Ok\nConnection: Close\n\n";
TransferData(&http_in, &out);
} catch (...) {
- YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
}
} catch (const yexception& /*e*/) {
out << "HTTP/1.1 500 Internal server error\nConnection: Close\n\n";
- YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
+ YSYSLOG(TLOG_DEBUG, "TCoHttpServer: while getting data from backend: %s", CurrentExceptionMessage().data());
}
}
diff --git a/library/cpp/on_disk/chunks/chunked_helpers.h b/library/cpp/on_disk/chunks/chunked_helpers.h
index 5fa96afdca..d8ff9237e4 100644
--- a/library/cpp/on_disk/chunks/chunked_helpers.h
+++ b/library/cpp/on_disk/chunks/chunked_helpers.h
@@ -66,7 +66,7 @@ public:
void Save(IOutputStream& out) const {
ui64 uSize = (ui64)Vector.size();
out.Write(&uSize, sizeof(uSize));
- out.Write(Vector.data(), Vector.size() * sizeof(T));
+ out.Write(Vector.data(), Vector.size() * sizeof(T));
}
const T& At(size_t idx) const {
@@ -239,7 +239,7 @@ private:
bool IsPlainEnought(ui16 bits) const {
TVector<size_t> counts(1LL << bits, 0);
- for (size_t i = 0; i < Data.size(); ++i) {
+ for (size_t i = 0; i < Data.size(); ++i) {
size_t& count = counts[KeyHash<TKey>(TKeyValuePair::GetFirst(&Data[i]), bits)];
++count;
if (count > 2)
@@ -273,7 +273,7 @@ public:
const ui32 nBuckets = ui32(1) << bits;
TData2 data2(nBuckets);
- for (size_t i = 0; i < Data.size(); ++i)
+ for (size_t i = 0; i < Data.size(); ++i)
data2[KeyHash<TKey>(TKeyValuePair::GetFirst(&Data[i]), bits)].push_back(Data[i]);
typedef TVector<TInterval> TIntervals;
@@ -292,9 +292,9 @@ public:
ythrow yexception() << "key clash";
}
#endif
- out.Write(intervals.data(), intervals.size() * sizeof(intervals[0]));
+ out.Write(intervals.data(), intervals.size() * sizeof(intervals[0]));
for (ui32 i = 0; i < nBuckets; ++i)
- out.Write(data2[i].data(), data2[i].size() * sizeof(data2[i][0]));
+ out.Write(data2[i].data(), data2[i].size() * sizeof(data2[i][0]));
}
};
@@ -497,7 +497,7 @@ public:
inline const char* GetBlockName(size_t index) const {
Y_ASSERT(index < GetBlocksCount());
- return Names[index].data();
+ return Names[index].data();
}
inline const void* GetBlockByName(const char* name) const {
@@ -595,7 +595,7 @@ public:
}
void PushBack(const T& t) {
- Offsets.push_back((ui64) Data.size());
+ Offsets.push_back((ui64) Data.size());
TSaveLoadVectorNonPodElement<T>::Save(&DataStream, t);
}
@@ -604,12 +604,12 @@ public:
}
void Save(IOutputStream& out) const {
- ui64 sizeofOffsets = Offsets.size() + 1;
+ ui64 sizeofOffsets = Offsets.size() + 1;
out.Write(&sizeofOffsets, sizeof(sizeofOffsets));
- out.Write(Offsets.data(), Offsets.size() * sizeof(Offsets[0]));
- ui64 lastOffset = (ui64) Data.size();
+ out.Write(Offsets.data(), Offsets.size() * sizeof(Offsets[0]));
+ ui64 lastOffset = (ui64) Data.size();
out.Write(&lastOffset, sizeof(lastOffset));
- out.Write(Data.data(), Data.size());
+ out.Write(Data.data(), Data.size());
}
};
@@ -657,7 +657,7 @@ struct TGeneralVectorG<TItem, true> {
template <>
struct TSaveLoadVectorNonPodElement<TString> {
static inline void Save(IOutputStream* out, const TString& s) {
- out->Write(s.data(), s.size() + 1);
+ out->Write(s.data(), s.size() + 1);
}
static inline void Load(TMemoryInput* in, TString& s, size_t elementSize) {
diff --git a/library/cpp/on_disk/chunks/writer.cpp b/library/cpp/on_disk/chunks/writer.cpp
index 6dc7397f09..c74d90dbc1 100644
--- a/library/cpp/on_disk/chunks/writer.cpp
+++ b/library/cpp/on_disk/chunks/writer.cpp
@@ -3,7 +3,7 @@
#include "writer.h"
static inline void WriteAux(IOutputStream* out, const TVector<ui64>& data) {
- ::SavePodArray(out, data.data(), data.size());
+ ::SavePodArray(out, data.data(), data.size());
}
/*************************** TBuffersWriter ***************************/
diff --git a/library/cpp/openssl/io/stream.cpp b/library/cpp/openssl/io/stream.cpp
index 0b4be38c0e..4530d8a565 100644
--- a/library/cpp/openssl/io/stream.cpp
+++ b/library/cpp/openssl/io/stream.cpp
@@ -184,8 +184,8 @@ namespace {
inline void InitVerification(ssl_st* ssl) {
X509_VERIFY_PARAM* param = SSL_get0_param(ssl);
X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
- Y_ENSURE(X509_VERIFY_PARAM_set1_host(param, VerifyCert_->Hostname_.data(), VerifyCert_->Hostname_.size()));
- SSL_set_tlsext_host_name(ssl, VerifyCert_->Hostname_.data()); // TLS extenstion: SNI
+ Y_ENSURE(X509_VERIFY_PARAM_set1_host(param, VerifyCert_->Hostname_.data(), VerifyCert_->Hostname_.size()));
+ SSL_set_tlsext_host_name(ssl, VerifyCert_->Hostname_.data()); // TLS extenstion: SNI
SSL_CTX_set_cert_store(Ctx.Get(), GetBuiltinOpenSslX509Store().Release());
diff --git a/library/cpp/packedtypes/longs_ut.cpp b/library/cpp/packedtypes/longs_ut.cpp
index 8b06c934d2..2764e9e344 100644
--- a/library/cpp/packedtypes/longs_ut.cpp
+++ b/library/cpp/packedtypes/longs_ut.cpp
@@ -38,7 +38,7 @@ Y_UNIT_TEST_SUITE(TLongsTest) {
s += Sprintf("OK\n");
}
- UNIT_ASSERT_EQUAL(Crc<ui64>(s.data(), s.size()), 7251624297500315779ULL); // WTF?
+ UNIT_ASSERT_EQUAL(Crc<ui64>(s.data(), s.size()), 7251624297500315779ULL); // WTF?
}
template <typename TSignedInt>
diff --git a/library/cpp/packers/ut/region_packer_ut.cpp b/library/cpp/packers/ut/region_packer_ut.cpp
index 0cb08ccf65..a3777a34d8 100644
--- a/library/cpp/packers/ut/region_packer_ut.cpp
+++ b/library/cpp/packers/ut/region_packer_ut.cpp
@@ -17,7 +17,7 @@ void TestPacker() {
p.PackLeaf(buffer.begin(), valueRegion, sz);
UNIT_ASSERT_VALUES_EQUAL(buffer[0], 4);
- p.UnpackLeaf(buffer.data(), valueRegion);
+ p.UnpackLeaf(buffer.data(), valueRegion);
UNIT_ASSERT_EQUAL(valueRegion.data(), (const TValue*)(buffer.begin() + 1));
UNIT_ASSERT_EQUAL(valueRegion.size(), Y_ARRAY_SIZE(values));
UNIT_ASSERT_EQUAL(0, memcmp(values, valueRegion.data(), sizeof(values)));
diff --git a/library/cpp/pop_count/popcount.h b/library/cpp/pop_count/popcount.h
index 3d67737ed2..c398f3fae7 100644
--- a/library/cpp/pop_count/popcount.h
+++ b/library/cpp/pop_count/popcount.h
@@ -11,17 +11,17 @@
#endif
static inline ui32 PopCountImpl(ui8 n) {
-#if defined(_ppc64_)
- ui32 r;
- __asm__("popcntb %0, %1"
- : "=r"(r)
- : "r"(n)
- :);
- return r;
-#else
+#if defined(_ppc64_)
+ ui32 r;
+ __asm__("popcntb %0, %1"
+ : "=r"(r)
+ : "r"(n)
+ :);
+ return r;
+#else
extern ui8 const* PopCountLUT8;
return PopCountLUT8[n];
-#endif
+#endif
}
static inline ui32 PopCountImpl(ui16 n) {
@@ -48,18 +48,18 @@ static inline ui32 PopCountImpl(ui32 n) {
return r;
}
-#else
-#if defined(_ppc64_)
- ui32 r;
-
- __asm__("popcntw %0, %1"
- : "=r"(r)
- : "r"(n)
- :);
-
- return r;
-#endif
+#else
+#if defined(_ppc64_)
+ ui32 r;
+
+ __asm__("popcntw %0, %1"
+ : "=r"(r)
+ : "r"(n)
+ :);
+
+ return r;
#endif
+#endif
return PopCountImpl((ui16)Lo16(n)) + PopCountImpl((ui16)Hi16(n));
#endif
@@ -80,18 +80,18 @@ static inline ui32 PopCountImpl(ui64 n) {
return r;
}
-#else
-#if defined(_ppc64_)
- ui32 r;
-
- __asm__("popcntd %0, %1"
- : "=r"(r)
- : "r"(n)
- :);
-
- return r;
-#endif
+#else
+#if defined(_ppc64_)
+ ui32 r;
+
+ __asm__("popcntd %0, %1"
+ : "=r"(r)
+ : "r"(n)
+ :);
+
+ return r;
#endif
+#endif
return PopCountImpl((ui32)Lo32(n)) + PopCountImpl((ui32)Hi32(n));
#endif
diff --git a/library/cpp/random_provider/random_provider.cpp b/library/cpp/random_provider/random_provider.cpp
index 64cb48b8b7..fcb0d9c802 100644
--- a/library/cpp/random_provider/random_provider.cpp
+++ b/library/cpp/random_provider/random_provider.cpp
@@ -27,8 +27,8 @@ public:
TGUID GenUuid4() noexcept override {
TGUID ret;
- WriteUnaligned<ui64>(ret.dw, RandomNumber<ui64>());
- WriteUnaligned<ui64>(ret.dw + 2, RandomNumber<ui64>());
+ WriteUnaligned<ui64>(ret.dw, RandomNumber<ui64>());
+ WriteUnaligned<ui64>(ret.dw + 2, RandomNumber<ui64>());
SetV4(ret);
return ret;
}
diff --git a/library/cpp/regex/pcre/regexp.cpp b/library/cpp/regex/pcre/regexp.cpp
index 575c09cee4..487a9100b9 100644
--- a/library/cpp/regex/pcre/regexp.cpp
+++ b/library/cpp/regex/pcre/regexp.cpp
@@ -5,9 +5,9 @@
#include <util/system/defaults.h>
#include <cstdlib>
-#include <util/generic/noncopyable.h>
+#include <util/generic/noncopyable.h>
-class TGlobalImpl : TNonCopyable {
+class TGlobalImpl : TNonCopyable {
private:
const char* Str;
regmatch_t* Pmatch;
@@ -149,13 +149,13 @@ public:
: CompileOptions(cflags)
, RegExpr(re)
{
- int rc = regcomp(&Preg, re.data(), cflags);
+ int rc = regcomp(&Preg, re.data(), cflags);
if (rc) {
const size_t ERRBUF_SIZE = 100;
char errbuf[ERRBUF_SIZE];
regerror(rc, &Preg, errbuf, ERRBUF_SIZE);
Error = "Error: regular expression " + re + " is wrong: " + errbuf;
- ythrow yexception() << "RegExp " << re << ": " << Error.data();
+ ythrow yexception() << "RegExp " << re << ": " << Error.data();
}
}
@@ -297,7 +297,7 @@ int TRegExSubst::ParseReplacement(const char* repl) {
while (IsAsciiDigit(*pos2))
pos2++;
if (pos2 > pos1 + 1) {
- Brfs[i].Refer = atol(TString(Replacement, pos1 + 1 - Replacement, pos2 - (pos1 + 1)).data());
+ Brfs[i].Refer = atol(TString(Replacement, pos1 + 1 - Replacement, pos2 - (pos1 + 1)).data());
} else {
pos1++;
if (*pos2 == '$')
diff --git a/library/cpp/regex/pire/pcre2pire.cpp b/library/cpp/regex/pire/pcre2pire.cpp
index f788beb85f..fbc0460ad4 100644
--- a/library/cpp/regex/pire/pcre2pire.cpp
+++ b/library/cpp/regex/pire/pcre2pire.cpp
@@ -4,7 +4,7 @@
TString Pcre2Pire(const TString& src) {
TVector<char> result;
- result.reserve(src.size() + 1);
+ result.reserve(src.size() + 1);
enum EState {
S_SIMPLE,
@@ -19,7 +19,7 @@ TString Pcre2Pire(const TString& src) {
EState state = S_SIMPLE;
- for (ui32 i = 0; i < src.size(); ++i) {
+ for (ui32 i = 0; i < src.size(); ++i) {
const char c = src[i];
switch (state) {
@@ -32,7 +32,7 @@ TString Pcre2Pire(const TString& src) {
state = S_EXPECT_Q;
result.push_back(c);
} else {
- if (c == ')' && result.size() > 0 && result.back() == '(') {
+ if (c == ')' && result.size() > 0 && result.back() == '(') {
// eliminating "()"
result.pop_back();
} else {
diff --git a/library/cpp/regex/pire/regexp.h b/library/cpp/regex/pire/regexp.h
index 94bba4064b..9fceacc028 100644
--- a/library/cpp/regex/pire/regexp.h
+++ b/library/cpp/regex/pire/regexp.h
@@ -278,8 +278,8 @@ namespace NRegExp {
}
inline TStringBuf GetCaptured() const noexcept {
- return TStringBuf(Data.data() + GetState().Begin() - 1,
- Data.data() + GetState().End() - 1);
+ return TStringBuf(Data.data() + GetState().Begin() - 1,
+ Data.data() + GetState().End() - 1);
}
private:
@@ -302,7 +302,7 @@ namespace NRegExp {
inline TSlowSearcher& Search(const char* data, size_t len, bool addBegin = false, bool addEnd = false) noexcept {
TStringBuf textData(data, len);
Data = textData;
- Run(Data.begin(), Data.size(), addBegin, addEnd);
+ Run(Data.begin(), Data.size(), addBegin, addEnd);
return GetAns();
}
diff --git a/library/cpp/scheme/scimpl_json_read.cpp b/library/cpp/scheme/scimpl_json_read.cpp
index 8a29cc7739..eb4f5bc56c 100644
--- a/library/cpp/scheme/scimpl_json_read.cpp
+++ b/library/cpp/scheme/scimpl_json_read.cpp
@@ -186,7 +186,7 @@ namespace NSc {
if (cfg.RelaxedJson) {
return NJson::ReadJsonFast(json, &d);
} else {
- TMemoryInput min(json.data(), json.size());
+ TMemoryInput min(json.data(), json.size());
return NJson::ReadJson(&min, &cfg, &d);
}
}
diff --git a/library/cpp/scheme/scimpl_select.rl6 b/library/cpp/scheme/scimpl_select.rl6
index 11aa549b78..9d6b79aeb0 100644
--- a/library/cpp/scheme/scimpl_select.rl6
+++ b/library/cpp/scheme/scimpl_select.rl6
@@ -67,8 +67,8 @@ namespace NSc {
TSelectorCtx(TSelector sel, TStringBuf data)
: Selector(sel)
- , p0(data.data())
- , p(data.data())
+ , p0(data.data())
+ , p(data.data())
, pe(data.end())
, eof(data.end())
{}
diff --git a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp
index 7c16527c23..a476a3dcb8 100644
--- a/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp
+++ b/library/cpp/scheme/tests/fuzz_json/lib/fuzz_json.cpp
@@ -79,7 +79,7 @@ namespace NSc::NUt {
void FuzzJson(TStringBuf wire) {
- if (wire.size() < 2) {
+ if (wire.size() < 2) {
return;
}
diff --git a/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp b/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp
index 2a06cf110d..447e27a4c2 100644
--- a/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp
+++ b/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp
@@ -54,12 +54,12 @@ Y_UNIT_TEST_SUITE(TSchemeMergeTest) {
NSc::TValue v2;
v2.MergeUpdate(v["a"]);
- UNIT_ASSERT_C(NSc::TValue::Equal(v["a"], v2), Sprintf("\n%s\n!=\n%s\n", v["a"].ToJson().data(), v2.ToJson().data()));
+ UNIT_ASSERT_C(NSc::TValue::Equal(v["a"], v2), Sprintf("\n%s\n!=\n%s\n", v["a"].ToJson().data(), v2.ToJson().data()));
v.MergeUpdate(v1);
- UNIT_ASSERT_C(!NSc::TValue::Equal(v["a"], v2), Sprintf("\n%s\n!=\n%s\n", v["a"].ToJson().data(), v2.ToJson().data()));
+ UNIT_ASSERT_C(!NSc::TValue::Equal(v["a"], v2), Sprintf("\n%s\n!=\n%s\n", v["a"].ToJson().data(), v2.ToJson().data()));
v2.MergeUpdate(v1["a"]);
- UNIT_ASSERT_C(NSc::TValue::Equal(v["a"], v2), Sprintf("\n%s\n!=\n%s\n", v["a"].ToJson().data(), v2.ToJson().data()));
+ UNIT_ASSERT_C(NSc::TValue::Equal(v["a"], v2), Sprintf("\n%s\n!=\n%s\n", v["a"].ToJson().data(), v2.ToJson().data()));
}
UNIT_ASSERT(v.Has("a"));
diff --git a/library/cpp/scheme/ut_utils/scheme_ut_utils.h b/library/cpp/scheme/ut_utils/scheme_ut_utils.h
index eb3ea15b2a..52c9c95ac6 100644
--- a/library/cpp/scheme/ut_utils/scheme_ut_utils.h
+++ b/library/cpp/scheme/ut_utils/scheme_ut_utils.h
@@ -31,8 +31,8 @@ namespace NSc {
if (_a != _b) { \
UNIT_FAIL_IMPL( \
"json values are different (" #A " != " #B ")", \
- Sprintf("%s\n!=\n%s\n%s\n%s", _a.data(), _b.data(), \
- ::NUnitTest::ColoredDiff(NJson::PrettifyJson(_a), NJson::PrettifyJson(_b), " \t\n,:\"{}[]").data(), ToString(c).data())); \
+ Sprintf("%s\n!=\n%s\n%s\n%s", _a.data(), _b.data(), \
+ ::NUnitTest::ColoredDiff(NJson::PrettifyJson(_a), NJson::PrettifyJson(_b), " \t\n,:\"{}[]").data(), ToString(c).data())); \
} \
} while (false)
diff --git a/library/cpp/sse/powerpc.h b/library/cpp/sse/powerpc.h
index 82fc011fa5..e717bf9f9c 100644
--- a/library/cpp/sse/powerpc.h
+++ b/library/cpp/sse/powerpc.h
@@ -10,991 +10,991 @@
#if !defined(_ppc64_)
#error "This header is for PowerPC (ppc64) platform only." \
- "Include sse.h instead of including this header directly."
+ "Include sse.h instead of including this header directly."
#endif
#include <util/system/types.h>
-#include <util/system/compiler.h>
+#include <util/system/compiler.h>
#include <altivec.h>
-typedef __attribute__((__aligned__(8))) unsigned long long __m64;
-typedef __attribute__((__aligned__(16), __may_alias__)) vector float __m128;
-typedef __attribute__((__aligned__(16), __may_alias__)) vector unsigned char __m128i;
-typedef __attribute__((__aligned__(16), __may_alias__)) vector double __m128d;
-
-using __v2df = __vector double;
-using __v2di = __vector long long;
-using __v2du = __vector unsigned long long;
-using __v4si = __vector int;
-using __v4su = __vector unsigned int;
-using __v8hi = __vector short;
-using __v8hu = __vector unsigned short;
-using __v16qi = __vector signed char;
-using __v16qu = __vector unsigned char;
-using __v4sf = __vector float;
-
-enum _mm_hint
-{
- /* _MM_HINT_ET is _MM_HINT_T with set 3rd bit. */
- _MM_HINT_ET0 = 7,
- _MM_HINT_ET1 = 6,
- _MM_HINT_T0 = 3,
- _MM_HINT_T1 = 2,
- _MM_HINT_T2 = 1,
- _MM_HINT_NTA = 0
-};
-
-#define _MM_SHUFFLE(a, b, c, d) ((signed char)(a * 64 + b * 16 + c * 4 + d))
-
+typedef __attribute__((__aligned__(8))) unsigned long long __m64;
+typedef __attribute__((__aligned__(16), __may_alias__)) vector float __m128;
+typedef __attribute__((__aligned__(16), __may_alias__)) vector unsigned char __m128i;
+typedef __attribute__((__aligned__(16), __may_alias__)) vector double __m128d;
+
+using __v2df = __vector double;
+using __v2di = __vector long long;
+using __v2du = __vector unsigned long long;
+using __v4si = __vector int;
+using __v4su = __vector unsigned int;
+using __v8hi = __vector short;
+using __v8hu = __vector unsigned short;
+using __v16qi = __vector signed char;
+using __v16qu = __vector unsigned char;
+using __v4sf = __vector float;
+
+enum _mm_hint
+{
+ /* _MM_HINT_ET is _MM_HINT_T with set 3rd bit. */
+ _MM_HINT_ET0 = 7,
+ _MM_HINT_ET1 = 6,
+ _MM_HINT_T0 = 3,
+ _MM_HINT_T1 = 2,
+ _MM_HINT_T2 = 1,
+ _MM_HINT_NTA = 0
+};
+
+#define _MM_SHUFFLE(a, b, c, d) ((signed char)(a * 64 + b * 16 + c * 4 + d))
+
/// Functions that work with floats.
-Y_FORCE_INLINE __m128 _mm_setzero_ps() {
- return (__m128){0.0f, 0.0f, 0.0f, 0.0f};
+Y_FORCE_INLINE __m128 _mm_setzero_ps() {
+ return (__m128){0.0f, 0.0f, 0.0f, 0.0f};
};
-Y_FORCE_INLINE __m128d _mm_setzero_pd() {
- return (__m128d)vec_splats((double)0);
+Y_FORCE_INLINE __m128d _mm_setzero_pd() {
+ return (__m128d)vec_splats((double)0);
}
-// bug in clang compiler until 7.0.0 inclusive, Y_NO_INLINE is vital/essential
-static Y_NO_INLINE __m128 _mm_set1_ps(float f) {
- return (vector float)f;
+// bug in clang compiler until 7.0.0 inclusive, Y_NO_INLINE is vital/essential
+static Y_NO_INLINE __m128 _mm_set1_ps(float f) {
+ return (vector float)f;
}
-Y_FORCE_INLINE __m128 _mm_set_ps1(float f) {
+Y_FORCE_INLINE __m128 _mm_set_ps1(float f) {
return _mm_set1_ps(f);
}
-Y_FORCE_INLINE __m128 _mm_set_ps(float v3, float v2, float v1, float v0) {
- return (__m128)(__v4sf){v0, v1, v2, v3};
+Y_FORCE_INLINE __m128 _mm_set_ps(float v3, float v2, float v1, float v0) {
+ return (__m128)(__v4sf){v0, v1, v2, v3};
}
-Y_FORCE_INLINE __m128d _mm_set_pd(double d1, double d0) {
- return (__m128d){d0, d1};
+Y_FORCE_INLINE __m128d _mm_set_pd(double d1, double d0) {
+ return (__m128d){d0, d1};
}
-Y_FORCE_INLINE __m128 _mm_loadu_ps(const float* p) {
- return vec_vsx_ld(0, p);
+Y_FORCE_INLINE __m128 _mm_loadu_ps(const float* p) {
+ return vec_vsx_ld(0, p);
}
-Y_FORCE_INLINE __m128 _mm_load_ps(const float* p) {
- return (__m128)vec_ld(0, (vector float*)p);
+Y_FORCE_INLINE __m128 _mm_load_ps(const float* p) {
+ return (__m128)vec_ld(0, (vector float*)p);
}
-Y_FORCE_INLINE __m128 _mm_loadu_pd(const double* d) {
- return vec_vsx_ld(0, d);
+Y_FORCE_INLINE __m128 _mm_loadu_pd(const double* d) {
+ return vec_vsx_ld(0, d);
}
-Y_FORCE_INLINE void _mm_storeu_ps(float* p, __m128 a) {
- *(__m128*)p = a;
+Y_FORCE_INLINE void _mm_storeu_ps(float* p, __m128 a) {
+ *(__m128*)p = a;
}
-Y_FORCE_INLINE __m128 _mm_xor_ps(__m128 a, __m128 b) {
- return (__m128)vec_xor((__v4sf)a, (__v4sf)b);
+Y_FORCE_INLINE __m128 _mm_xor_ps(__m128 a, __m128 b) {
+ return (__m128)vec_xor((__v4sf)a, (__v4sf)b);
+}
+
+Y_FORCE_INLINE __m128 _mm_xor_pd(__m128d a, __m128d b) {
+ return (__m128)vec_xor((__v2df)a, (__v2df)b);
+}
+
+Y_FORCE_INLINE __m128 _mm_add_ps(__m128 a, __m128 b) {
+ return (__m128)((__v4sf)a + (__v4sf)b);
}
-Y_FORCE_INLINE __m128 _mm_xor_pd(__m128d a, __m128d b) {
- return (__m128)vec_xor((__v2df)a, (__v2df)b);
+Y_FORCE_INLINE __m128d _mm_add_pd(__m128d a, __m128d b) {
+ return (__m128d)((__v2df)a + (__v2df)b);
}
-Y_FORCE_INLINE __m128 _mm_add_ps(__m128 a, __m128 b) {
- return (__m128)((__v4sf)a + (__v4sf)b);
+Y_FORCE_INLINE __m128 _mm_sub_ps(__m128 a, __m128 b) {
+ return (__m128)((__v4sf)a - (__v4sf)b);
}
-Y_FORCE_INLINE __m128d _mm_add_pd(__m128d a, __m128d b) {
- return (__m128d)((__v2df)a + (__v2df)b);
+Y_FORCE_INLINE __m128d _mm_sub_pd(__m128d a, __m128d b) {
+ return (__m128d)((__v2df)a - (__v2df)b);
}
-Y_FORCE_INLINE __m128 _mm_sub_ps(__m128 a, __m128 b) {
- return (__m128)((__v4sf)a - (__v4sf)b);
+Y_FORCE_INLINE __m128 _mm_mul_ps(__m128 a, __m128 b) {
+ return (__m128)((__v4sf)a * (__v4sf)b);
}
-Y_FORCE_INLINE __m128d _mm_sub_pd(__m128d a, __m128d b) {
- return (__m128d)((__v2df)a - (__v2df)b);
+Y_FORCE_INLINE __m128d _mm_mul_pd(__m128d a, __m128d b) {
+ return (__m128d)((__v2df)a * (__v2df)b);
}
-Y_FORCE_INLINE __m128 _mm_mul_ps(__m128 a, __m128 b) {
- return (__m128)((__v4sf)a * (__v4sf)b);
+Y_FORCE_INLINE __m128 _mm_div_ps(__m128 a, __m128 b) {
+ return (__m128)((__v4sf)a / (__v4sf)b);
}
-Y_FORCE_INLINE __m128d _mm_mul_pd(__m128d a, __m128d b) {
- return (__m128d)((__v2df)a * (__v2df)b);
+Y_FORCE_INLINE __m128d _mm_div_pd(__m128d a, __m128d b) {
+ return (__m128d)((__v2df)a / (__v2df)b);
}
-Y_FORCE_INLINE __m128 _mm_div_ps(__m128 a, __m128 b) {
- return (__m128)((__v4sf)a / (__v4sf)b);
+Y_FORCE_INLINE __m128 _mm_cmpeq_ps(__m128 a, __m128 b) {
+ return ((__m128)vec_cmpeq((__v4sf)a, (__v4sf)b));
+ ;
}
-Y_FORCE_INLINE __m128d _mm_div_pd(__m128d a, __m128d b) {
- return (__m128d)((__v2df)a / (__v2df)b);
+Y_FORCE_INLINE __m128 _mm_cmpgt_ps(__m128 a, __m128 b) {
+ return ((__m128)vec_cmpgt((__v4sf)a, (__v4sf)b));
}
-Y_FORCE_INLINE __m128 _mm_cmpeq_ps(__m128 a, __m128 b) {
- return ((__m128)vec_cmpeq((__v4sf)a, (__v4sf)b));
- ;
+Y_FORCE_INLINE __m128 _mm_max_ps(__m128 a, __m128 b) {
+ return (__m128)vec_max((vector float)a, (vector float)b);
}
-Y_FORCE_INLINE __m128 _mm_cmpgt_ps(__m128 a, __m128 b) {
- return ((__m128)vec_cmpgt((__v4sf)a, (__v4sf)b));
+Y_FORCE_INLINE __m128i _mm_max_epu8(__m128i a, __m128i b) {
+ return (__m128i)vec_max((__v16qu)a, (__v16qu)b);
+}
+
+Y_FORCE_INLINE __m128 _mm_min_ps(__m128 a, __m128 b) {
+ return (__m128)vec_min((vector float)a, (vector float)b);
}
-Y_FORCE_INLINE __m128 _mm_max_ps(__m128 a, __m128 b) {
- return (__m128)vec_max((vector float)a, (vector float)b);
+Y_FORCE_INLINE __m128 _mm_and_ps(__m128 a, __m128 b) {
+ return ((__m128)vec_and((__v4sf)a, (__v4sf)b));
}
-Y_FORCE_INLINE __m128i _mm_max_epu8(__m128i a, __m128i b) {
- return (__m128i)vec_max((__v16qu)a, (__v16qu)b);
+Y_FORCE_INLINE __m128d _mm_and_pd(__m128d a, __m128d b) {
+ return vec_and((__v2df)a, (__v2df)b);
+}
+
+Y_FORCE_INLINE __m128 _mm_rsqrt_ps(__m128 a) {
+ return vec_rsqrte(a);
}
-Y_FORCE_INLINE __m128 _mm_min_ps(__m128 a, __m128 b) {
- return (__m128)vec_min((vector float)a, (vector float)b);
+Y_FORCE_INLINE __m128 _mm_rsqrt_ss(__m128 a) {
+ __m128 a1, c;
+ const vector unsigned int mask = {0xffffffff, 0, 0, 0};
+ a1 = vec_splat(a, 0);
+ c = vec_rsqrte(a1);
+ return (vec_sel((vector float)a, c, mask));
}
-Y_FORCE_INLINE __m128 _mm_and_ps(__m128 a, __m128 b) {
- return ((__m128)vec_and((__v4sf)a, (__v4sf)b));
+Y_FORCE_INLINE int _mm_movemask_ps(__m128 a) {
+ __vector unsigned long long result;
+ const __vector unsigned int perm_mask =
+ {
+#ifdef __LITTLE_ENDIAN__
+ 0x00204060, 0x80808080, 0x80808080, 0x80808080
+#elif __BIG_ENDIAN__
+ 0x80808080, 0x80808080, 0x80808080, 0x00204060
+#endif
+ };
+
+ result = (__vector unsigned long long)vec_vbpermq((__vector unsigned char)a,
+ (__vector unsigned char)perm_mask);
+
+#ifdef __LITTLE_ENDIAN__
+ return result[1];
+#elif __BIG_ENDIAN__
+ return result[0];
+#endif
}
-Y_FORCE_INLINE __m128d _mm_and_pd(__m128d a, __m128d b) {
- return vec_and((__v2df)a, (__v2df)b);
+Y_FORCE_INLINE __m128 _mm_cvtepi32_ps(__m128i a) {
+ return ((__m128)vec_ctf((__v4si)a, 0));
}
-Y_FORCE_INLINE __m128 _mm_rsqrt_ps(__m128 a) {
- return vec_rsqrte(a);
+Y_FORCE_INLINE float _mm_cvtss_f32(__m128 a) {
+ return ((__v4sf)a)[0];
}
-Y_FORCE_INLINE __m128 _mm_rsqrt_ss(__m128 a) {
- __m128 a1, c;
- const vector unsigned int mask = {0xffffffff, 0, 0, 0};
- a1 = vec_splat(a, 0);
- c = vec_rsqrte(a1);
- return (vec_sel((vector float)a, c, mask));
+Y_FORCE_INLINE __m128 _mm_cmpunord_ps(__m128 A, __m128 B) {
+ __vector unsigned int a, b;
+ __vector unsigned int c, d;
+ const __vector unsigned int float_exp_mask =
+ {0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000};
+
+ a = (__vector unsigned int)vec_abs((__v4sf)A);
+ b = (__vector unsigned int)vec_abs((__v4sf)B);
+ c = (__vector unsigned int)vec_cmpgt(a, float_exp_mask);
+ d = (__vector unsigned int)vec_cmpgt(b, float_exp_mask);
+ return ((__m128)vec_or(c, d));
}
-Y_FORCE_INLINE int _mm_movemask_ps(__m128 a) {
- __vector unsigned long long result;
- const __vector unsigned int perm_mask =
- {
-#ifdef __LITTLE_ENDIAN__
- 0x00204060, 0x80808080, 0x80808080, 0x80808080
-#elif __BIG_ENDIAN__
- 0x80808080, 0x80808080, 0x80808080, 0x00204060
-#endif
- };
-
- result = (__vector unsigned long long)vec_vbpermq((__vector unsigned char)a,
- (__vector unsigned char)perm_mask);
-
-#ifdef __LITTLE_ENDIAN__
- return result[1];
-#elif __BIG_ENDIAN__
- return result[0];
-#endif
+Y_FORCE_INLINE __m128 _mm_andnot_ps(__m128 a, __m128 b) {
+ return ((__m128)vec_andc((__v4sf)b, (__v4sf)a));
}
-Y_FORCE_INLINE __m128 _mm_cvtepi32_ps(__m128i a) {
- return ((__m128)vec_ctf((__v4si)a, 0));
+Y_FORCE_INLINE __m128 _mm_or_ps(__m128 a, __m128 b) {
+ return ((__m128)vec_or((__v4sf)a, (__v4sf)b));
}
-Y_FORCE_INLINE float _mm_cvtss_f32(__m128 a) {
- return ((__v4sf)a)[0];
+Y_FORCE_INLINE void _mm_store_ss(float* p, __m128 a) {
+ *p = ((__v4sf)a)[0];
}
-Y_FORCE_INLINE __m128 _mm_cmpunord_ps(__m128 A, __m128 B) {
- __vector unsigned int a, b;
- __vector unsigned int c, d;
- const __vector unsigned int float_exp_mask =
- {0x7f800000, 0x7f800000, 0x7f800000, 0x7f800000};
-
- a = (__vector unsigned int)vec_abs((__v4sf)A);
- b = (__vector unsigned int)vec_abs((__v4sf)B);
- c = (__vector unsigned int)vec_cmpgt(a, float_exp_mask);
- d = (__vector unsigned int)vec_cmpgt(b, float_exp_mask);
- return ((__m128)vec_or(c, d));
-}
-
-Y_FORCE_INLINE __m128 _mm_andnot_ps(__m128 a, __m128 b) {
- return ((__m128)vec_andc((__v4sf)b, (__v4sf)a));
+Y_FORCE_INLINE void _mm_store_ps(float* p, __m128 a) {
+ vec_st(a, 0, p);
}
-Y_FORCE_INLINE __m128 _mm_or_ps(__m128 a, __m128 b) {
- return ((__m128)vec_or((__v4sf)a, (__v4sf)b));
-}
-
-Y_FORCE_INLINE void _mm_store_ss(float* p, __m128 a) {
- *p = ((__v4sf)a)[0];
-}
-
-Y_FORCE_INLINE void _mm_store_ps(float* p, __m128 a) {
- vec_st(a, 0, p);
-}
-
-Y_FORCE_INLINE void _mm_storeu_pd(double* p, __m128d a) {
- *(__m128d*)p = a;
-}
-
-Y_FORCE_INLINE void _mm_store_pd(double* p, __m128d a) {
- vec_st((vector unsigned char)a, 0, (vector unsigned char*)p);
-}
-
-Y_FORCE_INLINE __m128 _mm_shuffle_ps(__m128 a, __m128 b, long shuff) {
- unsigned long element_selector_10 = shuff & 0x03;
- unsigned long element_selector_32 = (shuff >> 2) & 0x03;
- unsigned long element_selector_54 = (shuff >> 4) & 0x03;
- unsigned long element_selector_76 = (shuff >> 6) & 0x03;
- const unsigned int permute_selectors[4] =
- {
-#ifdef __LITTLE_ENDIAN__
- 0x03020100, 0x07060504, 0x0B0A0908, 0x0F0E0D0C
-#elif __BIG_ENDIAN__
- 0x0C0D0E0F, 0x08090A0B, 0x04050607, 0x00010203
-#endif
- };
- __vector unsigned int t;
-
-#ifdef __LITTLE_ENDIAN__
- t[0] = permute_selectors[element_selector_10];
- t[1] = permute_selectors[element_selector_32];
- t[2] = permute_selectors[element_selector_54] + 0x10101010;
- t[3] = permute_selectors[element_selector_76] + 0x10101010;
-#elif __BIG_ENDIAN__
- t[3] = permute_selectors[element_selector_10] + 0x10101010;
- t[2] = permute_selectors[element_selector_32] + 0x10101010;
- t[1] = permute_selectors[element_selector_54];
- t[0] = permute_selectors[element_selector_76];
-#endif
- return vec_perm((__v4sf)a, (__v4sf)b, (__vector unsigned char)t);
-}
-
-Y_FORCE_INLINE __m128d _mm_shuffle_pd(__m128d a, __m128d b, const int mask) {
- __vector double result;
- const int litmsk = mask & 0x3;
-
- if (litmsk == 0)
- result = vec_mergeh(a, b);
- else if (litmsk == 1)
- result = vec_xxpermdi(a, b, 2);
- else if (litmsk == 2)
- result = vec_xxpermdi(a, b, 1);
- else
- result = vec_mergel(a, b);
- return result;
-}
-
-Y_FORCE_INLINE __m128i _mm_cvtps_epi32(__m128 a) {
- vector float rounded;
- __v4si result;
-
- rounded = vec_rint((vector float)a);
- result = vec_cts(rounded, 0);
- return (__m128i)result;
+Y_FORCE_INLINE void _mm_storeu_pd(double* p, __m128d a) {
+ *(__m128d*)p = a;
+}
+
+Y_FORCE_INLINE void _mm_store_pd(double* p, __m128d a) {
+ vec_st((vector unsigned char)a, 0, (vector unsigned char*)p);
+}
+
+Y_FORCE_INLINE __m128 _mm_shuffle_ps(__m128 a, __m128 b, long shuff) {
+ unsigned long element_selector_10 = shuff & 0x03;
+ unsigned long element_selector_32 = (shuff >> 2) & 0x03;
+ unsigned long element_selector_54 = (shuff >> 4) & 0x03;
+ unsigned long element_selector_76 = (shuff >> 6) & 0x03;
+ const unsigned int permute_selectors[4] =
+ {
+#ifdef __LITTLE_ENDIAN__
+ 0x03020100, 0x07060504, 0x0B0A0908, 0x0F0E0D0C
+#elif __BIG_ENDIAN__
+ 0x0C0D0E0F, 0x08090A0B, 0x04050607, 0x00010203
+#endif
+ };
+ __vector unsigned int t;
+
+#ifdef __LITTLE_ENDIAN__
+ t[0] = permute_selectors[element_selector_10];
+ t[1] = permute_selectors[element_selector_32];
+ t[2] = permute_selectors[element_selector_54] + 0x10101010;
+ t[3] = permute_selectors[element_selector_76] + 0x10101010;
+#elif __BIG_ENDIAN__
+ t[3] = permute_selectors[element_selector_10] + 0x10101010;
+ t[2] = permute_selectors[element_selector_32] + 0x10101010;
+ t[1] = permute_selectors[element_selector_54];
+ t[0] = permute_selectors[element_selector_76];
+#endif
+ return vec_perm((__v4sf)a, (__v4sf)b, (__vector unsigned char)t);
+}
+
+Y_FORCE_INLINE __m128d _mm_shuffle_pd(__m128d a, __m128d b, const int mask) {
+ __vector double result;
+ const int litmsk = mask & 0x3;
+
+ if (litmsk == 0)
+ result = vec_mergeh(a, b);
+ else if (litmsk == 1)
+ result = vec_xxpermdi(a, b, 2);
+ else if (litmsk == 2)
+ result = vec_xxpermdi(a, b, 1);
+ else
+ result = vec_mergel(a, b);
+ return result;
+}
+
+Y_FORCE_INLINE __m128i _mm_cvtps_epi32(__m128 a) {
+ vector float rounded;
+ __v4si result;
+
+ rounded = vec_rint((vector float)a);
+ result = vec_cts(rounded, 0);
+ return (__m128i)result;
}
/// Functions that work with integers.
-Y_FORCE_INLINE int _mm_movemask_epi8(__m128i a) {
- __vector unsigned long long result;
- const __vector unsigned char perm_mask =
- {
-#ifdef __LITTLE_ENDIAN__
- 0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40,
- 0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00
-#elif __BIG_ENDIAN__
- 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38,
- 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78
-#endif
- };
-
- result = (__vector unsigned long long)vec_vbpermq((__vector unsigned char)a,
- (__vector unsigned char)perm_mask);
-
-#ifdef __LITTLE_ENDIAN__
- return result[1];
-#elif __BIG_ENDIAN__
- return result[0];
-#endif
-}
-
-Y_FORCE_INLINE __m128i _mm_cvttps_epi32(__m128 a) {
- __v4si result;
-
- result = vec_cts((__v4sf)a, 0);
- return (__m128i)result;
-}
-
-#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
- do { \
- __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \
- __v4sf __t0 = vec_vmrghw((vector unsigned int)__r0, (vector unsigned int)__r1); \
- __v4sf __t1 = vec_vmrghw((vector unsigned int)__r2, (vector unsigned int)__r3); \
- __v4sf __t2 = vec_vmrglw((vector unsigned int)__r0, (vector unsigned int)__r1); \
- __v4sf __t3 = vec_vmrglw((vector unsigned int)__r2, (vector unsigned int)__r3); \
- (row0) = (__v4sf)vec_mergeh((vector long long)__t0, \
- (vector long long)__t1); \
- (row1) = (__v4sf)vec_mergel((vector long long)__t0, \
- (vector long long)__t1); \
- (row2) = (__v4sf)vec_mergeh((vector long long)__t2, \
- (vector long long)__t3); \
- (row3) = (__v4sf)vec_mergel((vector long long)__t2, \
- (vector long long)__t3); \
- } while (0)
-
-Y_FORCE_INLINE __m128i _mm_or_si128(__m128i a, __m128i b) {
- return (__m128i)vec_or((__v2di)a, (__v2di)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_and_si128(__m128i a, __m128i b) {
- return (__m128i)vec_and((__v2di)a, (__v2di)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_andnot_si128(__m128i a, __m128i b) {
- return (__m128i)vec_andc((__v2di)b, (__v2di)a);
-}
-
-Y_FORCE_INLINE __m128i _mm_xor_si128(__m128i a, __m128i b) {
- return (__m128i)vec_xor((__v2di)a, (__v2di)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_setzero_si128() {
- return (__m128i)(__v4si){0, 0, 0, 0};
-}
-
-Y_FORCE_INLINE __m128i _mm_shuffle_epi32(__m128i op1, long op2) {
- unsigned long element_selector_10 = op2 & 0x03;
- unsigned long element_selector_32 = (op2 >> 2) & 0x03;
- unsigned long element_selector_54 = (op2 >> 4) & 0x03;
- unsigned long element_selector_76 = (op2 >> 6) & 0x03;
- const unsigned int permute_selectors[4] =
- {
-#ifdef __LITTLE_ENDIAN__
- 0x03020100, 0x07060504, 0x0B0A0908, 0x0F0E0D0C
-#elif __BIG_ENDIAN__
- 0x0C0D0E0F, 0x08090A0B, 0x04050607, 0x00010203
-#endif
- };
- __v4su t;
-
-#ifdef __LITTLE_ENDIAN__
- t[0] = permute_selectors[element_selector_10];
- t[1] = permute_selectors[element_selector_32];
- t[2] = permute_selectors[element_selector_54] + 0x10101010;
- t[3] = permute_selectors[element_selector_76] + 0x10101010;
-#elif __BIG_ENDIAN__
- t[3] = permute_selectors[element_selector_10] + 0x10101010;
- t[2] = permute_selectors[element_selector_32] + 0x10101010;
- t[1] = permute_selectors[element_selector_54];
- t[0] = permute_selectors[element_selector_76];
-#endif
- return (__m128i)vec_perm((__v4si)op1, (__v4si)op1, (__vector unsigned char)t);
-}
-
-Y_FORCE_INLINE int _mm_extract_epi16(__m128i a, int imm) {
- return (unsigned short)((__v8hi)a)[imm & 7];
-}
-
-Y_FORCE_INLINE int _mm_extract_epi8(__m128i a, int imm) {
- return (unsigned char)((__v16qi)a)[imm & 15];
-}
-
-Y_FORCE_INLINE int _mm_extract_epi32(__m128i a, int imm) {
- return ((__v4si)a)[imm & 3];
-}
-
-Y_FORCE_INLINE long long _mm_extract_epi64(__m128i a, int imm) {
- return ((__v2di)a)[imm & 1];
-}
-
-Y_FORCE_INLINE int _mm_extract_ps(__m128 a, int imm) {
- return ((__v4si)a)[imm & 3];
-}
-
-Y_FORCE_INLINE __m128i _mm_slli_epi16(__m128i a, int count) {
- __v8hu lshift;
- __v8hi result = {0, 0, 0, 0, 0, 0, 0, 0};
-
- if (count >= 0 && count < 16) {
- if (__builtin_constant_p(count)) {
- lshift = (__v8hu)vec_splat_s16(count);
- } else {
- lshift = vec_splats((unsigned short)count);
- }
-
- result = vec_vslh((__v8hi)a, lshift);
- }
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_slli_epi32(__m128i a, int count) {
- __v4su lshift;
- __v4si result = {0, 0, 0, 0};
-
- if (count >= 0 && count < 32) {
- if (__builtin_constant_p(count) && count < 16) {
- lshift = (__v4su)vec_splat_s32(count);
- } else {
- lshift = vec_splats((unsigned int)count);
- }
-
- result = vec_vslw((__v4si)a, lshift);
- }
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_slli_epi64(__m128i a, int count) {
- __v2du lshift;
- __v2di result = {0, 0};
-
- if (count >= 0 && count < 64) {
- if (__builtin_constant_p(count) && count < 16) {
- lshift = (__v2du)vec_splat_s32(count);
- } else {
- lshift = (__v2du)vec_splats((unsigned int)count);
- }
-
- result = vec_sl((__v2di)a, lshift);
- }
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_slli_si128(__m128i a, int imm) {
- __v16qu result;
- const __v16qu zeros = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- if (imm < 16)
-#ifdef __LITTLE_ENDIAN__
- result = vec_sld((__v16qu)a, zeros, imm);
-#elif __BIG_ENDIAN__
- result = vec_sld(zeros, (__v16qu)a, (16 - imm));
-#endif
- else
- result = zeros;
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_srli_epi16(__m128i a, int count) {
- if ((unsigned long)count >= 16) {
- /* SSE2 shifts >= element_size or < 0 produce 0; Altivec/MMX shifts by count%element_size. */
- return (__m128i)vec_splats(0);
- } else if (count == 0) {
- return a;
- } else {
- /* The PowerPC Architecture says all shift count fields must contain the same shift count. */
- __v8hi replicated_count;
- replicated_count = vec_splats((short)count);
- return (__m128i)vec_sr((vector signed short)a, replicated_count);
- }
-}
-
-Y_FORCE_INLINE __m128i _mm_srli_epi32(__m128i a, int count) {
- if ((unsigned long)count >= 32) {
- /* SSE2 shifts >= element_size or < 0 produce 0; Altivec/MMX shifts by count%element_size. */
- return (__m128i)vec_splats(0);
- } else if (count == 0) {
- return a;
- } else {
- /* The PowerPC Architecture says all shift count fields must contain the same shift count. */
- __v4si replicated_count;
- replicated_count = vec_splats(count);
- return (__m128i)vec_sr((vector signed int)a, replicated_count);
- }
-}
-
-Y_FORCE_INLINE __m128i _mm_srli_epi64(__m128i a, int count) {
- if ((unsigned long)count >= 64) {
- /* SSE2 shifts >= element_size or < 0 produce 0; Altivec/MMX shifts by count%element_size. */
- return (__m128i)vec_splats(0);
- } else if (count == 0) {
- return a;
- } else {
- /* The PowerPC Architecture says all shift count fields must contain the same shift count. */
- /* On Power7 vec_slo (vslo) does use just the documented bits 121:124. */
- /* On Power7 vec_sll (vsll) uses the lower 3 bits of each byte instead (legal). */
- __v16qu replicated_count;
- replicated_count = vec_splats((unsigned char)count);
- long long m = 0xFFFFFFFFFFFFFFFFull >> count;
- __v2di mask;
- mask[0] = m;
- mask[1] = m;
- return vec_and(vec_srl(vec_sro(a, (__m128i)replicated_count), (__m128i)replicated_count), (__v16qu)mask);
- }
-}
-
-Y_FORCE_INLINE __m128i _mm_bsrli_si128(__m128i a, const int __N) {
- __v16qu result;
- const __v16qu zeros = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- if (__N < 16)
- if (__builtin_constant_p(__N))
- /* Would like to use Vector Shift Left Double by Octet
- Immediate here to use the immediate form and avoid
- load of __N * 8 value into a separate VR. */
- result = vec_sld(zeros, (__v16qu)a, (16 - __N));
- else {
- __v16qu shift = vec_splats((unsigned char)(__N * 8));
- result = vec_sro((__v16qu)a, shift);
- }
- else
- result = zeros;
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_srli_si128(__m128i a, int imm) {
- return _mm_bsrli_si128(a, imm);
-}
-
-Y_FORCE_INLINE __m128i _mm_srai_epi16(__m128i a, int count) {
- __v8hu rshift = {15, 15, 15, 15, 15, 15, 15, 15};
- __v8hi result;
- if (count < 16) {
- if (__builtin_constant_p(count)) {
- rshift = (__v8hu)vec_splat_s16(count);
- } else {
- rshift = vec_splats((unsigned short)count);
- }
- }
- result = vec_vsrah((__v8hi)a, rshift);
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_srai_epi32(__m128i a, int count) {
+Y_FORCE_INLINE int _mm_movemask_epi8(__m128i a) {
+ __vector unsigned long long result;
+ const __vector unsigned char perm_mask =
+ {
+#ifdef __LITTLE_ENDIAN__
+ 0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40,
+ 0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00
+#elif __BIG_ENDIAN__
+ 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38,
+ 0x40, 0x48, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78
+#endif
+ };
+
+ result = (__vector unsigned long long)vec_vbpermq((__vector unsigned char)a,
+ (__vector unsigned char)perm_mask);
+
+#ifdef __LITTLE_ENDIAN__
+ return result[1];
+#elif __BIG_ENDIAN__
+ return result[0];
+#endif
+}
+
+Y_FORCE_INLINE __m128i _mm_cvttps_epi32(__m128 a) {
+ __v4si result;
+
+ result = vec_cts((__v4sf)a, 0);
+ return (__m128i)result;
+}
+
+#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
+ do { \
+ __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \
+ __v4sf __t0 = vec_vmrghw((vector unsigned int)__r0, (vector unsigned int)__r1); \
+ __v4sf __t1 = vec_vmrghw((vector unsigned int)__r2, (vector unsigned int)__r3); \
+ __v4sf __t2 = vec_vmrglw((vector unsigned int)__r0, (vector unsigned int)__r1); \
+ __v4sf __t3 = vec_vmrglw((vector unsigned int)__r2, (vector unsigned int)__r3); \
+ (row0) = (__v4sf)vec_mergeh((vector long long)__t0, \
+ (vector long long)__t1); \
+ (row1) = (__v4sf)vec_mergel((vector long long)__t0, \
+ (vector long long)__t1); \
+ (row2) = (__v4sf)vec_mergeh((vector long long)__t2, \
+ (vector long long)__t3); \
+ (row3) = (__v4sf)vec_mergel((vector long long)__t2, \
+ (vector long long)__t3); \
+ } while (0)
+
+Y_FORCE_INLINE __m128i _mm_or_si128(__m128i a, __m128i b) {
+ return (__m128i)vec_or((__v2di)a, (__v2di)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_and_si128(__m128i a, __m128i b) {
+ return (__m128i)vec_and((__v2di)a, (__v2di)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_andnot_si128(__m128i a, __m128i b) {
+ return (__m128i)vec_andc((__v2di)b, (__v2di)a);
+}
+
+Y_FORCE_INLINE __m128i _mm_xor_si128(__m128i a, __m128i b) {
+ return (__m128i)vec_xor((__v2di)a, (__v2di)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_setzero_si128() {
+ return (__m128i)(__v4si){0, 0, 0, 0};
+}
+
+Y_FORCE_INLINE __m128i _mm_shuffle_epi32(__m128i op1, long op2) {
+ unsigned long element_selector_10 = op2 & 0x03;
+ unsigned long element_selector_32 = (op2 >> 2) & 0x03;
+ unsigned long element_selector_54 = (op2 >> 4) & 0x03;
+ unsigned long element_selector_76 = (op2 >> 6) & 0x03;
+ const unsigned int permute_selectors[4] =
+ {
+#ifdef __LITTLE_ENDIAN__
+ 0x03020100, 0x07060504, 0x0B0A0908, 0x0F0E0D0C
+#elif __BIG_ENDIAN__
+ 0x0C0D0E0F, 0x08090A0B, 0x04050607, 0x00010203
+#endif
+ };
+ __v4su t;
+
+#ifdef __LITTLE_ENDIAN__
+ t[0] = permute_selectors[element_selector_10];
+ t[1] = permute_selectors[element_selector_32];
+ t[2] = permute_selectors[element_selector_54] + 0x10101010;
+ t[3] = permute_selectors[element_selector_76] + 0x10101010;
+#elif __BIG_ENDIAN__
+ t[3] = permute_selectors[element_selector_10] + 0x10101010;
+ t[2] = permute_selectors[element_selector_32] + 0x10101010;
+ t[1] = permute_selectors[element_selector_54];
+ t[0] = permute_selectors[element_selector_76];
+#endif
+ return (__m128i)vec_perm((__v4si)op1, (__v4si)op1, (__vector unsigned char)t);
+}
+
+Y_FORCE_INLINE int _mm_extract_epi16(__m128i a, int imm) {
+ return (unsigned short)((__v8hi)a)[imm & 7];
+}
+
+Y_FORCE_INLINE int _mm_extract_epi8(__m128i a, int imm) {
+ return (unsigned char)((__v16qi)a)[imm & 15];
+}
+
+Y_FORCE_INLINE int _mm_extract_epi32(__m128i a, int imm) {
+ return ((__v4si)a)[imm & 3];
+}
+
+Y_FORCE_INLINE long long _mm_extract_epi64(__m128i a, int imm) {
+ return ((__v2di)a)[imm & 1];
+}
+
+Y_FORCE_INLINE int _mm_extract_ps(__m128 a, int imm) {
+ return ((__v4si)a)[imm & 3];
+}
+
+Y_FORCE_INLINE __m128i _mm_slli_epi16(__m128i a, int count) {
+ __v8hu lshift;
+ __v8hi result = {0, 0, 0, 0, 0, 0, 0, 0};
+
+ if (count >= 0 && count < 16) {
+ if (__builtin_constant_p(count)) {
+ lshift = (__v8hu)vec_splat_s16(count);
+ } else {
+ lshift = vec_splats((unsigned short)count);
+ }
+
+ result = vec_vslh((__v8hi)a, lshift);
+ }
+
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_slli_epi32(__m128i a, int count) {
+ __v4su lshift;
+ __v4si result = {0, 0, 0, 0};
+
+ if (count >= 0 && count < 32) {
+ if (__builtin_constant_p(count) && count < 16) {
+ lshift = (__v4su)vec_splat_s32(count);
+ } else {
+ lshift = vec_splats((unsigned int)count);
+ }
+
+ result = vec_vslw((__v4si)a, lshift);
+ }
+
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_slli_epi64(__m128i a, int count) {
+ __v2du lshift;
+ __v2di result = {0, 0};
+
+ if (count >= 0 && count < 64) {
+ if (__builtin_constant_p(count) && count < 16) {
+ lshift = (__v2du)vec_splat_s32(count);
+ } else {
+ lshift = (__v2du)vec_splats((unsigned int)count);
+ }
+
+ result = vec_sl((__v2di)a, lshift);
+ }
+
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_slli_si128(__m128i a, int imm) {
+ __v16qu result;
+ const __v16qu zeros = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ if (imm < 16)
+#ifdef __LITTLE_ENDIAN__
+ result = vec_sld((__v16qu)a, zeros, imm);
+#elif __BIG_ENDIAN__
+ result = vec_sld(zeros, (__v16qu)a, (16 - imm));
+#endif
+ else
+ result = zeros;
+
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_srli_epi16(__m128i a, int count) {
+ if ((unsigned long)count >= 16) {
+ /* SSE2 shifts >= element_size or < 0 produce 0; Altivec/MMX shifts by count%element_size. */
+ return (__m128i)vec_splats(0);
+ } else if (count == 0) {
+ return a;
+ } else {
+ /* The PowerPC Architecture says all shift count fields must contain the same shift count. */
+ __v8hi replicated_count;
+ replicated_count = vec_splats((short)count);
+ return (__m128i)vec_sr((vector signed short)a, replicated_count);
+ }
+}
+
+Y_FORCE_INLINE __m128i _mm_srli_epi32(__m128i a, int count) {
+ if ((unsigned long)count >= 32) {
+ /* SSE2 shifts >= element_size or < 0 produce 0; Altivec/MMX shifts by count%element_size. */
+ return (__m128i)vec_splats(0);
+ } else if (count == 0) {
+ return a;
+ } else {
+ /* The PowerPC Architecture says all shift count fields must contain the same shift count. */
+ __v4si replicated_count;
+ replicated_count = vec_splats(count);
+ return (__m128i)vec_sr((vector signed int)a, replicated_count);
+ }
+}
+
+Y_FORCE_INLINE __m128i _mm_srli_epi64(__m128i a, int count) {
+ if ((unsigned long)count >= 64) {
+ /* SSE2 shifts >= element_size or < 0 produce 0; Altivec/MMX shifts by count%element_size. */
+ return (__m128i)vec_splats(0);
+ } else if (count == 0) {
+ return a;
+ } else {
+ /* The PowerPC Architecture says all shift count fields must contain the same shift count. */
+ /* On Power7 vec_slo (vslo) does use just the documented bits 121:124. */
+ /* On Power7 vec_sll (vsll) uses the lower 3 bits of each byte instead (legal). */
+ __v16qu replicated_count;
+ replicated_count = vec_splats((unsigned char)count);
+ long long m = 0xFFFFFFFFFFFFFFFFull >> count;
+ __v2di mask;
+ mask[0] = m;
+ mask[1] = m;
+ return vec_and(vec_srl(vec_sro(a, (__m128i)replicated_count), (__m128i)replicated_count), (__v16qu)mask);
+ }
+}
+
+Y_FORCE_INLINE __m128i _mm_bsrli_si128(__m128i a, const int __N) {
+ __v16qu result;
+ const __v16qu zeros = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ if (__N < 16)
+ if (__builtin_constant_p(__N))
+ /* Would like to use Vector Shift Left Double by Octet
+ Immediate here to use the immediate form and avoid
+ load of __N * 8 value into a separate VR. */
+ result = vec_sld(zeros, (__v16qu)a, (16 - __N));
+ else {
+ __v16qu shift = vec_splats((unsigned char)(__N * 8));
+ result = vec_sro((__v16qu)a, shift);
+ }
+ else
+ result = zeros;
+
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_srli_si128(__m128i a, int imm) {
+ return _mm_bsrli_si128(a, imm);
+}
+
+Y_FORCE_INLINE __m128i _mm_srai_epi16(__m128i a, int count) {
+ __v8hu rshift = {15, 15, 15, 15, 15, 15, 15, 15};
+ __v8hi result;
+ if (count < 16) {
+ if (__builtin_constant_p(count)) {
+ rshift = (__v8hu)vec_splat_s16(count);
+ } else {
+ rshift = vec_splats((unsigned short)count);
+ }
+ }
+ result = vec_vsrah((__v8hi)a, rshift);
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_srai_epi32(__m128i a, int count) {
// return vec_shiftrightarithmetic4wimmediate(a, count); //!< Failes to work with count >= 32.
- __v4su rshift = {31, 31, 31, 31};
- __v4si result;
-
- if (count < 32) {
- if (__builtin_constant_p(count)) {
- if (count < 16) {
- rshift = (__v4su)vec_splat_s32(count);
- } else {
- rshift = (__v4su)vec_splats((unsigned int)count);
- }
- } else {
- rshift = vec_splats((unsigned int)count);
- }
+ __v4su rshift = {31, 31, 31, 31};
+ __v4si result;
+
+ if (count < 32) {
+ if (__builtin_constant_p(count)) {
+ if (count < 16) {
+ rshift = (__v4su)vec_splat_s32(count);
+ } else {
+ rshift = (__v4su)vec_splats((unsigned int)count);
+ }
+ } else {
+ rshift = vec_splats((unsigned int)count);
+ }
}
- result = vec_vsraw((__v4si)a, rshift);
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_sll_epi16(__m128i a, __m128i count) {
- __v8hu lshift, shmask;
- const __v8hu shmax = {15, 15, 15, 15, 15, 15, 15, 15};
- __v8hu result;
-
-#ifdef __LITTLE_ENDIAN__
- lshift = vec_splat((__v8hu)count, 0);
-#elif __BIG_ENDIAN__
- lshift = vec_splat((__v8hu)count, 3);
-#endif
- shmask = vec_cmple(lshift, shmax);
- result = vec_vslh((__v8hu)a, lshift);
- result = vec_sel(shmask, result, shmask);
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_sll_epi32(__m128i a, __m128i count) {
- __v4su lshift, shmask;
- const __v4su shmax = {32, 32, 32, 32};
- __v4su result;
-#ifdef __LITTLE_ENDIAN__
- lshift = vec_splat((__v4su)count, 0);
-#elif __BIG_ENDIAN__
- lshift = vec_splat((__v4su)count, 1);
-#endif
- shmask = vec_cmplt(lshift, shmax);
- result = vec_vslw((__v4su)a, lshift);
- result = vec_sel(shmask, result, shmask);
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_sll_epi64(__m128i a, __m128i count) {
- __v2du lshift, shmask;
- const __v2du shmax = {64, 64};
- __v2du result;
-
- lshift = (__v2du)vec_splat((__v2du)count, 0);
- shmask = vec_cmplt(lshift, shmax);
- result = vec_sl((__v2du)a, lshift);
- result = ((vector long long)shmask & ~(vector long long)shmask) | ((vector long long)result & (vector long long)shmask);
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_srl_epi16(__m128i a, __m128i count) {
- __v8hu rshift, shmask;
- const __v8hu shmax = {15, 15, 15, 15, 15, 15, 15, 15};
- __v8hu result;
-
-#ifdef __LITTLE_ENDIAN__
- rshift = vec_splat((__v8hu)count, 0);
-#elif __BIG_ENDIAN__
- rshift = vec_splat((__v8hu)count, 3);
-#endif
- shmask = vec_cmple(rshift, shmax);
- result = vec_vsrh((__v8hu)a, rshift);
- result = vec_sel(shmask, result, shmask);
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_srl_epi32(__m128i a, __m128i count) {
- __v4su rshift, shmask;
- const __v4su shmax = {32, 32, 32, 32};
- __v4su result;
-
-#ifdef __LITTLE_ENDIAN__
- rshift = vec_splat((__v4su)count, 0);
-#elif __BIG_ENDIAN__
- rshift = vec_splat((__v4su)count, 1);
-#endif
- shmask = vec_cmplt(rshift, shmax);
- result = vec_vsrw((__v4su)a, rshift);
- result = vec_sel(shmask, result, shmask);
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE __m128i _mm_srl_epi64(__m128i a, __m128i count) {
- __v2du rshift, shmask;
- const __v2du shmax = {64, 64};
- __v2du result;
-
- rshift = (__v2du)vec_splat((__v2du)count, 0);
- shmask = vec_cmplt(rshift, shmax);
- result = vec_sr((__v2du)a, rshift);
- result = (__v2du)vec_sel((__v2du)shmask, (__v2du)result, (__v2du)shmask);
-
- return (__m128i)result;
-}
-
-Y_FORCE_INLINE void _mm_storeu_si128(__m128i* p, __m128i a) {
- vec_vsx_st(a, 0, p);
-}
-
-Y_FORCE_INLINE void _mm_store_si128(__m128i* p, __m128i a) {
- vec_st((__v16qu)a, 0, (__v16qu*)p);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpackhi_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_mergel((__v16qu)a, (__v16qu)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpackhi_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_mergel((__v8hu)a, (__v8hu)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpackhi_epi32(__m128i a, __m128i b) {
- return (__m128i)vec_mergel((__v4su)a, (__v4su)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpackhi_epi64(__m128i a, __m128i b) {
- return (__m128i)vec_mergel((vector long long)a, (vector long long)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpacklo_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_mergeh((__v16qu)a, (__v16qu)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpacklo_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_mergeh((__v8hi)a, (__v8hi)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpacklo_epi32(__m128i a, __m128i b) {
- return (__m128i)vec_mergeh((__v4si)a, (__v4si)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_unpacklo_epi64(__m128i a, __m128i b) {
- return (__m128i)vec_mergeh((vector long long)a, (vector long long)b);
-}
+ result = vec_vsraw((__v4si)a, rshift);
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_sll_epi16(__m128i a, __m128i count) {
+ __v8hu lshift, shmask;
+ const __v8hu shmax = {15, 15, 15, 15, 15, 15, 15, 15};
+ __v8hu result;
+
+#ifdef __LITTLE_ENDIAN__
+ lshift = vec_splat((__v8hu)count, 0);
+#elif __BIG_ENDIAN__
+ lshift = vec_splat((__v8hu)count, 3);
+#endif
+ shmask = vec_cmple(lshift, shmax);
+ result = vec_vslh((__v8hu)a, lshift);
+ result = vec_sel(shmask, result, shmask);
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_sll_epi32(__m128i a, __m128i count) {
+ __v4su lshift, shmask;
+ const __v4su shmax = {32, 32, 32, 32};
+ __v4su result;
+#ifdef __LITTLE_ENDIAN__
+ lshift = vec_splat((__v4su)count, 0);
+#elif __BIG_ENDIAN__
+ lshift = vec_splat((__v4su)count, 1);
+#endif
+ shmask = vec_cmplt(lshift, shmax);
+ result = vec_vslw((__v4su)a, lshift);
+ result = vec_sel(shmask, result, shmask);
-Y_FORCE_INLINE __m128i _mm_add_epi8(__m128i a, __m128i b) {
- return (__m128i)((__v16qu)a + (__v16qu)b);
+ return (__m128i)result;
}
-Y_FORCE_INLINE __m128i _mm_add_epi16(__m128i a, __m128i b) {
- return (__m128i)((__v8hu)a + (__v8hu)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_add_epi32(__m128i a, __m128i b) {
- return (__m128i)((__v4su)a + (__v4su)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_add_epi64(__m128i a, __m128i b) {
- return (__m128i)((__v2du)a + (__v2du)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_madd_epi16(__m128i a, __m128i b) {
- const vector signed int zero = {0, 0, 0, 0};
- return (__m128i)vec_vmsumshm((__v8hi)a, (__v8hi)b, zero);
-}
-
-Y_FORCE_INLINE __m128i _mm_sub_epi8(__m128i a, __m128i b) {
- return (__m128i)((__v16qu)a - (__v16qu)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_sub_epi16(__m128i a, __m128i b) {
- return (__m128i)((__v8hu)a - (__v8hu)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_sub_epi32(__m128i a, __m128i b) {
- return (__m128i)((__v4su)a - (__v4su)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_sub_epi64(__m128i a, __m128i b) {
- return (__m128i)((__v2du)a - (__v2du)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_mul_epu32(__m128i a, __m128 b) {
-#ifdef __LITTLE_ENDIAN__
- return (__m128i)vec_mule((__v4su)a, (__v4su)b);
-#elif __BIG_ENDIAN__
- return (__m128i)vec_mulo((__v4su)a, (__v4su)b);
-#endif
-}
-
-Y_FORCE_INLINE __m128i _mm_set_epi8(char q15, char q14, char q13, char q12, char q11, char q10, char q09, char q08, char q07, char q06, char q05, char q04, char q03, char q02, char q01, char q00) {
- return (__m128i)(__v16qi){q00, q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15};
-};
-
-Y_FORCE_INLINE __m128i _mm_setr_epi8(char q15, char q14, char q13, char q12, char q11, char q10, char q09, char q08, char q07, char q06, char q05, char q04, char q03, char q02, char q01, char q00) {
- return (__m128i)(__v16qi){q15, q14, q13, q12, q11, q10, q09, q08, q07, q06, q05, q04, q03, q02, q01, q00};
-};
-
-Y_FORCE_INLINE __m128i _mm_set_epi16(short q7, short q6, short q5, short q4, short q3, short q2, short q1, short q0) {
- return (__m128i)(__v8hi){q0, q1, q2, q3, q4, q5, q6, q7};
-}
+Y_FORCE_INLINE __m128i _mm_sll_epi64(__m128i a, __m128i count) {
+ __v2du lshift, shmask;
+ const __v2du shmax = {64, 64};
+ __v2du result;
-Y_FORCE_INLINE __m128i _mm_setr_epi16(short q7, short q6, short q5, short q4, short q3, short q2, short q1, short q0) {
- return (__m128i)(__v8hi){q7, q6, q5, q4, q3, q2, q1, q0};
+ lshift = (__v2du)vec_splat((__v2du)count, 0);
+ shmask = vec_cmplt(lshift, shmax);
+ result = vec_sl((__v2du)a, lshift);
+ result = ((vector long long)shmask & ~(vector long long)shmask) | ((vector long long)result & (vector long long)shmask);
+
+ return (__m128i)result;
}
-Y_FORCE_INLINE __m128i _mm_set_epi32(int q3, int q2, int q1, int q0) {
- return (__m128i)(__v4si){q0, q1, q2, q3};
+Y_FORCE_INLINE __m128i _mm_srl_epi16(__m128i a, __m128i count) {
+ __v8hu rshift, shmask;
+ const __v8hu shmax = {15, 15, 15, 15, 15, 15, 15, 15};
+ __v8hu result;
+
+#ifdef __LITTLE_ENDIAN__
+ rshift = vec_splat((__v8hu)count, 0);
+#elif __BIG_ENDIAN__
+ rshift = vec_splat((__v8hu)count, 3);
+#endif
+ shmask = vec_cmple(rshift, shmax);
+ result = vec_vsrh((__v8hu)a, rshift);
+ result = vec_sel(shmask, result, shmask);
+
+ return (__m128i)result;
}
-Y_FORCE_INLINE __m128i _mm_setr_epi32(int q3, int q2, int q1, int q0) {
- return (__m128i)(__v4si){q3, q2, q1, q0};
+Y_FORCE_INLINE __m128i _mm_srl_epi32(__m128i a, __m128i count) {
+ __v4su rshift, shmask;
+ const __v4su shmax = {32, 32, 32, 32};
+ __v4su result;
+
+#ifdef __LITTLE_ENDIAN__
+ rshift = vec_splat((__v4su)count, 0);
+#elif __BIG_ENDIAN__
+ rshift = vec_splat((__v4su)count, 1);
+#endif
+ shmask = vec_cmplt(rshift, shmax);
+ result = vec_vsrw((__v4su)a, rshift);
+ result = vec_sel(shmask, result, shmask);
+
+ return (__m128i)result;
}
-Y_FORCE_INLINE __m128i _mm_set1_epi8(char a) {
- return _mm_set_epi8(a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a);
+Y_FORCE_INLINE __m128i _mm_srl_epi64(__m128i a, __m128i count) {
+ __v2du rshift, shmask;
+ const __v2du shmax = {64, 64};
+ __v2du result;
+
+ rshift = (__v2du)vec_splat((__v2du)count, 0);
+ shmask = vec_cmplt(rshift, shmax);
+ result = vec_sr((__v2du)a, rshift);
+ result = (__v2du)vec_sel((__v2du)shmask, (__v2du)result, (__v2du)shmask);
+
+ return (__m128i)result;
}
-Y_FORCE_INLINE __m128i _mm_set1_epi16(short a) {
- return _mm_set_epi16(a, a, a, a, a, a, a, a);
+Y_FORCE_INLINE void _mm_storeu_si128(__m128i* p, __m128i a) {
+ vec_vsx_st(a, 0, p);
}
-Y_FORCE_INLINE __m128i _mm_set1_epi32(int a) {
- return _mm_set_epi32(a, a, a, a);
+Y_FORCE_INLINE void _mm_store_si128(__m128i* p, __m128i a) {
+ vec_st((__v16qu)a, 0, (__v16qu*)p);
}
-Y_FORCE_INLINE __m128i _mm_cmpeq_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_cmpeq((__v16qi)a, (__v16qi)b);
+Y_FORCE_INLINE __m128i _mm_unpackhi_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_mergel((__v16qu)a, (__v16qu)b);
}
-Y_FORCE_INLINE __m128i _mm_cmpeq_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_cmpeq((__v8hi)a, (__v8hi)b);
+Y_FORCE_INLINE __m128i _mm_unpackhi_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_mergel((__v8hu)a, (__v8hu)b);
}
-Y_FORCE_INLINE __m128i _mm_cmpeq_epi32(__m128i a, __m128i b) {
- return (__m128i)vec_cmpeq((__v4si)a, (__v4si)b);
+Y_FORCE_INLINE __m128i _mm_unpackhi_epi32(__m128i a, __m128i b) {
+ return (__m128i)vec_mergel((__v4su)a, (__v4su)b);
}
-Y_FORCE_INLINE __m128i _mm_packs_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_packs((__v8hi)a, (__v8hi)b);
+Y_FORCE_INLINE __m128i _mm_unpackhi_epi64(__m128i a, __m128i b) {
+ return (__m128i)vec_mergel((vector long long)a, (vector long long)b);
}
-Y_FORCE_INLINE __m128i _mm_packs_epi32(__m128i a, __m128i b) {
- return (__m128i)vec_packs((__v4si)a, (__v4si)b);
+Y_FORCE_INLINE __m128i _mm_unpacklo_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_mergeh((__v16qu)a, (__v16qu)b);
}
-Y_FORCE_INLINE __m128i _mm_packus_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_packsu((vector signed short)a, (vector signed short)b);
+Y_FORCE_INLINE __m128i _mm_unpacklo_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_mergeh((__v8hi)a, (__v8hi)b);
}
-Y_FORCE_INLINE __m128i _mm_cvtsi64_si128(i64 a) {
- return (__m128i)(__v2di){a, 0LL};
+Y_FORCE_INLINE __m128i _mm_unpacklo_epi32(__m128i a, __m128i b) {
+ return (__m128i)vec_mergeh((__v4si)a, (__v4si)b);
}
-Y_FORCE_INLINE __m128i _mm_cvtsi32_si128(int a) {
- return _mm_set_epi32(0, 0, 0, a);
+Y_FORCE_INLINE __m128i _mm_unpacklo_epi64(__m128i a, __m128i b) {
+ return (__m128i)vec_mergeh((vector long long)a, (vector long long)b);
}
-Y_FORCE_INLINE int _mm_cvtsi128_si32(__m128i a) {
- return ((__v4si)a)[0];
+Y_FORCE_INLINE __m128i _mm_add_epi8(__m128i a, __m128i b) {
+ return (__m128i)((__v16qu)a + (__v16qu)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_add_epi16(__m128i a, __m128i b) {
+ return (__m128i)((__v8hu)a + (__v8hu)b);
}
-Y_FORCE_INLINE i64 _mm_cvtsi128_si64(__m128i a) {
- return ((__v2di)a)[0];
+Y_FORCE_INLINE __m128i _mm_add_epi32(__m128i a, __m128i b) {
+ return (__m128i)((__v4su)a + (__v4su)b);
}
-Y_FORCE_INLINE __m128i _mm_load_si128(const __m128i* p) {
- return *p;
+Y_FORCE_INLINE __m128i _mm_add_epi64(__m128i a, __m128i b) {
+ return (__m128i)((__v2du)a + (__v2du)b);
}
-Y_FORCE_INLINE __m128i _mm_loadu_si128(const __m128i* p) {
- return (__m128i)(vec_vsx_ld(0, (signed int const*)p));
+Y_FORCE_INLINE __m128i _mm_madd_epi16(__m128i a, __m128i b) {
+ const vector signed int zero = {0, 0, 0, 0};
+ return (__m128i)vec_vmsumshm((__v8hi)a, (__v8hi)b, zero);
}
-Y_FORCE_INLINE __m128i _mm_lddqu_si128(const __m128i* p) {
- return _mm_loadu_si128(p);
+Y_FORCE_INLINE __m128i _mm_sub_epi8(__m128i a, __m128i b) {
+ return (__m128i)((__v16qu)a - (__v16qu)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_sub_epi16(__m128i a, __m128i b) {
+ return (__m128i)((__v8hu)a - (__v8hu)b);
}
-Y_FORCE_INLINE __m128i _mm_loadl_epi64(const __m128i* a) {
-#ifdef __LITTLE_ENDIAN__
- const vector bool long long mask = {
- 0xFFFFFFFFFFFFFFFFull, 0x0000000000000000ull};
-#elif __BIG_ENDIAN__
- const vector bool long long mask = {
- 0x0000000000000000ull, 0xFFFFFFFFFFFFFFFFull};
-#endif
- return (__m128i)vec_and(_mm_loadu_si128(a), (vector unsigned char)mask);
-}
-
-Y_FORCE_INLINE void _mm_storel_epi64(__m128i* a, __m128i b) {
- *(long long*)a = ((__v2di)b)[0];
-}
-
-Y_FORCE_INLINE double _mm_cvtsd_f64(__m128d a) {
- return ((__v2df)a)[0];
-}
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-Y_FORCE_INLINE __m128d _mm_undefined_pd(void) {
- __m128d ans = ans;
- return ans;
-}
-#pragma GCC diagnostic pop
-
-Y_FORCE_INLINE __m128d _mm_loadh_pd(__m128d a, const double* b) {
- __v2df result = (__v2df)a;
- result[1] = *b;
- return (__m128d)result;
-}
-
-Y_FORCE_INLINE __m128d _mm_loadl_pd(__m128d a, const double* b) {
- __v2df result = (__v2df)a;
- result[0] = *b;
- return (__m128d)result;
-}
-
-Y_FORCE_INLINE __m128 _mm_castsi128_ps(__m128i a) {
- return (__m128)a;
-}
-
-Y_FORCE_INLINE __m128i _mm_castps_si128(__m128 a) {
- return (__m128i)a;
-}
-
-Y_FORCE_INLINE __m128i _mm_cmpgt_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_cmpgt((__v16qi)a, (__v16qi)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_cmpgt_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_cmpgt((__v8hi)a, (__v8hi)b);
-}
-
-Y_FORCE_INLINE __m128i _mm_cmpgt_epi32(__m128i a, __m128i b) {
- return (__m128i)vec_cmpgt((__v4si)a, (__v4si)b);
+Y_FORCE_INLINE __m128i _mm_sub_epi32(__m128i a, __m128i b) {
+ return (__m128i)((__v4su)a - (__v4su)b);
}
-Y_FORCE_INLINE __m128i _mm_cmpgt_epi64(__m128i a, __m128i b) {
- return vec_cmpgt((vector signed long long)a, (vector signed long long)b);
+Y_FORCE_INLINE __m128i _mm_sub_epi64(__m128i a, __m128i b) {
+ return (__m128i)((__v2du)a - (__v2du)b);
}
-Y_FORCE_INLINE __m128i _mm_cmplt_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_cmplt((__v16qi)a, (__v16qi)b);
+Y_FORCE_INLINE __m128i _mm_mul_epu32(__m128i a, __m128 b) {
+#ifdef __LITTLE_ENDIAN__
+ return (__m128i)vec_mule((__v4su)a, (__v4su)b);
+#elif __BIG_ENDIAN__
+ return (__m128i)vec_mulo((__v4su)a, (__v4su)b);
+#endif
}
-Y_FORCE_INLINE __m128i _mm_cmplt_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_cmplt((__v8hi)a, (__v8hi)b);
+Y_FORCE_INLINE __m128i _mm_set_epi8(char q15, char q14, char q13, char q12, char q11, char q10, char q09, char q08, char q07, char q06, char q05, char q04, char q03, char q02, char q01, char q00) {
+ return (__m128i)(__v16qi){q00, q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q14, q15};
+};
+
+Y_FORCE_INLINE __m128i _mm_setr_epi8(char q15, char q14, char q13, char q12, char q11, char q10, char q09, char q08, char q07, char q06, char q05, char q04, char q03, char q02, char q01, char q00) {
+ return (__m128i)(__v16qi){q15, q14, q13, q12, q11, q10, q09, q08, q07, q06, q05, q04, q03, q02, q01, q00};
+};
+
+Y_FORCE_INLINE __m128i _mm_set_epi16(short q7, short q6, short q5, short q4, short q3, short q2, short q1, short q0) {
+ return (__m128i)(__v8hi){q0, q1, q2, q3, q4, q5, q6, q7};
}
-Y_FORCE_INLINE __m128i _mm_cmplt_epi32(__m128i a, __m128i b) {
- return (__m128i)vec_cmplt((__v4si)a, (__v4si)b);
+Y_FORCE_INLINE __m128i _mm_setr_epi16(short q7, short q6, short q5, short q4, short q3, short q2, short q1, short q0) {
+ return (__m128i)(__v8hi){q7, q6, q5, q4, q3, q2, q1, q0};
+}
+
+Y_FORCE_INLINE __m128i _mm_set_epi32(int q3, int q2, int q1, int q0) {
+ return (__m128i)(__v4si){q0, q1, q2, q3};
}
-Y_FORCE_INLINE __m128i _mm_cmplt_epi64(__m128i a, __m128i b) {
- return vec_cmplt((vector signed long long)a, (vector signed long long)b);
+Y_FORCE_INLINE __m128i _mm_setr_epi32(int q3, int q2, int q1, int q0) {
+ return (__m128i)(__v4si){q3, q2, q1, q0};
+}
+
+Y_FORCE_INLINE __m128i _mm_set1_epi8(char a) {
+ return _mm_set_epi8(a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a);
+}
+
+Y_FORCE_INLINE __m128i _mm_set1_epi16(short a) {
+ return _mm_set_epi16(a, a, a, a, a, a, a, a);
+}
+
+Y_FORCE_INLINE __m128i _mm_set1_epi32(int a) {
+ return _mm_set_epi32(a, a, a, a);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmpeq_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_cmpeq((__v16qi)a, (__v16qi)b);
}
-Y_FORCE_INLINE __m128i _mm_sad_epu8(__m128i A, __m128i B) {
- __v16qu a, b;
- __v16qu vmin, vmax, vabsdiff;
- __v4si vsum;
- const __v4su zero = {0, 0, 0, 0};
- __v4si result;
-
- a = (__v16qu)A;
- b = (__v16qu)B;
- vmin = vec_min(a, b);
- vmax = vec_max(a, b);
- vabsdiff = vec_sub(vmax, vmin);
- /* Sum four groups of bytes into integers. */
- vsum = (__vector signed int)vec_sum4s(vabsdiff, zero);
- /* Sum across four integers with two integer results. */
- result = vec_sum2s(vsum, (__vector signed int)zero);
- /* Rotate the sums into the correct position. */
-#ifdef __LITTLE_ENDIAN__
- result = vec_sld(result, result, 4);
-#elif __BIG_ENDIAN__
- result = vec_sld(result, result, 6);
-#endif
- /* Rotate the sums into the correct position. */
- return (__m128i)result;
+Y_FORCE_INLINE __m128i _mm_cmpeq_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_cmpeq((__v8hi)a, (__v8hi)b);
}
-Y_FORCE_INLINE __m128i _mm_subs_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_subs((__v16qi)a, (__v16qi)b);
+Y_FORCE_INLINE __m128i _mm_cmpeq_epi32(__m128i a, __m128i b) {
+ return (__m128i)vec_cmpeq((__v4si)a, (__v4si)b);
}
-Y_FORCE_INLINE __m128i _mm_subs_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_subs((__v8hi)a, (__v8hi)b);
+Y_FORCE_INLINE __m128i _mm_packs_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_packs((__v8hi)a, (__v8hi)b);
}
-Y_FORCE_INLINE __m128i _mm_subs_epu8(__m128i a, __m128i b) {
- return (__m128i)vec_subs((__v16qu)a, (__v16qu)b);
+Y_FORCE_INLINE __m128i _mm_packs_epi32(__m128i a, __m128i b) {
+ return (__m128i)vec_packs((__v4si)a, (__v4si)b);
}
-Y_FORCE_INLINE __m128i _mm_subs_epu16(__m128i a, __m128i b) {
- return (__m128i)vec_subs((__v8hu)a, (__v8hu)b);
+Y_FORCE_INLINE __m128i _mm_packus_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_packsu((vector signed short)a, (vector signed short)b);
}
-Y_FORCE_INLINE __m128i _mm_adds_epi8(__m128i a, __m128i b) {
- return (__m128i)vec_adds((__v16qi)a, (__v16qi)b);
+Y_FORCE_INLINE __m128i _mm_cvtsi64_si128(i64 a) {
+ return (__m128i)(__v2di){a, 0LL};
}
-Y_FORCE_INLINE __m128i _mm_adds_epi16(__m128i a, __m128i b) {
- return (__m128i)vec_adds((__v8hi)a, (__v8hi)b);
+Y_FORCE_INLINE __m128i _mm_cvtsi32_si128(int a) {
+ return _mm_set_epi32(0, 0, 0, a);
}
-Y_FORCE_INLINE __m128i _mm_adds_epu8(__m128i a, __m128i b) {
- return (__m128i)vec_adds((__v16qu)a, (__v16qu)b);
+Y_FORCE_INLINE int _mm_cvtsi128_si32(__m128i a) {
+ return ((__v4si)a)[0];
}
-Y_FORCE_INLINE __m128i _mm_adds_epu16(__m128i a, __m128i b) {
- return (__m128i)vec_adds((__v8hu)a, (__v8hu)b);
+Y_FORCE_INLINE i64 _mm_cvtsi128_si64(__m128i a) {
+ return ((__v2di)a)[0];
}
-Y_FORCE_INLINE __m128d _mm_castsi128_pd(__m128i a) {
- return (__m128d)a;
+Y_FORCE_INLINE __m128i _mm_load_si128(const __m128i* p) {
+ return *p;
}
-Y_FORCE_INLINE void _mm_prefetch(const void *p, enum _mm_hint) {
- __builtin_prefetch(p);
+Y_FORCE_INLINE __m128i _mm_loadu_si128(const __m128i* p) {
+ return (__m128i)(vec_vsx_ld(0, (signed int const*)p));
}
-Y_FORCE_INLINE __m128i _mm_hadd_epi16(__m128i a, __m128i b) {
- const __v16qu p = { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29 };
- const __v16qu q = { 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31 };
- __v8hi c = vec_perm((__v8hi)a, (__v8hi)b, p);
- __v8hi d = vec_perm((__v8hi)a, (__v8hi)b, q);
- return (__m128i)vec_add(c, d);
-}
+Y_FORCE_INLINE __m128i _mm_lddqu_si128(const __m128i* p) {
+ return _mm_loadu_si128(p);
+}
+
+Y_FORCE_INLINE __m128i _mm_loadl_epi64(const __m128i* a) {
+#ifdef __LITTLE_ENDIAN__
+ const vector bool long long mask = {
+ 0xFFFFFFFFFFFFFFFFull, 0x0000000000000000ull};
+#elif __BIG_ENDIAN__
+ const vector bool long long mask = {
+ 0x0000000000000000ull, 0xFFFFFFFFFFFFFFFFull};
+#endif
+ return (__m128i)vec_and(_mm_loadu_si128(a), (vector unsigned char)mask);
+}
+
+Y_FORCE_INLINE void _mm_storel_epi64(__m128i* a, __m128i b) {
+ *(long long*)a = ((__v2di)b)[0];
+}
+
+Y_FORCE_INLINE double _mm_cvtsd_f64(__m128d a) {
+ return ((__v2df)a)[0];
+}
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+Y_FORCE_INLINE __m128d _mm_undefined_pd(void) {
+ __m128d ans = ans;
+ return ans;
+}
+#pragma GCC diagnostic pop
+
+Y_FORCE_INLINE __m128d _mm_loadh_pd(__m128d a, const double* b) {
+ __v2df result = (__v2df)a;
+ result[1] = *b;
+ return (__m128d)result;
+}
+
+Y_FORCE_INLINE __m128d _mm_loadl_pd(__m128d a, const double* b) {
+ __v2df result = (__v2df)a;
+ result[0] = *b;
+ return (__m128d)result;
+}
+
+Y_FORCE_INLINE __m128 _mm_castsi128_ps(__m128i a) {
+ return (__m128)a;
+}
+
+Y_FORCE_INLINE __m128i _mm_castps_si128(__m128 a) {
+ return (__m128i)a;
+}
+
+Y_FORCE_INLINE __m128i _mm_cmpgt_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_cmpgt((__v16qi)a, (__v16qi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmpgt_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_cmpgt((__v8hi)a, (__v8hi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmpgt_epi32(__m128i a, __m128i b) {
+ return (__m128i)vec_cmpgt((__v4si)a, (__v4si)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmpgt_epi64(__m128i a, __m128i b) {
+ return vec_cmpgt((vector signed long long)a, (vector signed long long)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmplt_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_cmplt((__v16qi)a, (__v16qi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmplt_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_cmplt((__v8hi)a, (__v8hi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmplt_epi32(__m128i a, __m128i b) {
+ return (__m128i)vec_cmplt((__v4si)a, (__v4si)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_cmplt_epi64(__m128i a, __m128i b) {
+ return vec_cmplt((vector signed long long)a, (vector signed long long)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_sad_epu8(__m128i A, __m128i B) {
+ __v16qu a, b;
+ __v16qu vmin, vmax, vabsdiff;
+ __v4si vsum;
+ const __v4su zero = {0, 0, 0, 0};
+ __v4si result;
+
+ a = (__v16qu)A;
+ b = (__v16qu)B;
+ vmin = vec_min(a, b);
+ vmax = vec_max(a, b);
+ vabsdiff = vec_sub(vmax, vmin);
+ /* Sum four groups of bytes into integers. */
+ vsum = (__vector signed int)vec_sum4s(vabsdiff, zero);
+ /* Sum across four integers with two integer results. */
+ result = vec_sum2s(vsum, (__vector signed int)zero);
+ /* Rotate the sums into the correct position. */
+#ifdef __LITTLE_ENDIAN__
+ result = vec_sld(result, result, 4);
+#elif __BIG_ENDIAN__
+ result = vec_sld(result, result, 6);
+#endif
+ /* Rotate the sums into the correct position. */
+ return (__m128i)result;
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_subs((__v16qi)a, (__v16qi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_subs((__v8hi)a, (__v8hi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epu8(__m128i a, __m128i b) {
+ return (__m128i)vec_subs((__v16qu)a, (__v16qu)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epu16(__m128i a, __m128i b) {
+ return (__m128i)vec_subs((__v8hu)a, (__v8hu)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_adds_epi8(__m128i a, __m128i b) {
+ return (__m128i)vec_adds((__v16qi)a, (__v16qi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_adds_epi16(__m128i a, __m128i b) {
+ return (__m128i)vec_adds((__v8hi)a, (__v8hi)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_adds_epu8(__m128i a, __m128i b) {
+ return (__m128i)vec_adds((__v16qu)a, (__v16qu)b);
+}
+
+Y_FORCE_INLINE __m128i _mm_adds_epu16(__m128i a, __m128i b) {
+ return (__m128i)vec_adds((__v8hu)a, (__v8hu)b);
+}
+
+Y_FORCE_INLINE __m128d _mm_castsi128_pd(__m128i a) {
+ return (__m128d)a;
+}
+
+Y_FORCE_INLINE void _mm_prefetch(const void *p, enum _mm_hint) {
+ __builtin_prefetch(p);
+}
+
+Y_FORCE_INLINE __m128i _mm_hadd_epi16(__m128i a, __m128i b) {
+ const __v16qu p = { 0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29 };
+ const __v16qu q = { 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31 };
+ __v8hi c = vec_perm((__v8hi)a, (__v8hi)b, p);
+ __v8hi d = vec_perm((__v8hi)a, (__v8hi)b, q);
+ return (__m128i)vec_add(c, d);
+}
diff --git a/library/cpp/sse/sse.cpp b/library/cpp/sse/sse.cpp
index d0d1de9930..1e880e40d3 100644
--- a/library/cpp/sse/sse.cpp
+++ b/library/cpp/sse/sse.cpp
@@ -1 +1 @@
-#include "sse.h"
+#include "sse.h"
diff --git a/library/cpp/sse/sse.h b/library/cpp/sse/sse.h
index 19bac17de0..39d1ccb958 100644
--- a/library/cpp/sse/sse.h
+++ b/library/cpp/sse/sse.h
@@ -4,16 +4,16 @@
The header chooses appropriate SSE support.
On Intel: SSE intrinsics
On ARM64: translation to NEON intrinsics or software emulation
- On PowerPc: translation to Altivec intrinsics or software emulation
+ On PowerPc: translation to Altivec intrinsics or software emulation
*/
-/* Author: Vitaliy Manushkin <agri@yandex-team.ru>, Danila Kutenin <danlark@yandex-team.ru> */
+/* Author: Vitaliy Manushkin <agri@yandex-team.ru>, Danila Kutenin <danlark@yandex-team.ru> */
#include <util/system/platform.h>
#if (defined(_i386_) || defined(_x86_64_)) && defined(_sse_)
#include <xmmintrin.h>
#include <emmintrin.h>
-#include <pmmintrin.h>
+#include <pmmintrin.h>
#define ARCADIA_SSE
#if defined(_ssse3_)
#include <tmmintrin.h>
diff --git a/library/cpp/sse/sse2neon.h b/library/cpp/sse/sse2neon.h
index 695dbd3041..f60711e77f 100644
--- a/library/cpp/sse/sse2neon.h
+++ b/library/cpp/sse/sse2neon.h
@@ -17,7 +17,7 @@
#if !defined(_arm64_)
#error "This header is for ARM64 (aarch64) platform only. " \
- "Include sse.h instead of including this header directly."
+ "Include sse.h instead of including this header directly."
#endif
#include <arm_neon.h>
@@ -57,21 +57,21 @@ union __m128 {
typedef float64x2_t __m128d;
-enum _mm_hint
-{
- /* _MM_HINT_ET is _MM_HINT_T with set 3rd bit. */
- _MM_HINT_ET0 = 7,
- _MM_HINT_ET1 = 6,
- _MM_HINT_T0 = 3,
- _MM_HINT_T1 = 2,
- _MM_HINT_T2 = 1,
- _MM_HINT_NTA = 0
-};
-
-Y_FORCE_INLINE void _mm_prefetch(const void *p, enum _mm_hint) {
- __builtin_prefetch(p);
-}
-
+enum _mm_hint
+{
+ /* _MM_HINT_ET is _MM_HINT_T with set 3rd bit. */
+ _MM_HINT_ET0 = 7,
+ _MM_HINT_ET1 = 6,
+ _MM_HINT_T0 = 3,
+ _MM_HINT_T1 = 2,
+ _MM_HINT_T2 = 1,
+ _MM_HINT_NTA = 0
+};
+
+Y_FORCE_INLINE void _mm_prefetch(const void *p, enum _mm_hint) {
+ __builtin_prefetch(p);
+}
+
template <typename TType>
struct TQType;
@@ -299,9 +299,9 @@ using _mm_or_si128 = TWrapperDual<uint64x2_t, decltype(vorrq_u64), vorrq_u64>;
using _mm_and_si128 = TWrapperDual<uint64x2_t, decltype(vandq_u64), vandq_u64>;
using _mm_andnot_si128 =
TWrapperDualSwap<uint64x2_t, decltype(vbicq_u64), vbicq_u64>;
-using _mm_xor_si128 = TWrapperDual<uint64x2_t, decltype(veorq_u64), veorq_u64>;
+using _mm_xor_si128 = TWrapperDual<uint64x2_t, decltype(veorq_u64), veorq_u64>;
-using _mm_add_epi8 = TWrapperDual<uint8x16_t, decltype(vaddq_u8), vaddq_u8>;
+using _mm_add_epi8 = TWrapperDual<uint8x16_t, decltype(vaddq_u8), vaddq_u8>;
using _mm_add_epi16 = TWrapperDual<uint16x8_t, decltype(vaddq_u16), vaddq_u16>;
using _mm_add_epi32 = TWrapperDual<uint32x4_t, decltype(vaddq_u32), vaddq_u32>;
using _mm_add_epi64 = TWrapperDual<uint64x2_t, decltype(vaddq_u64), vaddq_u64>;
@@ -342,7 +342,7 @@ inline __m128i _mm_madd_epi16(__m128i a, __m128i b) {
return res;
}
-using _mm_sub_epi8 = TWrapperDual<uint8x16_t, decltype(vsubq_u8), vsubq_u8>;
+using _mm_sub_epi8 = TWrapperDual<uint8x16_t, decltype(vsubq_u8), vsubq_u8>;
using _mm_sub_epi16 = TWrapperDual<uint16x8_t, decltype(vsubq_u16), vsubq_u16>;
using _mm_sub_epi32 = TWrapperDual<uint32x4_t, decltype(vsubq_u32), vsubq_u32>;
using _mm_sub_epi64 = TWrapperDual<uint64x2_t, decltype(vsubq_u64), vsubq_u64>;
@@ -385,27 +385,27 @@ using _mm_cmplt_epi16 =
using _mm_cmplt_epi32 =
TWrapperDual<int32x4_t, decltype(vcltq_s32), vcltq_s32>;
-Y_FORCE_INLINE __m128i _mm_load_si128(const __m128i* ptr) {
+Y_FORCE_INLINE __m128i _mm_load_si128(const __m128i* ptr) {
__m128i result;
result.AsUi64x2 = vld1q_u64((const uint64_t*)ptr);
return result;
}
-Y_FORCE_INLINE __m128i _mm_loadu_si128(const __m128i* ptr) {
+Y_FORCE_INLINE __m128i _mm_loadu_si128(const __m128i* ptr) {
__m128i result;
result.AsUi64x2 = vld1q_u64((const uint64_t*)ptr);
return result;
}
-Y_FORCE_INLINE __m128i _mm_lddqu_si128(const __m128i* ptr) {
- return _mm_loadu_si128(ptr);
-}
-
-Y_FORCE_INLINE void _mm_storeu_si128(__m128i* ptr, const __m128i& op) {
+Y_FORCE_INLINE __m128i _mm_lddqu_si128(const __m128i* ptr) {
+ return _mm_loadu_si128(ptr);
+}
+
+Y_FORCE_INLINE void _mm_storeu_si128(__m128i* ptr, const __m128i& op) {
vst1q_u64((uint64_t*)ptr, op.AsUi64x2);
}
-Y_FORCE_INLINE void
+Y_FORCE_INLINE void
_mm_store_si128(__m128i* ptr, const __m128i& op) {
vst1q_u64((uint64_t*)ptr, op.AsUi64x2);
}
@@ -459,7 +459,7 @@ struct ShuffleStruct4 {
ui8 x[4];
};
-Y_FORCE_INLINE ShuffleStruct4
+Y_FORCE_INLINE ShuffleStruct4
_MM_SHUFFLE(ui8 x4, ui8 x3, ui8 x2, ui8 x1) {
ShuffleStruct4 result;
result.x[0] = x1;
@@ -469,7 +469,7 @@ _MM_SHUFFLE(ui8 x4, ui8 x3, ui8 x2, ui8 x1) {
return result;
}
-Y_FORCE_INLINE __m128i
+Y_FORCE_INLINE __m128i
_mm_shuffle_epi32(const __m128i& op1, const ShuffleStruct4& op2) {
__m128i result;
const ui8 xi[4] = {
@@ -486,7 +486,7 @@ _mm_shuffle_epi32(const __m128i& op1, const ShuffleStruct4& op2) {
return result;
}
-Y_FORCE_INLINE int
+Y_FORCE_INLINE int
_mm_movemask_epi8(const __m128i& op) {
uint8x16_t mask = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80};
@@ -542,7 +542,7 @@ struct THelper_mm_slli_si128 : TBaseWrapper<__m128i> {
#define _mm_slli_si128(a, imm) THelper_mm_slli_si128<imm>(a)
-Y_FORCE_INLINE int _mm_cvtsi128_si32(const __m128i& op) {
+Y_FORCE_INLINE int _mm_cvtsi128_si32(const __m128i& op) {
return vgetq_lane_s32(op.AsSi32x4, 0);
}
@@ -558,18 +558,18 @@ struct _mm_set_epi16 : TBaseWrapper<__m128i> {
}
};
-struct _mm_setr_epi16 : TBaseWrapper<__m128i> {
- Y_FORCE_INLINE
- _mm_setr_epi16(const short w7, const short w6,
- const short w5, const short w4,
- const short w3, const short w2,
- const short w1, const short w0) {
- int16x4_t d0 = {w7, w6, w5, w4};
- int16x4_t d1 = {w3, w2, w1, w0};
- TQType<int16x8_t>::As(Value) = vcombine_s16(d0, d1);
- }
-};
-
+struct _mm_setr_epi16 : TBaseWrapper<__m128i> {
+ Y_FORCE_INLINE
+ _mm_setr_epi16(const short w7, const short w6,
+ const short w5, const short w4,
+ const short w3, const short w2,
+ const short w1, const short w0) {
+ int16x4_t d0 = {w7, w6, w5, w4};
+ int16x4_t d1 = {w3, w2, w1, w0};
+ TQType<int16x8_t>::As(Value) = vcombine_s16(d0, d1);
+ }
+};
+
struct _mm_set_epi32 : TBaseWrapper<__m128i> {
Y_FORCE_INLINE
_mm_set_epi32(const int x3, const int x2,
@@ -580,16 +580,16 @@ struct _mm_set_epi32 : TBaseWrapper<__m128i> {
}
};
-struct _mm_setr_epi32 : TBaseWrapper<__m128i> {
- Y_FORCE_INLINE
- _mm_setr_epi32(const int x3, const int x2,
- const int x1, const int x0) {
- int32x2_t d0 = {x3, x2};
- int32x2_t d1 = {x1, x0};
- TQType<int32x4_t>::As(Value) = vcombine_s32(d0, d1);
- }
-};
-
+struct _mm_setr_epi32 : TBaseWrapper<__m128i> {
+ Y_FORCE_INLINE
+ _mm_setr_epi32(const int x3, const int x2,
+ const int x1, const int x0) {
+ int32x2_t d0 = {x3, x2};
+ int32x2_t d1 = {x1, x0};
+ TQType<int32x4_t>::As(Value) = vcombine_s32(d0, d1);
+ }
+};
+
struct _mm_cvtsi32_si128 : TBaseWrapper<__m128i> {
Y_FORCE_INLINE
_mm_cvtsi32_si128(int op) {
@@ -642,31 +642,31 @@ struct TScalarOutWrapper : TBaseWrapper<TOpOut> {
};
template<int imm>
-int extract_epi8_arm(__m128i arg) {
- return vgetq_lane_u8(arg.AsUi8x16, imm);
-}
-
-template<int imm>
-int extract_epi16_arm(__m128i arg) {
+int extract_epi8_arm(__m128i arg) {
+ return vgetq_lane_u8(arg.AsUi8x16, imm);
+}
+
+template<int imm>
+int extract_epi16_arm(__m128i arg) {
return vgetq_lane_u16(arg.AsUi16x8, imm);
}
-template<int imm>
-int extract_epi32_arm(__m128i arg) {
- return vgetq_lane_s32(arg.AsSi32x4, imm);
-}
-
-template<int imm>
-long long extract_epi64_arm(__m128i arg) {
- return vgetq_lane_s64(arg.AsSi64x2, imm);
-}
-
-#define _mm_extract_epi8(op, imm) extract_epi8_arm<imm>(op)
-#define _mm_extract_epi16(op, imm) extract_epi16_arm<imm>(op)
-#define _mm_extract_epi32(op, imm) extract_epi32_arm<imm>(op)
-#define _mm_extract_epi64(op, imm) extract_epi64_arm<imm>(op)
-#define _mm_extract_ps(op, imm) _mm_extract_epi32(op, imm)
-
+template<int imm>
+int extract_epi32_arm(__m128i arg) {
+ return vgetq_lane_s32(arg.AsSi32x4, imm);
+}
+
+template<int imm>
+long long extract_epi64_arm(__m128i arg) {
+ return vgetq_lane_s64(arg.AsSi64x2, imm);
+}
+
+#define _mm_extract_epi8(op, imm) extract_epi8_arm<imm>(op)
+#define _mm_extract_epi16(op, imm) extract_epi16_arm<imm>(op)
+#define _mm_extract_epi32(op, imm) extract_epi32_arm<imm>(op)
+#define _mm_extract_epi64(op, imm) extract_epi64_arm<imm>(op)
+#define _mm_extract_ps(op, imm) _mm_extract_epi32(op, imm)
+
static Y_FORCE_INLINE
__m128i _mm_mul_epu32(__m128i op1, __m128i op2) {
__m128i result;
@@ -734,27 +734,27 @@ struct _mm_setzero_ps : TBaseWrapper<__m128> {
}
};
-Y_FORCE_INLINE __m128d _mm_setzero_pd() {
+Y_FORCE_INLINE __m128d _mm_setzero_pd() {
return vdupq_n_f64(0.);
}
-Y_FORCE_INLINE __m128 _mm_loadu_ps(const float* ptr) {
+Y_FORCE_INLINE __m128 _mm_loadu_ps(const float* ptr) {
__m128 result;
result.AsFloat32x4 = vld1q_f32(ptr);
return result;
}
-Y_FORCE_INLINE __m128 _mm_load_ps(const float* ptr) {
+Y_FORCE_INLINE __m128 _mm_load_ps(const float* ptr) {
__m128 result;
result.AsFloat32x4 = vld1q_f32(ptr);
return result;
}
-Y_FORCE_INLINE void _mm_storeu_ps(float* ptr, const __m128& op) {
+Y_FORCE_INLINE void _mm_storeu_ps(float* ptr, const __m128& op) {
vst1q_f32(ptr, op.AsFloat32x4);
}
-Y_FORCE_INLINE void _mm_store_ps(float* ptr, const __m128& op) {
+Y_FORCE_INLINE void _mm_store_ps(float* ptr, const __m128& op) {
vst1q_f32(ptr, op.AsFloat32x4);
}
@@ -768,23 +768,23 @@ struct _mm_set_ps : TBaseWrapper<__m128> {
}
};
-Y_FORCE_INLINE __m128d _mm_set_pd(double d1, double d0) {
+Y_FORCE_INLINE __m128d _mm_set_pd(double d1, double d0) {
const float64x1_t p0 = {d0};
const float64x1_t p1 = {d1};
return vcombine_f64(p0, p1);
}
-Y_FORCE_INLINE __m128d _mm_loadu_pd(const double* d) {
+Y_FORCE_INLINE __m128d _mm_loadu_pd(const double* d) {
__m128d res;
res = vld1q_f64(d);
return res;
}
-Y_FORCE_INLINE void _mm_storeu_pd(double* res, __m128d a) {
+Y_FORCE_INLINE void _mm_storeu_pd(double* res, __m128d a) {
vst1q_f64(res, a);
}
-Y_FORCE_INLINE void _mm_store_pd(double* res, __m128d a) {
+Y_FORCE_INLINE void _mm_store_pd(double* res, __m128d a) {
vst1q_f64(res, a);
}
@@ -811,11 +811,11 @@ struct _mm_and_ps : TBaseWrapper<__m128> {
}
};
-Y_FORCE_INLINE __m128d _mm_and_pd(__m128d a, __m128d b) {
- return vandq_u64(a, b);
-}
-
-Y_FORCE_INLINE void _MM_TRANSPOSE4_PS(__m128& op0, __m128& op1, __m128& op2, __m128& op3) {
+Y_FORCE_INLINE __m128d _mm_and_pd(__m128d a, __m128d b) {
+ return vandq_u64(a, b);
+}
+
+Y_FORCE_INLINE void _MM_TRANSPOSE4_PS(__m128& op0, __m128& op1, __m128& op2, __m128& op3) {
float64x2_t im0 =
(float64x2_t)vtrn1q_f32(op0.AsFloat32x4, op1.AsFloat32x4);
float64x2_t im1 =
@@ -831,11 +831,11 @@ Y_FORCE_INLINE void _MM_TRANSPOSE4_PS(__m128& op0, __m128& op1, __m128& op2, __m
TQType<float64x2_t>::As(op3) = vtrn2q_f64(im1, im3);
};
-Y_FORCE_INLINE __m128 _mm_castsi128_ps(__m128i op) {
+Y_FORCE_INLINE __m128 _mm_castsi128_ps(__m128i op) {
return reinterpret_cast<__m128&>(op);
}
-Y_FORCE_INLINE __m128i _mm_castps_si128(__m128 op) {
+Y_FORCE_INLINE __m128i _mm_castps_si128(__m128 op) {
return reinterpret_cast<__m128i&>(op);
}
@@ -878,7 +878,7 @@ using _mm_cvttps_epi32 =
TCvtF2SWrapperSingle<int32x4_t, float32x4_t,
decltype(vcvtq_s32_f32), vcvtq_s32_f32>;
-Y_FORCE_INLINE int
+Y_FORCE_INLINE int
_mm_movemask_ps(const __m128& op) {
uint32x4_t mask = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
uint32x4_t bits = vandq_u32(op.AsUi32x4, mask);
@@ -924,27 +924,27 @@ inline void _mm_store_ss(float* p, __m128 a) {
*p = vgetq_lane_f32(a.AsFloat32x4, 0);
}
-inline float vgetg_lane_f32_switch(float32x4_t a, ui8 b) {
- switch (b & 0x3) {
- case 0:
- return vgetq_lane_f32(a, 0);
- case 1:
- return vgetq_lane_f32(a, 1);
- case 2:
- return vgetq_lane_f32(a, 2);
- case 3:
- return vgetq_lane_f32(a, 3);
- }
- return 0;
-}
-
+inline float vgetg_lane_f32_switch(float32x4_t a, ui8 b) {
+ switch (b & 0x3) {
+ case 0:
+ return vgetq_lane_f32(a, 0);
+ case 1:
+ return vgetq_lane_f32(a, 1);
+ case 2:
+ return vgetq_lane_f32(a, 2);
+ case 3:
+ return vgetq_lane_f32(a, 3);
+ }
+ return 0;
+}
+
inline __m128 _mm_shuffle_ps(__m128 a, __m128 b, const ShuffleStruct4& shuf) {
- __m128 ret;
- ret.AsFloat32x4 = vmovq_n_f32(vgetg_lane_f32_switch(a.AsFloat32x4, shuf.x[0]));
- ret.AsFloat32x4 = vsetq_lane_f32(vgetg_lane_f32_switch(a.AsFloat32x4, shuf.x[1]), ret.AsFloat32x4, 1);
- ret.AsFloat32x4 = vsetq_lane_f32(vgetg_lane_f32_switch(b.AsFloat32x4, shuf.x[2]), ret.AsFloat32x4, 2);
- ret.AsFloat32x4 = vsetq_lane_f32(vgetg_lane_f32_switch(b.AsFloat32x4, shuf.x[3]), ret.AsFloat32x4, 3);
- return ret;
+ __m128 ret;
+ ret.AsFloat32x4 = vmovq_n_f32(vgetg_lane_f32_switch(a.AsFloat32x4, shuf.x[0]));
+ ret.AsFloat32x4 = vsetq_lane_f32(vgetg_lane_f32_switch(a.AsFloat32x4, shuf.x[1]), ret.AsFloat32x4, 1);
+ ret.AsFloat32x4 = vsetq_lane_f32(vgetg_lane_f32_switch(b.AsFloat32x4, shuf.x[2]), ret.AsFloat32x4, 2);
+ ret.AsFloat32x4 = vsetq_lane_f32(vgetg_lane_f32_switch(b.AsFloat32x4, shuf.x[3]), ret.AsFloat32x4, 3);
+ return ret;
}
inline __m128 _mm_or_ps(__m128 a, __m128 b) {
@@ -952,94 +952,94 @@ inline __m128 _mm_or_ps(__m128 a, __m128 b) {
res.AsUi32x4 = vorrq_u32(a.AsUi32x4, b.AsUi32x4);
return res;
}
-
-inline __m128i _mm_sad_epu8(__m128i a, __m128i b) {
- uint16x8_t t = vpaddlq_u8(vabdq_u8(a.AsUi8x16, b.AsUi8x16));
- uint16_t r0 = t[0] + t[1] + t[2] + t[3];
- uint16_t r4 = t[4] + t[5] + t[6] + t[7];
- uint16x8_t r = vsetq_lane_u16(r0, vdupq_n_u16(0), 0);
- __m128i ans;
- ans.AsUi16x8 = vsetq_lane_u16(r4, r, 4);
- return ans;
-}
-
-Y_FORCE_INLINE __m128i _mm_subs_epi8(__m128i a, __m128i b) {
- __m128i ans;
- ans.AsSi8x16 = vqsubq_s8(a.AsSi8x16, b.AsSi8x16);
- return ans;
-}
-
-Y_FORCE_INLINE __m128i _mm_subs_epi16(__m128i a, __m128i b) {
- __m128i ans;
- ans.AsSi16x8 = vqsubq_s16(a.AsSi16x8, b.AsSi16x8);
- return ans;
-}
-
-Y_FORCE_INLINE __m128i _mm_subs_epu8(__m128i a, __m128i b) {
- __m128i ans;
- ans.AsUi8x16 = vqsubq_u8(a.AsUi8x16, b.AsUi8x16);
- return ans;
-}
-
-Y_FORCE_INLINE __m128i _mm_subs_epu16(__m128i a, __m128i b) {
- __m128i ans;
- ans.AsUi16x8 = vqsubq_u16(a.AsUi16x8, b.AsUi16x8);
- return ans;
-}
-
-Y_FORCE_INLINE __m128d _mm_castsi128_pd(__m128i __A) {
- return reinterpret_cast<__m128d&>(__A);
-}
-
-Y_FORCE_INLINE __m128i _mm_set_epi8(ui8 i15, ui8 i14, ui8 i13, ui8 i12, ui8 i11, ui8 i10, ui8 i9, ui8 i8,
- ui8 i7, ui8 i6, ui8 i5, ui8 i4, ui8 i3, ui8 i2, ui8 i1, ui8 i0)
-{
- int a0 = i0 | (i1<<8) | (i2<<16) | (i3<<24);
- int a1 = i4 | (i5<<8) | (i6<<16) | (i7<<24);
- int a2 = i8 | (i9<<8) | (i10<<16) | (i11<<24);
- int a3 = i12 | (i13<<8) | (i14<<16) | (i15<<24);
- return _mm_set_epi32(a3, a2, a1, a0);
-}
-
-Y_FORCE_INLINE __m128i _mm_max_epu8(__m128i a, __m128i b) {
- __m128i ans;
- ans.AsUi8x16 = vmaxq_u8(a.AsUi8x16, b.AsUi8x16);
- return ans;
-}
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-Y_FORCE_INLINE __m128d _mm_undefined_pd(void) {
- __m128d ans = ans;
- return ans;
-}
-#pragma GCC diagnostic pop
-
-Y_FORCE_INLINE __m128d _mm_loadh_pd(__m128d a, const double* b) {
- a[1] = *b;
- return a;
-}
-
-Y_FORCE_INLINE __m128d _mm_loadl_pd(__m128d a, const double* b) {
- a[0] = *b;
- return a;
-}
-
-Y_FORCE_INLINE double _mm_cvtsd_f64(__m128d a) {
- return a[0];
-}
-
-Y_FORCE_INLINE __m128d _mm_shuffle_pd(__m128d a, __m128d b, int mask) {
- __m128d result;
- const int litmsk = mask & 0x3;
-
- if (litmsk == 0)
- result = vzip1q_f64(a, b);
- else if (litmsk == 1)
- result = __builtin_shufflevector(a, b, 1, 2);
- else if (litmsk == 2)
- result = __builtin_shufflevector(a, b, 0, 3);
- else
- result = vzip2q_f64(a, b);
- return result;
-}
+
+inline __m128i _mm_sad_epu8(__m128i a, __m128i b) {
+ uint16x8_t t = vpaddlq_u8(vabdq_u8(a.AsUi8x16, b.AsUi8x16));
+ uint16_t r0 = t[0] + t[1] + t[2] + t[3];
+ uint16_t r4 = t[4] + t[5] + t[6] + t[7];
+ uint16x8_t r = vsetq_lane_u16(r0, vdupq_n_u16(0), 0);
+ __m128i ans;
+ ans.AsUi16x8 = vsetq_lane_u16(r4, r, 4);
+ return ans;
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epi8(__m128i a, __m128i b) {
+ __m128i ans;
+ ans.AsSi8x16 = vqsubq_s8(a.AsSi8x16, b.AsSi8x16);
+ return ans;
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epi16(__m128i a, __m128i b) {
+ __m128i ans;
+ ans.AsSi16x8 = vqsubq_s16(a.AsSi16x8, b.AsSi16x8);
+ return ans;
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epu8(__m128i a, __m128i b) {
+ __m128i ans;
+ ans.AsUi8x16 = vqsubq_u8(a.AsUi8x16, b.AsUi8x16);
+ return ans;
+}
+
+Y_FORCE_INLINE __m128i _mm_subs_epu16(__m128i a, __m128i b) {
+ __m128i ans;
+ ans.AsUi16x8 = vqsubq_u16(a.AsUi16x8, b.AsUi16x8);
+ return ans;
+}
+
+Y_FORCE_INLINE __m128d _mm_castsi128_pd(__m128i __A) {
+ return reinterpret_cast<__m128d&>(__A);
+}
+
+Y_FORCE_INLINE __m128i _mm_set_epi8(ui8 i15, ui8 i14, ui8 i13, ui8 i12, ui8 i11, ui8 i10, ui8 i9, ui8 i8,
+ ui8 i7, ui8 i6, ui8 i5, ui8 i4, ui8 i3, ui8 i2, ui8 i1, ui8 i0)
+{
+ int a0 = i0 | (i1<<8) | (i2<<16) | (i3<<24);
+ int a1 = i4 | (i5<<8) | (i6<<16) | (i7<<24);
+ int a2 = i8 | (i9<<8) | (i10<<16) | (i11<<24);
+ int a3 = i12 | (i13<<8) | (i14<<16) | (i15<<24);
+ return _mm_set_epi32(a3, a2, a1, a0);
+}
+
+Y_FORCE_INLINE __m128i _mm_max_epu8(__m128i a, __m128i b) {
+ __m128i ans;
+ ans.AsUi8x16 = vmaxq_u8(a.AsUi8x16, b.AsUi8x16);
+ return ans;
+}
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+Y_FORCE_INLINE __m128d _mm_undefined_pd(void) {
+ __m128d ans = ans;
+ return ans;
+}
+#pragma GCC diagnostic pop
+
+Y_FORCE_INLINE __m128d _mm_loadh_pd(__m128d a, const double* b) {
+ a[1] = *b;
+ return a;
+}
+
+Y_FORCE_INLINE __m128d _mm_loadl_pd(__m128d a, const double* b) {
+ a[0] = *b;
+ return a;
+}
+
+Y_FORCE_INLINE double _mm_cvtsd_f64(__m128d a) {
+ return a[0];
+}
+
+Y_FORCE_INLINE __m128d _mm_shuffle_pd(__m128d a, __m128d b, int mask) {
+ __m128d result;
+ const int litmsk = mask & 0x3;
+
+ if (litmsk == 0)
+ result = vzip1q_f64(a, b);
+ else if (litmsk == 1)
+ result = __builtin_shufflevector(a, b, 1, 2);
+ else if (litmsk == 2)
+ result = __builtin_shufflevector(a, b, 0, 3);
+ else
+ result = vzip2q_f64(a, b);
+ return result;
+}
diff --git a/library/cpp/sse/ut/test.cpp b/library/cpp/sse/ut/test.cpp
index 33c999d284..a4e6c2bfbc 100644
--- a/library/cpp/sse/ut/test.cpp
+++ b/library/cpp/sse/ut/test.cpp
@@ -9,15 +9,15 @@
#include <util/generic/typetraits.h>
#include <util/string/hex.h>
-#include <util/random/fast.h>
-#include <util/stream/output.h>
+#include <util/random/fast.h>
+#include <util/stream/output.h>
-#include <algorithm>
+#include <algorithm>
#include <array>
#include <limits>
-#include <memory>
-#include <type_traits>
-#include <utility>
+#include <memory>
+#include <type_traits>
+#include <utility>
template <typename TResult, typename TFunc, TFunc* func>
struct T_mm_CallWrapper {
@@ -42,7 +42,7 @@ struct T_mm_CallWrapper {
#elif defined(_i386_) || defined(_x86_64_)
#include <xmmintrin.h>
#include <emmintrin.h>
-#include <smmintrin.h>
+#include <smmintrin.h>
#elif defined(_ppc64_)
#include "library/cpp/sse/powerpc.h"
#else
@@ -259,10 +259,10 @@ private:
UNIT_TEST(Test_mm_storel_epi64);
UNIT_TEST(Test_mm_loadl_epi64);
- UNIT_TEST(Test_mm_loadl_pd);
- UNIT_TEST(Test_mm_loadh_pd);
- UNIT_TEST(Test_mm_cvtsd_f64);
-
+ UNIT_TEST(Test_mm_loadl_pd);
+ UNIT_TEST(Test_mm_loadh_pd);
+ UNIT_TEST(Test_mm_cvtsd_f64);
+
UNIT_TEST(Test_mm_shuffle_epi32);
UNIT_TEST(Test_mm_movemask_epi8);
UNIT_TEST(Test_mm_cvtsi128_si32);
@@ -281,9 +281,9 @@ private:
UNIT_TEST(Test_mm_packus_epi16);
UNIT_TEST(Test_mm_extract_epi16);
- UNIT_TEST(Test_mm_extract_epi8);
- UNIT_TEST(Test_mm_extract_epi32);
- UNIT_TEST(Test_mm_extract_epi64);
+ UNIT_TEST(Test_mm_extract_epi8);
+ UNIT_TEST(Test_mm_extract_epi32);
+ UNIT_TEST(Test_mm_extract_epi64);
UNIT_TEST(Test_MM_TRANSPOSE4_PS);
UNIT_TEST(Test_mm_movemask_ps);
@@ -301,14 +301,14 @@ private:
UNIT_TEST(Test_mm_cmpunord_ps);
UNIT_TEST(Test_mm_andnot_ps);
UNIT_TEST(Test_mm_shuffle_ps);
- UNIT_TEST(Test_mm_shuffle_pd);
+ UNIT_TEST(Test_mm_shuffle_pd);
UNIT_TEST(Test_mm_or_ps);
UNIT_TEST(Test_mm_store_ss);
UNIT_TEST(Test_mm_store_ps);
UNIT_TEST(Test_mm_storeu_pd);
- UNIT_TEST(Test_mm_loadu_pd);
- UNIT_TEST(Test_mm_rsqrt_ps);
- UNIT_TEST(Test_matrixnet_powerpc);
+ UNIT_TEST(Test_mm_loadu_pd);
+ UNIT_TEST(Test_mm_rsqrt_ps);
+ UNIT_TEST(Test_matrixnet_powerpc);
UNIT_TEST_SUITE_END();
@@ -436,10 +436,10 @@ public:
void Test_mm_loadl_epi64();
void Test_mm_storel_epi64();
- void Test_mm_loadl_pd();
- void Test_mm_loadh_pd();
- void Test_mm_cvtsd_f64();
-
+ void Test_mm_loadl_pd();
+ void Test_mm_loadh_pd();
+ void Test_mm_cvtsd_f64();
+
void Test_mm_shuffle_epi32();
void Test_mm_movemask_epi8();
void Test_mm_cvtsi128_si32();
@@ -461,9 +461,9 @@ public:
void Test_mm_packus_epi16();
void Test_mm_extract_epi16();
- void Test_mm_extract_epi8();
- void Test_mm_extract_epi32();
- void Test_mm_extract_epi64();
+ void Test_mm_extract_epi8();
+ void Test_mm_extract_epi32();
+ void Test_mm_extract_epi64();
void Test_MM_TRANSPOSE4_PS();
void Test_mm_movemask_ps();
@@ -491,12 +491,12 @@ public:
void Test_mm_storeu_pd();
void Test_mm_andnot_ps();
void Test_mm_shuffle_ps();
- void Test_mm_shuffle_pd();
+ void Test_mm_shuffle_pd();
void Test_mm_or_ps();
- void Test_mm_loadu_pd();
- void Test_mm_rsqrt_ps();
- void Test_mm_rsqrt_ss();
- void Test_matrixnet_powerpc();
+ void Test_mm_loadu_pd();
+ void Test_mm_rsqrt_ps();
+ void Test_mm_rsqrt_ss();
+ void Test_matrixnet_powerpc();
};
UNIT_TEST_SUITE_REGISTRATION(TSSEEmulTest);
@@ -1569,33 +1569,33 @@ void TSSEEmulTest::Test_mm_packus_epi16() {
Test_mm_packs_epiXX<i16, ui8, 16, Wrap(_mm_packus_epi16)>();
}
-void TSSEEmulTest::Test_mm_extract_epi8() {
- alignas(16) char data[16] = {
- '\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
- '\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
- const ui8* dataw = reinterpret_cast<const ui8*>(&data);
- const __m128i value = _mm_loadu_si128((__m128i*)&data);
-
- UNIT_ASSERT_EQUAL((_mm_extract_epi16(value, 0)), int(dataw[0]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 1)), int(dataw[1]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 2)), int(dataw[2]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 3)), int(dataw[3]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 4)), int(dataw[4]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 5)), int(dataw[5]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 6)), int(dataw[6]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 7)), int(dataw[7]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 8)), int(dataw[8]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 9)), int(dataw[9]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 10)), int(dataw[10]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 11)), int(dataw[11]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 12)), int(dataw[12]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 13)), int(dataw[13]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 14)), int(dataw[14]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 15)), int(dataw[15]));
-}
-
+void TSSEEmulTest::Test_mm_extract_epi8() {
+ alignas(16) char data[16] = {
+ '\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
+ '\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
+ const ui8* dataw = reinterpret_cast<const ui8*>(&data);
+ const __m128i value = _mm_loadu_si128((__m128i*)&data);
+
+ UNIT_ASSERT_EQUAL((_mm_extract_epi16(value, 0)), int(dataw[0]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 1)), int(dataw[1]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 2)), int(dataw[2]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 3)), int(dataw[3]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 4)), int(dataw[4]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 5)), int(dataw[5]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 6)), int(dataw[6]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 7)), int(dataw[7]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 8)), int(dataw[8]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 9)), int(dataw[9]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 10)), int(dataw[10]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 11)), int(dataw[11]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 12)), int(dataw[12]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 13)), int(dataw[13]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 14)), int(dataw[14]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi8(value, 15)), int(dataw[15]));
+}
+
void TSSEEmulTest::Test_mm_extract_epi16() {
- alignas(16) char data[16] = {
+ alignas(16) char data[16] = {
'\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
'\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
const ui16* dataw = reinterpret_cast<const ui16*>(&data);
@@ -1611,30 +1611,30 @@ void TSSEEmulTest::Test_mm_extract_epi16() {
UNIT_ASSERT_EQUAL((_mm_extract_epi16(value, 7)), int(dataw[7]));
}
-void TSSEEmulTest::Test_mm_extract_epi64() {
- alignas(16) char data[16] = {
- '\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
- '\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
- const ui64* dataw = reinterpret_cast<const ui64*>(&data);
- const __m128i value = _mm_loadu_si128((__m128i*)&data);
-
- UNIT_ASSERT_EQUAL((_mm_extract_epi64(value, 0)), (long long)(dataw[0]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi64(value, 1)), (long long)(dataw[1]));
-}
-
-void TSSEEmulTest::Test_mm_extract_epi32() {
- alignas(16) char data[16] = {
- '\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
- '\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
- const ui32* dataw = reinterpret_cast<const ui32*>(&data);
- const __m128i value = _mm_loadu_si128((__m128i*)&data);
-
- UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 0)), int(dataw[0]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 1)), int(dataw[1]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 2)), int(dataw[2]));
- UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 3)), int(dataw[3]));
-}
-
+void TSSEEmulTest::Test_mm_extract_epi64() {
+ alignas(16) char data[16] = {
+ '\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
+ '\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
+ const ui64* dataw = reinterpret_cast<const ui64*>(&data);
+ const __m128i value = _mm_loadu_si128((__m128i*)&data);
+
+ UNIT_ASSERT_EQUAL((_mm_extract_epi64(value, 0)), (long long)(dataw[0]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi64(value, 1)), (long long)(dataw[1]));
+}
+
+void TSSEEmulTest::Test_mm_extract_epi32() {
+ alignas(16) char data[16] = {
+ '\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
+ '\x33', '\x99', '\x44', '\x88', '\x55', '\x77', '\x66', '\x1C'};
+ const ui32* dataw = reinterpret_cast<const ui32*>(&data);
+ const __m128i value = _mm_loadu_si128((__m128i*)&data);
+
+ UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 0)), int(dataw[0]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 1)), int(dataw[1]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 2)), int(dataw[2]));
+ UNIT_ASSERT_EQUAL((_mm_extract_epi32(value, 3)), int(dataw[3]));
+}
+
void TSSEEmulTest::Test_MM_TRANSPOSE4_PS() {
char data0[16] = {
'\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
@@ -1851,17 +1851,17 @@ void TSSEEmulTest::Test_mm_store_ps() {
}
void TSSEEmulTest::Test_mm_storeu_pd() {
- alignas(16) const double valueBits[4] = {1., 2., 3., 4.};
- for (size_t i = 0; i != 3; ++i) {
- const __m128d value = _mm_loadu_pd(&valueBits[i]);
- alignas(16) double res[4];
- for (size_t shift = 0; shift != 3; ++shift) {
- _mm_storeu_pd(&res[shift], value);
- for (size_t j = 0; j != 2; ++j) {
+ alignas(16) const double valueBits[4] = {1., 2., 3., 4.};
+ for (size_t i = 0; i != 3; ++i) {
+ const __m128d value = _mm_loadu_pd(&valueBits[i]);
+ alignas(16) double res[4];
+ for (size_t shift = 0; shift != 3; ++shift) {
+ _mm_storeu_pd(&res[shift], value);
+ for (size_t j = 0; j != 2; ++j) {
UNIT_ASSERT_EQUAL_C(res[j + shift], valueBits[i + j], "res: " << HexEncode(&res[shift], 16) << " vs etalon: " << HexEncode(&valueBits[i], 16));
- }
- }
- }
+ }
+ }
+ }
}
void TSSEEmulTest::Test_mm_andnot_ps() {
@@ -1899,75 +1899,75 @@ void TSSEEmulTest::Test_mm_shuffle_ps() {
UNIT_ASSERT_EQUAL(::memcmp(&res, etalon, sizeof(etalon)), 0);
}
-void TSSEEmulTest::Test_mm_shuffle_pd() {
- const double first[2] = {1.3, 2.3};
- const double second[2] = {5.3, 6.3};
- const double etalon0[2] = {1.3, 5.3};
- const double etalon1[2] = {2.3, 5.3};
- const double etalon2[2] = {1.3, 6.3};
- const double etalon3[2] = {2.3, 6.3};
-
- const __m128d value1 = _mm_loadu_pd(first);
- const __m128d value2 = _mm_loadu_pd(second);
-
- __m128d res = _mm_shuffle_pd(value1, value2, 0);
- UNIT_ASSERT_EQUAL(::memcmp(&res, etalon0, sizeof(etalon0)), 0);
-
- res = _mm_shuffle_pd(value1, value2, 1);
- UNIT_ASSERT_EQUAL(::memcmp(&res, etalon1, sizeof(etalon1)), 0);
-
- res = _mm_shuffle_pd(value1, value2, 2);
- UNIT_ASSERT_EQUAL(::memcmp(&res, etalon2, sizeof(etalon2)), 0);
-
- res = _mm_shuffle_pd(value1, value2, 3);
- UNIT_ASSERT_EQUAL(::memcmp(&res, etalon3, sizeof(etalon3)), 0);
-}
-
-void TSSEEmulTest::Test_mm_cvtsd_f64() {
- const double first[2] = {1.3, 2.3};
- const double second[2] = {5.3, 6.3};
-
- const __m128d value1 = _mm_loadu_pd(first);
- const __m128d value2 = _mm_loadu_pd(second);
-
- UNIT_ASSERT_EQUAL(_mm_cvtsd_f64(value1), 1.3);
- UNIT_ASSERT_EQUAL(_mm_cvtsd_f64(value2), 5.3);
-}
-
-void TSSEEmulTest::Test_mm_loadl_pd() {
- const double first[2] = {1.3, 2.3};
- const double second[2] = {5.3, 6.3};
- const double firstEtalon[2] = {10.13, 2.3};
- const double secondEtalon[2] = {11.13, 6.3};
-
- double newFirst = 10.13;
- double newSecond = 11.13;
-
- __m128d value1 = _mm_loadu_pd(first);
- __m128d value2 = _mm_loadu_pd(second);
- value1 = _mm_loadl_pd(value1, &newFirst);
- value2 = _mm_loadl_pd(value2, &newSecond);
- UNIT_ASSERT_EQUAL(::memcmp(&value1, firstEtalon, sizeof(firstEtalon)), 0);
- UNIT_ASSERT_EQUAL(::memcmp(&value2, secondEtalon, sizeof(secondEtalon)), 0);
-}
-
-void TSSEEmulTest::Test_mm_loadh_pd() {
- const double first[2] = {1.3, 2.3};
- const double second[2] = {5.3, 6.3};
- const double firstEtalon[2] = {1.3, 10.13};
- const double secondEtalon[2] = {5.3, 11.13};
-
- double newFirst = 10.13;
- double newSecond = 11.13;
-
- __m128d value1 = _mm_loadu_pd(first);
- __m128d value2 = _mm_loadu_pd(second);
- value1 = _mm_loadh_pd(value1, &newFirst);
- value2 = _mm_loadh_pd(value2, &newSecond);
- UNIT_ASSERT_EQUAL(::memcmp(&value1, firstEtalon, sizeof(firstEtalon)), 0);
- UNIT_ASSERT_EQUAL(::memcmp(&value2, secondEtalon, sizeof(secondEtalon)), 0);
-}
-
+void TSSEEmulTest::Test_mm_shuffle_pd() {
+ const double first[2] = {1.3, 2.3};
+ const double second[2] = {5.3, 6.3};
+ const double etalon0[2] = {1.3, 5.3};
+ const double etalon1[2] = {2.3, 5.3};
+ const double etalon2[2] = {1.3, 6.3};
+ const double etalon3[2] = {2.3, 6.3};
+
+ const __m128d value1 = _mm_loadu_pd(first);
+ const __m128d value2 = _mm_loadu_pd(second);
+
+ __m128d res = _mm_shuffle_pd(value1, value2, 0);
+ UNIT_ASSERT_EQUAL(::memcmp(&res, etalon0, sizeof(etalon0)), 0);
+
+ res = _mm_shuffle_pd(value1, value2, 1);
+ UNIT_ASSERT_EQUAL(::memcmp(&res, etalon1, sizeof(etalon1)), 0);
+
+ res = _mm_shuffle_pd(value1, value2, 2);
+ UNIT_ASSERT_EQUAL(::memcmp(&res, etalon2, sizeof(etalon2)), 0);
+
+ res = _mm_shuffle_pd(value1, value2, 3);
+ UNIT_ASSERT_EQUAL(::memcmp(&res, etalon3, sizeof(etalon3)), 0);
+}
+
+void TSSEEmulTest::Test_mm_cvtsd_f64() {
+ const double first[2] = {1.3, 2.3};
+ const double second[2] = {5.3, 6.3};
+
+ const __m128d value1 = _mm_loadu_pd(first);
+ const __m128d value2 = _mm_loadu_pd(second);
+
+ UNIT_ASSERT_EQUAL(_mm_cvtsd_f64(value1), 1.3);
+ UNIT_ASSERT_EQUAL(_mm_cvtsd_f64(value2), 5.3);
+}
+
+void TSSEEmulTest::Test_mm_loadl_pd() {
+ const double first[2] = {1.3, 2.3};
+ const double second[2] = {5.3, 6.3};
+ const double firstEtalon[2] = {10.13, 2.3};
+ const double secondEtalon[2] = {11.13, 6.3};
+
+ double newFirst = 10.13;
+ double newSecond = 11.13;
+
+ __m128d value1 = _mm_loadu_pd(first);
+ __m128d value2 = _mm_loadu_pd(second);
+ value1 = _mm_loadl_pd(value1, &newFirst);
+ value2 = _mm_loadl_pd(value2, &newSecond);
+ UNIT_ASSERT_EQUAL(::memcmp(&value1, firstEtalon, sizeof(firstEtalon)), 0);
+ UNIT_ASSERT_EQUAL(::memcmp(&value2, secondEtalon, sizeof(secondEtalon)), 0);
+}
+
+void TSSEEmulTest::Test_mm_loadh_pd() {
+ const double first[2] = {1.3, 2.3};
+ const double second[2] = {5.3, 6.3};
+ const double firstEtalon[2] = {1.3, 10.13};
+ const double secondEtalon[2] = {5.3, 11.13};
+
+ double newFirst = 10.13;
+ double newSecond = 11.13;
+
+ __m128d value1 = _mm_loadu_pd(first);
+ __m128d value2 = _mm_loadu_pd(second);
+ value1 = _mm_loadh_pd(value1, &newFirst);
+ value2 = _mm_loadh_pd(value2, &newSecond);
+ UNIT_ASSERT_EQUAL(::memcmp(&value1, firstEtalon, sizeof(firstEtalon)), 0);
+ UNIT_ASSERT_EQUAL(::memcmp(&value2, secondEtalon, sizeof(secondEtalon)), 0);
+}
+
void TSSEEmulTest::Test_mm_or_ps() {
alignas(16) const char bytes1[16] = {
'\x00', '\x00', '\xff', '\xff', '\x00', '\x00', '\xff', '\xff',
@@ -1990,99 +1990,99 @@ void TSSEEmulTest::Test_mm_or_ps() {
UNIT_ASSERT_EQUAL(::memcmp(&res, etalon, sizeof(etalon)), 0);
}
-
-void TSSEEmulTest::Test_mm_loadu_pd() {
- alignas(16) double stub[4] = {
- 0.f, 1.f,
- 2.f, 3.f
- };
-
- for (size_t shift = 0; shift != 3; ++shift) {
- const __m128d val = _mm_loadu_pd(&stub[shift]);
- alignas(16) double res[2];
- _mm_store_pd(res, val);
-
- for (size_t i = 0; i != 2; ++i) {
- UNIT_ASSERT_EQUAL_C(res[i], stub[shift + i], "res: " << HexEncode(res, 16) << " vs etalon: " << HexEncode(&stub[shift], 16));
- }
- }
-}
-
-void TSSEEmulTest::Test_mm_rsqrt_ps() {
- alignas(16) const char bytes[16] = {
- '\x00', '\x00', '\x28', '\x42', // 42.f
- '\x00', '\x98', '\x84', '\x45', // 4243.f
- '\x60', '\x26', '\xcf', '\x48', // 424243.f
- '\xed', '\xd5', '\x21', '\x4c' // 42424243.f
- };
- const __m128 value = _mm_loadu_ps((const float*)bytes);
- const __m128 result = _mm_rsqrt_ps(value);
- alignas(16) float res[4];
- _mm_store_ps(res, result);
- float fResult = 0.f;
- for (size_t i = 0; i < 4; ++i) {
- memcpy(&fResult, &bytes[i * 4], 4);
- fResult = 1.f / std::sqrt(fResult);
- UNIT_ASSERT_DOUBLES_EQUAL_C(res[i], fResult, 1e-3, "res: " << fResult << " vs etalon " << res[i]);
- }
-}
-
-namespace NHelpers {
-
- static __m128i Y_FORCE_INLINE GetCmp16(const __m128 &c0, const __m128 &c1, const __m128 &c2, const __m128 &c3, const __m128 test) {
- const __m128i r0 = _mm_castps_si128(_mm_cmpgt_ps(c0, test));
- const __m128i r1 = _mm_castps_si128(_mm_cmpgt_ps(c1, test));
- const __m128i r2 = _mm_castps_si128(_mm_cmpgt_ps(c2, test));
- const __m128i r3 = _mm_castps_si128(_mm_cmpgt_ps(c3, test));
- const __m128i packed = _mm_packs_epi16(_mm_packs_epi32(r0, r1), _mm_packs_epi32(r2, r3));
- return _mm_and_si128(_mm_set1_epi8(0x01), packed);
- }
-
- static __m128i Y_FORCE_INLINE GetCmp16(const float *factors, const __m128 test) {
- const __m128 *ptr = (__m128 *)factors;
- return GetCmp16(ptr[0], ptr[1], ptr[2], ptr[3], test);
- }
-
- template<size_t Num>
- void DoLane(size_t length, const float *factors, ui32 *& dst, const float *&values) {
- for (size_t i = 0; i < length; ++i) {
- __m128 value = _mm_set1_ps(values[i]);
- __m128i agg = GetCmp16(factors, value);
- if (Num > 1) {
- agg = _mm_add_epi16(agg, _mm_slli_epi16(GetCmp16(&factors[64], value), 1));
- }
- _mm_store_si128((__m128i *)&dst[4 * i], agg);
- }
- }
-}
-
-void TSSEEmulTest::Test_matrixnet_powerpc() {
- static constexpr size_t length = 10;
- alignas(16) float factors[1024];
- alignas(16) ui32 valP[4 * length] = { 0 };
- float values[length];
- TReallyFastRng32 rng(42);
- for (size_t i = 0; i < 1024; ++i) {
- factors[i] = rng.GenRandReal2();
- }
- for (size_t i = 0; i < length; ++i) {
- values[i] = rng.GenRandReal2();
- }
- ui32* val = reinterpret_cast<ui32*>(valP);
- const float* vals = reinterpret_cast<const float*>(values);
- NHelpers::DoLane<2>(length, factors, val, vals);
- static const ui32 etalon[4 * length] = {
- 2, 33554432, 258, 33554433, 50529027,
- 50529027, 50529027, 50529027, 50528770,
- 33685763, 33555203, 50462723, 50528770,
- 33685763, 33555203, 50462723, 50529026,
- 33751299, 50529027, 50463491, 2, 33554432,
- 258, 33554433, 50397698, 33685761, 259,
- 50462721, 50332162, 33554689, 259, 50462721,
- 50528770, 33685761, 33555203, 50462723,
- 50529026, 33685763, 50463491, 50463235
- };
- for (size_t i = 0; i < 4 * length; ++i) {
- UNIT_ASSERT_EQUAL(valP[i], etalon[i]);
- }
-}
+
+void TSSEEmulTest::Test_mm_loadu_pd() {
+ alignas(16) double stub[4] = {
+ 0.f, 1.f,
+ 2.f, 3.f
+ };
+
+ for (size_t shift = 0; shift != 3; ++shift) {
+ const __m128d val = _mm_loadu_pd(&stub[shift]);
+ alignas(16) double res[2];
+ _mm_store_pd(res, val);
+
+ for (size_t i = 0; i != 2; ++i) {
+ UNIT_ASSERT_EQUAL_C(res[i], stub[shift + i], "res: " << HexEncode(res, 16) << " vs etalon: " << HexEncode(&stub[shift], 16));
+ }
+ }
+}
+
+void TSSEEmulTest::Test_mm_rsqrt_ps() {
+ alignas(16) const char bytes[16] = {
+ '\x00', '\x00', '\x28', '\x42', // 42.f
+ '\x00', '\x98', '\x84', '\x45', // 4243.f
+ '\x60', '\x26', '\xcf', '\x48', // 424243.f
+ '\xed', '\xd5', '\x21', '\x4c' // 42424243.f
+ };
+ const __m128 value = _mm_loadu_ps((const float*)bytes);
+ const __m128 result = _mm_rsqrt_ps(value);
+ alignas(16) float res[4];
+ _mm_store_ps(res, result);
+ float fResult = 0.f;
+ for (size_t i = 0; i < 4; ++i) {
+ memcpy(&fResult, &bytes[i * 4], 4);
+ fResult = 1.f / std::sqrt(fResult);
+ UNIT_ASSERT_DOUBLES_EQUAL_C(res[i], fResult, 1e-3, "res: " << fResult << " vs etalon " << res[i]);
+ }
+}
+
+namespace NHelpers {
+
+ static __m128i Y_FORCE_INLINE GetCmp16(const __m128 &c0, const __m128 &c1, const __m128 &c2, const __m128 &c3, const __m128 test) {
+ const __m128i r0 = _mm_castps_si128(_mm_cmpgt_ps(c0, test));
+ const __m128i r1 = _mm_castps_si128(_mm_cmpgt_ps(c1, test));
+ const __m128i r2 = _mm_castps_si128(_mm_cmpgt_ps(c2, test));
+ const __m128i r3 = _mm_castps_si128(_mm_cmpgt_ps(c3, test));
+ const __m128i packed = _mm_packs_epi16(_mm_packs_epi32(r0, r1), _mm_packs_epi32(r2, r3));
+ return _mm_and_si128(_mm_set1_epi8(0x01), packed);
+ }
+
+ static __m128i Y_FORCE_INLINE GetCmp16(const float *factors, const __m128 test) {
+ const __m128 *ptr = (__m128 *)factors;
+ return GetCmp16(ptr[0], ptr[1], ptr[2], ptr[3], test);
+ }
+
+ template<size_t Num>
+ void DoLane(size_t length, const float *factors, ui32 *& dst, const float *&values) {
+ for (size_t i = 0; i < length; ++i) {
+ __m128 value = _mm_set1_ps(values[i]);
+ __m128i agg = GetCmp16(factors, value);
+ if (Num > 1) {
+ agg = _mm_add_epi16(agg, _mm_slli_epi16(GetCmp16(&factors[64], value), 1));
+ }
+ _mm_store_si128((__m128i *)&dst[4 * i], agg);
+ }
+ }
+}
+
+void TSSEEmulTest::Test_matrixnet_powerpc() {
+ static constexpr size_t length = 10;
+ alignas(16) float factors[1024];
+ alignas(16) ui32 valP[4 * length] = { 0 };
+ float values[length];
+ TReallyFastRng32 rng(42);
+ for (size_t i = 0; i < 1024; ++i) {
+ factors[i] = rng.GenRandReal2();
+ }
+ for (size_t i = 0; i < length; ++i) {
+ values[i] = rng.GenRandReal2();
+ }
+ ui32* val = reinterpret_cast<ui32*>(valP);
+ const float* vals = reinterpret_cast<const float*>(values);
+ NHelpers::DoLane<2>(length, factors, val, vals);
+ static const ui32 etalon[4 * length] = {
+ 2, 33554432, 258, 33554433, 50529027,
+ 50529027, 50529027, 50529027, 50528770,
+ 33685763, 33555203, 50462723, 50528770,
+ 33685763, 33555203, 50462723, 50529026,
+ 33751299, 50529027, 50463491, 2, 33554432,
+ 258, 33554433, 50397698, 33685761, 259,
+ 50462721, 50332162, 33554689, 259, 50462721,
+ 50528770, 33685761, 33555203, 50462723,
+ 50529026, 33685763, 50463491, 50463235
+ };
+ for (size_t i = 0; i < 4 * length; ++i) {
+ UNIT_ASSERT_EQUAL(valP[i], etalon[i]);
+ }
+}
diff --git a/library/cpp/sse/ut/ya.make b/library/cpp/sse/ut/ya.make
index 45e104971e..3605e95fad 100644
--- a/library/cpp/sse/ut/ya.make
+++ b/library/cpp/sse/ut/ya.make
@@ -1,13 +1,13 @@
UNITTEST_FOR(library/cpp/sse)
-OWNER(danlark)
+OWNER(danlark)
SRCS(
test.cpp
)
-IF (ARCH_X86_64)
- CFLAGS(-msse4.1 -msse4.2)
-ENDIF()
-
+IF (ARCH_X86_64)
+ CFLAGS(-msse4.1 -msse4.2)
+ENDIF()
+
END()
diff --git a/library/cpp/sse/ya.make b/library/cpp/sse/ya.make
index d2351e791d..f37918aced 100644
--- a/library/cpp/sse/ya.make
+++ b/library/cpp/sse/ya.make
@@ -1,12 +1,12 @@
LIBRARY()
-OWNER(
- g:base
- danlark
-)
+OWNER(
+ g:base
+ danlark
+)
SRCS(
- sse.cpp
+ sse.cpp
)
END()
diff --git a/library/cpp/streams/brotli/brotli_ut.cpp b/library/cpp/streams/brotli/brotli_ut.cpp
index aeb2e284dc..4c7b941ff2 100644
--- a/library/cpp/streams/brotli/brotli_ut.cpp
+++ b/library/cpp/streams/brotli/brotli_ut.cpp
@@ -9,7 +9,7 @@ Y_UNIT_TEST_SUITE(TBrotliTestSuite) {
TString compressed;
TStringOutput output(compressed);
TBrotliCompress compressStream(&output, 11);
- compressStream.Write(data.data(), data.size());
+ compressStream.Write(data.data(), data.size());
compressStream.Finish();
output.Finish();
return compressed;
@@ -69,7 +69,7 @@ Y_UNIT_TEST_SUITE(TBrotliTestSuite) {
Y_UNIT_TEST(TestIncompleteStream) {
TString manyAs(64 * 1024, 'a');
auto compressed = Compress(manyAs);
- TString truncated(compressed.data(), compressed.size() - 1);
+ TString truncated(compressed.data(), compressed.size() - 1);
UNIT_CHECK_GENERATED_EXCEPTION(Decompress(truncated), std::exception);
}
diff --git a/library/cpp/streams/bzip2/bzip2_ut.cpp b/library/cpp/streams/bzip2/bzip2_ut.cpp
index 69a98f296c..ac2646dbac 100644
--- a/library/cpp/streams/bzip2/bzip2_ut.cpp
+++ b/library/cpp/streams/bzip2/bzip2_ut.cpp
@@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(TBZipTest) {
TUnbufferedFileOutput o(ZDATA);
TBZipCompress c(&o);
- c.Write(data.data(), data.size());
+ c.Write(data.data(), data.size());
c.Finish();
o.Finish();
}
diff --git a/library/cpp/streams/lz/lz.cpp b/library/cpp/streams/lz/lz.cpp
index b65bb3ed96..01798a780c 100644
--- a/library/cpp/streams/lz/lz.cpp
+++ b/library/cpp/streams/lz/lz.cpp
@@ -679,7 +679,7 @@ static TAutoPtr<IInputStream> TryOpenLzDecompressorX(const TDecompressSignature&
template <class T>
static inline TAutoPtr<IInputStream> TryOpenLzDecompressorImpl(const TStringBuf& signature, T input) {
if (signature.size() == SIGNATURE_SIZE) {
- TMemoryInput mem(signature.data(), signature.size());
+ TMemoryInput mem(signature.data(), signature.size());
TDecompressSignature s(&mem);
return TryOpenLzDecompressorX(s, input);
diff --git a/library/cpp/streams/lz/lz_ut.cpp b/library/cpp/streams/lz/lz_ut.cpp
index 6876f070fc..ba6bb47ba5 100644
--- a/library/cpp/streams/lz/lz_ut.cpp
+++ b/library/cpp/streams/lz/lz_ut.cpp
@@ -32,7 +32,7 @@ namespace {
}
} while (!sym);
Y_ASSERT(sym);
- j = (j + 1) % entropy.size();
+ j = (j + 1) % entropy.size();
result += char(sym + entropy[j]);
}
return result;
@@ -56,7 +56,7 @@ namespace {
}
TString TestFileName(const TString& d, size_t bufferSize) {
- return LDATA_RANDOM + TString(".") + ToString(d.size()) + TString(".") + ToString(bufferSize);
+ return LDATA_RANDOM + TString(".") + ToString(d.size()) + TString(".") + ToString(bufferSize);
}
struct TRandomData: public TVector<TString> {
@@ -90,7 +90,7 @@ static inline void TestGoodDataCompress() {
TString d = data;
for (size_t i = 0; i < 10; ++i) {
- c.Write(d.data(), d.size());
+ c.Write(d.data(), d.size());
c << Endl;
d = d + d;
}
@@ -104,7 +104,7 @@ static inline void TestIncompressibleDataCompress(const TString& d, size_t buffe
TString testFileName = TestFileName(d, bufferSize);
TFixedBufferFileOutput o(testFileName);
C c(&o, bufferSize);
- c.Write(d.data(), d.size());
+ c.Write(d.data(), d.size());
c.Finish();
o.Finish();
}
diff --git a/library/cpp/streams/lzma/lzma_ut.cpp b/library/cpp/streams/lzma/lzma_ut.cpp
index 847e98d1ca..6518b3ff22 100644
--- a/library/cpp/streams/lzma/lzma_ut.cpp
+++ b/library/cpp/streams/lzma/lzma_ut.cpp
@@ -63,7 +63,7 @@ private:
};
TString data(GenData());
- TMemoryInput mi(data.data(), data.size());
+ TMemoryInput mi(data.data(), data.size());
TExcOutput out;
try {
@@ -81,7 +81,7 @@ private:
TString res;
{
- TMemoryInput mi(data.data(), data.size());
+ TMemoryInput mi(data.data(), data.size());
TStringOutput so(res);
TLzmaCompress c(&so);
@@ -91,7 +91,7 @@ private:
}
{
- TMemoryInput mi(res.data(), res.size());
+ TMemoryInput mi(res.data(), res.size());
TStringOutput so(data1);
TLzmaDecompress d((IInputStream*)&mi);
@@ -102,7 +102,7 @@ private:
data1.clear();
{
- TMemoryInput mi(res.data(), res.size());
+ TMemoryInput mi(res.data(), res.size());
TStringOutput so(data1);
TLzmaDecompress d(&mi);
diff --git a/library/cpp/string_utils/base64/base64.h b/library/cpp/string_utils/base64/base64.h
index f778a6425a..22a1623479 100644
--- a/library/cpp/string_utils/base64/base64.h
+++ b/library/cpp/string_utils/base64/base64.h
@@ -100,11 +100,11 @@ char* Base64Encode(char* outstr, const unsigned char* instr, size_t len);
char* Base64EncodeUrl(char* outstr, const unsigned char* instr, size_t len);
inline TStringBuf Base64Encode(const TStringBuf src, void* tmp) {
- return TStringBuf((const char*)tmp, Base64Encode((char*)tmp, (const unsigned char*)src.data(), src.size()));
+ return TStringBuf((const char*)tmp, Base64Encode((char*)tmp, (const unsigned char*)src.data(), src.size()));
}
inline TStringBuf Base64EncodeUrl(const TStringBuf src, void* tmp) {
- return TStringBuf((const char*)tmp, Base64EncodeUrl((char*)tmp, (const unsigned char*)src.data(), src.size()));
+ return TStringBuf((const char*)tmp, Base64EncodeUrl((char*)tmp, (const unsigned char*)src.data(), src.size()));
}
inline void Base64Encode(const TStringBuf src, TString& dst) {
diff --git a/library/cpp/string_utils/base64/base64_ut.cpp b/library/cpp/string_utils/base64/base64_ut.cpp
index bcc1e65879..fd9384db8a 100644
--- a/library/cpp/string_utils/base64/base64_ut.cpp
+++ b/library/cpp/string_utils/base64/base64_ut.cpp
@@ -57,7 +57,7 @@ using namespace std::string_view_literals;
\
Y_DECLARE_UNUSED \
static inline TStringBuf prefix##Base64Encode(const TStringBuf& src, void* tmp) { \
- return TStringBuf((const char*)tmp, ::NB64Etalon::prefix##Base64Encode((char*)tmp, (const unsigned char*)src.data(), src.size())); \
+ return TStringBuf((const char*)tmp, ::NB64Etalon::prefix##Base64Encode((char*)tmp, (const unsigned char*)src.data(), src.size())); \
} \
\
Y_DECLARE_UNUSED \
@@ -436,7 +436,7 @@ Y_UNIT_TEST_SUITE(TBase64) {
}
buf.assign(Base64EncodeBufSize(x.size()), Max<char>());
- const auto* const xEncEnd = Base64Encode(buf.data(), (const unsigned char*)x.data(), x.size());
+ const auto* const xEncEnd = Base64Encode(buf.data(), (const unsigned char*)x.data(), x.size());
UNIT_ASSERT_VALUES_EQUAL(*xEncEnd, '\0');
}
}
diff --git a/library/cpp/string_utils/base64/bench/main.cpp b/library/cpp/string_utils/base64/bench/main.cpp
index 10e09bc1c7..73e36758b7 100644
--- a/library/cpp/string_utils/base64/bench/main.cpp
+++ b/library/cpp/string_utils/base64/bench/main.cpp
@@ -96,9 +96,9 @@ static inline void BenchEncode(T& d, const NBench::NCpu::TParams& iface) {
for (const auto it : xrange(iface.Iterations())) {
Y_UNUSED(it);
for (size_t i = 0; i < d.Size; ++i) {
- NBench::Escape(d.PlaceToEncode[i].data());
+ NBench::Escape(d.PlaceToEncode[i].data());
Y_DO_NOT_OPTIMIZE_AWAY(
- Base64Encode(d.PlaceToEncode[i].data(), (const unsigned char*)d.Data[i].data(), d.Data[i].size()));
+ Base64Encode(d.PlaceToEncode[i].data(), (const unsigned char*)d.Data[i].data(), d.Data[i].size()));
NBench::Clobber();
}
}
@@ -109,9 +109,9 @@ static inline void BenchEncodeUrl(T& d, const NBench::NCpu::TParams& iface) {
for (const auto it : xrange(iface.Iterations())) {
Y_UNUSED(it);
for (size_t i = 0; i < d.Size; ++i) {
- NBench::Escape(d.PlaceToEncode[i].data());
+ NBench::Escape(d.PlaceToEncode[i].data());
Y_DO_NOT_OPTIMIZE_AWAY(
- Base64EncodeUrl(d.PlaceToEncode[i].data(), (const unsigned char*)d.Data[i].data(), d.Data[i].size()));
+ Base64EncodeUrl(d.PlaceToEncode[i].data(), (const unsigned char*)d.Data[i].data(), d.Data[i].size()));
NBench::Clobber();
}
}
@@ -122,9 +122,9 @@ static inline void BenchDecode(T& d, const NBench::NCpu::TParams& iface) {
for (const auto it : xrange(iface.Iterations())) {
Y_UNUSED(it);
for (size_t i = 0; i < d.Size; ++i) {
- NBench::Escape(d.PlaceToDecode[i].data());
+ NBench::Escape(d.PlaceToDecode[i].data());
Y_DO_NOT_OPTIMIZE_AWAY(
- Base64Decode(d.PlaceToDecode[i].data(), (const char*)d.DataEncoded[i].data(), (const char*)(d.DataEncoded[i].data() + d.DataEncoded[i].size())));
+ Base64Decode(d.PlaceToDecode[i].data(), (const char*)d.DataEncoded[i].data(), (const char*)(d.DataEncoded[i].data() + d.DataEncoded[i].size())));
NBench::Clobber();
}
}
diff --git a/library/cpp/string_utils/indent_text/indent_text.cpp b/library/cpp/string_utils/indent_text/indent_text.cpp
index 09a4f6bca8..6c3c9cc9f4 100644
--- a/library/cpp/string_utils/indent_text/indent_text.cpp
+++ b/library/cpp/string_utils/indent_text/indent_text.cpp
@@ -7,7 +7,7 @@ TString IndentText(TStringBuf text, TStringBuf indent) {
return TString();
TStringStream ss;
- ss.Reserve(text.size() + 20);
+ ss.Reserve(text.size() + 20);
char pc = 0;
for (size_t i = 0; i < text.size(); ++i) {
diff --git a/library/cpp/string_utils/parse_size/parse_size.cpp b/library/cpp/string_utils/parse_size/parse_size.cpp
index 39188d560b..d69d8cbca5 100644
--- a/library/cpp/string_utils/parse_size/parse_size.cpp
+++ b/library/cpp/string_utils/parse_size/parse_size.cpp
@@ -34,9 +34,9 @@ namespace {
namespace NSize {
ui64 ParseSize(TStringBuf str) {
- if (! str.size())
+ if (! str.size())
ythrow yexception() << "Wrong size " << str;
- char suff = tolower(str[str.size() - 1]);
+ char suff = tolower(str[str.size() - 1]);
if (isdigit(suff))
return FromString<ui64>(str);
ui64 shift = 1;
@@ -57,7 +57,7 @@ namespace NSize {
ythrow yexception() << "Unknown suffix " << str;
}
- ui64 value = FromString<ui64>(str.substr(0, str.size() - 1));
+ ui64 value = FromString<ui64>(str.substr(0, str.size() - 1));
if (!TryShiftValue(value, shift)) {
ythrow yexception() << "Value overflow " << str;
diff --git a/library/cpp/string_utils/quote/quote.cpp b/library/cpp/string_utils/quote/quote.cpp
index e523350b80..5f852c4921 100644
--- a/library/cpp/string_utils/quote/quote.cpp
+++ b/library/cpp/string_utils/quote/quote.cpp
@@ -156,16 +156,16 @@ char* CGIEscape(char* to, const char* from, size_t len) {
}
void CGIEscape(TString& url) {
- TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
+ TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
char* to = tempBuf.Data();
- url.AssignNoAlias(to, CGIEscape(to, url.data(), url.size()));
+ url.AssignNoAlias(to, CGIEscape(to, url.data(), url.size()));
}
TString CGIEscapeRet(const TStringBuf url) {
TString to;
- to.ReserveAndResize(CgiEscapeBufLen(url.size()));
- to.resize(CGIEscape(to.begin(), url.data(), url.size()) - to.data());
+ to.ReserveAndResize(CgiEscapeBufLen(url.size()));
+ to.resize(CGIEscape(to.begin(), url.data(), url.size()) - to.data());
return to;
}
@@ -204,11 +204,11 @@ char* Quote(char* to, const char* from, const char* safe) {
}
char* Quote(char* to, const TStringBuf s, const char* safe) {
- return Quote(to, s.data(), s.data() + s.size(), safe);
+ return Quote(to, s.data(), s.data() + s.size(), safe);
}
void Quote(TString& url, const char* safe) {
- TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
+ TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
char* to = tempBuf.Data();
url.AssignNoAlias(to, Quote(to, url, safe));
@@ -237,13 +237,13 @@ void CGIUnescape(TString& url) {
TString CGIUnescapeRet(const TStringBuf from) {
TString to;
- to.ReserveAndResize(CgiUnescapeBufLen(from.size()));
- to.resize(CGIUnescape(to.begin(), from.data(), from.size()) - to.data());
+ to.ReserveAndResize(CgiUnescapeBufLen(from.size()));
+ to.resize(CGIUnescape(to.begin(), from.data(), from.size()) - to.data());
return to;
}
char* UrlUnescape(char* to, TStringBuf from) {
- while (!from.empty()) {
+ while (!from.empty()) {
char ch = from[0];
from.Skip(1);
if ('%' == ch && 2 <= from.length())
@@ -271,8 +271,8 @@ void UrlUnescape(TString& url) {
TString UrlUnescapeRet(const TStringBuf from) {
TString to;
- to.ReserveAndResize(CgiUnescapeBufLen(from.size()));
- to.resize(UrlUnescape(to.begin(), from) - to.data());
+ to.ReserveAndResize(CgiUnescapeBufLen(from.size()));
+ to.resize(UrlUnescape(to.begin(), from) - to.data());
return to;
}
@@ -298,14 +298,14 @@ char* UrlEscape(char* to, const char* from, bool forceEscape) {
}
void UrlEscape(TString& url, bool forceEscape) {
- TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
+ TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
char* to = tempBuf.Data();
- url.AssignNoAlias(to, UrlEscape(to, url.data(), forceEscape));
+ url.AssignNoAlias(to, UrlEscape(to, url.data(), forceEscape));
}
TString UrlEscapeRet(const TStringBuf from, bool forceEscape) {
TString to;
- to.ReserveAndResize(CgiEscapeBufLen(from.size()));
- to.resize(UrlEscape(to.begin(), from.begin(), forceEscape) - to.data());
+ to.ReserveAndResize(CgiEscapeBufLen(from.size()));
+ to.resize(UrlEscape(to.begin(), from.begin(), forceEscape) - to.data());
return to;
}
diff --git a/library/cpp/string_utils/quote/quote.h b/library/cpp/string_utils/quote/quote.h
index 3b7221154e..75fc1ee81a 100644
--- a/library/cpp/string_utils/quote/quote.h
+++ b/library/cpp/string_utils/quote/quote.h
@@ -11,14 +11,14 @@
char* CGIEscape(char* to, const char* from);
char* CGIEscape(char* to, const char* from, size_t len);
inline char* CGIEscape(char* to, const TStringBuf from) {
- return CGIEscape(to, from.data(), from.size());
+ return CGIEscape(to, from.data(), from.size());
}
void CGIEscape(TString& url);
TString CGIEscapeRet(const TStringBuf url);
TString& AppendCgiEscaped(const TStringBuf value, TString& to);
inline TStringBuf CgiEscapeBuf(char* to, const TStringBuf from) {
- return TStringBuf(to, CGIEscape(to, from.data(), from.size()));
+ return TStringBuf(to, CGIEscape(to, from.data(), from.size()));
}
inline TStringBuf CgiEscape(void* tmp, const TStringBuf s) {
return CgiEscapeBuf(static_cast<char*>(tmp), s);
@@ -34,7 +34,7 @@ void CGIUnescape(TString& url);
TString CGIUnescapeRet(const TStringBuf from);
inline TStringBuf CgiUnescapeBuf(char* to, const TStringBuf from) {
- return TStringBuf(to, CGIUnescape(to, from.data(), from.size()));
+ return TStringBuf(to, CGIUnescape(to, from.data(), from.size()));
}
inline TStringBuf CgiUnescape(void* tmp, const TStringBuf s) {
return CgiUnescapeBuf(static_cast<char*>(tmp), s);
diff --git a/library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h b/library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h
index d7ea7c1259..068e8368d9 100644
--- a/library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h
+++ b/library/cpp/string_utils/relaxed_escaper/relaxed_escaper.h
@@ -151,12 +151,12 @@ namespace NEscJ {
template <bool quote, bool tounicode>
inline void EscapeJ(TStringBuf in, IOutputStream& out, TStringBuf safe = TStringBuf(), TStringBuf unsafe = TStringBuf()) {
- TTempBuf b(SuggestBuffer(in.size()) + 2);
+ TTempBuf b(SuggestBuffer(in.size()) + 2);
if (quote)
b.Append("\"", 1);
- b.Proceed(EscapeJ<tounicode>(in.data(), in.size(), b.Current(), safe, unsafe));
+ b.Proceed(EscapeJ<tounicode>(in.data(), in.size(), b.Current(), safe, unsafe));
if (quote)
b.Append("\"", 1);
@@ -166,12 +166,12 @@ namespace NEscJ {
template <bool quote, bool tounicode>
inline void EscapeJ(TStringBuf in, TString& out, TStringBuf safe = TStringBuf(), TStringBuf unsafe = TStringBuf()) {
- TTempBuf b(SuggestBuffer(in.size()) + 2);
+ TTempBuf b(SuggestBuffer(in.size()) + 2);
if (quote)
b.Append("\"", 1);
- b.Proceed(EscapeJ<tounicode>(in.data(), in.size(), b.Current(), safe, unsafe));
+ b.Proceed(EscapeJ<tounicode>(in.data(), in.size(), b.Current(), safe, unsafe));
if (quote)
b.Append("\"", 1);
diff --git a/library/cpp/string_utils/scan/scan.h b/library/cpp/string_utils/scan/scan.h
index 703db54321..d97a4bc7c0 100644
--- a/library/cpp/string_utils/scan/scan.h
+++ b/library/cpp/string_utils/scan/scan.h
@@ -6,10 +6,10 @@ template <bool addAll, char sep, char sepKeyVal, class F>
static inline void ScanKeyValue(TStringBuf s, F&& f) {
TStringBuf key, val;
- while (!s.empty()) {
+ while (!s.empty()) {
val = s.NextTok(sep);
- if (val.empty()) {
+ if (val.empty()) {
continue; // && case
}
diff --git a/library/cpp/string_utils/url/url.cpp b/library/cpp/string_utils/url/url.cpp
index 85f4ac5d69..3658cfbabd 100644
--- a/library/cpp/string_utils/url/url.cpp
+++ b/library/cpp/string_utils/url/url.cpp
@@ -106,7 +106,7 @@ size_t GetSchemePrefixSize(const TStringBuf url) noexcept {
};
const auto& delim = *Singleton<TDelim>();
- const char* n = delim.brk(url.data(), url.end());
+ const char* n = delim.brk(url.data(), url.end());
if (n + 2 >= url.end() || *n != ':' || n[1] != '/' || n[2] != '/') {
return 0;
@@ -140,7 +140,7 @@ static inline TStringBuf GetHostAndPortImpl(const TStringBuf url) {
const char* firstNonHostCharacter = nonHostCharacters.brk(urlNoScheme.begin(), urlNoScheme.end());
if (firstNonHostCharacter != urlNoScheme.end()) {
- return urlNoScheme.substr(0, firstNonHostCharacter - urlNoScheme.data());
+ return urlNoScheme.substr(0, firstNonHostCharacter - urlNoScheme.data());
}
return urlNoScheme;
@@ -250,8 +250,8 @@ TStringBuf GetPathAndQuery(const TStringBuf url, bool trimFragment) noexcept {
// this strange creature returns 2nd level domain, possibly with port
TStringBuf GetDomain(const TStringBuf host) noexcept {
- const char* c = !host ? host.data() : host.end() - 1;
- for (bool wasPoint = false; c != host.data(); --c) {
+ const char* c = !host ? host.data() : host.end() - 1;
+ for (bool wasPoint = false; c != host.data(); --c) {
if (*c == '.') {
if (wasPoint) {
++c;
@@ -278,7 +278,7 @@ TStringBuf GetZone(const TStringBuf host) noexcept {
}
TStringBuf CutWWWPrefix(const TStringBuf url) noexcept {
- if (url.size() >= 4 && url[3] == '.' && !strnicmp(url.data(), "www", 3))
+ if (url.size() >= 4 && url[3] == '.' && !strnicmp(url.data(), "www", 3))
return url.substr(4);
return url;
}
@@ -362,7 +362,7 @@ static inline int Unescape(char* str) {
}
size_t NormalizeUrlName(char* dest, const TStringBuf source, size_t dest_size) {
- if (source.empty() || source[0] == '?')
+ if (source.empty() || source[0] == '?')
return strlcpy(dest, "/", dest_size);
size_t len = Min(dest_size - 1, source.length());
memcpy(dest, source.data(), len);
diff --git a/library/cpp/testing/benchmark/bench.cpp b/library/cpp/testing/benchmark/bench.cpp
index 08d8708005..9c6e6ae96d 100644
--- a/library/cpp/testing/benchmark/bench.cpp
+++ b/library/cpp/testing/benchmark/bench.cpp
@@ -189,7 +189,7 @@ namespace {
}
inline TSamples RemoveOutliers(const TSamples& s, double fraction) {
- if (s.size() < 20) {
+ if (s.size() < 20) {
return s;
}
@@ -205,7 +205,7 @@ namespace {
using TSampleWithError = std::pair<const TSample*, double>;
TVector<TSampleWithError> v;
- v.reserve(s.size());
+ v.reserve(s.size());
for (const auto& p : s) {
v.emplace_back(&p, errfunc(p));
@@ -223,9 +223,9 @@ namespace {
TSamples ret;
- ret.reserve(v.size());
+ ret.reserve(v.size());
- for (const auto i : xrange<size_t>(0, fraction * v.size())) {
+ for (const auto i : xrange<size_t>(0, fraction * v.size())) {
ret.push_back(*v[i].first);
}
@@ -246,7 +246,7 @@ namespace {
func(1);
while (start.Passed() < budget) {
- if (start.Passed() < ((budget * samples.size()) / 2000000.0)) {
+ if (start.Passed() < ((budget * samples.size()) / 2000000.0)) {
ThreadYield();
} else {
const size_t n = sample.Next();
@@ -258,7 +258,7 @@ namespace {
auto filtered = RemoveOutliers(samples, 0.9);
- return {test.Name(), filtered.size(), iters, CalcModel(filtered).A, Nothing(), start.Passed(), test.SequentialId};
+ return {test.Name(), filtered.size(), iters, CalcModel(filtered).A, Nothing(), start.Passed(), test.SequentialId};
}
using TTests = TIntrusiveListWithAutoDelete<ITestRunner, TDestructor>;
@@ -523,7 +523,7 @@ namespace {
const TOptsParseResult parseResult{&opts, argc, argv};
for (const auto& regexp : parseResult.GetFreeArgs()) {
- Filters.push_back(MakeHolder<RE2>(regexp.data(), RE2::Quiet));
+ Filters.push_back(MakeHolder<RE2>(regexp.data(), RE2::Quiet));
Y_ENSURE(Filters.back()->ok(), "incorrect RE2 expression '" << regexp << "'");
}
}
@@ -534,7 +534,7 @@ namespace {
}
for (auto&& re : Filters) {
- if (RE2::FullMatchN({name.data(), name.size()}, *re, nullptr, 0)) {
+ if (RE2::FullMatchN({name.data(), name.size()}, *re, nullptr, 0)) {
return true;
}
}
@@ -577,10 +577,10 @@ int NBench::Main(int argc, char** argv) {
double timeBudget = opts.TimeBudget;
if (timeBudget < 0) {
- timeBudget = 5.0 * tests.size();
+ timeBudget = 5.0 * tests.size();
}
- const TOptions testOpts = {timeBudget / tests.size()};
+ const TOptions testOpts = {timeBudget / tests.size()};
const auto reporter = MakeOrderedReporter(opts.OutFormat);
std::function<void(ITestRunner**)> func = [&](ITestRunner** it) {
diff --git a/library/cpp/testing/benchmark/examples/main.cpp b/library/cpp/testing/benchmark/examples/main.cpp
index ddd8b05ffc..50d0554289 100644
--- a/library/cpp/testing/benchmark/examples/main.cpp
+++ b/library/cpp/testing/benchmark/examples/main.cpp
@@ -100,19 +100,19 @@ Y_NO_INLINE int FFF(int x, int y) {
}
Y_NO_INLINE size_t FS1(TStringBuf x) {
- return x.size();
+ return x.size();
}
Y_NO_INLINE size_t FS1_2(TStringBuf x, TStringBuf y) {
- return x.size() + y.size();
+ return x.size() + y.size();
}
Y_NO_INLINE size_t FS2(const TStringBuf& x) {
- return x.size();
+ return x.size();
}
Y_NO_INLINE size_t FS2_2(const TStringBuf& x, const TStringBuf& y) {
- return x.size() + y.size();
+ return x.size() + y.size();
}
Y_CPU_BENCHMARK(FunctionCallCost_StringBufVal1, iface) {
diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp
index 3679b768ed..7d40ff2c27 100644
--- a/library/cpp/testing/unittest/registar.cpp
+++ b/library/cpp/testing/unittest/registar.cpp
@@ -35,7 +35,7 @@ currentTest;
::NUnitTest::TRaiseErrorHandler RaiseErrorHandler;
void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, bool fatalFailure) {
- Y_VERIFY(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
+ Y_VERIFY(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
Y_VERIFY(GetCurrentTest());
if (RaiseErrorHandler) {
@@ -46,7 +46,7 @@ void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, boo
// Default handler
TBackTrace bt;
bt.Capture();
- GetCurrentTest()->AddError(msg.data(), bt.PrintToString());
+ GetCurrentTest()->AddError(msg.data(), bt.PrintToString());
if (::NUnitTest::ContinueOnFail || !fatalFailure) {
return;
}
@@ -414,7 +414,7 @@ NUnitTest::TTestBase::TCleanUp::~TCleanUp() {
try {
Base_->AfterTest();
} catch (...) {
- Base_->AddError(CurrentExceptionMessage().data());
+ Base_->AddError(CurrentExceptionMessage().data());
}
::NUnitTest::NPrivate::SetUnittestThread(false);
::NUnitTest::NPrivate::SetCurrentTest(nullptr);
@@ -434,7 +434,7 @@ namespace {
struct TCmp {
template <class T>
inline bool operator()(const T& l, const T& r) const noexcept {
- return stricmp(Fix(l.Name().data()), Fix(r.Name().data())) < 0;
+ return stricmp(Fix(l.Name().data()), Fix(r.Name().data())) < 0;
}
static inline const char* Fix(const char* n) noexcept {
diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h
index 44517a0092..2774c8b4a9 100644
--- a/library/cpp/testing/unittest/registar.h
+++ b/library/cpp/testing/unittest/registar.h
@@ -454,7 +454,7 @@ public: \
const TString _a(A); \
const TString _b(B); \
if (_a != _b) { \
- UNIT_FAIL_IMPL("strings (" #A ") and (" #B ") are different", Sprintf("\n%s", ::NUnitTest::ColoredDiff(_a, _b, " \t\n.,:;'\"").data())); \
+ UNIT_FAIL_IMPL("strings (" #A ") and (" #B ") are different", Sprintf("\n%s", ::NUnitTest::ColoredDiff(_a, _b, " \t\n.,:;'\"").data())); \
} \
} while (false)
diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp
index 1f36d53abb..35e71adf61 100644
--- a/library/cpp/testing/unittest/registar_ut.cpp
+++ b/library/cpp/testing/unittest/registar_ut.cpp
@@ -253,7 +253,7 @@ Y_UNIT_TEST_SUITE(TUnitTestMacroTest) {
UNIT_ASSERT_TEST_FAILS(valuesUnequal(5, 5));
UNIT_ASSERT_TEST_FAILS(valuesUnequal(static_cast<char>(5), 5l));
TString test("test");
- UNIT_ASSERT_TEST_FAILS(valuesUnequal("test", test.data()));
+ UNIT_ASSERT_TEST_FAILS(valuesUnequal("test", test.data()));
UNIT_ASSERT_VALUES_UNEQUAL("UNIT_ASSERT_VALUES_UNEQUAL", "UNIT_ASSERT_VALUES_EQUAL");
UNIT_ASSERT_VALUES_UNEQUAL(1.0, 1.1);
diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp
index 305bc6b40f..d7d73662af 100644
--- a/library/cpp/testing/unittest/utmain.cpp
+++ b/library/cpp/testing/unittest/utmain.cpp
@@ -41,7 +41,7 @@
#endif
#ifdef WITH_VALGRIND
-#define NOTE_IN_VALGRIND(test) VALGRIND_PRINTF("%s::%s", test->unit->name.data(), test->name)
+#define NOTE_IN_VALGRIND(test) VALGRIND_PRINTF("%s::%s", test->unit->name.data(), test->name)
#else
#define NOTE_IN_VALGRIND(test)
#endif
@@ -87,7 +87,7 @@ private:
event.InsertValue("class", className);
event.InsertValue("subtest", subtestName);
event.InsertValue("status", status);
- event.InsertValue("comment", comment.data());
+ event.InsertValue("comment", comment.data());
event.InsertValue("time", (now - PrevTime).SecondsFloat());
if (context) {
for (const auto& metric : context->Metrics) {
@@ -140,13 +140,13 @@ private:
}
void OnError(const TError* descr) override {
- const TString comment = BuildComment(descr->msg, descr->BackTrace.data());
+ const TString comment = BuildComment(descr->msg, descr->BackTrace.data());
ErrorMessages.push_back(comment);
}
void OnFinish(const TFinish* descr) override {
if (descr->Success) {
- TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "good", "", descr->Context);
+ TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "good", "", descr->Context);
} else {
TStringBuilder msgs;
for (const TString& m : ErrorMessages) {
@@ -158,7 +158,7 @@ private:
if (msgs) {
msgs << TStringBuf("\n");
}
- TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "fail", msgs, descr->Context);
+ TraceSubtestFinished(descr->test->unit->name.data(), descr->test->name, "fail", msgs, descr->Context);
ErrorMessages.clear();
}
}
@@ -302,7 +302,7 @@ private:
return;
}
if (PrintBeforeSuite_ || PrintBeforeTest_) {
- fprintf(stderr, "%s<-----%s %s\n", LightBlueColor().data(), OldColor().data(), unit->name.data());
+ fprintf(stderr, "%s<-----%s %s\n", LightBlueColor().data(), OldColor().data(), unit->name.data());
}
}
@@ -316,11 +316,11 @@ private:
}
fprintf(stderr, "%s----->%s %s -> ok: %s%u%s",
- LightBlueColor().data(), OldColor().data(), unit->name.data(),
- LightGreenColor().data(), GoodTestsInCurrentUnit(), OldColor().data());
+ LightBlueColor().data(), OldColor().data(), unit->name.data(),
+ LightGreenColor().data(), GoodTestsInCurrentUnit(), OldColor().data());
if (FailTestsInCurrentUnit()) {
fprintf(stderr, ", err: %s%u%s",
- LightRedColor().data(), FailTestsInCurrentUnit(), OldColor().data());
+ LightRedColor().data(), FailTestsInCurrentUnit(), OldColor().data());
}
fprintf(stderr, "\n");
}
@@ -331,7 +331,7 @@ private:
return;
}
if (PrintBeforeTest_) {
- fprintf(stderr, "[%sexec%s] %s::%s...\n", LightBlueColor().data(), OldColor().data(), test->unit->name.data(), test->name);
+ fprintf(stderr, "[%sexec%s] %s::%s...\n", LightBlueColor().data(), OldColor().data(), test->unit->name.data(), test->name);
}
}
@@ -344,19 +344,19 @@ private:
return;
}
- const TString err = Sprintf("[%sFAIL%s] %s::%s -> %s%s%s\n%s%s%s", LightRedColor().data(), OldColor().data(),
- descr->test->unit->name.data(),
+ const TString err = Sprintf("[%sFAIL%s] %s::%s -> %s%s%s\n%s%s%s", LightRedColor().data(), OldColor().data(),
+ descr->test->unit->name.data(),
descr->test->name,
- LightRedColor().data(), descr->msg, OldColor().data(), LightCyanColor().data(), descr->BackTrace.data(), OldColor().data());
+ LightRedColor().data(), descr->msg, OldColor().data(), LightCyanColor().data(), descr->BackTrace.data(), OldColor().data());
const TDuration test_duration = SaveTestDuration();
if (ShowFails) {
if (PrintTimes_) {
- Fails.push_back(Sprintf("%s %s", test_duration.ToString().data(), err.data()));
+ Fails.push_back(Sprintf("%s %s", test_duration.ToString().data(), err.data()));
} else {
Fails.push_back(err);
}
}
- fprintf(stderr, "%s", err.data());
+ fprintf(stderr, "%s", err.data());
NOTE_IN_VALGRIND(descr->test);
PrintTimes(test_duration);
if (IsForked) {
@@ -374,8 +374,8 @@ private:
}
if (descr->Success) {
- fprintf(stderr, "[%sgood%s] %s::%s\n", LightGreenColor().data(), OldColor().data(),
- descr->test->unit->name.data(),
+ fprintf(stderr, "[%sgood%s] %s::%s\n", LightGreenColor().data(), OldColor().data(),
+ descr->test->unit->name.data(),
descr->test->name);
NOTE_IN_VALGRIND(descr->test);
PrintTimes(SaveTestDuration());
@@ -411,16 +411,16 @@ private:
}
fprintf(stderr, "[%sDONE%s] ok: %s%u%s",
- YellowColor().data(), OldColor().data(),
- LightGreenColor().data(), GoodTests(), OldColor().data());
+ YellowColor().data(), OldColor().data(),
+ LightGreenColor().data(), GoodTests(), OldColor().data());
if (FailTests())
fprintf(stderr, ", err: %s%u%s",
- LightRedColor().data(), FailTests(), OldColor().data());
+ LightRedColor().data(), FailTests(), OldColor().data());
fprintf(stderr, "\n");
if (ShowFails) {
for (size_t i = 0; i < Fails.size(); ++i) {
- printf("%s", Fails[i].data());
+ printf("%s", Fails[i].data());
}
}
}
@@ -434,7 +434,7 @@ private:
return false;
}
- if (DisabledSuites_.find(name.data()) != DisabledSuites_.end()) {
+ if (DisabledSuites_.find(name.data()) != DisabledSuites_.end()) {
return false;
}
@@ -442,7 +442,7 @@ private:
return true;
}
- return EnabledSuites_.find(name.data()) != EnabledSuites_.end();
+ return EnabledSuites_.find(name.data()) != EnabledSuites_.end();
}
bool CheckAccessTest(TString suite, const char* test) override {
@@ -468,7 +468,7 @@ private:
}
TList<TString> args(1, "--is-forked-internal");
- args.push_back(Sprintf("+%s::%s", suite.data(), name));
+ args.push_back(Sprintf("+%s::%s", suite.data(), name));
// stdin is ignored - unittest should not need them...
TShellCommand cmd(AppName, args,
diff --git a/library/cpp/unicode/punycode/punycode.cpp b/library/cpp/unicode/punycode/punycode.cpp
index 800d1f19fe..463e6ffc17 100644
--- a/library/cpp/unicode/punycode/punycode.cpp
+++ b/library/cpp/unicode/punycode/punycode.cpp
@@ -48,7 +48,7 @@ TStringBuf WideToPunycode(const TWtringBuf& in16, TString& out) {
do {
outlen *= 2;
out.ReserveAndResize(outlen);
- rc = punycode_encode(in32.size(), in32.data(), nullptr, &outlen, out.begin());
+ rc = punycode_encode(in32.size(), in32.data(), nullptr, &outlen, out.begin());
} while (rc == PUNYCODE_BIG_OUTPUT);
CheckPunycodeResult(rc);
@@ -61,7 +61,7 @@ TWtringBuf PunycodeToWide(const TStringBuf& in, TUtf16String& out16) {
size_t outlen = in.size();
TVector<ui32> out32(outlen);
- int rc = punycode_decode(in.size(), in.data(), &outlen, out32.begin(), nullptr);
+ int rc = punycode_decode(in.size(), in.data(), &outlen, out32.begin(), nullptr);
CheckPunycodeResult(rc);
AppendUtf32ToWide(out32.begin(), outlen, out16);
diff --git a/library/cpp/uri/assign.cpp b/library/cpp/uri/assign.cpp
index ae9125c727..3ef124e9cc 100644
--- a/library/cpp/uri/assign.cpp
+++ b/library/cpp/uri/assign.cpp
@@ -120,7 +120,7 @@ namespace NUri {
}
static inline bool AppendField(TMemoryWriteBuffer& out, TField::EField fld, const TStringBuf& val, long flags) {
- if (val.empty())
+ if (val.empty())
return false;
if (flags & TFeature::FeaturesAllEncoder)
TUri::ReEncodeField(out, val, fld, flags);
@@ -140,7 +140,7 @@ namespace NUri {
const TSchemeInfo& schemeInfo = SetSchemeImpl(parser.Scheme);
// set the scheme always if available
- if (schemeInfo.Str.empty() && scheme.IsSet())
+ if (schemeInfo.Str.empty() && scheme.IsSet())
FldSet(FieldScheme, scheme.Get());
if (ParsedOK != ret)
@@ -171,7 +171,7 @@ namespace NUri {
else
hostascii = HostToAscii(hostbuf, hostptr, allowIDN, parser.Enc);
- if (hostascii.empty())
+ if (hostascii.empty())
ret = ParsedBadHost; // exists but cannot be converted
else if (hostbuf.data() != hostascii.data()) {
hostConverted = true;
@@ -209,7 +209,7 @@ namespace NUri {
if (0 == (parser.Flags & FeatureHashBangToEscapedFragment))
break;
const TStringBuf fragbuf = frag.Get();
- if (fragbuf.empty() || '!' != fragbuf[0])
+ if (fragbuf.empty() || '!' != fragbuf[0])
break;
encHashBangFrag = true;
// '!' will make space for '&' or '\0' if needed
@@ -263,10 +263,10 @@ namespace NUri {
if (qryEscapedFragment.IsInited()) {
const EField dstfld = FieldFrag; // that's where we will store
out << '!';
- if (!qryEscapedFragment.empty())
+ if (!qryEscapedFragment.empty())
ReEncodeToField(out, qryEscapedFragment, fld, FeatureDecodeANY | careFlags, dstfld, FeatureDecodeANY | parser.GetFieldFlags(dstfld));
FldSetNoDirty(dstfld, TStringBuf(beg, out.Buf()));
- if (qryBeforeEscapedFragment.empty())
+ if (qryBeforeEscapedFragment.empty())
continue;
out << '\0';
beg = out.Buf();
@@ -336,7 +336,7 @@ namespace NUri {
CheckMissingFields();
const TStringBuf& port = GetField(FieldPort);
- if (!port.empty()) {
+ if (!port.empty()) {
if (!TryFromString<ui16>(port, Port))
ret = ParsedBadPort;
}
@@ -350,9 +350,9 @@ namespace NUri {
do {
if (0 == (flags & FeatureCheckHost))
break;
- if (hostascii.empty())
+ if (hostascii.empty())
hostascii = GetField(FieldHost);
- if (hostascii.empty())
+ if (hostascii.empty())
break;
// IP literal
if ('[' == hostascii[0] && ']' == hostascii.back())
@@ -368,7 +368,7 @@ namespace NUri {
TState::EParsed TUri::ParseImpl(const TStringBuf& url, const TParseFlags& flags, ui32 maxlen, TScheme::EKind defscheme, ECharset enc) {
Clear();
- if (url.empty())
+ if (url.empty())
return ParsedEmpty;
if (maxlen > 0 && url.length() > maxlen)
@@ -381,11 +381,11 @@ namespace NUri {
TState::EParsed TUri::Parse(const TStringBuf& url, const TParseFlags& flags, const TStringBuf& url_base, ui32 maxlen, ECharset enc) {
const TParseFlags flags1 = flags.Exclude(FeatureNoRelPath);
- TState::EParsed ret = ParseImpl(url, url_base.empty() ? flags : flags1, maxlen, SchemeEmpty, enc);
+ TState::EParsed ret = ParseImpl(url, url_base.empty() ? flags : flags1, maxlen, SchemeEmpty, enc);
if (ParsedOK != ret)
return ret;
- if (!url_base.empty() && !IsValidAbs()) {
+ if (!url_base.empty() && !IsValidAbs()) {
TUri base;
ret = base.ParseImpl(url_base, flags, maxlen, SchemeEmpty, enc);
if (ParsedOK != ret)
diff --git a/library/cpp/uri/common.cpp b/library/cpp/uri/common.cpp
index 05af1e57d1..0c683216f9 100644
--- a/library/cpp/uri/common.cpp
+++ b/library/cpp/uri/common.cpp
@@ -107,7 +107,7 @@ namespace NUri {
const char* SchemeKindToString(const TScheme::EKind& t) {
const TSchemeInfo& info = TSchemeInfo::Get(t);
- if (!info.Str.empty())
+ if (!info.Str.empty())
return info.Str.data();
return TScheme::SchemeEmpty == t ? "empty" : "unknown";
}
diff --git a/library/cpp/uri/other.h b/library/cpp/uri/other.h
index 7aec22e77b..c0d8b583b2 100644
--- a/library/cpp/uri/other.h
+++ b/library/cpp/uri/other.h
@@ -15,7 +15,7 @@ void UnTrspChars(const char* s, char* d);
void InvertDomain(char* begin, char* end);
inline TString& InvertDomain(TString& url) {
- InvertDomain(url.begin(), url.begin() + url.size());
+ InvertDomain(url.begin(), url.begin() + url.size());
return url;
}
@@ -26,7 +26,7 @@ inline void InvertUrl(char* url) {
}
inline TString& InvertUrl(TString& url) {
- InvertUrl(url.begin(), url.begin() + url.size());
+ InvertUrl(url.begin(), url.begin() + url.size());
return url;
}
@@ -37,6 +37,6 @@ inline void RevertUrl(char* url) {
}
inline TString& RevertUrl(TString& url) {
- RevertUrl(url.begin(), url.begin() + url.size());
+ RevertUrl(url.begin(), url.begin() + url.size());
return url;
}
diff --git a/library/cpp/uri/uri.cpp b/library/cpp/uri/uri.cpp
index 56a9a4e5ef..4383c0ffe7 100644
--- a/library/cpp/uri/uri.cpp
+++ b/library/cpp/uri/uri.cpp
@@ -7,7 +7,7 @@
namespace NUri {
TState::EParsed TUri::CheckHost(const TStringBuf& host) {
- if (host.empty())
+ if (host.empty())
return ParsedOK;
unsigned domainLevel = 0;
@@ -62,8 +62,8 @@ namespace NUri {
, Scheme(SchemeEmpty)
, FieldsDirty(0)
{
- if (!scheme.empty()) {
- if (SetSchemeImpl(TSchemeInfo::Get(scheme)).Str.empty())
+ if (!scheme.empty()) {
+ if (SetSchemeImpl(TSchemeInfo::Get(scheme)).Str.empty())
FldSet(FieldScheme, scheme);
}
@@ -91,12 +91,12 @@ namespace NUri {
switch (field) {
case FieldScheme:
- if (!SetScheme(TSchemeInfo::Get(value)).Str.empty())
+ if (!SetScheme(TSchemeInfo::Get(value)).Str.empty())
return false;
break;
case FieldPort:
- Port = value.empty() ? 0 : FromString<ui16>(value);
+ Port = value.empty() ? 0 : FromString<ui16>(value);
break;
default:
@@ -213,7 +213,7 @@ namespace NUri {
static constexpr TStringBuf rootPath = "/";
if (noscheme) {
- if (!basescheme.empty()) {
+ if (!basescheme.empty()) {
FldSetNoDirty(FieldScheme, basescheme);
// check if it is canonical
if (basescheme.data() != base.GetSchemeInfo().Str.data())
@@ -296,7 +296,7 @@ namespace NUri {
// merge with base URL
// taken either from _BASE_ property or from optional argument
- if (!codebase.empty()) {
+ if (!codebase.empty()) {
// if optional code base given -- parse it
TUri codebaseUrl;
if (codebaseUrl.ParseImpl(codebase, careFlags, 0, SchemeEmpty, enc) != ParsedOK || !codebaseUrl.IsValidAbs())
@@ -312,7 +312,7 @@ namespace NUri {
if (!IsValidAbs())
return LinkBadAbs;
- if (!host.empty()) {
+ if (!host.empty()) {
// - we don't care about different ports for the same server
// - we don't care about win|www|koi|etc. preffixes for the same server
if (GetPort() != base.GetPort() || !EqualNoCase(host, base.GetHost()))
@@ -359,7 +359,7 @@ namespace NUri {
if (flags & FlagScheme) {
v = Fields[FieldScheme];
- if (!v.empty())
+ if (!v.empty())
out << v << ':';
}
@@ -381,7 +381,7 @@ namespace NUri {
if (flags & FlagAuth) {
if (flags & FlagUser) {
v = Fields[FieldUser];
- if (!v.empty())
+ if (!v.empty())
TEncoder::EncodeNotAlnum(out, v);
}
@@ -407,7 +407,7 @@ namespace NUri {
if (flags & FlagPath) {
v = Fields[FieldPath];
// for relative, empty path is not the same as missing
- if (v.empty() && 0 == (flags & FlagHost))
+ if (v.empty() && 0 == (flags & FlagHost))
v = TStringBuf(".");
out << v;
}
diff --git a/library/cpp/uri/uri.h b/library/cpp/uri/uri.h
index 3b6c19fe4a..e6b41009c5 100644
--- a/library/cpp/uri/uri.h
+++ b/library/cpp/uri/uri.h
@@ -566,7 +566,7 @@ namespace NUri {
const TSchemeInfo& SetSchemeImpl(const TSchemeInfo& info) {
Scheme = info.Kind;
DefaultPort = info.Port;
- if (!info.Str.empty())
+ if (!info.Str.empty())
FldSetNoDirty(FieldScheme, info.Str);
return info;
}
@@ -577,7 +577,7 @@ namespace NUri {
public:
const TSchemeInfo& SetScheme(const TSchemeInfo& info) {
SetSchemeImpl(info);
- if (!info.Str.empty())
+ if (!info.Str.empty())
FldMarkClean(FieldScheme);
return info;
}
diff --git a/library/cpp/xml/document/xml-document-decl.h b/library/cpp/xml/document/xml-document-decl.h
index bfda1fb7e6..f5b35750ac 100644
--- a/library/cpp/xml/document/xml-document-decl.h
+++ b/library/cpp/xml/document/xml-document-decl.h
@@ -50,7 +50,7 @@ namespace NXml {
void Save(IOutputStream& stream, TZtStringBuf enc = "", bool shouldFormat = true) const {
int bufferSize = 0;
xmlChar* xmlBuff = nullptr;
- const char* encoding = enc.size() ? enc.data() : Doc->encoding ? nullptr : "UTF-8";
+ const char* encoding = enc.size() ? enc.data() : Doc->encoding ? nullptr : "UTF-8";
xmlDocDumpFormatMemoryEnc(Doc.Get(), &xmlBuff, &bufferSize, encoding, shouldFormat);
TCharPtr xmlCharBuffPtr(xmlBuff);
stream.Write(xmlBuff, bufferSize);
diff --git a/library/cpp/xml/document/xml-document.cpp b/library/cpp/xml/document/xml-document.cpp
index 18a554d732..3a712fb099 100644
--- a/library/cpp/xml/document/xml-document.cpp
+++ b/library/cpp/xml/document/xml-document.cpp
@@ -314,7 +314,7 @@ namespace NXml {
}
void TNode::SaveInternal(IOutputStream& stream, TZtStringBuf enc, int options) const {
- const char* encoding = enc.size() ? enc.data() : "utf-8";
+ const char* encoding = enc.size() ? enc.data() : "utf-8";
TSaveCtxtPtr ctx(xmlSaveToIO(XmlWriteToOstream, /* close */ nullptr, &stream,
encoding, options));
if (xmlSaveTree(ctx.Get(), (xmlNode*)GetPtr()) < 0)
diff --git a/library/cpp/xml/document/xml-textreader.cpp b/library/cpp/xml/document/xml-textreader.cpp
index b946f1fbf2..5ea6c75fe7 100644
--- a/library/cpp/xml/document/xml-textreader.cpp
+++ b/library/cpp/xml/document/xml-textreader.cpp
@@ -114,15 +114,15 @@ namespace NXml {
}
TString TTextReader::GetAttribute(TZtStringBuf name) const {
- return TempStringResult(xmlTextReaderGetAttribute(Impl.Get(), XMLCHAR(name.data())));
+ return TempStringResult(xmlTextReaderGetAttribute(Impl.Get(), XMLCHAR(name.data())));
}
TString TTextReader::GetAttribute(TZtStringBuf localName, TZtStringBuf nsUri) const {
- return TempStringResult(xmlTextReaderGetAttributeNs(Impl.Get(), XMLCHAR(localName.data()), XMLCHAR(nsUri.data())));
+ return TempStringResult(xmlTextReaderGetAttributeNs(Impl.Get(), XMLCHAR(localName.data()), XMLCHAR(nsUri.data())));
}
TString TTextReader::LookupNamespace(TZtStringBuf prefix) const {
- return TempStringResult(xmlTextReaderLookupNamespace(Impl.Get(), XMLCHAR(prefix.data())));
+ return TempStringResult(xmlTextReaderLookupNamespace(Impl.Get(), XMLCHAR(prefix.data())));
}
bool TTextReader::MoveToAttribute(int number) {
@@ -130,11 +130,11 @@ namespace NXml {
}
bool TTextReader::MoveToAttribute(TZtStringBuf name) {
- return BoolResult(xmlTextReaderMoveToAttribute(Impl.Get(), XMLCHAR(name.data())));
+ return BoolResult(xmlTextReaderMoveToAttribute(Impl.Get(), XMLCHAR(name.data())));
}
bool TTextReader::MoveToAttribute(TZtStringBuf localName, TZtStringBuf nsUri) {
- return BoolResult(xmlTextReaderMoveToAttributeNs(Impl.Get(), XMLCHAR(localName.data()), XMLCHAR(nsUri.data())));
+ return BoolResult(xmlTextReaderMoveToAttributeNs(Impl.Get(), XMLCHAR(localName.data()), XMLCHAR(nsUri.data())));
}
bool TTextReader::MoveToFirstAttribute() {
diff --git a/library/cpp/yson/detail.h b/library/cpp/yson/detail.h
index 27f5e8ffff..99328d7903 100644
--- a/library/cpp/yson/detail.h
+++ b/library/cpp/yson/detail.h
@@ -454,7 +454,7 @@ namespace NYson {
ythrow TYsonException() << "Incorrect %-literal prefix: '" << ch << "'";
}
- for (size_t i = 0; i < expectedString.size(); ++i) {
+ for (size_t i = 0; i < expectedString.size(); ++i) {
if (expectedString[i] != ch) {
ythrow TYsonException()
<< "Incorrect %-literal prefix "
@@ -570,7 +570,7 @@ namespace NYson {
Buffer_.push_back(TBaseStream::template GetChar<AllowFinish>());
TBaseStream::Advance(1);
if (Buffer_[0] == trueString[0]) {
- for (size_t i = 1; i < trueString.size(); ++i) {
+ for (size_t i = 1; i < trueString.size(); ++i) {
Buffer_.push_back(TBaseStream::template GetChar<AllowFinish>());
TBaseStream::Advance(1);
if (Buffer_.back() != trueString[i]) {
@@ -579,7 +579,7 @@ namespace NYson {
}
return true;
} else if (Buffer_[0] == falseString[0]) {
- for (size_t i = 1; i < falseString.size(); ++i) {
+ for (size_t i = 1; i < falseString.size(); ++i) {
Buffer_.push_back(TBaseStream::template GetChar<AllowFinish>());
TBaseStream::Advance(1);
if (Buffer_.back() != falseString[i]) {
diff --git a/library/cpp/yson/writer.cpp b/library/cpp/yson/writer.cpp
index 054459f9f5..5b4971b444 100644
--- a/library/cpp/yson/writer.cpp
+++ b/library/cpp/yson/writer.cpp
@@ -126,7 +126,7 @@ namespace NYson {
} else {
str = negativeInfLiteral;
}
- return TString(str.data(), str.size());
+ return TString(str.data(), str.size());
}
}