From bc6a94c5b330158348b76285f05d12a00bb36726 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 18 Jan 2011 16:14:24 +0000 Subject: [PATCH] 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. " --- include/osgDB/OutputStream | 1 + 1 file changed, 1 insertion(+) diff --git a/include/osgDB/OutputStream b/include/osgDB/OutputStream index 4a3681e5f..275840462 100644 --- a/include/osgDB/OutputStream +++ b/include/osgDB/OutputStream @@ -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; }