From 30d0c3d5f26f0ecb5053bc008de11bf070d81a22 Mon Sep 17 00:00:00 2001 From: Lee Thomason Date: Fri, 29 Jun 2018 15:47:37 -0700 Subject: [PATCH 1/2] add assertion --- tinyxml2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 33cf19f..ed38c3c 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -2327,6 +2327,7 @@ void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... size_t BUFFER_SIZE = 1000; char* buffer = new char[BUFFER_SIZE]; + TIXMLASSERT(sizeof(error) <= sizeof(int)); TIXML_SNPRINTF(buffer, BUFFER_SIZE, "Error=%s ErrorID=%d (0x%x) Line number=%d", ErrorIDToName(error), int(error), int(error), lineNum); if (format) { From 92fc089e174bdcad8f0e67865d8365e96551487f Mon Sep 17 00:00:00 2001 From: Lee Thomason Date: Fri, 29 Jun 2018 15:51:37 -0700 Subject: [PATCH 2/2] remove deprecated errors. next version will be major. --- tinyxml2.cpp | 2 -- tinyxml2.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index ed38c3c..de3d2fb 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1977,10 +1977,8 @@ const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = { "XML_ERROR_FILE_NOT_FOUND", "XML_ERROR_FILE_COULD_NOT_BE_OPENED", "XML_ERROR_FILE_READ_ERROR", - "UNUSED_XML_ERROR_ELEMENT_MISMATCH", "XML_ERROR_PARSING_ELEMENT", "XML_ERROR_PARSING_ATTRIBUTE", - "UNUSED_XML_ERROR_IDENTIFYING_TAG", "XML_ERROR_PARSING_TEXT", "XML_ERROR_PARSING_CDATA", "XML_ERROR_PARSING_COMMENT", diff --git a/tinyxml2.h b/tinyxml2.h index 52840a0..2a0e0bf 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -525,10 +525,8 @@ enum XMLError { XML_ERROR_FILE_NOT_FOUND, XML_ERROR_FILE_COULD_NOT_BE_OPENED, XML_ERROR_FILE_READ_ERROR, - UNUSED_XML_ERROR_ELEMENT_MISMATCH, // remove at next major version XML_ERROR_PARSING_ELEMENT, XML_ERROR_PARSING_ATTRIBUTE, - UNUSED_XML_ERROR_IDENTIFYING_TAG, // remove at next major version XML_ERROR_PARSING_TEXT, XML_ERROR_PARSING_CDATA, XML_ERROR_PARSING_COMMENT,