partial fix for #4358
This commit is contained in:
parent
765e7536b5
commit
dbfc89891c
@ -378,8 +378,19 @@ inline void from_json(const BasicJsonType& j, ArithmeticType& val)
|
|||||||
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
|
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case value_t::boolean:
|
case value_t::boolean:
|
||||||
|
{
|
||||||
|
if ((sizeof(ArithmeticType) == 1) && std::is_unsigned<ArithmeticType>::value)
|
||||||
|
{
|
||||||
|
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
get_arithmetic_value(j, val);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case value_t::null:
|
case value_t::null:
|
||||||
case value_t::object:
|
case value_t::object:
|
||||||
case value_t::array:
|
case value_t::array:
|
||||||
|
|||||||
@ -5051,8 +5051,19 @@ inline void from_json(const BasicJsonType& j, ArithmeticType& val)
|
|||||||
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
|
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case value_t::boolean:
|
case value_t::boolean:
|
||||||
|
{
|
||||||
|
if ((sizeof(ArithmeticType) == 1) && std::is_unsigned<ArithmeticType>::value)
|
||||||
|
{
|
||||||
|
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
get_arithmetic_value(j, val);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case value_t::null:
|
case value_t::null:
|
||||||
case value_t::object:
|
case value_t::object:
|
||||||
case value_t::array:
|
case value_t::array:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user