diff --git a/src/osgPlugins/osg/BinaryStreamOperator.h b/src/osgPlugins/osg/BinaryStreamOperator.h index 1f84aa994..93c721d0d 100644 --- a/src/osgPlugins/osg/BinaryStreamOperator.h +++ b/src/osgPlugins/osg/BinaryStreamOperator.h @@ -90,13 +90,14 @@ public: } else if ( mark._name=="}" && _beginPositions.size()>0 ) { - int pos = _out->tellp(), beginPos = _beginPositions.back(); + std::streampos pos = _out->tellp(), beginPos = _beginPositions.back(); _beginPositions.pop_back(); - _out->seekp( beginPos, std::ios_base::beg ); + _out->seekp( beginPos ); - int size = pos - beginPos; + std::streampos size64 = pos - beginPos; + int size = (int) size64; _out->write( (char*)&size, osgDB::INT_SIZE ); - _out->seekp( pos, std::ios_base::beg ); + _out->seekp( pos ); } } } @@ -108,7 +109,7 @@ public: { writeString( str ); } protected: - std::vector _beginPositions; + std::vector _beginPositions; }; class BinaryInputIterator : public osgDB::InputIterator @@ -262,7 +263,7 @@ public: { if ( _supportBinaryBrackets && _beginPositions.size()>0 ) { - int pos = _beginPositions.back() + _blockSizes.back(); + std::streampos pos = _beginPositions.back() + _blockSizes.back(); _in->seekg( pos, std::ios_base::beg ); _beginPositions.pop_back(); _blockSizes.pop_back(); @@ -270,8 +271,8 @@ public: } protected: - std::vector _beginPositions; - std::vector _blockSizes; + std::vector _beginPositions; + std::vector _blockSizes; }; #endif