From b6404d18c30ddedc12c360df903f72941d05a45f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 29 Apr 2014 13:41:35 +0000 Subject: [PATCH] From Pjotr Svetachov, "Today I found a bug in the IutputStream class when saving array attributes in vec3b format. It looks like my compiler takes the wrong overload and outputs integers instead of characters. The problem is that vec3b is of type signed char and that is not the same as char ( see http://stackoverflow.com/questions/436513/char-signed-char-char-unsigned-char ) and visual studio 2013 will promote it to integer when choosing an overload. It looks like that the InputStream class already takes care of this issue (if it didn't it would have read everything ok and I would have not even stumbled upon this bug. :) )" --- include/osgDB/OutputStream | 1 + 1 file changed, 1 insertion(+) diff --git a/include/osgDB/OutputStream b/include/osgDB/OutputStream index 24a55bd4b..61c54d1d9 100644 --- a/include/osgDB/OutputStream +++ b/include/osgDB/OutputStream @@ -92,6 +92,7 @@ public: // Serialization related functions OutputStream& operator<<( bool b ) { _out->writeBool(b); return *this; } OutputStream& operator<<( char c ) { _out->writeChar(c); return *this; } + OutputStream& operator<<( signed char c) { _out->writeChar(c); return *this; } OutputStream& operator<<( unsigned char c ) { _out->writeUChar(c); return *this; } OutputStream& operator<<( short s ) { _out->writeShort(s); return *this; } OutputStream& operator<<( unsigned short s ) { _out->writeUShort(s); return *this; }