From 9d2b1b539cebaa3057838cc60e867ecf24e5a8d8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Dec 2008 13:23:48 +0000 Subject: [PATCH] Fixed warnings --- src/osgPlugins/Inventor/ConvertToInventor.cpp | 41 +++++++++++++------ src/osgPlugins/Inventor/ConvertToInventor.h | 3 +- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/osgPlugins/Inventor/ConvertToInventor.cpp b/src/osgPlugins/Inventor/ConvertToInventor.cpp index daff25a64..1de65bacf 100644 --- a/src/osgPlugins/Inventor/ConvertToInventor.cpp +++ b/src/osgPlugins/Inventor/ConvertToInventor.cpp @@ -351,6 +351,7 @@ bool ivApplicateIntType(const osg::Array *array, fieldClass &field, int startInd (array, field, 1, 255, 0, startIndex, stopIndex, numItemsUntilMinusOne); return true; case osg::Array::Vec4ArrayType: osgArray2ivMField_pack_template (array, field, 255.f, 255.f, 0.f, startIndex, stopIndex, numItemsUntilMinusOne); return true; + default: break; } } return false; @@ -365,6 +366,7 @@ static void osgArray2ivMField(const osg::Array *array, SoMField &field, int star { case osg::Array::FloatArrayType: osgArray2ivMField_template (array, (SoMFFloat&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; + default: break; } } else if (ivApplicateIntType(array, (SoMFInt32&) field, startIndex, stopIndex, numItemsUntilMinusOne)) return; @@ -377,6 +379,7 @@ static void osgArray2ivMField(const osg::Array *array, SoMField &field, int star { case osg::Array::Vec2ArrayType: osgArray2ivMField_composite_template (array, (SoMFVec2f&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; + default: break; } } else if (field.isOfType(SoMFVec3f::getClassTypeId())) @@ -387,6 +390,7 @@ static void osgArray2ivMField(const osg::Array *array, SoMField &field, int star (array, (SoMFVec3f&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; case osg::Array::Vec2ArrayType: osgArray2ivMField_composite_template (array, (SoMFVec3f&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; + default: break; } } else if (field.isOfType(SoMFVec4f::getClassTypeId())) @@ -394,6 +398,7 @@ static void osgArray2ivMField(const osg::Array *array, SoMField &field, int star switch (array->getType()) { case osg::Array::Vec4ArrayType: osgArray2ivMField_composite_template (array, (SoMFVec4f&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; + default: break; } } else if (field.isOfType(SoMFColor::getClassTypeId())) @@ -406,6 +411,7 @@ static void osgArray2ivMField(const osg::Array *array, SoMField &field, int star (array, (SoMFColor&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; case osg::Array::Vec4ubArrayType: osgArray2ivMField_composite_template (array, (SoMFColor&)field, startIndex, stopIndex, numItemsUntilMinusOne); return; + default: break; } }; @@ -594,7 +600,7 @@ static void postProcessField(const SbIntList &runLengths, osg::PrimitiveSet::Mod field->setNum(newNum); int32_t *src = tmpArray; int32_t *dst = field->startEditing(); - int32_t *dst2 = dst; + // int32_t *dst2 = dst; switch (binding) { case osg::Geometry::BIND_PER_VERTEX: for (int i=0; i(pset) : NULL; - int drawArrayLengthsElems; + + int drawArrayLengthsElems = 0; if (drawArrayLengths) { @@ -1121,7 +1128,7 @@ static bool processPrimitiveSet(const osg::Geometry *g, const osg::PrimitiveSet // Normal indexing int normalStart = g->getNormalBinding() == osg::Geometry::BIND_PER_VERTEX ? startIndex : normalIndex; - int numNormalsUsed; + int numNormalsUsed = 0; switch (g->getNormalBinding()) { case osg::Geometry::BIND_OFF: // FIXME: what is meaning of OFF value? case osg::Geometry::BIND_OVERALL: numNormalsUsed = 0; break; @@ -1134,7 +1141,7 @@ static bool processPrimitiveSet(const osg::Geometry *g, const osg::PrimitiveSet // Color indexing int colorStart = g->getColorBinding() == osg::Geometry::BIND_PER_VERTEX ? startIndex : colorIndex; - int numColorsUsed; + int numColorsUsed = 0; switch (g->getColorBinding()) { case osg::Geometry::BIND_OFF: case osg::Geometry::BIND_OVERALL: numColorsUsed = 0; break; @@ -1193,7 +1200,8 @@ static bool processPrimitiveSet(const osg::Geometry *g, const osg::PrimitiveSet int i,n = stopIndex-startIndex; // create alternate coordinates - if (ivCoords->isOfType(SoCoordinate4::getClassTypeId())) { + if (ivCoords->isOfType(SoCoordinate4::getClassTypeId())) + { nonIndexedCoords = new SoCoordinate4; if (ok) { ((SoCoordinate4*)nonIndexedCoords)->point.setNum(n); @@ -1217,9 +1225,12 @@ static bool processPrimitiveSet(const osg::Geometry *g, const osg::PrimitiveSet // create alternate texture coordinates if (ivTexCoords) - if (ivTexCoords->isOfType(SoTextureCoordinate2::getClassTypeId())) { + { + if (ivTexCoords->isOfType(SoTextureCoordinate2::getClassTypeId())) + { nonIndexedTexCoords = new SoTextureCoordinate2; - if (ok) { + if (ok) + { ((SoTextureCoordinate2*)nonIndexedTexCoords)->point.setNum(n); ok = ivProcessArray(g->getTexCoordIndices(0), drawElemIndices, @@ -1229,9 +1240,11 @@ static bool processPrimitiveSet(const osg::Geometry *g, const osg::PrimitiveSet } } else #ifdef __COIN__ - if (ivTexCoords->isOfType(SoTextureCoordinate3::getClassTypeId())) { + if (ivTexCoords->isOfType(SoTextureCoordinate3::getClassTypeId())) + { nonIndexedTexCoords = new SoTextureCoordinate3; - if (ok) { + if (ok) + { ((SoTextureCoordinate3*)nonIndexedTexCoords)->point.setNum(n); ok = ivProcessArray(g->getTexCoordIndices(0), drawElemIndices, @@ -1239,10 +1252,12 @@ static bool processPrimitiveSet(const osg::Geometry *g, const osg::PrimitiveSet &((SoTextureCoordinate3*)ivCoords)->point, startIndex, n); } - } else + } + else #endif // __COIN__ nonIndexedTexCoords = ivTexCoords; - + } + // create alternate normals if (ivNormals) { nonIndexedNormals = new SoNormal; @@ -1827,7 +1842,7 @@ void ConvertToInventor::apply(osg::Geode &node) #endif // Create SoSeparator and convert StateSet for Geode - InventorState *ivGeodeState = createInventorState(node.getStateSet()); + /*InventorState *ivGeodeState = */createInventorState(node.getStateSet()); // Convert drawables const int numDrawables = node.getNumDrawables(); @@ -1848,7 +1863,7 @@ void ConvertToInventor::apply(osg::Group &node) #endif // Create SoSeparator and convert StateSet - InventorState *ivState = createInventorState(node.getStateSet()); + /*InventorState *ivState = */createInventorState(node.getStateSet()); traverse(node); diff --git a/src/osgPlugins/Inventor/ConvertToInventor.h b/src/osgPlugins/Inventor/ConvertToInventor.h index b592d1438..46e9875d1 100644 --- a/src/osgPlugins/Inventor/ConvertToInventor.h +++ b/src/osgPlugins/Inventor/ConvertToInventor.h @@ -85,7 +85,7 @@ protected: bool useIvExtensions; SoSeparator *ivRoot; - typedef struct InventorState { + struct InventorState { class SoGroup *ivHead; class SoTexture2 *ivTexture; class SoMaterial *ivMaterial; @@ -120,6 +120,7 @@ protected: osgBlendEnabled(s.osgBlendEnabled), osgBlendFunc(s.osgBlendFunc) {} static InventorState createTopLevelState(SoSeparator *ivRoot) { return InventorState(ivRoot); } }; + std::stack ivStack; typedef std::map Env2ivTexMap;