leethomason/tinyxml2 — pull request #62 by dandee (2012-09-14 19:43:57+00:00)
Title: Code refactoring

Perhaps you'd be interested in the refactoring of the code I made. Beside to the changes to the coding style which can be of course a matter of personal preference the biggest change I made is to rename class member variables to not clash with local method variables.

Perhaps it's not visible while using GCC but since I use Clang I've got a huge number of warnings about local variables shadowed like this:
/Users/danielk/Development/3rdparty/tinyxml2-orig/tinyxml2.cpp:100:44: warning: declaration shadows a field of 'tinyxml2::StrPair' [-Wshadow]
void StrPair::SetStr( const char* str, int flags )
^
/Users/danielk/Development/3rdparty/tinyxml2-orig/./tinyxml2.h:162:6: note: previous declaration is here
int flags;
^
/Users/danielk/Development/3rdparty/tinyxml2-orig/tinyxml2.cpp:115:8: warning: declaration shadows a field of 'tinyxml2::StrPair' [-Wshadow]
char* start = p; // fixme: hides a member
^
/Users/danielk/Development/3rdparty/tinyxml2-orig/./tinyxml2.h:163:8: note: previous declaration is here
char* start;
^
I hope you'd reuse the work I've done,
Daniel