aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2023-03-25 20:23:17 +0300
committerthegeorg <thegeorg@yandex-team.com>2023-03-25 20:23:17 +0300
commita50a4399c2600b05a086acdca3ba56c957d62196 (patch)
tree2cf3f6cc37ccc6bd19c33a928e07dd6c083cea72 /contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
parent76f3ccf647d9cff0e38a7989dc89480854107b78 (diff)
downloadydb-a50a4399c2600b05a086acdca3ba56c957d62196.tar.gz
Update contrib/restricted/abseil-cpp-tstring to 20230125.1
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc')
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
index cfc9f7cdb2..fc31726ed4 100644
--- a/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/strings/string_view.cc
@@ -32,7 +32,7 @@ void WritePadding(std::ostream& o, size_t pad) {
memset(fill_buf, o.fill(), sizeof(fill_buf));
while (pad) {
size_t n = std::min(pad, sizeof(fill_buf));
- o.write(fill_buf, n);
+ o.write(fill_buf, static_cast<std::streamsize>(n));
pad -= n;
}
}
@@ -63,7 +63,7 @@ std::ostream& operator<<(std::ostream& o, string_view piece) {
size_t lpad = 0;
size_t rpad = 0;
if (static_cast<size_t>(o.width()) > piece.size()) {
- size_t pad = o.width() - piece.size();
+ size_t pad = static_cast<size_t>(o.width()) - piece.size();
if ((o.flags() & o.adjustfield) == o.left) {
rpad = pad;
} else {
@@ -71,7 +71,7 @@ std::ostream& operator<<(std::ostream& o, string_view piece) {
}
}
if (lpad) WritePadding(o, lpad);
- o.write(piece.data(), piece.size());
+ o.write(piece.data(), static_cast<std::streamsize>(piece.size()));
if (rpad) WritePadding(o, rpad);
o.width(0);
}
@@ -86,7 +86,7 @@ string_view::size_type string_view::find(string_view s,
}
const char* result =
strings_internal::memmatch(ptr_ + pos, length_ - pos, s.ptr_, s.length_);
- return result ? result - ptr_ : npos;
+ return result ? static_cast<size_type>(result - ptr_) : npos;
}
string_view::size_type string_view::find(char c, size_type pos) const noexcept {
@@ -95,7 +95,7 @@ string_view::size_type string_view::find(char c, size_type pos) const noexcept {
}
const char* result =
static_cast<const char*>(memchr(ptr_ + pos, c, length_ - pos));
- return result != nullptr ? result - ptr_ : npos;
+ return result != nullptr ? static_cast<size_type>(result - ptr_) : npos;
}
string_view::size_type string_view::rfind(string_view s,
@@ -104,7 +104,7 @@ string_view::size_type string_view::rfind(string_view s,
if (s.empty()) return std::min(length_, pos);
const char* last = ptr_ + std::min(length_ - s.length_, pos) + s.length_;
const char* result = std::find_end(ptr_, last, s.ptr_, s.ptr_ + s.length_);
- return result != last ? result - ptr_ : npos;
+ return result != last ? static_cast<size_type>(result - ptr_) : npos;
}
// Search range is [0..pos] inclusive. If pos == npos, search everything.