From d6bd7360b80489852400a14862525cfaade649dd Mon Sep 17 00:00:00 2001 From: "Lee Thomason (grinliz)" Date: Sat, 11 May 2013 20:23:13 -0700 Subject: [PATCH] fix floating point specifier and clean up a warning --- tinyxml2.cpp | 4 ++-- xmltest.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index a6ec20a..c13713f 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -425,13 +425,13 @@ void XMLUtil::ToStr( bool v, char* buffer, int bufferSize ) void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) { - TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); + TIXML_SNPRINTF( buffer, bufferSize, "%f", v ); } void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) { - TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); + TIXML_SNPRINTF( buffer, bufferSize, "%f", v ); } diff --git a/xmltest.cpp b/xmltest.cpp index e7da311..abb2f1b 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -301,9 +301,9 @@ int main( int argc, const char ** argv ) printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID ); if ( !errorID ) { - printf( "Load time=%d\n", loadTime - startTime ); - printf( "Delete time=%d\n", deleteTime - loadTime ); - printf( "Total time=%d\n", deleteTime - startTime ); + printf( "Load time=%u\n", (unsigned)(loadTime - startTime) ); + printf( "Delete time=%u\n", (unsigned)(deleteTime - loadTime) ); + printf( "Total time=%u\n", (unsigned)(deleteTime - startTime) ); } exit(0); }