diff options
author | Abseil Team <absl-team@google.com> | 2022-09-01 09:19:13 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-09-01 09:19:53 -0700 |
commit | 847fa56a5422c20a6f471e67ac0bca004ff5eac5 (patch) | |
tree | ca3c7f6dc33390e9e752932e3540404c743ca9b6 /absl/time | |
parent | b308bc06514600e9dedc16442fa5099050090d94 (diff) |
Fix "unsafe narrowing" warnings in absl, 8/n.
Addresses failures with the following, in some files:
-Wshorten-64-to-32
-Wimplicit-int-conversion
-Wsign-compare
-Wsign-conversion
-Wtautological-unsigned-zero-compare
(This specific CL focuses on .cc files in */internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 471549854
Change-Id: Id685d0e4666212926f4e001b8ef4930b6a33a4cc
Diffstat (limited to 'absl/time')
-rw-r--r-- | absl/time/internal/test_util.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/time/internal/test_util.cc b/absl/time/internal/test_util.cc index 454b33a1..4b7849c6 100644 --- a/absl/time/internal/test_util.cc +++ b/absl/time/internal/test_util.cc @@ -84,14 +84,15 @@ class TestZoneInfoSource : public cctz::ZoneInfoSource { : data_(data), end_(data + size) {} std::size_t Read(void* ptr, std::size_t size) override { - const std::size_t len = std::min<std::size_t>(size, end_ - data_); + const std::size_t len = + std::min(size, static_cast<std::size_t>(end_ - data_)); memcpy(ptr, data_, len); data_ += len; return len; } int Skip(std::size_t offset) override { - data_ += std::min<std::size_t>(offset, end_ - data_); + data_ += std::min(offset, static_cast<std::size_t>(end_ - data_)); return 0; } |