replaced reading and writing of std::container.size() using InputStream::readSize() and OutputStream::writeSize() to make
the type writing more explictly tied to the size type, with use of unsigned int as the default size. This approach ensures that we get the same results under 32 and 64bit builds.
This commit is contained in:
@@ -39,7 +39,7 @@ static bool checkDescriptions( const osg::Node& node )
|
||||
|
||||
static bool readDescriptions( osgDB::InputStream& is, osg::Node& node )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = is.readSize(); is >> osgDB::BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
std::string value;
|
||||
@@ -53,7 +53,7 @@ static bool readDescriptions( osgDB::InputStream& is, osg::Node& node )
|
||||
static bool writeDescriptions( osgDB::OutputStream& os, const osg::Node& node )
|
||||
{
|
||||
const osg::Node::DescriptionList& slist = node.getDescriptions();
|
||||
os << slist.size() << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os.writeSize(slist.size()); os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
for ( osg::Node::DescriptionList::const_iterator itr=slist.begin();
|
||||
itr!=slist.end(); ++itr )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user