11 Commits

Author SHA1 Message Date
e834e174b6 Обновить CMakeLists.txt 2024-06-17 13:19:55 +04:00
5b695f2b64 Обновить CMakeLists.txt 2024-06-17 13:15:55 +04:00
Lee Thomason
a0f66fdf71 Merge pull request #984 from Blake-Madden/master
Fix typo in comment
2024-06-13 08:29:51 -07:00
Lee Thomason
a965e28c4f Merge pull request #978 from AlbertHungGarmin/fix-format-specifier
Fix format specifier mismatch in XMLUtil::ToStr
2024-06-13 08:17:16 -07:00
Blake-Madden
5b04868fee Fix typo in comment 2024-06-01 15:41:57 -04:00
Albert Hung
dded8bb2e9 Fix format specifier mismatch in XMLUtil::ToStr
In the XMLUtil::ToStr( uint64_t v, char* buffer, int bufferSize ) function, the format specifier %llu was used with a signed long long argument. This caused a type mismatch warning. The argument has been changed to unsigned long long to match the format specifier, resolving the warning.
2024-05-15 19:43:55 +08:00
Lee Thomason
312a809224 Merge pull request #976 from leethomason/AlbertHungGarmin-format_error
Albert hung garmin format error
2024-04-20 19:46:41 -07:00
Lee Thomason
c33aae04d9 kick the system 2024-04-20 19:44:22 -07:00
Lee Thomason
0f9c021a44 Merge pull request #973 from davidoakley/fix-android-before-api24
Use fseek/ftell on Android when api level < 24
2024-04-20 19:34:58 -07:00
David Oakley
dfc20c5f8f Android SDK<24 doesn’t support fseeko/ftello
Fall back to using fseek/ftell;
This was broken by d9fb8d3443
2024-04-08 12:58:12 +01:00
Albert Hung
1d658f0d95 Fix format error of TIXML_SNPRINTF
The format "%x" is treated as an unsigned int by the GCC compiler. Use static_cast to cast the error to an unsigned int to match the "%x" type. Additionally, replace int(error) with static_cast<int>(error) to avoid the old-style cast warning.
2024-03-19 14:22:17 +08:00
3 changed files with 142 additions and 142 deletions

View File

@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.15)
project(tinyxml2 VERSION 10.0.0)
if(NOT "${CMAKE_TOOLCHAIN_FILE}" STREQUAL "")
MESSAGE(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
endif()
include(CTest)
option(tinyxml2_BUILD_TESTING "Build tests for tinyxml2" "${BUILD_TESTING}")

View File

@@ -7,7 +7,7 @@
// 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.
// 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.
// Examples: "<div class='lolcats'></div>".

View File

@@ -106,14 +106,9 @@ distribution.
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__CYGWIN__)
#define TIXML_FSEEK fseeko
#define TIXML_FTELL ftello
#elif defined(__ANDROID__)
#if __ANDROID_API__ > 24
#define TIXML_FSEEK fseeko64
#define TIXML_FTELL ftello64
#else
#define TIXML_FSEEK fseeko
#define TIXML_FTELL ftello
#endif
#elif defined(__ANDROID__) && __ANDROID_API__ > 24
#define TIXML_FSEEK fseeko64
#define TIXML_FTELL ftello64
#else
#define TIXML_FSEEK fseek
#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 )
{
// 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)
@@ -2509,7 +2504,7 @@ void XMLDocument::ClearError() {
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;
_errorLineNum = lineNum;
_errorStr.Reset();
@@ -2518,7 +2513,8 @@ void XMLDocument::SetError( XMLError error, int lineNum, const char* format, ...
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);
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) {
size_t len = strlen(buffer);