Added OutputStream::writeSize and InputStream::readSize methods to help out with ensure that 32bit and 64bit builds all

use the same 32bit type for sizes.
This commit is contained in:
Robert Osfield
2010-02-10 17:03:09 +00:00
parent f3ee7fa6ba
commit 5b1ca779e4
4 changed files with 19 additions and 12 deletions

View File

@@ -763,7 +763,7 @@ void InputStream::resetSchema()
}
template<typename T>
void InputStream::readArrayImplementation( T* a, int readSize, bool useByteSwap )
void InputStream::readArrayImplementation( T* a, int read_size, bool useByteSwap )
{
int size = 0;
*this >> size >> BEGIN_BRACKET;
@@ -772,11 +772,11 @@ void InputStream::readArrayImplementation( T* a, int readSize, bool useByteSwap
a->resize( size );
if ( isBinary() )
{
_in->getStream()->read( (char*)&((*a)[0]), readSize*size ); checkStream();
_in->getStream()->read( (char*)&((*a)[0]), read_size*size ); checkStream();
if ( useByteSwap && _byteSwap )
{
for ( int i=0; i<size; ++i )
osg::swapBytes( (char*)&((*a)[i]), readSize );
osg::swapBytes( (char*)&((*a)[i]), read_size );
}
}
else