Merge pull request #490 from Dmitry-Me/avoidCastToSigned

Avoid cast to signed integer type
This commit is contained in:
Lee Thomason 2016-10-17 15:34:20 -07:00 committed by GitHub
commit 6bbcda0215
1 changed files with 1 additions and 2 deletions

View File

@ -2192,8 +2192,7 @@ XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :
} }
for( int i=0; i<NUM_ENTITIES; ++i ) { for( int i=0; i<NUM_ENTITIES; ++i ) {
const char entityValue = entities[i].value; const char entityValue = entities[i].value;
// cast to explicit signed because char may be unsigned (on PowerPC) TIXMLASSERT( ((unsigned char)entityValue) < ENTITY_RANGE );
TIXMLASSERT( 0 <= static_cast<signed char>(entityValue) && entityValue < ENTITY_RANGE );
_entityFlag[ (unsigned char)entityValue ] = true; _entityFlag[ (unsigned char)entityValue ] = true;
} }
_restrictedEntityFlag[(unsigned char)'&'] = true; _restrictedEntityFlag[(unsigned char)'&'] = true;