Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e834e174b6 | |||
| 5b695f2b64 | |||
|
|
a0f66fdf71 | ||
|
|
a965e28c4f | ||
|
|
5b04868fee | ||
|
|
dded8bb2e9 | ||
|
|
312a809224 | ||
|
|
c33aae04d9 | ||
|
|
0f9c021a44 | ||
|
|
dfc20c5f8f | ||
|
|
1d658f0d95 |
@@ -1,6 +1,10 @@
|
|||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
project(tinyxml2 VERSION 10.0.0)
|
project(tinyxml2 VERSION 10.0.0)
|
||||||
|
|
||||||
|
if(NOT "${CMAKE_TOOLCHAIN_FILE}" STREQUAL "")
|
||||||
|
MESSAGE(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
option(tinyxml2_BUILD_TESTING "Build tests for tinyxml2" "${BUILD_TESTING}")
|
option(tinyxml2_BUILD_TESTING "Build tests for tinyxml2" "${BUILD_TESTING}")
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
// In HTML5, there are 16 so-called "void" elements. "void elements" NEVER have
|
// In HTML5, there are 16 so-called "void" elements. "void elements" NEVER have
|
||||||
// inner content (but they MAY have attributes), and are assumed to be self-closing.
|
// inner content (but they MAY have attributes), and are assumed to be self-closing.
|
||||||
// An example of a self-closig HTML5 element is "<br/>" (line break)
|
// An example of a self-closing HTML5 element is "<br/>" (line break)
|
||||||
// All other elements are called "non-void" and MUST never self-close.
|
// All other elements are called "non-void" and MUST never self-close.
|
||||||
// Examples: "<div class='lolcats'></div>".
|
// Examples: "<div class='lolcats'></div>".
|
||||||
|
|
||||||
|
|||||||
18
tinyxml2.cpp
18
tinyxml2.cpp
@@ -106,14 +106,9 @@ distribution.
|
|||||||
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__CYGWIN__)
|
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__CYGWIN__)
|
||||||
#define TIXML_FSEEK fseeko
|
#define TIXML_FSEEK fseeko
|
||||||
#define TIXML_FTELL ftello
|
#define TIXML_FTELL ftello
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__) && __ANDROID_API__ > 24
|
||||||
#if __ANDROID_API__ > 24
|
#define TIXML_FSEEK fseeko64
|
||||||
#define TIXML_FSEEK fseeko64
|
#define TIXML_FTELL ftello64
|
||||||
#define TIXML_FTELL ftello64
|
|
||||||
#else
|
|
||||||
#define TIXML_FSEEK fseeko
|
|
||||||
#define TIXML_FTELL ftello
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#define TIXML_FSEEK fseek
|
#define TIXML_FSEEK fseek
|
||||||
#define TIXML_FTELL ftell
|
#define TIXML_FTELL ftell
|
||||||
@@ -610,7 +605,7 @@ void XMLUtil::ToStr( int64_t v, char* buffer, int bufferSize )
|
|||||||
void XMLUtil::ToStr( uint64_t v, char* buffer, int bufferSize )
|
void XMLUtil::ToStr( uint64_t v, char* buffer, int bufferSize )
|
||||||
{
|
{
|
||||||
// horrible syntax trick to make the compiler happy about %llu
|
// horrible syntax trick to make the compiler happy about %llu
|
||||||
TIXML_SNPRINTF(buffer, bufferSize, "%llu", (long long)v);
|
TIXML_SNPRINTF(buffer, bufferSize, "%llu", static_cast<unsigned long long>(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XMLUtil::ToInt(const char* str, int* value)
|
bool XMLUtil::ToInt(const char* str, int* value)
|
||||||
@@ -2509,7 +2504,7 @@ void XMLDocument::ClearError() {
|
|||||||
|
|
||||||
void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... )
|
void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... )
|
||||||
{
|
{
|
||||||
TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );
|
TIXMLASSERT(error >= 0 && error < XML_ERROR_COUNT);
|
||||||
_errorID = error;
|
_errorID = error;
|
||||||
_errorLineNum = lineNum;
|
_errorLineNum = lineNum;
|
||||||
_errorStr.Reset();
|
_errorStr.Reset();
|
||||||
@@ -2518,7 +2513,8 @@ void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ...
|
|||||||
char* buffer = new char[BUFFER_SIZE];
|
char* buffer = new char[BUFFER_SIZE];
|
||||||
|
|
||||||
TIXMLASSERT(sizeof(error) <= sizeof(int));
|
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);
|
TIXML_SNPRINTF(buffer, BUFFER_SIZE, "Error=%s ErrorID=%d (0x%x) Line number=%d",
|
||||||
|
ErrorIDToName(error), static_cast<int>(error), static_cast<unsigned int>(error), lineNum);
|
||||||
|
|
||||||
if (format) {
|
if (format) {
|
||||||
size_t len = strlen(buffer);
|
size_t len = strlen(buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user