Added sizeof tests of istream::pos_type and off_type to osgunittests.
Added debuggin messages to endian handling code in Archive::open().
This commit is contained in:
@@ -112,6 +112,10 @@ void sizeOfTest()
|
||||
#endif
|
||||
std::cout<<"sizeof(float)=="<<sizeof(float)<<std::endl;
|
||||
std::cout<<"sizeof(double)=="<<sizeof(double)<<std::endl;
|
||||
|
||||
std::cout<<"sizeof(std::istream::pos_type)=="<<sizeof(std::istream::pos_type)<<std::endl;
|
||||
std::cout<<"sizeof(std::istream::off_type)=="<<sizeof(std::istream::off_type)<<std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ bool Archive::open(const std::string& filename, ArchiveStatus status, unsigned i
|
||||
if (validArchive)
|
||||
{
|
||||
|
||||
unsigned int endianTestWord;
|
||||
unsigned int endianTestWord=0;
|
||||
_input.read(reinterpret_cast<char*>(&endianTestWord),4);
|
||||
bool doEndianSwap = (endianTestWord!=ENDIAN_TEST_NUMBER);
|
||||
|
||||
@@ -256,6 +256,9 @@ bool Archive::open(const std::string& filename, ArchiveStatus status, unsigned i
|
||||
osg::swapBytes(reinterpret_cast<char*>(&_version),sizeof(_version));
|
||||
}
|
||||
|
||||
osg::notify(osg::NOTICE)<<"Archive::open() doEndianSwap="<<doEndianSwap<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Archive::open() Version="<<_version<<std::endl;
|
||||
|
||||
IndexBlock *indexBlock = 0;
|
||||
|
||||
while ( (indexBlock=Archive::IndexBlock::read(_input, doEndianSwap)) != 0)
|
||||
|
||||
Reference in New Issue
Block a user