Skip to content

Commit

Permalink
Merge pull request leethomason#490 from Dmitry-Me/avoidCastToSigned
Browse files Browse the repository at this point in the history
Avoid cast to signed integer type
  • Loading branch information
leethomason authored Oct 17, 2016
2 parents 15ad071 + c5f1e7c commit 6bbcda0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2192,8 +2192,7 @@ XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :
}
for( int i=0; i<NUM_ENTITIES; ++i ) {
const char entityValue = entities[i].value;
// cast to explicit signed because char may be unsigned (on PowerPC)
TIXMLASSERT( 0 <= static_cast<signed char>(entityValue) && entityValue < ENTITY_RANGE );
TIXMLASSERT( ((unsigned char)entityValue) < ENTITY_RANGE );
_entityFlag[ (unsigned char)entityValue ] = true;
}
_restrictedEntityFlag[(unsigned char)'&'] = true;
Expand Down

0 comments on commit 6bbcda0

Please sign in to comment.