diff options
author | Abseil Team <absl-team@google.com> | 2022-08-29 14:08:26 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-08-29 14:10:13 -0700 |
commit | 75691f1c3292969c5a85288a3cee8ae831203302 (patch) | |
tree | 15b90542c2237971c2d98bb96a38654c2dfe2f23 /absl/strings/internal/str_format/float_conversion.cc | |
parent | 92fdbfb301f8b301b28ab5c99e7361e775c2fb8a (diff) |
Fix "unsafe narrowing" warnings in absl, 6/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 strings/internal/.)
Bug: chromium:1292951
PiperOrigin-RevId: 470810568
Change-Id: Ibd316a7e62cc43cb198ba22daed565c9573ce235
Diffstat (limited to 'absl/strings/internal/str_format/float_conversion.cc')
-rw-r--r-- | absl/strings/internal/str_format/float_conversion.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/absl/strings/internal/str_format/float_conversion.cc b/absl/strings/internal/str_format/float_conversion.cc index 3895001a..8e497852 100644 --- a/absl/strings/internal/str_format/float_conversion.cc +++ b/absl/strings/internal/str_format/float_conversion.cc @@ -1090,12 +1090,12 @@ void PrintExponent(int exp, char e, Buffer *out) { } // Exponent digits. if (exp > 99) { - out->push_back(static_cast<char>(exp / 100) + '0'); - out->push_back(exp / 10 % 10 + '0'); - out->push_back(exp % 10 + '0'); + out->push_back(static_cast<char>(exp / 100 + '0')); + out->push_back(static_cast<char>(exp / 10 % 10 + '0')); + out->push_back(static_cast<char>(exp % 10 + '0')); } else { - out->push_back(static_cast<char>(exp / 10) + '0'); - out->push_back(exp % 10 + '0'); + out->push_back(static_cast<char>(exp / 10 + '0')); + out->push_back(static_cast<char>(exp % 10 + '0')); } } |