mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
🚨 fixed more compiler warnings
This commit is contained in:
@ -1520,7 +1520,7 @@ void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
|
||||
|
||||
template<typename BasicJsonType, typename T,
|
||||
enable_if_t<std::is_convertible<T, BasicJsonType>::value, int> = 0>
|
||||
void to_json(BasicJsonType& j, std::valarray<T> arr)
|
||||
void to_json(BasicJsonType& j, const std::valarray<T>& arr)
|
||||
{
|
||||
external_constructor<value_t::array>::construct(j, std::move(arr));
|
||||
}
|
||||
@ -3165,7 +3165,7 @@ scan_number_done:
|
||||
{
|
||||
// escape control characters
|
||||
char cs[9];
|
||||
snprintf(cs, 9, "<U+%.4hhX>", c);
|
||||
snprintf(cs, 9, "<U+%.4hhX>", static_cast<unsigned char>(c));
|
||||
result += cs;
|
||||
}
|
||||
else
|
||||
@ -3746,11 +3746,9 @@ class json_sax_dom_callback_parser : public json_sax<BasicJsonType>
|
||||
|
||||
bool end_object() override
|
||||
{
|
||||
bool keep = true;
|
||||
if (ref_stack.back())
|
||||
{
|
||||
keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::object_end, *ref_stack.back());
|
||||
if (not keep)
|
||||
if (not callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::object_end, *ref_stack.back()))
|
||||
{
|
||||
// discard object
|
||||
*ref_stack.back() = discarded;
|
||||
|
Reference in New Issue
Block a user