summaryrefslogtreecommitdiff
path: root/absl/strings/internal/str_format/extension.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-01-10 10:41:45 -0800
committerGravatar vslashg <gfalcon@google.com>2022-01-10 15:52:27 -0500
commit2a042b082ca6fc8592ec98d800012fc03c965c15 (patch)
treed698c4f717306c8aa30c84b2904a3f39596db85c /absl/strings/internal/str_format/extension.h
parent78f9680225b9792c26dfdd99d0bd26c96de53dd4 (diff)
Export of internal Abseil changes
-- 389189dbb322df0d0468ab13edf7dc185dc63833 by Abseil Team <absl-team@google.com>: absl str_format.h can compile with -Wconversion and -Wsign-compare PiperOrigin-RevId: 420799960 -- 762e5adc429fc143756c42fe92fe8073c87c075f by Abseil Team <absl-team@google.com>: GetStackTraceWithContext: Fix min_dropped_frames when no frames are recorded Previously, if there were still frames to skip, they would be included in min_dropped_frames. PiperOrigin-RevId: 420766341 -- 7d4374b8eaa410f4f98ec03d6a8997dccadfb271 by Abseil Team <absl-team@google.com>: absl::flags compiles with -Wconversion and -Wsign-compare PiperOrigin-RevId: 420476807 -- 5f00f7805419d725fa1ff57b388e4c0750d1d6b0 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 420282152 -- bd5471fc34956acf3888bf90287b2aee4415c96d by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 420282033 -- 61c78020804e4290e9b2fe151aeaf99b198716ee by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 420281867 -- dbe3aad24b65ea11664401a307ea3d2f28e8a7b9 by Derek Mauro <dmauro@google.com>: Remove the incorrect test for the availability of [[nodiscard]] It should have been ABSL_HAVE_CPP_ATTRIBUTE(nodiscard) instead of ABSL_HAVE_ATTRIBUTE(nodiscard). As a result, some code is not compliant with [[nodiscard]], so we cannot simply correct the availability test. Recommend that C++17-only code use the standard [[nodiscard] directly. PiperOrigin-RevId: 420150702 GitOrigin-RevId: 389189dbb322df0d0468ab13edf7dc185dc63833 Change-Id: Idf6ebae3c4edd945c9032c7db3d0ab32d16e8078
Diffstat (limited to 'absl/strings/internal/str_format/extension.h')
-rw-r--r--absl/strings/internal/str_format/extension.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/absl/strings/internal/str_format/extension.h b/absl/strings/internal/str_format/extension.h
index 55cbb56d..c47536d6 100644
--- a/absl/strings/internal/str_format/extension.h
+++ b/absl/strings/internal/str_format/extension.h
@@ -70,7 +70,7 @@ class FormatSinkImpl {
~FormatSinkImpl() { Flush(); }
void Flush() {
- raw_.Write(string_view(buf_, pos_ - buf_));
+ raw_.Write(string_view(buf_, static_cast<size_t>(pos_ - buf_)));
pos_ = buf_;
}
@@ -120,7 +120,9 @@ class FormatSinkImpl {
}
private:
- size_t Avail() const { return buf_ + sizeof(buf_) - pos_; }
+ size_t Avail() const {
+ return static_cast<size_t>(buf_ + sizeof(buf_) - pos_);
+ }
FormatRawSinkImpl raw_;
size_t size_ = 0;