1
0
mirror of https://github.com/leethomason/tinyxml2.git synced 2026-07-30 23:52:59 +04:00

Compare commits

..

9 Commits

Author SHA1 Message Date
Lee Thomason b2dea344ad remove dead platforms 2026-03-09 17:52:37 -07:00
Lee Thomason 111f462dc4 remove old comments 2026-03-09 17:41:19 -07:00
Lee Thomason 3324d04d58 minor readme fixes (#1054) 2025-11-22 16:26:53 -08:00
LuridHound c4e29afeaf Fix issue 1000 (#1040)
* fix compilation warnings produced by -Wold-style-cast

* remove incorrect cast
2025-11-22 16:08:17 -08:00
Lee Thomason 5c9a452c73 Merge fallthrough to cpp (#1052)
Fix warnings on merge fallthroughs
2025-11-22 16:02:49 -08:00
Lee Thomason 2722500313 Merge pull request #1043 from gruenich/feature/replace-c-style-casts
Replace C-style casts
2025-11-22 15:38:08 -08:00
Christoph Grüninger b5e767a6b9 Fix more warnings for C-style casts
Use static_cast or reinterpret_cast.
Found by g++ 15.
2025-07-26 23:08:21 +02:00
Lurend e186491558 fix compilation warnings produced by -Wold-style-cast 2025-07-26 14:26:04 +02:00
Lee Thomason 36ff404c34 Update yaml file
Update yaml file
2025-07-09 20:54:23 -07:00
4 changed files with 60 additions and 81 deletions
+4 -4
View File
@@ -59,7 +59,7 @@ browsers or have more complete XML needs, TinyXML-2 is not the parser for you.
TinyXML-1 vs. TinyXML-2 TinyXML-1 vs. TinyXML-2
----------------------- -----------------------
TinyXML-2 long been the focus of all development. It is well tested TinyXML-2 has long been the focus of all development. It is well tested
and should be used instead of TinyXML-1. and should be used instead of TinyXML-1.
TinyXML-2 uses a similar API to TinyXML-1 and the same TinyXML-2 uses a similar API to TinyXML-1 and the same
@@ -145,7 +145,7 @@ It essentially causes the XML to be parsed twice.
For applications that need to know about text nodes that are composed entirely of For applications that need to know about text nodes that are composed entirely of
whitespace, PEDANTIC_WHITESPACE is available. PEDANTIC_WHITESPACE maintains all the whitespace, PEDANTIC_WHITESPACE is available. PEDANTIC_WHITESPACE maintains all the
whilespace between elements. whitespace between elements.
PEDANTIC_WHITESPACE is a new mode and not as tested as the other whitespace modes. PEDANTIC_WHITESPACE is a new mode and not as tested as the other whitespace modes.
@@ -178,7 +178,7 @@ will have the Value() of "Far & Away" when queried from the XMLText object,
and will be written back to the XML stream/file as an ampersand. and will be written back to the XML stream/file as an ampersand.
Additionally, any character can be specified by its Unicode code point: Additionally, any character can be specified by its Unicode code point:
The syntax ` ` or ` ` are both to the non-breaking space character. The syntax ` ` or ` ` both refer to the non-breaking space character.
This is called a 'numeric character reference'. Any numeric character reference This is called a 'numeric character reference'. Any numeric character reference
that isn't one of the special entities above, will be read, but written as a that isn't one of the special entities above, will be read, but written as a
regular code point. The output is correct, but the entity syntax isn't preserved. regular code point. The output is correct, but the entity syntax isn't preserved.
@@ -270,7 +270,7 @@ tinyxml2.h files in your project and build with your other source code.
There is also a CMake build included. CMake is the general build for TinyXML-2. There is also a CMake build included. CMake is the general build for TinyXML-2.
(Additional build systems are costly to maintain, and tend to bit-rot. They are (Additional build systems are costly to maintain, and tend to become outdated. They are
being removed over time.) being removed over time.)
Building TinyXML-2 - Using vcpkg Building TinyXML-2 - Using vcpkg
+31 -41
View File
@@ -24,7 +24,7 @@ distribution.
#include "tinyxml2.h" #include "tinyxml2.h"
#include <new> // yes, this one new style header, is in the Android SDK. #include <new> // yes, this one new style header, is in the Android SDK.
#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) || defined(__CC_ARM) #if defined(ANDROID_NDK)
# include <stddef.h> # include <stddef.h>
# include <stdarg.h> # include <stdarg.h>
#else #else
@@ -32,15 +32,27 @@ distribution.
# include <cstdarg> # include <cstdarg>
#endif #endif
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) // Handle fallthrough attribute for different compilers
// Microsoft Visual Studio, version 2005 and higher. Not WinCE. #ifndef __has_attribute
/*int _snprintf_s( # define __has_attribute(x) 0
char *buffer, #endif
size_t sizeOfBuffer, #ifndef __has_cpp_attribute
size_t count, # define __has_cpp_attribute(x) 0
const char *format [, #endif
argument] ...
);*/ #if (__cplusplus >= 201703L && __has_cpp_attribute(fallthrough))
# define TIXML_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
# define TIXML_FALLTHROUGH [[clang::fallthrough]]
#elif __has_attribute(fallthrough)
# define TIXML_FALLTHROUGH __attribute__((fallthrough))
#else
# define TIXML_FALLTHROUGH (void(0))
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
// Microsoft Visual Studio, version 2005 and higher.
static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... ) static inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
{ {
va_list va; va_list va;
@@ -59,33 +71,11 @@ distribution.
#define TIXML_VSCPRINTF _vscprintf #define TIXML_VSCPRINTF _vscprintf
#define TIXML_SSCANF sscanf_s #define TIXML_SSCANF sscanf_s
#elif defined _MSC_VER #elif defined _MSC_VER
// Microsoft Visual Studio 2003 and earlier or WinCE // Microsoft Visual Studio 2003 and earlier.
#define TIXML_SNPRINTF _snprintf #define TIXML_SNPRINTF _snprintf
#define TIXML_VSNPRINTF _vsnprintf #define TIXML_VSNPRINTF _vsnprintf
#define TIXML_SSCANF sscanf #define TIXML_SSCANF sscanf
#if (_MSC_VER < 1400 ) && (!defined WINCE) #define TIXML_VSCPRINTF _vscprintf
// Microsoft Visual Studio 2003 and not WinCE.
#define TIXML_VSCPRINTF _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have.
#else
// Microsoft Visual Studio 2003 and earlier or WinCE.
static inline int TIXML_VSCPRINTF( const char* format, va_list va )
{
int len = 512;
for (;;) {
len = len*2;
char* str = new char[len]();
const int required = _vsnprintf(str, len, format, va);
delete[] str;
if ( required != -1 ) {
TIXMLASSERT( required >= 0 );
len = required;
break;
}
}
TIXMLASSERT( len >= 0 );
return len;
}
#endif
#else #else
// GCC version 3 and higher // GCC version 3 and higher
//#warning( "Using sn* functions." ) //#warning( "Using sn* functions." )
@@ -100,7 +90,7 @@ distribution.
#define TIXML_SSCANF sscanf #define TIXML_SSCANF sscanf
#endif #endif
#if defined(_WIN64) #if defined(_MSC_VER)
#define TIXML_FSEEK _fseeki64 #define TIXML_FSEEK _fseeki64
#define TIXML_FTELL _ftelli64 #define TIXML_FTELL _ftelli64
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__CYGWIN__) #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__CYGWIN__)
@@ -446,17 +436,17 @@ void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length
--output; --output;
*output = static_cast<char>((input | BYTE_MARK) & BYTE_MASK); *output = static_cast<char>((input | BYTE_MARK) & BYTE_MASK);
input >>= 6; input >>= 6;
//fall through TIXML_FALLTHROUGH;
case 3: case 3:
--output; --output;
*output = static_cast<char>((input | BYTE_MARK) & BYTE_MASK); *output = static_cast<char>((input | BYTE_MARK) & BYTE_MASK);
input >>= 6; input >>= 6;
//fall through TIXML_FALLTHROUGH;
case 2: case 2:
--output; --output;
*output = static_cast<char>((input | BYTE_MARK) & BYTE_MASK); *output = static_cast<char>((input | BYTE_MARK) & BYTE_MASK);
input >>= 6; input >>= 6;
//fall through TIXML_FALLTHROUGH;
case 1: case 1:
--output; --output;
*output = static_cast<char>(input | FIRST_BYTE_MARK[*length]); *output = static_cast<char>(input | FIRST_BYTE_MARK[*length]);
@@ -2236,7 +2226,7 @@ void XMLDocument::Clear()
delete [] _charBuffer; delete [] _charBuffer;
_charBuffer = 0; _charBuffer = 0;
_parsingDepth = 0; _parsingDepth = 0;
#if 0 #if 0
_textPool.Trace( "text" ); _textPool.Trace( "text" );
_elementPool.Trace( "element" ); _elementPool.Trace( "element" );
@@ -2311,7 +2301,7 @@ static FILE* callfopen( const char* filepath, const char* mode )
{ {
TIXMLASSERT( filepath ); TIXMLASSERT( filepath );
TIXMLASSERT( mode ); TIXMLASSERT( mode );
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE) #if defined(_MSC_VER) && (_MSC_VER >= 1400)
FILE* fp = 0; FILE* fp = 0;
const errno_t err = fopen_s( &fp, filepath, mode ); const errno_t err = fopen_s( &fp, filepath, mode );
if ( err ) { if ( err ) {
@@ -2635,7 +2625,7 @@ void XMLPrinter::Write( const char* data, size_t size )
fwrite ( data , sizeof(char), size, _fp); fwrite ( data , sizeof(char), size, _fp);
} }
else { else {
char* p = _buffer.PushArr( static_cast<int>(size) ) - 1; // back up over the null terminator. char* p = _buffer.PushArr( size ) - 1; // back up over the null terminator.
memcpy( p, data, size ); memcpy( p, data, size );
p[size] = 0; p[size] = 0;
} }
+1 -12
View File
@@ -24,15 +24,12 @@ distribution.
#ifndef TINYXML2_INCLUDED #ifndef TINYXML2_INCLUDED
#define TINYXML2_INCLUDED #define TINYXML2_INCLUDED
#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) #if defined(ANDROID_NDK)
# include <ctype.h> # include <ctype.h>
# include <limits.h> # include <limits.h>
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
# include <string.h> # include <string.h>
# if defined(__PS3__)
# include <stddef.h>
# endif
#else #else
# include <cctype> # include <cctype>
# include <climits> # include <climits>
@@ -42,14 +39,6 @@ distribution.
#endif #endif
#include <stdint.h> #include <stdint.h>
/*
gcc:
g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe
Formatting, Artistic Style:
AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h
*/
#if defined( _DEBUG ) || defined (__DEBUG__) #if defined( _DEBUG ) || defined (__DEBUG__)
# ifndef TINYXML2_DEBUG # ifndef TINYXML2_DEBUG
# define TINYXML2_DEBUG # define TINYXML2_DEBUG
+24 -24
View File
@@ -324,9 +324,9 @@ int main( int argc, const char ** argv )
printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID ); printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID );
if ( !errorID ) { if ( !errorID ) {
printf( "Load time=%u\n", (unsigned)(loadTime - startTime) ); printf( "Load time=%u\n", static_cast<unsigned>(loadTime - startTime) );
printf( "Delete time=%u\n", (unsigned)(deleteTime - loadTime) ); printf( "Delete time=%u\n", static_cast<unsigned>(deleteTime - loadTime) );
printf( "Total time=%u\n", (unsigned)(deleteTime - startTime) ); printf( "Total time=%u\n", static_cast<unsigned>(deleteTime - startTime) );
} }
exit(0); exit(0);
} }
@@ -595,8 +595,8 @@ int main( int argc, const char ** argv )
result = ele->QueryDoubleAttribute( "attr0", &dVal ); result = ele->QueryDoubleAttribute( "attr0", &dVal );
XMLTest( "Query attribute: int as double", XML_SUCCESS, result); XMLTest( "Query attribute: int as double", XML_SUCCESS, result);
XMLTest( "Query attribute: int as double", 1, (int)dVal ); XMLTest( "Query attribute: int as double", 1, static_cast<int>(dVal) );
XMLTest( "Query attribute: int as double", 1, (int)ele->DoubleAttribute("attr0")); XMLTest( "Query attribute: int as double", 1, static_cast<int>(ele->DoubleAttribute("attr0")));
result = ele->QueryDoubleAttribute( "attr1", &dVal ); result = ele->QueryDoubleAttribute( "attr1", &dVal );
XMLTest( "Query attribute: double as double", XML_SUCCESS, result); XMLTest( "Query attribute: double as double", XML_SUCCESS, result);
@@ -648,17 +648,17 @@ int main( int argc, const char ** argv )
{ {
XMLError queryResult = ele->QueryAttribute( "int", &iVal2 ); XMLError queryResult = ele->QueryAttribute( "int", &iVal2 );
XMLTest( "Query int attribute generic", (int)XML_SUCCESS, queryResult); XMLTest( "Query int attribute generic", static_cast<int>(XML_SUCCESS), queryResult);
} }
{ {
XMLError queryResult = ele->QueryAttribute( "double", &dVal2 ); XMLError queryResult = ele->QueryAttribute( "double", &dVal2 );
XMLTest( "Query double attribute generic", (int)XML_SUCCESS, queryResult); XMLTest( "Query double attribute generic", static_cast<int>(XML_SUCCESS), queryResult);
} }
XMLTest( "Attribute match test", "strValue", ele->Attribute( "str", "strValue" ) ); XMLTest( "Attribute match test", "strValue", ele->Attribute( "str", "strValue" ) );
XMLTest( "Attribute round trip. c-string.", "strValue", cStr ); XMLTest( "Attribute round trip. c-string.", "strValue", cStr );
XMLTest( "Attribute round trip. int.", 1, iVal ); XMLTest( "Attribute round trip. int.", 1, iVal );
XMLTest( "Attribute round trip. double.", -1, (int)dVal ); XMLTest( "Attribute round trip. double.", -1, static_cast<int>(dVal) );
XMLTest( "Alternate query", true, iVal == iVal2 ); XMLTest( "Alternate query", true, iVal == iVal2 );
XMLTest( "Alternate query", true, dVal == dVal2 ); XMLTest( "Alternate query", true, dVal == dVal2 );
XMLTest( "Alternate query", true, iVal == ele->IntAttribute("int") ); XMLTest( "Alternate query", true, iVal == ele->IntAttribute("int") );
@@ -675,7 +675,7 @@ int main( int argc, const char ** argv )
const unsigned char correctValue[] = { 0xd1U, 0x86U, 0xd0U, 0xb5U, 0xd0U, 0xbdU, 0xd0U, 0xbdU, const unsigned char correctValue[] = { 0xd1U, 0x86U, 0xd0U, 0xb5U, 0xd0U, 0xbdU, 0xd0U, 0xbdU,
0xd0U, 0xbeU, 0xd1U, 0x81U, 0xd1U, 0x82U, 0xd1U, 0x8cU, 0 }; 0xd0U, 0xbeU, 0xd1U, 0x81U, 0xd1U, 0x82U, 0xd1U, 0x8cU, 0 };
XMLTest( "UTF-8: Russian value.", (const char*)correctValue, element->Attribute( "value" ) ); XMLTest( "UTF-8: Russian value.", reinterpret_cast<const char*>(correctValue), element->Attribute( "value" ) );
const unsigned char russianElementName[] = { 0xd0U, 0xa0U, 0xd1U, 0x83U, const unsigned char russianElementName[] = { 0xd0U, 0xa0U, 0xd1U, 0x83U,
0xd1U, 0x81U, 0xd1U, 0x81U, 0xd1U, 0x81U, 0xd1U, 0x81U,
@@ -683,7 +683,7 @@ int main( int argc, const char ** argv )
0xd0U, 0xb9U, 0 }; 0xd0U, 0xb9U, 0 };
const char russianText[] = "<\xD0\xB8\xD0\xBC\xD0\xB5\xD0\xB5\xD1\x82>"; const char russianText[] = "<\xD0\xB8\xD0\xBC\xD0\xB5\xD0\xB5\xD1\x82>";
XMLText* text = doc.FirstChildElement( "document" )->FirstChildElement( (const char*) russianElementName )->FirstChild()->ToText(); XMLText* text = doc.FirstChildElement( "document" )->FirstChildElement( reinterpret_cast<const char*>(russianElementName) )->FirstChild()->ToText();
XMLTest( "UTF-8: Browsing russian element name.", XMLTest( "UTF-8: Browsing russian element name.",
russianText, russianText,
text->Value() ); text->Value() );
@@ -824,7 +824,7 @@ int main( int argc, const char ** argv )
{ {
int v = 0; int v = 0;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: int", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: int", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: int", -100, v, true); XMLTest("Attribute: int", -100, v, true);
} }
XMLTest("Attribute: int", -100, element->IntAttribute("attrib"), true); XMLTest("Attribute: int", -100, element->IntAttribute("attrib"), true);
@@ -840,7 +840,7 @@ int main( int argc, const char ** argv )
{ {
unsigned v = 0; unsigned v = 0;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: unsigned", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: unsigned", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: unsigned", unsigned(100), v, true); XMLTest("Attribute: unsigned", unsigned(100), v, true);
} }
{ {
@@ -864,7 +864,7 @@ int main( int argc, const char ** argv )
{ {
int64_t v = 0; int64_t v = 0;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: int64_t", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: int64_t", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: int64_t", BIG, v, true); XMLTest("Attribute: int64_t", BIG, v, true);
} }
XMLTest("Attribute: int64_t", BIG, element->Int64Attribute("attrib"), true); XMLTest("Attribute: int64_t", BIG, element->Int64Attribute("attrib"), true);
@@ -880,7 +880,7 @@ int main( int argc, const char ** argv )
{ {
uint64_t v = 0; uint64_t v = 0;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: uint64_t", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: uint64_t", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: uint64_t", BIG_POS, v, true); XMLTest("Attribute: uint64_t", BIG_POS, v, true);
} }
XMLTest("Attribute: uint64_t", BIG_POS, element->Unsigned64Attribute("attrib"), true); XMLTest("Attribute: uint64_t", BIG_POS, element->Unsigned64Attribute("attrib"), true);
@@ -896,7 +896,7 @@ int main( int argc, const char ** argv )
{ {
bool v = false; bool v = false;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: bool", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: bool", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: bool", true, v, true); XMLTest("Attribute: bool", true, v, true);
} }
XMLTest("Attribute: bool", true, element->BoolAttribute("attrib"), true); XMLTest("Attribute: bool", true, element->BoolAttribute("attrib"), true);
@@ -924,7 +924,7 @@ int main( int argc, const char ** argv )
{ {
double v = 0; double v = 0;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: bool", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: bool", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: double", 100.0, v, true); XMLTest("Attribute: double", 100.0, v, true);
} }
XMLTest("Attribute: double", 100.0, element->DoubleAttribute("attrib"), true); XMLTest("Attribute: double", 100.0, element->DoubleAttribute("attrib"), true);
@@ -940,7 +940,7 @@ int main( int argc, const char ** argv )
{ {
float v = 0; float v = 0;
XMLError queryResult = element->QueryAttribute("attrib", &v); XMLError queryResult = element->QueryAttribute("attrib", &v);
XMLTest("Attribute: float", (int)XML_SUCCESS, queryResult, true); XMLTest("Attribute: float", static_cast<int>(XML_SUCCESS), queryResult, true);
XMLTest("Attribute: float", 100.0f, v, true); XMLTest("Attribute: float", 100.0f, v, true);
} }
XMLTest("Attribute: float", 100.0f, element->FloatAttribute("attrib"), true); XMLTest("Attribute: float", 100.0f, element->FloatAttribute("attrib"), true);
@@ -1068,15 +1068,15 @@ int main( int argc, const char ** argv )
unsigned unsigned_value; unsigned unsigned_value;
unsigned_value = root->FirstChildElement("unsigned")->UnsignedText(); unsigned_value = root->FirstChildElement("unsigned")->UnsignedText();
XMLTest("PushText( unsigned value ) test", (unsigned)12, unsigned_value); XMLTest("PushText( unsigned value ) test", static_cast<unsigned>(12), unsigned_value);
int64_t int64_t_value; int64_t int64_t_value;
int64_t_value = root->FirstChildElement("int64_t")->Int64Text(); int64_t_value = root->FirstChildElement("int64_t")->Int64Text();
XMLTest("PushText( int64_t value ) test", (int64_t) 13, int64_t_value); XMLTest("PushText( int64_t value ) test", static_cast<int64_t>(13), int64_t_value);
uint64_t uint64_t_value; uint64_t uint64_t_value;
uint64_t_value = root->FirstChildElement("uint64_t")->Unsigned64Text(); uint64_t_value = root->FirstChildElement("uint64_t")->Unsigned64Text();
XMLTest("PushText( uint64_t value ) test", (uint64_t) 14, uint64_t_value); XMLTest("PushText( uint64_t value ) test", static_cast<uint64_t>(14), uint64_t_value);
float float_value; float float_value;
float_value = root->FirstChildElement("float")->FloatText(); float_value = root->FirstChildElement("float")->FloatText();
@@ -1397,7 +1397,7 @@ int main( int argc, const char ** argv )
buf[61] = 0; buf[61] = 0;
XMLDocument doc; XMLDocument doc;
doc.Parse( (const char*)buf); doc.Parse( reinterpret_cast<const char*>(buf) );
XMLTest( "Broken CDATA", true, doc.Error() ); XMLTest( "Broken CDATA", true, doc.Error() );
} }
@@ -1753,7 +1753,7 @@ int main( int argc, const char ** argv )
unsigned unsignedValue = 0; unsigned unsignedValue = 0;
XMLError queryResult = pointElement->FirstChildElement( "y" )->QueryUnsignedText( &unsignedValue ); XMLError queryResult = pointElement->FirstChildElement( "y" )->QueryUnsignedText( &unsignedValue );
XMLTest( "QueryUnsignedText result", XML_SUCCESS, queryResult, false ); XMLTest( "QueryUnsignedText result", XML_SUCCESS, queryResult, false );
XMLTest( "QueryUnsignedText", (unsigned)1, unsignedValue, false ); XMLTest( "QueryUnsignedText", static_cast<unsigned>(1), unsignedValue, false );
} }
{ {
@@ -2779,9 +2779,9 @@ int main( int argc, const char ** argv )
#endif #endif
#if defined( _MSC_VER ) #if defined( _MSC_VER )
const double duration = 1000.0 * (double)(end - start) / ((double)freq * (double)COUNT); const double duration = 1000.0 * static_cast<double>(end - start) / (static_cast<double>(freq) * static_cast<double>(COUNT));
#else #else
const double duration = (double)(cend - cstart) / (double)COUNT; const double duration = static_cast<double>(cend - cstart) / static_cast<double>(COUNT);
#endif #endif
printf("\nParsing dream.xml (%s): %.3f milli-seconds\n", note, duration); printf("\nParsing dream.xml (%s): %.3f milli-seconds\n", note, duration);
} }