|
From: Keith M. <kei...@us...> - 2009-11-05 21:52:42
|
Update of /cvsroot/mingw/mingw-get/tinyxml In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10230 Modified Files: tinyxml.cpp tinyxml.h tinyxmlparser.cpp Log Message: Correct some identified TinyXML issues. Index: tinyxmlparser.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/tinyxml/tinyxmlparser.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tinyxmlparser.cpp 15 Aug 2008 02:45:34 -0000 1.1 --- tinyxmlparser.cpp 5 Nov 2009 21:52:29 -0000 1.2 *************** *** 23,30 **** */ - /* Modified: JohnE, 2008-08-09 - * Add parentheses to fix GCC -Wall warning - */ - #include <ctype.h> #include <stddef.h> --- 23,26 ---- *************** *** 351,355 **** } ! if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space. ++p; else --- 347,351 ---- } ! if ( IsWhiteSpace( *p ) ) ++p; else *************** *** 359,363 **** else { ! while ( ( *p && IsWhiteSpace( *p ) ) || *p == '\n' || *p =='\r' ) ++p; } --- 355,359 ---- else { ! while ( *p && IsWhiteSpace( *p ) ) ++p; } *************** *** 1451,1455 **** value = ""; while ( p && *p // existence ! && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace && *p != '/' && *p != '>' ) // tag end { --- 1447,1451 ---- value = ""; while ( p && *p // existence ! && !IsWhiteSpace( *p ) // whitespace && *p != '/' && *p != '>' ) // tag end { Index: tinyxml.h =================================================================== RCS file: /cvsroot/mingw/mingw-get/tinyxml/tinyxml.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tinyxml.h 15 Aug 2008 02:45:34 -0000 1.1 --- tinyxml.h 5 Nov 2009 21:52:29 -0000 1.2 *************** *** 291,294 **** --- 291,299 ---- inline static bool IsWhiteSpace( char c ) { + // FIXME: Explicit tests for '\n' and '\r' seem redundant here; + // POSIX requires isspace() to match both of these characters as + // white space anyway; is there any know implementation which + // does not comply with this requirement? + // return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); } Index: tinyxml.cpp =================================================================== RCS file: /cvsroot/mingw/mingw-get/tinyxml/tinyxml.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tinyxml.cpp 15 Aug 2008 02:45:33 -0000 1.1 --- tinyxml.cpp 5 Nov 2009 21:52:28 -0000 1.2 *************** *** 1267,1273 **** char buf [256]; #if defined(TIXML_SNPRINTF) ! TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); #else ! sprintf (buf, "%lf", _value); #endif SetValue (buf); --- 1267,1273 ---- char buf [256]; #if defined(TIXML_SNPRINTF) ! TIXML_SNPRINTF( buf, sizeof(buf), "%f", _value); #else ! sprintf (buf, "%f", _value); #endif SetValue (buf); |