Merge pull request #428 from wvvelzen/WarningsFix

Fix 2 "Condition is always true" compiler warnings.
This commit is contained in:
Lee Thomason 2016-03-25 07:41:51 -07:00
commit 97837e77f4
1 changed files with 2 additions and 2 deletions

View File

@ -471,7 +471,7 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )
else {
return 0;
}
TIXMLASSERT( digit >= 0 && digit < 16);
TIXMLASSERT( digit < 16 );
TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );
const unsigned int digitScaled = mult * digit;
TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );
@ -501,7 +501,7 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )
while ( *q != '#' ) {
if ( *q >= '0' && *q <= '9' ) {
const unsigned int digit = *q - '0';
TIXMLASSERT( digit >= 0 && digit < 10);
TIXMLASSERT( digit < 10 );
TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );
const unsigned int digitScaled = mult * digit;
TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );