Ver código fonte

Ensure enum is printed properly

Dmitry-Me 11 anos atrás
pai
commit
400f1199ea
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      tinyxml2.cpp

+ 2 - 1
tinyxml2.cpp

@@ -1956,8 +1956,9 @@ void XMLDocument::PrintError() const
             TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 );
             TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 );
         }
         }
 
 
+        TIXMLASSERT( INT_MIN <= _errorID && _errorID <= INT_MAX );
         printf( "XMLDocument error id=%d '%s' str1=%s str2=%s\n",
         printf( "XMLDocument error id=%d '%s' str1=%s str2=%s\n",
-                _errorID, ErrorName(), buf1, buf2 );
+                static_cast<int>( _errorID ), ErrorName(), buf1, buf2 );
     }
     }
 }
 }