Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed old-style-cast warnings #1008

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned char>(*p) ) ) {
return 0;
}

char* const start = p;
++p;
while ( *p && XMLUtil::IsNameChar( (unsigned char) *p ) ) {
while ( *p && XMLUtil::IsNameChar( static_cast<unsigned char>(*p) ) ) {
++p;
}

Expand Down Expand Up @@ -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<uint64_t>(v);
return true;
}
return false;
Expand Down Expand Up @@ -1977,7 +1977,7 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr )
}

// attribute.
if (XMLUtil::IsNameStartChar( (unsigned char) *p ) ) {
if (XMLUtil::IsNameStartChar( static_cast<unsigned char>(*p) ) ) {
XMLAttribute* attrib = CreateAttribute();
TIXMLASSERT( attrib );
attrib->_parseLineNum = _document->_parseCurLineNum;
Expand Down
Loading