From 0aeac18ad372c5a35f344a890f13ce3dbf54c94c Mon Sep 17 00:00:00 2001 From: Wilfred van Velzen Date: Fri, 25 Mar 2016 14:14:03 +0100 Subject: [PATCH] Fix 2 "Condition is always true" compiler warnings. --- tinyxml2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index df49d0d..39d4d72 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -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 );