Deal with covered switches consistently (#4161)
* Fixes a number of "<function>: not all control paths return a value" warnings on MSVC. * Introduces the UNREACHABLE global macro and uses it instead of conditionally compiled switch defaults. * Move cNBTParseErrorCategory from FastNBT.h into FastNBT.cpp to prevent bad calls to message()
This commit is contained in:
@@ -388,12 +388,7 @@ AString DamageTypeToString(eDamageType a_DamageType)
|
||||
case dtSuffocating: return "dtSuffocation";
|
||||
case dtExplosion: return "dtExplosion";
|
||||
}
|
||||
|
||||
// Unknown damage type:
|
||||
ASSERT(!"Unknown DamageType");
|
||||
#ifndef __clang__
|
||||
return Printf("dtUnknown_%d", static_cast<int>(a_DamageType));
|
||||
#endif
|
||||
UNREACHABLE("Unsupported damage type");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user