• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Installation Manager Tool


Commit MetaInfo

Révision97d42169a25486cca7cdb9fa5d84d2d96ec7d17f (tree)
l'heure2009-11-06 06:53:19
AuteurKeith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Message de Log

Correct some identified TinyXML issues.

Change Summary

Modification

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
1+2009-11-05 Keith Marshall <keithmarshall@users.sourceforge.net>
2+
3+ Correct some identified TinyXML issues.
4+
5+ * tinyxml/tinyxml.h (IsWhiteSpace): Add FIXME annotation to flag
6+ probable redundancy of checks for '\n' and '\r'.
7+ * tinyxml/tinyxmlparser.cpp: Revert John E's 2008-08-09 change; remove
8+ all such redundancies in IsWhiteSpace() calls throughout.
9+
10+ * tinyxml/tinyxml.cpp (TiXmlAttribute::SetDoubleValue): Correct format
11+ specification in sprintf()/snprintf() calls; "%lf" is invalid; replace
12+ with "%f".
13+
114 2009-10-31 Keith Marshall <keithmarshall@users.sourceforge.net>
215
316 Add CLI loader stub.
--- a/tinyxml/tinyxml.cpp
+++ b/tinyxml/tinyxml.cpp
@@ -1266,9 +1266,9 @@ void TiXmlAttribute::SetDoubleValue( double _value )
12661266 {
12671267 char buf [256];
12681268 #if defined(TIXML_SNPRINTF)
1269- TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value);
1269+ TIXML_SNPRINTF( buf, sizeof(buf), "%f", _value);
12701270 #else
1271- sprintf (buf, "%lf", _value);
1271+ sprintf (buf, "%f", _value);
12721272 #endif
12731273 SetValue (buf);
12741274 }
--- a/tinyxml/tinyxml.h
+++ b/tinyxml/tinyxml.h
@@ -290,6 +290,11 @@ protected:
290290 static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
291291 inline static bool IsWhiteSpace( char c )
292292 {
293+ // FIXME: Explicit tests for '\n' and '\r' seem redundant here;
294+ // POSIX requires isspace() to match both of these characters as
295+ // white space anyway; is there any know implementation which
296+ // does not comply with this requirement?
297+ //
293298 return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
294299 }
295300 inline static bool IsWhiteSpace( int c )
--- a/tinyxml/tinyxmlparser.cpp
+++ b/tinyxml/tinyxmlparser.cpp
@@ -22,10 +22,6 @@ must not be misrepresented as being the original software.
2222 distribution.
2323 */
2424
25-/* Modified: JohnE, 2008-08-09
26- * Add parentheses to fix GCC -Wall warning
27- */
28-
2925 #include <ctype.h>
3026 #include <stddef.h>
3127
@@ -350,7 +346,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
350346 continue;
351347 }
352348
353- if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space.
349+ if ( IsWhiteSpace( *p ) )
354350 ++p;
355351 else
356352 break;
@@ -358,7 +354,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
358354 }
359355 else
360356 {
361- while ( ( *p && IsWhiteSpace( *p ) ) || *p == '\n' || *p =='\r' )
357+ while ( *p && IsWhiteSpace( *p ) )
362358 ++p;
363359 }
364360
@@ -1450,7 +1446,7 @@ const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlE
14501446 // its best, even without them.
14511447 value = "";
14521448 while ( p && *p // existence
1453- && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace
1449+ && !IsWhiteSpace( *p ) // whitespace
14541450 && *p != '/' && *p != '>' ) // tag end
14551451 {
14561452 if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) {