Fixes -Wswitch-default warnings
This commit is contained in:
parent
469333af8f
commit
e2cd486e6e
@ -64,7 +64,7 @@ solution "test"
|
|||||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||||
|
|
||||||
configuration "gmake"
|
configuration "gmake"
|
||||||
buildoptions "-msse4.2 -Werror -Wall -Wextra"
|
buildoptions "-msse4.2 -Werror -Wall -Wextra -Wswitch-default"
|
||||||
|
|
||||||
project "gtest"
|
project "gtest"
|
||||||
kind "StaticLib"
|
kind "StaticLib"
|
||||||
@ -154,7 +154,7 @@ solution "example"
|
|||||||
defines { "_CRT_SECURE_NO_WARNINGS" }
|
defines { "_CRT_SECURE_NO_WARNINGS" }
|
||||||
|
|
||||||
configuration "gmake"
|
configuration "gmake"
|
||||||
buildoptions "-Werror -Wall -Wextra -Weffc++"
|
buildoptions "-Werror -Wall -Wextra -Weffc++ -Wswitch-default"
|
||||||
|
|
||||||
project "condense"
|
project "condense"
|
||||||
kind "ConsoleApp"
|
kind "ConsoleApp"
|
||||||
|
@ -319,6 +319,9 @@ public:
|
|||||||
case kCopyStringFlag:
|
case kCopyStringFlag:
|
||||||
Allocator::Free(const_cast<Ch*>(data_.s.str));
|
Allocator::Free(const_cast<Ch*>(data_.s.str));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break; // Do nothing for other types.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -794,6 +797,9 @@ int z = a[0u].GetInt(); // This works too.
|
|||||||
else if (IsUint64()) handler.Uint64(data_.n.u64);
|
else if (IsUint64()) handler.Uint64(data_.n.u64);
|
||||||
else handler.Double(data_.n.d);
|
else handler.Double(data_.n.d);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
RAPIDJSON_ASSERT(false);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -158,10 +158,11 @@ private:
|
|||||||
case 0x01: type_ = kUTF32LE; break;
|
case 0x01: type_ = kUTF32LE; break;
|
||||||
case 0x05: type_ = kUTF16LE; break;
|
case 0x05: type_ = kUTF16LE; break;
|
||||||
case 0x0F: type_ = kUTF8; break;
|
case 0x0F: type_ = kUTF8; break;
|
||||||
|
default: break; // Use type defined by user.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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_) {
|
switch (type_) {
|
||||||
case kUTF8:
|
case kUTF8:
|
||||||
// Do nothing
|
// Do nothing
|
||||||
@ -174,6 +175,8 @@ private:
|
|||||||
case kUTF32BE:
|
case kUTF32BE:
|
||||||
RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
|
RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
RAPIDJSON_ASSERT(false); // Invalid type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,6 +219,8 @@ public:
|
|||||||
case kUTF8:
|
case kUTF8:
|
||||||
// Do nothing
|
// Do nothing
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
RAPIDJSON_ASSERT(false); // Invalid UTFType
|
||||||
}
|
}
|
||||||
|
|
||||||
static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };
|
static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user