Commit 703d4baf by Yixin Zhang

Fixed conversion warnings

Use static_cast on digit.
parent bd6422f5
...@@ -10619,7 +10619,7 @@ basic_json_parser_66: ...@@ -10619,7 +10619,7 @@ basic_json_parser_66:
// skip if definitely not an integer // skip if definitely not an integer
if (type != value_t::number_float) 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 // overflow if value * 10 + digit > max, move terms around
// to avoid overflow in intermediate values // to avoid overflow in intermediate values
......
...@@ -9769,7 +9769,7 @@ class basic_json ...@@ -9769,7 +9769,7 @@ class basic_json
// skip if definitely not an integer // skip if definitely not an integer
if (type != value_t::number_float) 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 // overflow if value * 10 + digit > max, move terms around
// to avoid overflow in intermediate values // to avoid overflow in intermediate values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment