diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index 50036d000..9d50fbcab 100644 --- a/include/nlohmann/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -599,7 +600,7 @@ class json_pointer std::memcpy(&w, data + i, size - i); } h = (h ^ w) * 0x9E3779B97F4A7C15ULL; - return static_cast(h ^ (h >> 29u)); + return detail::conditional_static_cast(h ^ (h >> 29u)); } void grow() @@ -1275,7 +1276,7 @@ class json_pointer std::size_t pos = buf.size(); do { - buf[--pos] = static_cast('0' + i % 10); + buf[--pos] = static_cast('0' + (i % 10)); i /= 10; } while (i != 0); @@ -1327,7 +1328,7 @@ class json_pointer // flatten `v`, whose path is `path`: primitives and empty containers // are added to the result right away; other containers get a frame auto& object = *result.m_data.m_value.object; - typename BasicJsonType::object_t::iterator hint = object.end(); + auto hint = object.end(); const auto enter = [&stack, &path, &object, &hint](const BasicJsonType & v) { switch (v.type()) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 460177036..77fb9ed85 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -21448,6 +21448,8 @@ NLOHMANN_JSON_NAMESPACE_END // #include +// #include + // #include // #include @@ -22024,7 +22026,7 @@ class json_pointer std::memcpy(&w, data + i, size - i); } h = (h ^ w) * 0x9E3779B97F4A7C15ULL; - return static_cast(h ^ (h >> 29u)); + return detail::conditional_static_cast(h ^ (h >> 29u)); } void grow() @@ -22700,7 +22702,7 @@ class json_pointer std::size_t pos = buf.size(); do { - buf[--pos] = static_cast('0' + i % 10); + buf[--pos] = static_cast('0' + (i % 10)); i /= 10; } while (i != 0); @@ -22752,7 +22754,7 @@ class json_pointer // flatten `v`, whose path is `path`: primitives and empty containers // are added to the result right away; other containers get a frame auto& object = *result.m_data.m_value.object; - typename BasicJsonType::object_t::iterator hint = object.end(); + auto hint = object.end(); const auto enter = [&stack, &path, &object, &hint](const BasicJsonType & v) { switch (v.type())