diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp index cf2689a40..a09f1c433 100644 --- a/include/nlohmann/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -1102,7 +1102,8 @@ class json_pointer void reseed(const void* address) noexcept { // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast): the address is only a source of entropy - std::uint64_t x = static_cast(reinterpret_cast(address)) ^ 0x9E3779B97F4A7C15ULL; + std::uint64_t x = reinterpret_cast(address); + x ^= 0x9E3779B97F4A7C15ULL; x *= 0xBF58476D1CE4E5B9ULL; seed = x ^ (x >> 31u); tree.reseed(seed); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 5b3003734..84332139c 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -27277,7 +27277,8 @@ class json_pointer void reseed(const void* address) noexcept { // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast): the address is only a source of entropy - std::uint64_t x = static_cast(reinterpret_cast(address)) ^ 0x9E3779B97F4A7C15ULL; + std::uint64_t x = reinterpret_cast(address); + x ^= 0x9E3779B97F4A7C15ULL; x *= 0xBF58476D1CE4E5B9ULL; seed = x ^ (x >> 31u); tree.reseed(seed);