summaryrefslogtreecommitdiff
path: root/absl/strings/internal/numbers_test_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/internal/numbers_test_common.h')
-rw-r--r--absl/strings/internal/numbers_test_common.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/strings/internal/numbers_test_common.h b/absl/strings/internal/numbers_test_common.h
index 28247205..a263219e 100644
--- a/absl/strings/internal/numbers_test_common.h
+++ b/absl/strings/internal/numbers_test_common.h
@@ -42,8 +42,9 @@ inline bool Itoa(IntType value, int base, std::string* destination) {
while (value != 0) {
const IntType next_value = value / base;
// Can't use std::abs here because of problems when IntType is unsigned.
- int remainder = value > next_value * base ? value - next_value * base
- : next_value * base - value;
+ int remainder =
+ static_cast<int>(value > next_value * base ? value - next_value * base
+ : next_value * base - value);
char c = remainder < 10 ? '0' + remainder : 'A' + remainder - 10;
destination->insert(0, 1, c);
value = next_value;