diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 4a3152a..091f328 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -88,9 +88,7 @@ const char* XMLBase::ParseText( char* p, const char* endTag, char** next ) } -char* XMLBase::ParseName( char* in, StrPair* pair ); - -const char* XMLBase::ParseName( char* p, char** next ) +char* XMLBase::ParseName( char* p, StrPair* pair ) { char* start = p; char* nextTag = 0; diff --git a/tinyxml2.h b/tinyxml2.h index f081758..fe3979e 100644 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -48,6 +48,7 @@ struct CharBuffer // FIXME: refactor to be the basis for all string handling. class StrPair { +public: enum { NEEDS_FLUSH = 0x01, NEEDS_ENTITY_PROCESSING = 0x02, @@ -55,7 +56,7 @@ class StrPair }; StrPair() : flags( 0 ), start( 0 ), end( 0 ) {} - void Init( const char* start, char* end, int flags; ) { + void Init( const char* start, char* end, int flags ) { this->start = start; this->end = end; this->flags = flags | NEEDS_FLUSH; } const char* GetStr(); @@ -80,6 +81,9 @@ protected: inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { int n = 0; + if ( p == q ) { + return true; + } while( *p && *q && *p == *q && n