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:
Robert Osfield
2010-02-10 19:36:31 +00:00
parent 5b1ca779e4
commit 725258ea54
14 changed files with 47 additions and 45 deletions

View File

@@ -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 )
{