Просмотр исходного кода

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.

Franz Höpfinger 1 год назад
Родитель
Сommit
668fd81256
2 измененных файлов с 6 добавлено и 6 удалено
  1. 4 4
      tinyxml2.cpp
  2. 2 2
      tinyxml2.h

+ 4 - 4
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;
 }

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