From 32d60a78f560259d04da81d9a78065030d53641c Mon Sep 17 00:00:00 2001 From: JinWang An Date: Fri, 30 Oct 2020 14:29:48 +0900 Subject: [PATCH] Imported Upstream version 4.0.1 --- CMakeLists.txt | 2 +- dox | 2 +- tinyxml2.cpp | 7 +++++-- tinyxml2.h | 2 +- xmltest.cpp | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98d4c55..e1d3ca0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ include(GNUInstallDirs) ################################ # set lib version here -set(GENERIC_LIB_VERSION "4.0.0") +set(GENERIC_LIB_VERSION "4.0.1") set(GENERIC_LIB_SOVERSION "4") diff --git a/dox b/dox index 5ae0b21..394b182 100644 --- a/dox +++ b/dox @@ -38,7 +38,7 @@ PROJECT_NAME = "TinyXML-2" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.0.0 +PROJECT_NUMBER = 4.0.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tinyxml2.cpp b/tinyxml2.cpp index d5d8ebb..9d6be5c 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -558,7 +558,8 @@ void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) void XMLUtil::ToStr(int64_t v, char* buffer, int bufferSize) { - TIXML_SNPRINTF(buffer, bufferSize, "%lld", v); + // horrible syntax trick to make the compiler happy about %lld + TIXML_SNPRINTF(buffer, bufferSize, "%lld", (long long)v); } @@ -617,7 +618,9 @@ bool XMLUtil::ToDouble( const char* str, double* value ) bool XMLUtil::ToInt64(const char* str, int64_t* value) { - if (TIXML_SSCANF(str, "%lld", value) == 1) { + long long v = 0; // horrible syntax trick to make the compiler happy about %lld + if (TIXML_SSCANF(str, "%lld", &v) == 1) { + *value = (int64_t)v; return true; } return false; diff --git a/tinyxml2.h b/tinyxml2.h index 9dcc345..fb4376d 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -98,7 +98,7 @@ distribution. */ static const int TIXML2_MAJOR_VERSION = 4; static const int TIXML2_MINOR_VERSION = 0; -static const int TIXML2_PATCH_VERSION = 0; +static const int TIXML2_PATCH_VERSION = 1; namespace tinyxml2 { diff --git a/xmltest.cpp b/xmltest.cpp index 3fdc0bd..7451fbe 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -426,7 +426,7 @@ int main( int argc, const char ** argv ) XMLTest( "Programmatic DOM", 2, doc->FirstChildElement()->LastChildElement( "sub" )->IntAttribute( "attrib" ) ); XMLTest( "Programmatic DOM", "& Text!", doc->FirstChildElement()->LastChildElement( "sub" )->FirstChild()->ToText()->Value() ); - XMLTest("User data", 2, (int)comment->GetUserData()); + XMLTest("User data", (void*)2 == comment->GetUserData(), true, false); // And now deletion: element->DeleteChild( sub[2] ); -- 2.34.1