From cd8c1a63225e7464d58cc1a425053a961933916a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:34:59 +0200 Subject: [PATCH] Update ToStr functions to use int32_t and uint32_t types, and change corresponding function signatures in the header file. Update ToInt and ToUnsigned functions to use int32_t and uint32_t types respectively. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 4e50064..5108bae 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -563,13 +563,13 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) } -void XMLUtil::ToStr( int v, char* buffer, int bufferSize ) +void XMLUtil::ToStr( int32_t v, char* buffer, int bufferSize ) { TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); } -void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize ) +void XMLUtil::ToStr( uint32_t v, char* buffer, int bufferSize ) { TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); } diff --git a/tinyxml2.h b/tinyxml2.h index 96fa334..dd3185a 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -614,8 +614,8 @@ public: static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); // converts primitive types to strings - static void ToStr( int v, char* buffer, int bufferSize ); - static void ToStr( unsigned v, char* buffer, int bufferSize ); + static void ToStr( int32_t v, char* buffer, int bufferSize ); + static void ToStr( uint32_t v, char* buffer, int bufferSize ); static void ToStr( bool v, char* buffer, int bufferSize ); static void ToStr( float v, char* buffer, int bufferSize ); static void ToStr( double v, char* buffer, int bufferSize ); @@ -623,8 +623,8 @@ public: static void ToStr(uint64_t v, char* buffer, int bufferSize); // converts strings to primitive types - static bool ToInt( const char* str, int* value ); - static bool ToUnsigned( const char* str, unsigned* value ); + static bool ToInt( const char* str, int32_t* value ); + static bool ToUnsigned( const char* str, uint32_t* value ); static bool ToBool( const char* str, bool* value ); static bool ToFloat( const char* str, float* value ); static bool ToDouble( const char* str, double* value );