From 22c313cf3e003b82ace2ec5cc5f45c086e90ba92 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 22 Nov 2002 09:46:25 +0000 Subject: [PATCH] Warning fixes. --- src/osg/Geometry.cpp | 20 ++++++++++---------- src/osg/ShapeDrawable.cpp | 4 ---- src/osgGLUT/Viewer.cpp | 14 ++------------ src/osgPlugins/lwo/lw.cpp | 16 ++++++++-------- src/osgPlugins/osg/Geometry.cpp | 3 +-- 5 files changed, 21 insertions(+), 36 deletions(-) diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index 014290ebe..05f36a50c 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -944,7 +944,7 @@ class AttrbuteFunctorArrayVisitor : public ArrayVisitor virtual void apply(Vec4Array& array) { if (!array.empty()) _af.apply(_type,array.size(),&(array.front())); } - inline void apply(Drawable::AttributeType type,Array* array) + inline void applyArray(Drawable::AttributeType type,Array* array) { if (array) { @@ -961,13 +961,13 @@ void Geometry::accept(AttributeFunctor& af) { AttrbuteFunctorArrayVisitor afav(af); - afav.apply(VERTICES,_vertexArray.get()); - afav.apply(NORMALS,_normalArray.get()); - afav.apply(COLORS,_colorArray.get()); + afav.applyArray(VERTICES,_vertexArray.get()); + afav.applyArray(NORMALS,_normalArray.get()); + afav.applyArray(COLORS,_colorArray.get()); for(unsigned unit=0;unit<_texCoordList.size();++unit) { - afav.apply((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get()); + afav.applyArray((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get()); } } @@ -993,7 +993,7 @@ class ConstAttrbuteFunctorArrayVisitor : public ConstArrayVisitor virtual void apply(const Vec4Array& array) { if (!array.empty()) _af.apply(_type,array.size(),&(array.front())); } - inline void apply(Drawable::AttributeType type,const Array* array) + inline void applyArray(Drawable::AttributeType type,const Array* array) { if (array) { @@ -1010,13 +1010,13 @@ void Geometry::accept(ConstAttributeFunctor& af) const { ConstAttrbuteFunctorArrayVisitor afav(af); - afav.apply(VERTICES,_vertexArray.get()); - afav.apply(NORMALS,_normalArray.get()); - afav.apply(COLORS,_colorArray.get()); + afav.applyArray(VERTICES,_vertexArray.get()); + afav.applyArray(NORMALS,_normalArray.get()); + afav.applyArray(COLORS,_colorArray.get()); for(unsigned unit=0;unit<_texCoordList.size();++unit) { - afav.apply((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get()); + afav.applyArray((AttributeType)(TEXTURE_COORDS_0+unit),_texCoordList[unit].first.get()); } } diff --git a/src/osg/ShapeDrawable.cpp b/src/osg/ShapeDrawable.cpp index 7e82acd3a..670a6abca 100644 --- a/src/osg/ShapeDrawable.cpp +++ b/src/osg/ShapeDrawable.cpp @@ -845,8 +845,6 @@ void PrimitiveShapeVisitor::apply(const Sphere& sphere) float rBase=0.0f; float zBase=-sphere.getRadius(); float vBase=0.0f; - float nzBase=-1.0f; - float nRatioBase=0.0f; for(unsigned int rowi=0; rowi ea = osgNew GLUTEventAdapter; ea->adaptFrame(_frameStamp->getReferenceTime()); - bool handled = false; for (EventHandlerList::iterator eh = _viewportList[viewport]._eventHandlerList.begin(); eh != _viewportList[viewport]._eventHandlerList.end(); eh++ ) { - if ( eh->valid() ) - { - if ( (*eh)->handle(*ea,*this) ) - { - handled = true; - break; - } - } + if (eh->valid()) (*eh)->handle(*ea,*this); } -// if ( !handled ) { - _viewportList[viewport]._cameraManipulator->handle(*ea,*this); -// } + _viewportList[viewport]._cameraManipulator->handle(*ea,*this); if (getRecordingAnimationPath() && getAnimationPath()) diff --git a/src/osgPlugins/lwo/lw.cpp b/src/osgPlugins/lwo/lw.cpp index b7ce50510..963afe34c 100644 --- a/src/osgPlugins/lwo/lw.cpp +++ b/src/osgPlugins/lwo/lw.cpp @@ -217,10 +217,10 @@ static void read_surf(FILE *f, gint nbytes, lwObject *lwo) break; case ID_TFAL: if (tex) { - float vx,vy,vz; - vx = read_float(f); - vy = read_float(f); - vz = read_float(f); + //float vx,vy,vz; + /*vx =*/ read_float(f); + /*vy =*/ read_float(f); + /*vz =*/ read_float(f); //printf("fal %.2f %.2f %.2f\n", vx,vy,vz); } else @@ -228,10 +228,10 @@ static void read_surf(FILE *f, gint nbytes, lwObject *lwo) break; case ID_TVEL: if (tex) { - float vx,vy,vz; - vx = read_float(f); - vy = read_float(f); - vz = read_float(f); + //float vx,vy,vz; + /*vx =*/ read_float(f); + /*vy =*/ read_float(f); + /*vz =*/ read_float(f); //printf("vel %.2f %.2f %.2f\n", vx,vy,vz); } else diff --git a/src/osgPlugins/osg/Geometry.cpp b/src/osgPlugins/osg/Geometry.cpp index c5d97e14c..4c4b7c569 100644 --- a/src/osgPlugins/osg/Geometry.cpp +++ b/src/osgPlugins/osg/Geometry.cpp @@ -38,8 +38,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr) Geometry& geom = static_cast(obj); - bool matchedFirst = false; - if ((matchedFirst=fr.matchSequence("Primitives %i {")) || fr.matchSequence("PrimitiveSets %i {") ) + if (fr.matchSequence("Primitives %i {") || fr.matchSequence("PrimitiveSets %i {") ) { int entry = fr[1].getNoNestedBrackets();