From fd26a5ee1fd891058cf18758a50289bbd2aa1a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:15:52 +0200 Subject: [PATCH 01/16] Update QueryIntValue and QueryUnsignedValue to use int32_t and uint32_t types for better consistency. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 903d690..2e33d08 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1481,7 +1481,7 @@ void XMLAttribute::SetName( const char* n ) } -XMLError XMLAttribute::QueryIntValue( int* value ) const +XMLError XMLAttribute::QueryIntValue( int32_t* value ) const { if ( XMLUtil::ToInt( Value(), value )) { return XML_SUCCESS; @@ -1490,7 +1490,7 @@ XMLError XMLAttribute::QueryIntValue( int* value ) const } -XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const +XMLError XMLAttribute::QueryUnsignedValue( uint32_t* value ) const { if ( XMLUtil::ToUnsigned( Value(), value )) { return XML_SUCCESS; diff --git a/tinyxml2.h b/tinyxml2.h index 7586f7b..2baad3a 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1209,9 +1209,9 @@ public: in the provided parameter. The function will return XML_SUCCESS on success, and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. */ - XMLError QueryIntValue( int* value ) const; + XMLError QueryIntValue( int32_t* value ) const; /// See QueryIntValue - XMLError QueryUnsignedValue( unsigned int* value ) const; + XMLError QueryUnsignedValue( uint32_t* value ) const; /// See QueryIntValue XMLError QueryInt64Value(int64_t* value) const; /// See QueryIntValue From 5d219c893bcf1fee70d54e34397964550e6e880c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:21:27 +0200 Subject: [PATCH 02/16] Update attribute query functions to use int32_t and uint32_t types. - Changed QueryIntAttribute parameter type from int* to int32_t* - Changed QueryUnsignedAttribute parameter type from unsigned int* to uint32_t* --- tinyxml2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.h b/tinyxml2.h index 2baad3a..120a0c6 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1343,7 +1343,7 @@ public: QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 @endverbatim */ - XMLError QueryIntAttribute( const char* name, int* value ) const { + XMLError QueryIntAttribute( const char* name, int32_t* value ) const { const XMLAttribute* a = FindAttribute( name ); if ( !a ) { return XML_NO_ATTRIBUTE; @@ -1352,7 +1352,7 @@ public: } /// See QueryIntAttribute() - XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const { + XMLError QueryUnsignedAttribute( const char* name, uint32_t* value ) const { const XMLAttribute* a = FindAttribute( name ); if ( !a ) { return XML_NO_ATTRIBUTE; From 574c760b7f3a50694d7254ff8c9976601f07384b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:22:25 +0200 Subject: [PATCH 03/16] Update attribute query functions to use int32_t and uint32_t types. - Changed QueryAttribute parameter type from int* to int32_t* - Changed QueryAttribute parameter type from unsigned int* to uint32_t* --- tinyxml2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.h b/tinyxml2.h index 120a0c6..60ae3b6 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1432,11 +1432,11 @@ public: QueryAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 @endverbatim */ - XMLError QueryAttribute( const char* name, int* value ) const { + XMLError QueryAttribute( const char* name, int32_t* value ) const { return QueryIntAttribute( name, value ); } - XMLError QueryAttribute( const char* name, unsigned int* value ) const { + XMLError QueryAttribute( const char* name, uint32_t* value ) const { return QueryUnsignedAttribute( name, value ); } From 095a8ffa42ad8d9bd6fd941267e16da251d12c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:24:09 +0200 Subject: [PATCH 04/16] Update IntValue and UnsignedValue to use int32_t and uint32_t types. This change ensures consistent integer handling throughout the codebase. --- tinyxml2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.h b/tinyxml2.h index 60ae3b6..0e09eca 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1162,8 +1162,8 @@ public: If the value isn't an integer, 0 will be returned. There is no error checking; use QueryIntValue() if you need error checking. */ - int IntValue() const { - int i = 0; + int32_t IntValue() const { + int32_t i = 0; QueryIntValue(&i); return i; } @@ -1181,8 +1181,8 @@ public: } /// Query as an unsigned integer. See IntValue() - unsigned UnsignedValue() const { - unsigned i=0; + uint32_t UnsignedValue() const { + uint32_t i=0; QueryUnsignedValue( &i ); return i; } From 668fd8125604446511a4626bf2bc51600f43766c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:31:58 +0200 Subject: [PATCH 05/16] Update attribute types to int32_t and uint32_t for better consistency and clarity. Update attribute types to int32_t and uint32_t for better consistency and clarity. Changed attribute types to int32_t and uint32_t for IntAttribute and UnsignedAttribute methods in both .cpp and .h files. --- tinyxml2.cpp | 8 ++++---- tinyxml2.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 2e33d08..4e50064 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1644,16 +1644,16 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const return 0; } -int XMLElement::IntAttribute(const char* name, int defaultValue) const +int32_t XMLElement::IntAttribute(const char* name, int defaultValue) const { - int i = defaultValue; + int32_t i = defaultValue; QueryIntAttribute(name, &i); return i; } -unsigned XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const +uint32_t XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const { - unsigned i = defaultValue; + uint32_t i = defaultValue; QueryUnsignedAttribute(name, &i); return i; } diff --git a/tinyxml2.h b/tinyxml2.h index 0e09eca..96fa334 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1316,9 +1316,9 @@ public: or if there is an error. (For a method with error checking, see QueryIntAttribute()). */ - int IntAttribute(const char* name, int defaultValue = 0) const; + int32_t IntAttribute(const char* name, int defaultValue = 0) const; /// See IntAttribute() - unsigned UnsignedAttribute(const char* name, unsigned defaultValue = 0) const; + uint32_t UnsignedAttribute(const char* name, unsigned defaultValue = 0) const; /// See IntAttribute() int64_t Int64Attribute(const char* name, int64_t defaultValue = 0) const; /// See IntAttribute() 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 06/16] 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 ); From e269b2e91ff4310e0802a3c2fdfa483422099474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:53:44 +0200 Subject: [PATCH 07/16] Update QueryIntText and QueryUnsignedText functions to use int32_t and uint32_t types instead of int and unsigned in tinyxml2.cpp and tinyxml2.h. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 5108bae..8112ec8 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1777,7 +1777,7 @@ void XMLElement::SetText( double v ) } -XMLError XMLElement::QueryIntText( int* ival ) const +XMLError XMLElement::QueryIntText( int32_t* ival ) const { if ( FirstChild() && FirstChild()->ToText() ) { const char* t = FirstChild()->Value(); @@ -1790,7 +1790,7 @@ XMLError XMLElement::QueryIntText( int* ival ) const } -XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const +XMLError XMLElement::QueryUnsignedText( uint32_t* uval ) const { if ( FirstChild() && FirstChild()->ToText() ) { const char* t = FirstChild()->Value(); diff --git a/tinyxml2.h b/tinyxml2.h index dd3185a..5a8c451 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1626,9 +1626,9 @@ public: to the requested type, and XML_NO_TEXT_NODE if there is no child text to query. */ - XMLError QueryIntText( int* ival ) const; + XMLError QueryIntText( int32_t* ival ) const; /// See QueryIntText() - XMLError QueryUnsignedText( unsigned* uval ) const; + XMLError QueryUnsignedText( uint32_t* uval ) const; /// See QueryIntText() XMLError QueryInt64Text(int64_t* uval) const; /// See QueryIntText() From 8fed517e5db95854c49e26f1c2feeb3ae736c6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 19:53:50 +0200 Subject: [PATCH 08/16] Update SetText method parameters to use int32_t and uint32_t. This change updates the SetText method in both the .cpp and .h files to use int32_t and uint32_t types for better consistency and clarity. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 8112ec8..1f7f392 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1723,7 +1723,7 @@ void XMLElement::SetText( const char* inText ) } -void XMLElement::SetText( int v ) +void XMLElement::SetText( int32_t v ) { char buf[BUF_SIZE]; XMLUtil::ToStr( v, buf, BUF_SIZE ); @@ -1731,7 +1731,7 @@ void XMLElement::SetText( int v ) } -void XMLElement::SetText( unsigned v ) +void XMLElement::SetText( uint32_t v ) { char buf[BUF_SIZE]; XMLUtil::ToStr( v, buf, BUF_SIZE ); diff --git a/tinyxml2.h b/tinyxml2.h index 5a8c451..66c8b36 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1586,9 +1586,9 @@ public: */ void SetText( const char* inText ); /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( int value ); + void SetText( int32_t value ); /// Convenience method for setting text inside an element. See SetText() for important limitations. - void SetText( unsigned value ); + void SetText( uint32_t value ); /// Convenience method for setting text inside an element. See SetText() for important limitations. void SetText(int64_t value); /// Convenience method for setting text inside an element. See SetText() for important limitations. From ef185a8f85e45bb9c9a2267017150b87052b2858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:05:52 +0200 Subject: [PATCH 09/16] Update PushText functions to use specific integer types The commit changes the PushText functions in both the .cpp and .h files to utilize int32_t and uint32_t instead of int and unsigned for better type specificity. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 1f7f392..d5609a2 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -2895,7 +2895,7 @@ void XMLPrinter::PushText( uint64_t value ) } -void XMLPrinter::PushText( int value ) +void XMLPrinter::PushText( int32_t value ) { char buf[BUF_SIZE]; XMLUtil::ToStr( value, buf, BUF_SIZE ); @@ -2903,7 +2903,7 @@ void XMLPrinter::PushText( int value ) } -void XMLPrinter::PushText( unsigned value ) +void XMLPrinter::PushText( uint32_t value ) { char buf[BUF_SIZE]; XMLUtil::ToStr( value, buf, BUF_SIZE ); diff --git a/tinyxml2.h b/tinyxml2.h index 66c8b36..07089d1 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -2270,9 +2270,9 @@ public: /// Add a text node. void PushText( const char* text, bool cdata=false ); /// Add a text node from an integer. - void PushText( int value ); + void PushText( int32_t value ); /// Add a text node from an unsigned. - void PushText( unsigned value ); + void PushText( uint32_t value ); /// Add a text node from a signed 64bit integer. void PushText( int64_t value ); /// Add a text node from an unsigned 64bit integer. From a151353f3a5d16e7acda22f88313e4712da092bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:08:50 +0200 Subject: [PATCH 10/16] Update integer to string conversion functions for different data types. - Changed formatting from %d to %ld for int32_t. - Changed formatting from %u to %lu for uint32_t. alternatively use the PRI Macros there. --- tinyxml2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index d5609a2..ad4b655 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -565,13 +565,13 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) void XMLUtil::ToStr( int32_t v, char* buffer, int bufferSize ) { - TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); + TIXML_SNPRINTF( buffer, bufferSize, "%ld", v ); } void XMLUtil::ToStr( uint32_t v, char* buffer, int bufferSize ) { - TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); + TIXML_SNPRINTF( buffer, bufferSize, "%lu", v ); } From afb8fabf58aac429452aecf9c7dc7051deadfcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:13:48 +0200 Subject: [PATCH 11/16] Update integer parsing to use long type and unsigned parsing to use unsigned long type for better compatibility with different platforms. Update integer parsing to use long type and unsigned parsing to use unsigned long type for better compatibility with different platforms. Alternatively, use the PRI Macros there. alternatively use the PRI Macros there. --- tinyxml2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index ad4b655..ce0c9fa 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -618,7 +618,7 @@ bool XMLUtil::ToInt(const char* str, int* value) } } else { - if (TIXML_SSCANF(str, "%d", value) == 1) { + if (TIXML_SSCANF(str, "%ld", value) == 1) { return true; } } @@ -627,7 +627,7 @@ bool XMLUtil::ToInt(const char* str, int* value) bool XMLUtil::ToUnsigned(const char* str, unsigned* value) { - if (TIXML_SSCANF(str, IsPrefixHex(str) ? "%x" : "%u", value) == 1) { + if (TIXML_SSCANF(str, IsPrefixHex(str) ? "%x" : "%lu", value) == 1) { return true; } return false; From 42875a9f60bd23882334891278339244539bda13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:16:20 +0200 Subject: [PATCH 12/16] Update data type in ToBool function for better clarity and consistency. - Change int to int32_t in the ToBool function for improved data type clarity. --- tinyxml2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index ce0c9fa..3ea4f4f 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -635,7 +635,7 @@ bool XMLUtil::ToUnsigned(const char* str, unsigned* value) bool XMLUtil::ToBool( const char* str, bool* value ) { - int ival = 0; + int32_t ival = 0; if ( ToInt( str, &ival )) { *value = (ival==0) ? false : true; return true; From 693052afe4ef0e273f9b03f09a38220ef424c57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:19:13 +0200 Subject: [PATCH 13/16] Update integer types to int32_t and uint32_t for better clarity and consistency. --- tinyxml2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 3ea4f4f..abb7f40 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1869,14 +1869,14 @@ XMLError XMLElement::QueryFloatText( float* fval ) const int XMLElement::IntText(int defaultValue) const { - int i = defaultValue; + int32_t i = defaultValue; QueryIntText(&i); return i; } unsigned XMLElement::UnsignedText(unsigned defaultValue) const { - unsigned i = defaultValue; + uint32_t i = defaultValue; QueryUnsignedText(&i); return i; } From 5e27269c044e66150395c251c18201837336ca67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:27:26 +0200 Subject: [PATCH 14/16] Update attribute setting functions to use specific integer types The commit changes the attribute setting functions in both the .cpp and .h files to use int32_t and uint32_t instead of int and unsigned for better type specificity. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index abb7f40..f86634c 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1550,7 +1550,7 @@ void XMLAttribute::SetAttribute( const char* v ) } -void XMLAttribute::SetAttribute( int v ) +void XMLAttribute::SetAttribute( int32_t v ) { char buf[BUF_SIZE]; XMLUtil::ToStr( v, buf, BUF_SIZE ); @@ -1558,7 +1558,7 @@ void XMLAttribute::SetAttribute( int v ) } -void XMLAttribute::SetAttribute( unsigned v ) +void XMLAttribute::SetAttribute( uint32_t v ) { char buf[BUF_SIZE]; XMLUtil::ToStr( v, buf, BUF_SIZE ); diff --git a/tinyxml2.h b/tinyxml2.h index 07089d1..a9c99f9 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1226,9 +1226,9 @@ public: /// Set the attribute to a string value. void SetAttribute( const char* value ); /// Set the attribute to value. - void SetAttribute( int value ); + void SetAttribute(int32_t value ); /// Set the attribute to value. - void SetAttribute( unsigned value ); + void SetAttribute( uint32_t value ); /// Set the attribute to value. void SetAttribute(int64_t value); /// Set the attribute to value. From 53d8ec5573166f081c4a02b035807258b07b1ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:28:46 +0200 Subject: [PATCH 15/16] Update attribute setting functions to use specific integer types The commit updates attribute setting functions to use int32_t and uint32_t types for better clarity and consistency. --- tinyxml2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinyxml2.h b/tinyxml2.h index a9c99f9..5c165a0 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -1470,12 +1470,12 @@ public: a->SetAttribute( value ); } /// Sets the named attribute to value. - void SetAttribute( const char* name, int value ) { + void SetAttribute( const char* name, int32_t value ) { XMLAttribute* a = FindOrCreateAttribute( name ); a->SetAttribute( value ); } /// Sets the named attribute to value. - void SetAttribute( const char* name, unsigned value ) { + void SetAttribute( const char* name, uint32_t value ) { XMLAttribute* a = FindOrCreateAttribute( name ); a->SetAttribute( value ); } From 8df9b25bb9faaede71c1cf0e21511529fc9133f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Thu, 30 May 2024 20:31:00 +0200 Subject: [PATCH 16/16] Update attribute handling to use int32_t and uint32_t types. The commit changes the attribute handling in the code to utilize int32_t and uint32_t types for better consistency and compatibility. --- tinyxml2.cpp | 4 ++-- tinyxml2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index f86634c..6b0312a 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -2777,7 +2777,7 @@ void XMLPrinter::PushAttribute( const char* name, const char* value ) } -void XMLPrinter::PushAttribute( const char* name, int v ) +void XMLPrinter::PushAttribute( const char* name, int32_t v ) { char buf[BUF_SIZE]; XMLUtil::ToStr( v, buf, BUF_SIZE ); @@ -2785,7 +2785,7 @@ void XMLPrinter::PushAttribute( const char* name, int v ) } -void XMLPrinter::PushAttribute( const char* name, unsigned v ) +void XMLPrinter::PushAttribute( const char* name, uint32_t v ) { char buf[BUF_SIZE]; XMLUtil::ToStr( v, buf, BUF_SIZE ); diff --git a/tinyxml2.h b/tinyxml2.h index 5c165a0..87e989b 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -2258,8 +2258,8 @@ public: void OpenElement( const char* name, bool compactMode=false ); /// If streaming, add an attribute to an open element. void PushAttribute( const char* name, const char* value ); - void PushAttribute( const char* name, int value ); - void PushAttribute( const char* name, unsigned value ); + void PushAttribute( const char* name, int32_t value ); + void PushAttribute( const char* name, uint32_t value ); void PushAttribute( const char* name, int64_t value ); void PushAttribute( const char* name, uint64_t value ); void PushAttribute( const char* name, bool value );