Fixed conversion warnings

Use static_cast on digit.
This commit is contained in:
Yixin Zhang committed 2016-12-12 21:12:08 -05:00
1 parent bd6422f583
commit 703d4baf8b
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -10619,7 +10619,7 @@ basic_json_parser_66:
// skip if definitely not an integer
if (type != value_t::number_float)
{
auto digit = *curptr - '0';
auto digit = static_cast<number_unsigned_t>(*curptr - '0');
// overflow if value * 10 + digit > max, move terms around
// to avoid overflow in intermediate values
+1 -1
View File
@@ -9769,7 +9769,7 @@ class basic_json
// skip if definitely not an integer
if (type != value_t::number_float)
{
auto digit = *curptr - '0';
auto digit = static_cast<number_unsigned_t>(*curptr - '0');
// overflow if value * 10 + digit > max, move terms around
// to avoid overflow in intermediate values