diff options
author | 2020-08-28 11:09:07 -0700 | |
---|---|---|
committer | 2020-08-28 19:50:55 -0400 | |
commit | a4cbb5f698c42845aab6a6d6318290205e6c5baf (patch) | |
tree | 26477a784e3b703087db0184596db5170ac1476f /absl/strings | |
parent | 4d2ff381a3709ef9dd4cbc0237bae847c0bb1ccd (diff) |
Export of internal Abseil changes
--
cc712eea29157198dc2ad001a0b8717bf6621074 by Abseil Team <absl-team@google.com>:
Quiet -Wsign-compare warning in AdvanceDigits().
PiperOrigin-RevId: 328972215
--
0b7a7ccd7c5c201062ed9671a8b2f5cc53b76ded by Abseil Team <absl-team@google.com>:
Quiet -Wsign-compare warning in ExtraWidthToPadding()
PiperOrigin-RevId: 328882525
--
df828f8e78276897ad0f8aed8a94ac9882f719ee by Abseil Team <absl-team@google.com>:
Quiet -Wsign-compare warning
PiperOrigin-RevId: 328840508
GitOrigin-RevId: cc712eea29157198dc2ad001a0b8717bf6621074
Change-Id: Ie7caa022ee308d84c2f3b5ff7a9b3d02e0f30587
Diffstat (limited to 'absl/strings')
-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 cafa479b..20aeada5 100644 --- a/absl/strings/internal/str_format/float_conversion.cc +++ b/absl/strings/internal/str_format/float_conversion.cc @@ -205,7 +205,7 @@ class BinaryToDecimal { } private: - static constexpr size_t kDigitsPerChunk = 9; + static constexpr int kDigitsPerChunk = 9; int decimal_start_; int decimal_end_; @@ -442,8 +442,10 @@ struct Padding { }; Padding ExtraWidthToPadding(size_t total_size, const FormatState &state) { - if (state.conv.width() < 0 || state.conv.width() <= total_size) + if (state.conv.width() < 0 || + static_cast<size_t>(state.conv.width()) <= total_size) { return {0, 0, 0}; + } int missing_chars = state.conv.width() - total_size; if (state.conv.has_left_flag()) { return {0, 0, missing_chars}; @@ -685,9 +687,7 @@ bool IncrementNibble(int nibble_index, Int *n) { // i.e., if the nibble_index is out of range. So therefore we check for this // and if we are out of range we just add 0 which leaves *n unchanged, which // seems like the reasonable thing to do in that case. - *n += - ((nibble_index * 4 >= sizeof(Int) * 8) ? 0 - : (Int{1} << (nibble_index * 4))); + *n += ((nibble_index >= kNumNibbles) ? 0 : (Int{1} << (nibble_index * 4))); Int after = *n >> kShift; return (before && !after) || (nibble_index >= kNumNibbles); } |