From 2ab66723d5946324a7b6275c2532a1ec06bcf747 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 29 Apr 2014 13:41:33 +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 b2f86b6c4..88d5184af 100644 --- a/include/osgDB/OutputStream +++ b/include/osgDB/OutputStream @@ -89,6 +89,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; }