mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 02:00:50 +08:00
Fix comparison warnings caused by 54fc4e2 (#1575)
Co-authored-by: Jordan Bayles <bayles.jordan@gmail.com>
This commit is contained in:
parent
3f86349128
commit
dca8a24cf8
@ -684,7 +684,7 @@ Value::UInt Value::asUInt() const {
|
|||||||
JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
|
JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
|
||||||
return UInt(value_.uint_);
|
return UInt(value_.uint_);
|
||||||
case realValue:
|
case realValue:
|
||||||
JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
|
JSON_ASSERT_MESSAGE(InRange(value_.real_, 0u, maxUInt),
|
||||||
"double out of UInt range");
|
"double out of UInt range");
|
||||||
return UInt(value_.real_);
|
return UInt(value_.real_);
|
||||||
case nullValue:
|
case nullValue:
|
||||||
@ -733,7 +733,7 @@ Value::UInt64 Value::asUInt64() const {
|
|||||||
case uintValue:
|
case uintValue:
|
||||||
return UInt64(value_.uint_);
|
return UInt64(value_.uint_);
|
||||||
case realValue:
|
case realValue:
|
||||||
JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
|
JSON_ASSERT_MESSAGE(InRange(value_.real_, 0u, maxUInt64),
|
||||||
"double out of UInt64 range");
|
"double out of UInt64 range");
|
||||||
return UInt64(value_.real_);
|
return UInt64(value_.real_);
|
||||||
case nullValue:
|
case nullValue:
|
||||||
@ -844,7 +844,7 @@ bool Value::isConvertibleTo(ValueType other) const {
|
|||||||
type() == booleanValue || type() == nullValue;
|
type() == booleanValue || type() == nullValue;
|
||||||
case uintValue:
|
case uintValue:
|
||||||
return isUInt() ||
|
return isUInt() ||
|
||||||
(type() == realValue && InRange(value_.real_, 0, maxUInt)) ||
|
(type() == realValue && InRange(value_.real_, 0u, maxUInt)) ||
|
||||||
type() == booleanValue || type() == nullValue;
|
type() == booleanValue || type() == nullValue;
|
||||||
case realValue:
|
case realValue:
|
||||||
return isNumeric() || type() == booleanValue || type() == nullValue;
|
return isNumeric() || type() == booleanValue || type() == nullValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user