diff --git a/src/osgPlugins/3ds/ReaderWriter3DS.cpp b/src/osgPlugins/3ds/ReaderWriter3DS.cpp index 3149a7ca4..277706f28 100644 --- a/src/osgPlugins/3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/3ds/ReaderWriter3DS.cpp @@ -189,7 +189,7 @@ protected: /// An OSG state set with the original 3DS material attached (used to get info such as UV scaling & offset) struct StateSetInfo { - StateSetInfo(osg::StateSet * stateset=NULL, Lib3dsMaterial * lib3dsmat=NULL) : stateset(stateset), lib3dsmat(lib3dsmat) {} + StateSetInfo(osg::StateSet * ss=NULL, Lib3dsMaterial * lm=NULL) : stateset(ss), lib3dsmat(lm) {} StateSetInfo(const StateSetInfo & v) : stateset(v.stateset), lib3dsmat(v.lib3dsmat) {} StateSetInfo & operator=(const StateSetInfo & v) { stateset=v.stateset; lib3dsmat=v.lib3dsmat; return *this; } @@ -265,9 +265,9 @@ ReaderWriter3DS::ReaderWriter3DS() } -ReaderWriter3DS::ReaderObject::ReaderObject(const osgDB::ReaderWriter::Options* options) : +ReaderWriter3DS::ReaderObject::ReaderObject(const osgDB::ReaderWriter::Options* op) : _useSmoothingGroups(true), - options(options), + options(op), noMatrixTransforms(false), checkForEspilonIdentityMatrices(false), restoreMatrixTransformsNoMeshes(false) diff --git a/src/osgPlugins/3ds/WriterCompareTriangle.cpp b/src/osgPlugins/3ds/WriterCompareTriangle.cpp index ba8335ca9..6dbe9313d 100644 --- a/src/osgPlugins/3ds/WriterCompareTriangle.cpp +++ b/src/osgPlugins/3ds/WriterCompareTriangle.cpp @@ -1,7 +1,7 @@ #include "WriterCompareTriangle.h" #include -WriterCompareTriangle::WriterCompareTriangle(const osg::Geode & geode, unsigned int nbVertices) : geode(geode) +WriterCompareTriangle::WriterCompareTriangle(const osg::Geode & g, unsigned int nbVertices) : geode(g) { cutscene(nbVertices, geode.getBoundingBox()); } @@ -10,15 +10,15 @@ bool WriterCompareTriangle::operator()(const std::pair & t1, const std::pair & t2) const { - const osg::Geometry *g = geode.getDrawable( t1.second )->asGeometry(); + const osg::Geometry *g1 = geode.getDrawable( t1.second )->asGeometry(); - const osg::Vec3Array * vecs= static_cast(g->getVertexArray()); + const osg::Vec3Array * vecs= static_cast(g1->getVertexArray()); const osg::BoundingBox::vec_type v1( (*vecs)[t1.first.t1] ); if (t1.second != t2.second) { - const osg::Geometry *g = geode.getDrawable( t2.second )->asGeometry(); - vecs = static_cast(g->getVertexArray()); + const osg::Geometry *g2 = geode.getDrawable( t2.second )->asGeometry(); + vecs = static_cast(g2->getVertexArray()); }; const osg::BoundingBox::vec_type v2( (*vecs)[t2.first.t1] ); int val1 = inWhichBox(v1); diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.cpp b/src/osgPlugins/3ds/WriterNodeVisitor.cpp index dc62589a9..af9189a03 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.cpp +++ b/src/osgPlugins/3ds/WriterNodeVisitor.cpp @@ -358,8 +358,8 @@ void PrimitiveIndexWriter::drawArrays(GLenum mode,GLint first,GLsizei count) -WriterNodeVisitor::Material::Material(WriterNodeVisitor & writerNodeVisitor, osg::StateSet * stateset, osg::Material* mat, osg::Texture* tex, bool preserveName, int index) : - index(index), +WriterNodeVisitor::Material::Material(WriterNodeVisitor & writerNodeVisitor, osg::StateSet * stateset, osg::Material* mat, osg::Texture* tex, bool preserveName, int ind) : + index(ind), diffuse(1,1,1,1), ambient(0.2,0.2,0.2,1), specular(0,0,0,1), diff --git a/src/osgPlugins/ac/ac3d.cpp b/src/osgPlugins/ac/ac3d.cpp index 28aa1165b..7c315a4a9 100644 --- a/src/osgPlugins/ac/ac3d.cpp +++ b/src/osgPlugins/ac/ac3d.cpp @@ -1273,20 +1273,20 @@ readObject(std::istream& stream, FileData& fileData, const osg::Matrix& parentTr vertexSet->setCreaseAngle(creaseAngle); for (unsigned n = 0; n < num; ++n) { - std::string token; - stream >> token; + std::string inner_token; + stream >> inner_token; - if (token != "SURF") { + if (inner_token != "SURF") { OSG_FATAL << "osgDB ac3d reader: expected SURF line while reading object \"" << group->getName() << "\"!" << std::endl; return group.release(); } - stream >> token; - unsigned flags = strtol(token.c_str(), NULL, 0); + stream >> inner_token; + unsigned flags = strtol(inner_token.c_str(), NULL, 0); - stream >> token; - if (token != "mat") { + stream >> inner_token; + if (inner_token != "mat") { OSG_FATAL << "osgDB ac3d reader: expected mat line while reading object \"" << group->getName() << "\"!" << std::endl; return group.release(); @@ -1311,8 +1311,8 @@ readObject(std::istream& stream, FileData& fileData, const osg::Matrix& parentTr } // read the refs - stream >> token; - if (token != "refs") { + stream >> inner_token; + if (inner_token != "refs") { OSG_FATAL << "osgDB ac3d reader: expected refs line while reading object \"" << group->getName() << "\"" << std::endl; return group.release(); diff --git a/src/osgPlugins/dds/ReaderWriterDDS.cpp b/src/osgPlugins/dds/ReaderWriterDDS.cpp index eb1c5ca72..f844e3563 100644 --- a/src/osgPlugins/dds/ReaderWriterDDS.cpp +++ b/src/osgPlugins/dds/ReaderWriterDDS.cpp @@ -965,20 +965,20 @@ osg::Image* ReadDDSFile(std::istream& _istream, bool flipDDSRead) // array starts at 1 level offset, 0 level skipped mipmap_offsets.resize( numMipmaps - 1 ); - int width = s; - int height = t; - int depth = r; + int mip_width = s; + int mip_height = t; + int mip_depth = r; for( unsigned int k = 0; k < mipmap_offsets.size(); ++k ) { mipmap_offsets[k] = sizeWithMipmaps; - width = osg::maximum( width >> 1, 1 ); - height = osg::maximum( height >> 1, 1 ); - depth = osg::maximum( depth >> 1, 1 ); + mip_width = osg::maximum( mip_width >> 1, 1 ); + mip_height = osg::maximum( mip_height >> 1, 1 ); + mip_depth = osg::maximum( mip_depth >> 1, 1 ); sizeWithMipmaps += - ComputeImageSizeInBytes( width, height, depth, pixelFormat, dataType, packing ); + ComputeImageSizeInBytes( mip_width, mip_height, mip_depth, pixelFormat, dataType, packing ); } } diff --git a/src/osgPlugins/dw/ReaderWriterDW.cpp b/src/osgPlugins/dw/ReaderWriterDW.cpp index e0313675b..f60fd9964 100644 --- a/src/osgPlugins/dw/ReaderWriterDW.cpp +++ b/src/osgPlugins/dw/ReaderWriterDW.cpp @@ -237,7 +237,7 @@ public: getside12(side,s2, verts); norm(nrm, s2, side); } - void settrans(Matrix &mx, const Vec3 nrm, const std::vector verts, const dwmaterial *mat) const { + void settrans(Matrix &mx, const Vec3 normal, const std::vector verts, const dwmaterial *mat) const { // define the matrix perpendcular to normal for mapping textures float wid=mat->getRepWid(); float ht=mat->getRepHt(); @@ -246,7 +246,7 @@ public: Vec3 s2; // want transformed u coordinate parallel to 'r1' getside12(r1,s2, verts); // r1 = edge of first side // printf("fullface s2 %f %f %f\n", s2.x(),s2.y(),s2.z());//, errm - r3=nrm; + r3=normal; float len=r1.length(); r1=r1/len; r2=r3^r1; @@ -257,7 +257,7 @@ public: // the transformation is unitary - preserves lengths; and // converts points on a plane into (s,t, constant) coords for use with texturing // Rinv.(0,0,1) = (nrm) implies R since Rinv=R(transpose) - r3=nrm; // already a unit vector + r3=normal; // already a unit vector // mat.(010) = (0ab) -> Minv.(0ab) = (010); and this row DOT nrm=0 if (r3.z() < 0.99f && r3.z() > -0.99f) { // not face parallel to ground - choose r1 perpendicular to nrm & 001 r2.set(0,0,1); // therefore r1 is in plane of face. @@ -639,8 +639,8 @@ public: nverts++; return nverts-1; } - void settmat(const Matrix& mx) { - tmat= new RefMatrix(mx); + void settmat(const Matrix& matrix) { + tmat= new RefMatrix(matrix); } void makeuv(Vec2 &uv, const double pos[]) { Vec3 p; @@ -906,7 +906,6 @@ class ReaderWriterDW : public osgDB::ReaderWriter sscanf(buff+6,"%f %f %f", &rgb[0], &rgb[1], &rgb[2]); matpalet[nmat].setcolour(rgb); } else if (rdg==OBJECT) { - float rgb[3]; sscanf(buff+6,"%f %f %f", &rgb[0], &rgb[1], &rgb[2]); rgb[0]/=65536.0f; // convert to range 0-1 rgb[1]/=65536.0f; // convert to range 0-1 diff --git a/src/osgPlugins/normals/Normals.cpp b/src/osgPlugins/normals/Normals.cpp index 749ca2a83..f9eae612d 100644 --- a/src/osgPlugins/normals/Normals.cpp +++ b/src/osgPlugins/normals/Normals.cpp @@ -104,7 +104,7 @@ void Normals::MakeNormalsVisitor::apply( Geode &geode ) Vec3 v(0,0,0); Vec3 n = *(normals_index++); int ni = (*itr)->getNumIndices(); - for( int i = 0; i < ni; i++ ) + for( int vi = 0; vi < ni; vi++ ) v += *(coord_index++) * _mat; v /= (float)(ni); diff --git a/src/osgPlugins/shp/ESRIShape.cpp b/src/osgPlugins/shp/ESRIShape.cpp index 8ffd4dcd4..cc01e3d0f 100644 --- a/src/osgPlugins/shp/ESRIShape.cpp +++ b/src/osgPlugins/shp/ESRIShape.cpp @@ -268,11 +268,11 @@ bool MultiPoint::read( int fd ) SAFE_DELETE_ARRAY( points ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypeMultiPoint ) + if( st != ShapeTypeMultiPoint ) return false; if( bbox.read(fd) == false ) @@ -336,11 +336,11 @@ bool PolyLine::read( int fd ) SAFE_DELETE_ARRAY( parts ); SAFE_DELETE_ARRAY( points ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePolyLine ) + if( st != ShapeTypePolyLine ) return false; if( bbox.read(fd) == false ) @@ -408,11 +408,11 @@ bool Polygon::read( int fd ) SAFE_DELETE_ARRAY( parts ); SAFE_DELETE_ARRAY( points ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePolygon ) + if( st != ShapeTypePolygon ) return false; if( bbox.read(fd) == false ) @@ -526,11 +526,11 @@ bool MultiPointM::read( int fd ) SAFE_DELETE_ARRAY( points ); SAFE_DELETE_ARRAY( mArray ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypeMultiPointM ) + if( st != ShapeTypeMultiPointM ) return false; if( bbox.read(fd) == false ) @@ -619,11 +619,11 @@ bool PolyLineM::read( int fd ) SAFE_DELETE_ARRAY( points ); SAFE_DELETE_ARRAY( mArray ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePolyLineM ) + if( st != ShapeTypePolyLineM ) return false; if( bbox.read(fd) == false ) @@ -717,11 +717,11 @@ bool PolygonM::read( int fd ) SAFE_DELETE_ARRAY( points ); SAFE_DELETE_ARRAY( mArray ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePolygonM ) + if( st != ShapeTypePolygonM ) return false; if( bbox.read(fd) == false ) @@ -793,11 +793,11 @@ bool PointZ::read( int fd ) if( rh.read(fd) == false ) return false; - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePointZ ) + if( st != ShapeTypePointZ ) return false; if( readVal( fd, x, LittleEndian ) == false ) @@ -865,11 +865,11 @@ bool MultiPointZ::read( int fd ) SAFE_DELETE_ARRAY( zArray ); SAFE_DELETE_ARRAY( mArray ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypeMultiPointZ ) + if( st != ShapeTypeMultiPointZ ) return false; if( bbox.read(fd) == false ) @@ -982,11 +982,11 @@ bool PolyLineZ::read( int fd ) SAFE_DELETE_ARRAY( zArray ); SAFE_DELETE_ARRAY( mArray ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePolyLineZ ) + if( st != ShapeTypePolyLineZ ) return false; if( bbox.read(fd) == false ) @@ -1095,11 +1095,11 @@ bool PolygonZ::read( int fd ) SAFE_DELETE_ARRAY( zArray ); SAFE_DELETE_ARRAY( mArray ); - Integer shapeType; - if( readVal(fd, shapeType, LittleEndian ) == false ) + Integer st; + if( readVal(fd, st, LittleEndian ) == false ) return false; - if( shapeType != ShapeTypePolygonZ ) + if( st != ShapeTypePolygonZ ) return false; if( bbox.read(fd) == false ) diff --git a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp index 36e220d24..b51776012 100644 --- a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp +++ b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp @@ -222,7 +222,7 @@ toff_t libtiffOStreamSeekProc(thandle_t fd, toff_t off, int i) // position required past the end of the stream so we need to insert extra characters to // ensure the stream is big enough to encompass the new the position. fout->seekp(0, std::ios::end); - for(toff_t i=stream_end; iput(char(0)); } @@ -909,7 +909,7 @@ class ReaderWriterTIFF : public osgDB::ReaderWriter } uint32 rowsperstrip = 0; - + switch(img.getDataType()){ case GL_FLOAT: TIFFSetField(image, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); @@ -937,7 +937,7 @@ class ReaderWriterTIFF : public osgDB::ReaderWriter TIFFSetField(image, TIFFTAG_COMPRESSION, compressionType); TIFFSetField(image, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); TIFFSetField(image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - + if (rowsperstrip==0) rowsperstrip = TIFFDefaultStripSize(image, 0); TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); diff --git a/src/osgPlugins/x/mesh.cpp b/src/osgPlugins/x/mesh.cpp index ccbf38d33..b5ebfa0f9 100644 --- a/src/osgPlugins/x/mesh.cpp +++ b/src/osgPlugins/x/mesh.cpp @@ -86,8 +86,7 @@ bool Mesh::generateNormals(float /*creaseAngle*/) vector faceNormals; faceNormals.resize(_faces.size()); - unsigned int fi; - for (fi = 0; fi < _faces.size(); fi++) { + for (unsigned int fi = 0; fi < _faces.size(); fi++) { vector poly; unsigned int n = _faces[fi].size(); @@ -161,7 +160,7 @@ bool Mesh::generateNormals(float /*creaseAngle*/) // Copy face mesh to normals mesh _normals->faceNormals.resize(_faces.size()); - for (fi = 0; fi < _faces.size(); fi++) + for (unsigned int fi = 0; fi < _faces.size(); fi++) _normals->faceNormals[fi] = _faces[fi]; return true;