소스 검색

Merge pull request #484 from kainjow/patch-2

Fix warning on PowerPC
Lee Thomason 9 년 전
부모
커밋
e8157ff9ae
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      tinyxml2.cpp

+ 2 - 1
tinyxml2.cpp

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