bspfile: fix OverflowsUint16

This commit is contained in:
Eric Wasylishen 2021-09-20 23:59:26 -06:00
parent 23a234f6e9
commit 0c0cc9ef81
1 changed files with 5 additions and 2 deletions

View File

@ -988,14 +988,17 @@ OverflowsInt16(int32_t input) {
return false;
}
static bool
static constexpr bool
OverflowsUint16(uint32_t input) {
if (input > INT16_MAX) {
if (input > UINT16_MAX) {
return true;
}
return false;
}
static_assert(!OverflowsUint16(65535));
static_assert( OverflowsUint16(65536));
static bool
MBSPto29_Leafs_Validate(const mleaf_t *mleafs, int numleafs) {
const mleaf_t *mleaf = mleafs;