Add pre-assert, fix comment

This commit is contained in:
Dmitry-Me 2014-11-08 15:24:52 +03:00
parent 97cfa03865
commit 66d2a84715
2 changed files with 3 additions and 2 deletions

View File

@ -1846,6 +1846,7 @@ void XMLDocument::Print( XMLPrinter* streamer ) const
void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )
{
TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );
_errorID = error;
_errorStr1 = str1;
_errorStr2 = str2;
@ -1853,7 +1854,7 @@ void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )
const char* XMLDocument::ErrorName() const
{
TIXMLASSERT(_errorID >= 0 && _errorID < XML_ERROR_COUNT );
TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );
return _errorNames[_errorID];
}

View File

@ -491,7 +491,7 @@ public:
}
};
// WARNING: must match XMLErrorNames[]
// WARNING: must match XMLDocument::_errorNames[]
enum XMLError {
XML_SUCCESS = 0,
XML_NO_ERROR = 0,