mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Thirdparty: upgrade to latest RapidJSON
This commit is contained in:
parent
bed3bc87a0
commit
5e10fde155
6
src/thirdparty/rapidjson/schema.h
vendored
6
src/thirdparty/rapidjson/schema.h
vendored
@ -367,7 +367,9 @@ public:
|
||||
uint64_t h = Hash(0, kObjectType);
|
||||
uint64_t* kv = stack_.template Pop<uint64_t>(memberCount * 2);
|
||||
for (SizeType i = 0; i < memberCount; i++)
|
||||
h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive
|
||||
// Issue #2205
|
||||
// Hasing the key to avoid key=value cases with bug-prone zero-value hash
|
||||
h ^= Hash(Hash(0, kv[i * 2]), kv[i * 2 + 1]); // Use xor to achieve member order insensitive
|
||||
*stack_.template Push<uint64_t>() = h;
|
||||
return true;
|
||||
}
|
||||
@ -405,7 +407,7 @@ private:
|
||||
|
||||
bool WriteBuffer(Type type, const void* data, size_t len) {
|
||||
// FNV-1a from http://isthe.com/chongo/tech/comp/fnv/
|
||||
uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type);
|
||||
uint64_t h = Hash(RAPIDJSON_UINT64_C2(0xcbf29ce4, 0x84222325), type);
|
||||
const unsigned char* d = static_cast<const unsigned char*>(data);
|
||||
for (size_t i = 0; i < len; i++)
|
||||
h = Hash(h, d[i]);
|
||||
|
2
src/thirdparty/rapidjson/writer.h
vendored
2
src/thirdparty/rapidjson/writer.h
vendored
@ -349,7 +349,7 @@ protected:
|
||||
|
||||
bool WriteDouble(double d) {
|
||||
if (internal::Double(d).IsNanOrInf()) {
|
||||
if (!(writeFlags & kWriteNanAndInfFlag))
|
||||
if (!(writeFlags & kWriteNanAndInfFlag) && !(writeFlags & kWriteNanAndInfNullFlag))
|
||||
return false;
|
||||
if (writeFlags & kWriteNanAndInfNullFlag) {
|
||||
PutReserve(*os_, 4);
|
||||
|
Loading…
x
Reference in New Issue
Block a user