Commit 4f4aff32 authored by Milo Yip's avatar Milo Yip

Fix clang compilation

parent a5990f3e
...@@ -855,6 +855,7 @@ private: ...@@ -855,6 +855,7 @@ private:
// InsituStringStream -> InsituStringStream // InsituStringStream -> InsituStringStream
static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) { static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) {
RAPIDJSON_ASSERT(&is == &os); RAPIDJSON_ASSERT(&is == &os);
(void)os;
if (is.src_ == is.dst_) { if (is.src_ == is.dst_) {
SkipUnescapedString(is); SkipUnescapedString(is);
...@@ -867,8 +868,11 @@ private: ...@@ -867,8 +868,11 @@ private:
// Scan one by one until alignment (unaligned load may cross page boundary and cause crash) // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15)); const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
while (p != nextAligned) while (p != nextAligned)
if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
goto exit; is.src_ = p;
is.dst_ = q;
return;
}
else else
*q++ = *p++; *q++ = *p++;
...@@ -903,7 +907,6 @@ private: ...@@ -903,7 +907,6 @@ private:
_mm_storeu_si128(reinterpret_cast<__m128i *>(q), s); _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s);
} }
exit:
is.src_ = p; is.src_ = p;
is.dst_ = q; is.dst_ = q;
} }
...@@ -915,10 +918,11 @@ exit: ...@@ -915,10 +918,11 @@ exit:
// Scan one by one until alignment (unaligned load may cross page boundary and cause crash) // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15)); const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
bool found = false;
for (; p != nextAligned; p++) for (; p != nextAligned; p++)
if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
goto exit; is.src_ = is.dst_ = p;
return;
}
// The rest of string using SIMD // The rest of string using SIMD
static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' }; static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
...@@ -949,7 +953,6 @@ exit: ...@@ -949,7 +953,6 @@ exit:
} }
} }
exit:
is.src_ = is.dst_ = p; is.src_ = is.dst_ = p;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment