From Michael Platings, "I've attached a fix for a subtle bug that causes animations (and quite possibly other things) to be serialized incorrectly.

For the following code:

#define MYMACRO(NAME) myOutputStream << #NAME;
MYMACRO(Group)

you would expect that "Group" would be output. However, as there are many overloaded operator<< functions, none of which take a const char* argument, the function that's actually called is operator<<(bool). Hence what actually gets output is "TRUE".
An actual example of this is in serializers\osgAnimation\Animation.cpp, WRITE_CHANNEL_FUNC2.

So the simple solution to this is to add operator<<(const char*), attached.
"
This commit is contained in:
Robert Osfield 2011-01-18 16:14:24 +00:00
parent f2f9bb11b0
commit bc6a94c5b3

View File

@ -96,6 +96,7 @@ public:
OutputStream& operator<<( float f ) { _out->writeFloat(f); return *this; }
OutputStream& operator<<( double d ) { _out->writeDouble(d); return *this; }
OutputStream& operator<<( const std::string& s ) { _out->writeString(s); return *this; }
OutputStream& operator<<( const char* s ) { _out->writeString(s); return *this; }
OutputStream& operator<<( std::ostream& (*fn)(std::ostream&) ) { _out->writeStream(fn); return *this; }
OutputStream& operator<<( std::ios_base& (*fn)(std::ios_base&) ) { _out->writeBase(fn); return *this; }