diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index c2c7c9240..0ee9e8eb3 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -2110,7 +2110,10 @@ class AttributeFunctorArrayVisitor : public ArrayVisitor array->accept(*this); } } - + + protected: + + AttributeFunctorArrayVisitor& operator = (const AttributeFunctorArrayVisitor&) { return *this; } Drawable::AttributeFunctor& _af; Drawable::AttributeType _type; }; @@ -2171,6 +2174,10 @@ class ConstAttributeFunctorArrayVisitor : public ConstArrayVisitor } } +protected: + + ConstAttributeFunctorArrayVisitor& operator = (const ConstAttributeFunctorArrayVisitor&) { return *this; } + Drawable::ConstAttributeFunctor& _af; Drawable::AttributeType _type; }; @@ -2944,7 +2951,8 @@ class ExpandIndexedArray : public osg::ConstArrayVisitor // the input array, but the interface of the osg::Array class doesn't include a way // to set an element. template - osg::Array* create_noinline(const osg::Array& array, const osg::IndexArray& indices) { + osg::Array* create_noinline(const osg::Array& array, const osg::IndexArray& indices) + { T* newArray = 0; typedef typename T::ElementDataType EDT; @@ -2961,42 +2969,44 @@ class ExpandIndexedArray : public osg::ConstArrayVisitor return newArray; } - osg::Array* create_noinline(const osg::Array& array, const osg::IndexArray& indices) { - switch (array.getType()) + osg::Array* create_noinline(const osg::Array& array, const osg::IndexArray& indices) + { + switch (array.getType()) { - case(osg::Array::ByteArrayType): return create_noinline(array,indices); - case(osg::Array::ShortArrayType): return create_noinline(array,indices); - case(osg::Array::IntArrayType): return create_noinline(array,indices); - case(osg::Array::UByteArrayType): return create_noinline(array,indices); - case(osg::Array::UShortArrayType): return create_noinline(array,indices); - case(osg::Array::UIntArrayType): return create_noinline(array,indices); - case(osg::Array::Vec4ubArrayType): return create_noinline(array,indices); - case(osg::Array::FloatArrayType): return create_noinline(array,indices); - case(osg::Array::Vec2ArrayType): return create_noinline(array,indices); - case(osg::Array::Vec3ArrayType): return create_noinline(array,indices); - case(osg::Array::Vec4ArrayType): return create_noinline(array,indices); - case(osg::Array::Vec2dArrayType): return create_noinline(array,indices); - case(osg::Array::Vec3dArrayType): return create_noinline(array,indices); - case(osg::Array::Vec4dArrayType): return create_noinline(array,indices); - default: - return NULL; + case(osg::Array::ByteArrayType): return create_noinline(array,indices); + case(osg::Array::ShortArrayType): return create_noinline(array,indices); + case(osg::Array::IntArrayType): return create_noinline(array,indices); + case(osg::Array::UByteArrayType): return create_noinline(array,indices); + case(osg::Array::UShortArrayType): return create_noinline(array,indices); + case(osg::Array::UIntArrayType): return create_noinline(array,indices); + case(osg::Array::Vec4ubArrayType): return create_noinline(array,indices); + case(osg::Array::FloatArrayType): return create_noinline(array,indices); + case(osg::Array::Vec2ArrayType): return create_noinline(array,indices); + case(osg::Array::Vec3ArrayType): return create_noinline(array,indices); + case(osg::Array::Vec4ArrayType): return create_noinline(array,indices); + case(osg::Array::Vec2dArrayType): return create_noinline(array,indices); + case(osg::Array::Vec3dArrayType): return create_noinline(array,indices); + case(osg::Array::Vec4dArrayType): return create_noinline(array,indices); + default: + return NULL; + } } - } template - osg::Array* create(const TA& array, const osg::IndexArray& indices) { - // We know that indices.getType returned the same thing as TI, but - // we need to determine whether it is really an instance of TI, or - // perhaps another subclass of osg::Array that contains the same - // type of data. - const TI* ba(dynamic_cast(&indices)); - if (ba != NULL) { - return create_inline(array,*ba); + osg::Array* create(const TA& array, const osg::IndexArray& indices) + { + // We know that indices.getType returned the same thing as TI, but + // we need to determine whether it is really an instance of TI, or + // perhaps another subclass of osg::Array that contains the same + // type of data. + const TI* ba(dynamic_cast(&indices)); + if (ba != NULL) { + return create_inline(array,*ba); + } + else { + return create_noinline(array, _indices); + } } - else { - return create_noinline(array, _indices); - } - } template osg::Array* create(const T& array) @@ -3009,8 +3019,7 @@ class ExpandIndexedArray : public osg::ConstArrayVisitor case(osg::Array::UByteArrayType): return create(array, _indices); case(osg::Array::UShortArrayType): return create(array, _indices); case(osg::Array::UIntArrayType): return create(array, _indices); - default: - return create_noinline(array, _indices); + default: return create_noinline(array, _indices); } } @@ -3033,6 +3042,11 @@ class ExpandIndexedArray : public osg::ConstArrayVisitor const osg::IndexArray& _indices; osg::Array* _targetArray; + + protected: + + ExpandIndexedArray& operator = (const ExpandIndexedArray&) { return *this; } + }; bool Geometry::suitableForOptimization() const diff --git a/src/osg/GraphicsThread.cpp b/src/osg/GraphicsThread.cpp index 1e2c407e1..3401685d2 100644 --- a/src/osg/GraphicsThread.cpp +++ b/src/osg/GraphicsThread.cpp @@ -61,7 +61,7 @@ void BarrierOperation::release() Barrier::release(); } -void BarrierOperation::operator () (Object* object) +void BarrierOperation::operator () (Object* /*object*/) { if (_preBlockOp!=NO_OPERATION) { diff --git a/src/osg/Hint.cpp b/src/osg/Hint.cpp index 0afbe2ee7..791327ee6 100644 --- a/src/osg/Hint.cpp +++ b/src/osg/Hint.cpp @@ -16,7 +16,7 @@ using namespace osg; -void Hint::apply(State& state) const +void Hint::apply(State& /*state*/) const { if (_target==GL_NONE || _mode==GL_NONE) return; diff --git a/src/osg/KdTree.cpp b/src/osg/KdTree.cpp index 0887bdf87..c4010d3e0 100644 --- a/src/osg/KdTree.cpp +++ b/src/osg/KdTree.cpp @@ -48,6 +48,9 @@ struct BuildKdTree Indices _primitiveIndices; CenterList _centers; +protected: + + BuildKdTree& operator = (const BuildKdTree&) { return *this; } }; //////////////////////////////////////////////////////////////////////////////// @@ -464,6 +467,11 @@ struct IntersectKdTree osg::Vec3 _d_invX; osg::Vec3 _d_invY; osg::Vec3 _d_invZ; + + +protected: + + IntersectKdTree& operator = (const IntersectKdTree&) { return *this; } }; @@ -743,7 +751,10 @@ KdTree::KdTree() } KdTree::KdTree(const KdTree& rhs, const osg::CopyOp& copyop): - Shape(rhs) + Shape(rhs, copyop), + _vertices(rhs._vertices), + _kdNodes(rhs._kdNodes), + _triangles(rhs._triangles) { } diff --git a/src/osg/MatrixDecomposition.cpp b/src/osg/MatrixDecomposition.cpp index 2ac3b044b..0b4bd303e 100644 --- a/src/osg/MatrixDecomposition.cpp +++ b/src/osg/MatrixDecomposition.cpp @@ -467,7 +467,7 @@ namespace MatrixDecomposition } if (turn>=0) { Quat qtoz, qp; - unsigned neg[3], win; + unsigned int win; double mag[3], t; switch (turn) { default: return (Qt_Conj(q)); @@ -480,11 +480,12 @@ namespace MatrixDecomposition mag[1] = (double)q.x*q.z-(double)q.y*q.w; mag[2] = (double)q.y*q.z+(double)q.x*q.w; - for (i=0; i<3; i++) - //JVK?????? - //if (neg[i] = (mag[i]<0.0)) - if (neg[i] == (mag[i]<0.0)) - mag[i] = -mag[i]; + bool neg[3]; + for (i=0; i<3; i++) + { + neg[i] = (mag[i]<0.0); + if (neg[i]) mag[i] = -mag[i]; + } if (mag[0]>mag[1]) { if (mag[0]>mag[2]) @@ -509,13 +510,15 @@ namespace MatrixDecomposition } else { double qa[4], pa[4]; - unsigned lo, hi, neg[4], par = 0; + unsigned int lo, hi; + bool par = false; + bool neg[4]; double all, big, two; qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w; for (i=0; i<4; i++) { pa[i] = 0.0; - //if (neg[i] = (qa[i]<0.0)) qa[i] = -qa[i]; - if (neg[i] == (qa[i]<0.0)) qa[i] = -qa[i]; + neg[i] = (qa[i]<0.0); + if (neg[i]) qa[i] = -qa[i]; par ^= neg[i]; } diff --git a/src/osg/OcclusionQueryNode.cpp b/src/osg/OcclusionQueryNode.cpp index 25b21a72f..256f4fcb4 100644 --- a/src/osg/OcclusionQueryNode.cpp +++ b/src/osg/OcclusionQueryNode.cpp @@ -299,7 +299,7 @@ struct ClearQueriesCallback : public osg::Camera::DrawCallback ClearQueriesCallback( const ClearQueriesCallback&, const osg::CopyOp& ) {} META_Object( osgOQ, ClearQueriesCallback ) - virtual void operator() (const osg::Camera& camera) const + virtual void operator() (const osg::Camera&) const { if (!_rqcb) { diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index a54cf7ec1..261e68ff7 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -1879,6 +1879,10 @@ public: DatabasePager::PagedLODList& _activePagedLODList; int _frameNumber; + +protected: + + FindPagedLODsVisitor& operator = (const FindPagedLODsVisitor&) { return *this; } }; void DatabasePager::registerPagedLODs(osg::Node* subgraph, int frameNumber) diff --git a/src/osgDB/ImagePager.cpp b/src/osgDB/ImagePager.cpp index 802359fc3..23a77759f 100644 --- a/src/osgDB/ImagePager.cpp +++ b/src/osgDB/ImagePager.cpp @@ -294,7 +294,7 @@ osg::Image* ImagePager::readImageFile(const std::string& fileName) return osgDB::readImageFile(fileName); } -void ImagePager::requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp* framestamp) +void ImagePager::requestImageFile(const std::string& fileName,osg::Object* attachmentPoint, int attachmentIndex, double timeToMergeBy, const osg::FrameStamp*) { osg::notify(osg::INFO)<<"ImagePager::requestNodeFile("<_requestList.empty()); } -void ImagePager::updateSceneGraph(const osg::FrameStamp &frameStamp) +void ImagePager::updateSceneGraph(const osg::FrameStamp&) { OpenThreads::ScopedLock lock(_completedQueue->_requestMutex); diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index ace55bd57..d34579a80 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -82,6 +82,8 @@ public: protected: + AvailableReaderWriterIterator& operator = (const AvailableReaderWriterIterator&) { return *this; } + Registry::ReaderWriterList& _rwList; OpenThreads::ReentrantMutex& _pluginMutex; diff --git a/src/osgGA/CameraViewSwitchManipulator.cpp b/src/osgGA/CameraViewSwitchManipulator.cpp index 82c501be6..056057c6b 100644 --- a/src/osgGA/CameraViewSwitchManipulator.cpp +++ b/src/osgGA/CameraViewSwitchManipulator.cpp @@ -39,7 +39,7 @@ void CameraViewSwitchManipulator::getUsage(osg::ApplicationUsage& usage) const usage.addKeyboardMouseBinding("CameraViewSwitcher: ]","Increase current camera number"); } -bool CameraViewSwitchManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us) +bool CameraViewSwitchManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter&) { if (ea.getHandled()) return false;