Commit 84e57412 authored by Milo Yip's avatar Milo Yip

Fix gcc warning

parent 872aba66
...@@ -178,19 +178,10 @@ private: ...@@ -178,19 +178,10 @@ private:
} }
// Runtime check whether the size of character type is sufficient. It only perform checks with assertion. // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
switch (type_) { if (type_ == kUTF16LE || type_ == kUTF16BE)
case kUTF8:
// Do nothing
break;
case kUTF16LE:
case kUTF16BE:
RAPIDJSON_ASSERT(sizeof(Ch) >= 2); RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
break; else if (type_ == kUTF32LE || type_ == kUTF32BE)
case kUTF32LE:
case kUTF32BE:
RAPIDJSON_ASSERT(sizeof(Ch) >= 4); RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
break;
}
} }
typedef Ch (*TakeFunc)(InputByteStream& is); typedef Ch (*TakeFunc)(InputByteStream& is);
...@@ -221,20 +212,11 @@ public: ...@@ -221,20 +212,11 @@ public:
AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) { AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) {
RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE); RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
// RUntime check whether the size of character type is sufficient. It only perform checks with assertion. // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
switch (type_) { if (type_ == kUTF16LE || type_ == kUTF16BE)
case kUTF16LE:
case kUTF16BE:
RAPIDJSON_ASSERT(sizeof(Ch) >= 2); RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
break; else if (type_ == kUTF32LE || type_ == kUTF32BE)
case kUTF32LE:
case kUTF32BE:
RAPIDJSON_ASSERT(sizeof(Ch) >= 4); RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
break;
case kUTF8:
// Do nothing
break;
}
static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) }; static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };
putFunc_ = f[type_]; putFunc_ = f[type_];
......
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