mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 06:57:28 +00:00
Update AMFDeserialize (#1096)
Per ISO C++ standard 9.7.1 5.3, "Otherwise the type of the enumerator is the same as that of the preceding enumerator unless the incremented value is not representable in that type, in which case the type is an unspecified integral type sufficient to contain the incremented value. If no such type exists, the program is ill-formed." it is not undefined behavior to set a scoped enum to a value outside of its constant range because all values of the underlying type can represent the scoped enum
This commit is contained in:
parent
e47169fec5
commit
9fabff16e4
@ -13,10 +13,8 @@ AMFBaseValue* AMFDeserialize::Read(RakNet::BitStream* inStream) {
|
|||||||
if (!inStream) return nullptr;
|
if (!inStream) return nullptr;
|
||||||
AMFBaseValue* returnValue = nullptr;
|
AMFBaseValue* returnValue = nullptr;
|
||||||
// Read in the value type from the bitStream
|
// Read in the value type from the bitStream
|
||||||
uint8_t i;
|
eAmf marker;
|
||||||
inStream->Read(i);
|
inStream->Read(marker);
|
||||||
if (i > static_cast<uint8_t>(eAmf::Dictionary)) return nullptr;
|
|
||||||
eAmf marker = static_cast<eAmf>(i);
|
|
||||||
// Based on the typing, create the value associated with that and return the base value class
|
// Based on the typing, create the value associated with that and return the base value class
|
||||||
switch (marker) {
|
switch (marker) {
|
||||||
case eAmf::Undefined: {
|
case eAmf::Undefined: {
|
||||||
|
Loading…
Reference in New Issue
Block a user