@@ -1561,7 +1561,7 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) {
1561
1561
1562
1562
const Value::LargestUInt threshold =
1563
1563
isNegative ? negative_threshold : positive_threshold;
1564
- const Value::UInt last_digit =
1564
+ const Value::UInt max_last_digit =
1565
1565
isNegative ? negative_last_digit : positive_last_digit;
1566
1566
1567
1567
Value::LargestUInt value = 0 ;
@@ -1577,7 +1577,7 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) {
1577
1577
// b) this is the last digit, or
1578
1578
// c) it's small enough to fit in that rounding delta, we're okay.
1579
1579
// Otherwise treat this number as a double to avoid overflow.
1580
- if (value > threshold || current != token.end_ || digit > last_digit ) {
1580
+ if (value > threshold || current != token.end_ || digit > max_last_digit ) {
1581
1581
return decodeDouble (token, decoded);
1582
1582
}
1583
1583
}
@@ -1586,7 +1586,7 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) {
1586
1586
1587
1587
if (isNegative) {
1588
1588
// We use the same magnitude assumption here, just in case.
1589
- const Value::UInt last_digit = value % 10 ;
1589
+ const Value::UInt last_digit = static_cast <Value::UInt>( value % 10 ) ;
1590
1590
decoded = -Value::LargestInt (value / 10 ) * 10 - last_digit;
1591
1591
} else if (value <= Value::LargestUInt (Value::maxLargestInt)) {
1592
1592
decoded = Value::LargestInt (value);
0 commit comments