diff options
author | Abseil Team <absl-team@google.com> | 2022-08-17 09:17:56 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-08-17 09:18:39 -0700 |
commit | fcfc7a6d15eab5aff86d7b90c9e38fa386a103fa (patch) | |
tree | ec697cf6574f311f9f373df7d19f307d9c185781 /absl/strings/internal/charconv_parse.cc | |
parent | 934f613818ffcb26c942dff4a80be9a4031c662c (diff) |
Fix "unsafe narrowing" warnings in absl, 5/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: 468215101
Change-Id: I07fa487bcf2cf62d403489c3be7a5997cdef8987
Diffstat (limited to 'absl/strings/internal/charconv_parse.cc')
-rw-r--r-- | absl/strings/internal/charconv_parse.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/strings/internal/charconv_parse.cc b/absl/strings/internal/charconv_parse.cc index d29acaf4..98823def 100644 --- a/absl/strings/internal/charconv_parse.cc +++ b/absl/strings/internal/charconv_parse.cc @@ -190,11 +190,11 @@ bool IsDigit<16>(char ch) { template <> unsigned ToDigit<10>(char ch) { - return ch - '0'; + return static_cast<unsigned>(ch - '0'); } template <> unsigned ToDigit<16>(char ch) { - return kAsciiToInt[static_cast<unsigned char>(ch)]; + return static_cast<unsigned>(kAsciiToInt[static_cast<unsigned char>(ch)]); } template <> |