Skip to content

Commit dfc4852

Browse files
committed
Add explicit type conversions into type checks functions
These conversions are required for stable work of debug build on Android
1 parent 6062f9b commit dfc4852

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib_json/json_value.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,12 +1308,12 @@ bool Value::isInt() const {
13081308
switch (type_) {
13091309
case intValue:
13101310
#if defined(JSON_HAS_INT64)
1311-
return value_.int_ >= minInt && value_.int_ <= maxInt;
1311+
return Int(value_.int_) >= minInt && Int(value_.int_) <= maxInt;
13121312
#else
13131313
return true;
13141314
#endif
13151315
case uintValue:
1316-
return value_.uint_ <= UInt(maxInt);
1316+
return UInt(value_.uint_) <= UInt(maxInt);
13171317
case realValue:
13181318
return value_.real_ >= minInt && value_.real_ <= maxInt &&
13191319
IsIntegral(value_.real_);
@@ -1333,7 +1333,7 @@ bool Value::isUInt() const {
13331333
#endif
13341334
case uintValue:
13351335
#if defined(JSON_HAS_INT64)
1336-
return value_.uint_ <= maxUInt;
1336+
return UInt(value_.uint_) <= maxUInt;
13371337
#else
13381338
return true;
13391339
#endif
@@ -1352,7 +1352,7 @@ bool Value::isInt64() const {
13521352
case intValue:
13531353
return true;
13541354
case uintValue:
1355-
return value_.uint_ <= UInt64(maxInt64);
1355+
return UInt64(value_.uint_) <= UInt64(maxInt64);
13561356
case realValue:
13571357
// Note that maxInt64 (= 2^63 - 1) is not exactly representable as a
13581358
// double, so double(maxInt64) will be rounded up to 2^63. Therefore we

0 commit comments

Comments
 (0)