From e1c77dfe2a02800244f8660da35be5735b6f9748 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 16 May 2006 21:20:36 +0000 Subject: [PATCH] Minor tweaks of ints to unsigned ints --- include/osg/StateSet | 2 +- src/osg/StateSet.cpp | 2 +- src/osgPlugins/ive/Uniform.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/osg/StateSet b/include/osg/StateSet index ab4b35265..8b449f427 100644 --- a/include/osg/StateSet +++ b/include/osg/StateSet @@ -281,7 +281,7 @@ class OSG_EXPORT StateSet : public Object Uniform* getUniform(const std::string& name); /** Get Uniform for specified name, if one is not available create it, add it to this StateSet and return a pointer to it.*/ - Uniform* getOrCreateUniform(const std::string& name, Uniform::Type type, int numElements=1); + Uniform* getOrCreateUniform(const std::string& name, Uniform::Type type, unsigned int numElements=1); /** Get const Uniform for specified name. * Returns NULL if no matching Uniform is contained within StateSet.*/ diff --git a/src/osg/StateSet.cpp b/src/osg/StateSet.cpp index cc7ce2528..6302cde33 100644 --- a/src/osg/StateSet.cpp +++ b/src/osg/StateSet.cpp @@ -924,7 +924,7 @@ Uniform* StateSet::getUniform(const std::string& name) else return 0; } -Uniform* StateSet::getOrCreateUniform(const std::string& name, Uniform::Type type, int numElements) +Uniform* StateSet::getOrCreateUniform(const std::string& name, Uniform::Type type, unsigned int numElements) { // for look for an appropriate uniform. UniformList::iterator itr = _uniformList.find(name); diff --git a/src/osgPlugins/ive/Uniform.cpp b/src/osgPlugins/ive/Uniform.cpp index 2a7f17c49..b4255aba3 100644 --- a/src/osgPlugins/ive/Uniform.cpp +++ b/src/osgPlugins/ive/Uniform.cpp @@ -40,7 +40,7 @@ void Uniform::write(DataOutputStream* out){ if ( out->getVersion() >= VERSION_0016 ) { - out->writeInt(getNumElements()); + out->writeUInt(getNumElements()); if( getFloatArray() ) out->writeArray( getFloatArray() ); if( getIntArray() ) out->writeArray( getIntArray() ); @@ -173,7 +173,7 @@ void Uniform::read(DataInputStream* in) if ( in->getVersion() >= VERSION_0016 ) { - setNumElements( in->readInt() ); + setNumElements( in->readUInt() ); osg::Array* data = in->readArray(); setArray( dynamic_cast(data) );