From 162bd4e9256e3c7cf3c8da4bbd43367b4b95c8a3 Mon Sep 17 00:00:00 2001 From: Albert Hung Date: Mon, 2 Dec 2024 13:47:07 +0800 Subject: [PATCH] Fixed -Wold-style-cast warnings Fixed old-style-cast warnings --- tinyxml2.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 0fed8dc..1605999 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -234,13 +234,13 @@ char* StrPair::ParseName( char* p ) if ( !p || !(*p) ) { return 0; } - if ( !XMLUtil::IsNameStartChar( (unsigned char) *p ) ) { + if ( !XMLUtil::IsNameStartChar( static_cast(*p) ) ) { return 0; } char* const start = p; ++p; - while ( *p && XMLUtil::IsNameChar( (unsigned char) *p ) ) { + while ( *p && XMLUtil::IsNameChar( static_cast(*p) ) ) { ++p; } @@ -700,7 +700,7 @@ bool XMLUtil::ToInt64(const char* str, int64_t* value) bool XMLUtil::ToUnsigned64(const char* str, uint64_t* value) { unsigned long long v = 0; // horrible syntax trick to make the compiler happy about %llu if(TIXML_SSCANF(str, IsPrefixHex(str) ? "%llx" : "%llu", &v) == 1) { - *value = (uint64_t)v; + *value = static_cast(v); return true; } return false; @@ -1977,7 +1977,7 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) } // attribute. - if (XMLUtil::IsNameStartChar( (unsigned char) *p ) ) { + if (XMLUtil::IsNameStartChar( static_cast(*p) ) ) { XMLAttribute* attrib = CreateAttribute(); TIXMLASSERT( attrib ); attrib->_parseLineNum = _document->_parseCurLineNum;