From dded8bb2e9a04ce35924b5ce71645e4752a6b5b5 Mon Sep 17 00:00:00 2001 From: Albert Hung Date: Wed, 15 May 2024 19:37:45 +0800 Subject: [PATCH] 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. --- tinyxml2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 903d690..6d6c200 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -605,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(v)); } bool XMLUtil::ToInt(const char* str, int* value)