Skip to content

Commit

Permalink
Fix build errors with NOOPT=1 (#37020)
Browse files Browse the repository at this point in the history
  • Loading branch information
anothersimulacrum authored and kevingranade committed Jan 13, 2020
1 parent 1ab323e commit 9d5aa5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ number_sci_notation JsonIn::get_any_int()
int JsonIn::get_int()
{
number_sci_notation n = get_any_int();
if( !n.negative && n.number > std::numeric_limits<int>::max() ) {
if( !n.negative && n.number > static_cast<uint64_t>( std::numeric_limits<int>::max() ) ) {
error( "Found a number greater than " + std::to_string( std::numeric_limits<int>::max() ) +
" which is unsupported in this context." );
} else if( n.negative && n.number > neg_INT_MIN() ) {
Expand All @@ -1096,7 +1096,7 @@ unsigned int JsonIn::get_uint()
int64_t JsonIn::get_int64()
{
number_sci_notation n = get_any_int();
if( !n.negative && n.number > std::numeric_limits<int64_t>::max() ) {
if( !n.negative && n.number > static_cast<uint64_t>( std::numeric_limits<int64_t>::max() ) ) {
error( "Signed integers greater than " +
std::to_string( std::numeric_limits<int64_t>::max() ) + " not supported." );
} else if( n.negative && n.number > neg_INT64_MIN() ) {
Expand Down

0 comments on commit 9d5aa5e

Please sign in to comment.