Kaynağa Gözat

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.
Franz Höpfinger 1 yıl önce
ebeveyn
işleme
5e27269c04
2 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 2 2
      tinyxml2.cpp
  2. 2 2
      tinyxml2.h

+ 2 - 2
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 );

+ 2 - 2
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.