I believe the TiXmlBase class's method
inline static bool IsWhiteSpace( char c ) { return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); }
may be safely shortened to
inline static bool IsWhiteSpace( char c ) { return ( isspace( (unsigned char) c ) ); }
as I believe the C++ isspace function already explicitly checks for '\n' and '\r' as well as other characters (such as '\t', ' ', etc.).
If someone knows otherwise, I'd be most interested to hear it.
Regards. Greg
I can't remember if I put that in there to fix a compiler bug or because I made a mistake. Fear of the former has kept me from fixing it...
lee
Log in to post a comment.
I believe the TiXmlBase class's method
inline static bool IsWhiteSpace( char c )
{
return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
}
may be safely shortened to
inline static bool IsWhiteSpace( char c )
{
return ( isspace( (unsigned char) c ) );
}
as I believe the C++ isspace function already explicitly checks for '\n' and '\r' as well as other characters (such as '\t', ' ', etc.).
If someone knows otherwise, I'd be most interested to hear it.
Regards.
Greg
I can't remember if I put that in there to fix a compiler bug or because I made a mistake. Fear of the former has kept me from fixing it...
lee