diff options
author | Abseil Team <absl-team@google.com> | 2022-08-04 05:19:56 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-08-04 05:20:40 -0700 |
commit | 751ade00ee347abef5dac7248db851e3f2012e14 (patch) | |
tree | d5946590986f065406933c68bda8fd6af3013473 /absl/time/format.cc | |
parent | 07360899e64ded32e9a5e304bd6a3b6a0ff266bc (diff) |
Fix "unsafe narrowing" warnings in absl, 3/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 dirs n-t, except string.)
Bug: chromium:1292951
PiperOrigin-RevId: 465287204
Change-Id: I0fe98ff78bf3c08d86992019eb626755f8b6803e
Diffstat (limited to 'absl/time/format.cc')
-rw-r--r-- | absl/time/format.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/time/format.cc b/absl/time/format.cc index 4005fb70..15a26b14 100644 --- a/absl/time/format.cc +++ b/absl/time/format.cc @@ -64,7 +64,8 @@ cctz_parts Split(absl::Time t) { // details about rep_hi and rep_lo. absl::Time Join(const cctz_parts& parts) { const int64_t rep_hi = (parts.sec - unix_epoch()).count(); - const uint32_t rep_lo = parts.fem.count() / (1000 * 1000 / 4); + const uint32_t rep_lo = + static_cast<uint32_t>(parts.fem.count() / (1000 * 1000 / 4)); const auto d = time_internal::MakeDuration(rep_hi, rep_lo); return time_internal::FromUnixDuration(d); } |