From 98bd0583175287a72e3b3e5c4bdfafa9dbc50e86 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 7 Jan 2009 10:32:59 +0000 Subject: [PATCH] Fixed warnings --- include/OpenThreads/ReadWriteMutex | 4 ++++ include/osg/TemplatePrimitiveFunctor | 4 ++-- include/osgAnimation/Bone | 2 +- include/osgAnimation/Timeline | 11 +++++++---- include/osgAnimation/VertexInfluence | 2 +- include/osgDB/ParameterOutput | 3 ++- include/osgGA/CameraViewSwitchManipulator | 6 +++--- include/osgSim/ObjectRecordData | 4 +++- include/osgSim/OverlayNode | 2 +- include/osgTerrain/Layer | 2 +- include/osgTerrain/ValidDataOperator | 2 +- include/osgViewer/ViewerEventHandlers | 5 ++++- include/osgVolume/Locator | 1 + include/osgWidget/Browser | 4 +++- include/osgWidget/EventInterface | 8 +++----- 15 files changed, 37 insertions(+), 23 deletions(-) diff --git a/include/OpenThreads/ReadWriteMutex b/include/OpenThreads/ReadWriteMutex index 83bc75ddb..c78a651d6 100644 --- a/include/OpenThreads/ReadWriteMutex +++ b/include/OpenThreads/ReadWriteMutex @@ -91,6 +91,8 @@ class ScopedReadLock protected: ReadWriteMutex& _mutex; + + ScopedReadLock& operator = (const ScopedReadLock&) { return *this; } }; @@ -103,6 +105,8 @@ class ScopedWriteLock protected: ReadWriteMutex& _mutex; + + ScopedWriteLock& operator = (const ScopedWriteLock&) { return *this; } }; } diff --git a/include/osg/TemplatePrimitiveFunctor b/include/osg/TemplatePrimitiveFunctor index d718b7251..699e0c817 100644 --- a/include/osg/TemplatePrimitiveFunctor +++ b/include/osg/TemplatePrimitiveFunctor @@ -76,7 +76,7 @@ namespace osg { notify(WARN)<<"Triangle Functor does not support Vec2d* vertex arrays"<operator()(_vertexArrayPtr[*iptr],_vertexArrayPtr[*(iptr+1)], _treatVertexDataAsTemporary); - break; this->operator()(_vertexArrayPtr[*(ilast)],_vertexArrayPtr[indices[0]], _treatVertexDataAsTemporary); + break; } default: break; diff --git a/include/osgAnimation/Bone b/include/osgAnimation/Bone index f714ad5d0..5cc8342e1 100644 --- a/include/osgAnimation/Bone +++ b/include/osgAnimation/Bone @@ -58,7 +58,7 @@ namespace osgAnimation META_NodeVisitor("osgAnimation","BoneMapVisitor") - void apply(osg::Node& node) { return; } + void apply(osg::Node&) { return; } void apply(osg::Transform& node) { Bone* bone = dynamic_cast(&node); diff --git a/include/osgAnimation/Timeline b/include/osgAnimation/Timeline index b34209ba9..33de8136f 100644 --- a/include/osgAnimation/Timeline +++ b/include/osgAnimation/Timeline @@ -35,11 +35,12 @@ namespace osgAnimation { public: Callback(){} - Callback(const Callback& nc,const osg::CopyOp&) {} + Callback(const Callback&,const osg::CopyOp&) {} META_Object(osgAnimation,Callback); - virtual void operator()(Action* action) {} + virtual void operator()(Action* /*action*/) {} + void addNestedCallback(Callback* callback) { if (_nested.valid()) @@ -56,6 +57,7 @@ namespace osgAnimation typedef std::map > FrameCallback; META_Object(osgAnimation, Action); + Action() { _numberFrame = 25; @@ -63,7 +65,8 @@ namespace osgAnimation _speed = 1.0; _loop = 1; } - Action(const Action& nc,const osg::CopyOp&) {} + + Action(const Action&,const osg::CopyOp&) {} void setCallback(double when, Callback* callback) { @@ -520,7 +523,7 @@ namespace osgAnimation public: RunAction(Timeline* tm, Action* a) : _tm(tm), _action(a) {} - virtual void operator()(Action* action) + virtual void operator()(Action* /*action*/) { _tm->addActionAt(_tm->getCurrentFrame(), _action.get()); // warning we are trsversing the vector } diff --git a/include/osgAnimation/VertexInfluence b/include/osgAnimation/VertexInfluence index d9c09044b..337e0d792 100644 --- a/include/osgAnimation/VertexInfluence +++ b/include/osgAnimation/VertexInfluence @@ -46,7 +46,7 @@ namespace osgAnimation META_Object(osgAnimation, VertexInfluenceMap); VertexInfluenceMap() {} - VertexInfluenceMap(const osgAnimation::VertexInfluenceMap& infl, const osg::CopyOp&) {;} + VertexInfluenceMap(const osgAnimation::VertexInfluenceMap&, const osg::CopyOp&) {} }; diff --git a/include/osgDB/ParameterOutput b/include/osgDB/ParameterOutput index c80c23863..f5398b914 100644 --- a/include/osgDB/ParameterOutput +++ b/include/osgDB/ParameterOutput @@ -99,10 +99,11 @@ class ParameterOutput protected: + ParameterOutput& operator = (const ParameterOutput&) { return *this; } + Output& _fw; int _numItemsPerLine; int _column; - }; diff --git a/include/osgGA/CameraViewSwitchManipulator b/include/osgGA/CameraViewSwitchManipulator index 0d5e20417..61d2b8860 100644 --- a/include/osgGA/CameraViewSwitchManipulator +++ b/include/osgGA/CameraViewSwitchManipulator @@ -28,10 +28,10 @@ class OSGGA_EXPORT CameraViewSwitchManipulator : public MatrixManipulator virtual const char* className() const { return "CameraViewSwitcher"; } /** set the position of the matrix manipulator using a 4x4 Matrix.*/ - virtual void setByMatrix(const osg::Matrixd& matrix) {} + virtual void setByMatrix(const osg::Matrixd& /*matrix*/) {} /** set the position of the matrix manipulator using a 4x4 Matrix.*/ - virtual void setByInverseMatrix(const osg::Matrixd& matrix) {} + virtual void setByInverseMatrix(const osg::Matrixd& /*matrix*/) {} /** get the position of the manipulator as 4x4 Matrix.*/ virtual osg::Matrixd getMatrix() const; @@ -53,7 +53,7 @@ class OSGGA_EXPORT CameraViewSwitchManipulator : public MatrixManipulator virtual osg::Node* getNode() { return _node.get();} /** Start/restart the manipulator.*/ - virtual void init(const GUIEventAdapter& ea,GUIActionAdapter& us) { _currentView = 0; } + virtual void init(const GUIEventAdapter& /*ea*/,GUIActionAdapter& /*aa*/) { _currentView = 0; } /** handle events, return true if handled, false otherwise.*/ virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us); diff --git a/include/osgSim/ObjectRecordData b/include/osgSim/ObjectRecordData index 2878f96ee..1dc20fef5 100644 --- a/include/osgSim/ObjectRecordData +++ b/include/osgSim/ObjectRecordData @@ -38,7 +38,9 @@ class ObjectRecordData : public osg::Object _significance( 0 ) {} - ObjectRecordData( const ObjectRecordData& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY ) + + ObjectRecordData( const ObjectRecordData& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY ): + osg::Object(copy, copyop) { _flags = copy._flags; _relativePriority = copy._relativePriority; diff --git a/include/osgSim/OverlayNode b/include/osgSim/OverlayNode index 5f68c38f1..a133795dc 100644 --- a/include/osgSim/OverlayNode +++ b/include/osgSim/OverlayNode @@ -84,7 +84,7 @@ class OSGSIM_EXPORT OverlayNode : public osg::Group double getOverlayBaseHeight() const { return _overlayBaseHeight; } /** Set the clear color to use when rendering the overlay subgraph.*/ - void setOverlayClearColor(const osg::Vec4& color) { _overlayClearColor = _overlayClearColor; } + void setOverlayClearColor(const osg::Vec4& color) { _overlayClearColor = color; } /** Get the clear color to use when rendering the overlay subgraph.*/ const osg::Vec4& getOverlayClearColor() const { return _overlayClearColor; } diff --git a/include/osgTerrain/Layer b/include/osgTerrain/Layer index 0aec06692..9004278be 100644 --- a/include/osgTerrain/Layer +++ b/include/osgTerrain/Layer @@ -100,7 +100,7 @@ class OSGTERRAIN_EXPORT Layer : public osg::Object virtual const osg::Image* getImage() const { return 0; } - virtual bool transform(float offset, float scale) { return false; } + virtual bool transform(float /*offset*/, float /*scale*/) { return false; } virtual bool getValue(unsigned int /*i*/, unsigned int /*j*/, float& /*value*/) const { return false; } diff --git a/include/osgTerrain/ValidDataOperator b/include/osgTerrain/ValidDataOperator index a86bb373d..b6ea98922 100644 --- a/include/osgTerrain/ValidDataOperator +++ b/include/osgTerrain/ValidDataOperator @@ -24,7 +24,7 @@ namespace osgTerrain { struct ValidDataOperator : public osg::Referenced { - virtual bool operator() (float value) const { return true; } + virtual bool operator() (float /*value*/) const { return true; } virtual bool operator() (const osg::Vec2& value) const { return operator()(value.x()) && operator()(value.y()) ; } virtual bool operator() (const osg::Vec3& value) const { return operator()(value.x()) && operator()(value.y()) && operator()(value.z()); } virtual bool operator() (const osg::Vec4& value) const { return operator()(value.x()) && operator()(value.y()) && operator()(value.z()) && operator()(value.w()); } diff --git a/include/osgViewer/ViewerEventHandlers b/include/osgViewer/ViewerEventHandlers index f6b875bee..91996474a 100644 --- a/include/osgViewer/ViewerEventHandlers +++ b/include/osgViewer/ViewerEventHandlers @@ -328,6 +328,9 @@ class OSGVIEWER_EXPORT ScreenCaptureHandler : public osgGA::GUIEventHandler SavePolicy getSavePolicy() const { return _savePolicy; } protected: + + WriteToFile& operator = (const WriteToFile&) { return *this; } + const std::string _filename; const std::string _extension; @@ -387,7 +390,7 @@ protected: InteractiveImageHandler() {} - InteractiveImageHandler(const InteractiveImageHandler& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) {} + InteractiveImageHandler(const InteractiveImageHandler&,const osg::CopyOp& = osg::CopyOp::SHALLOW_COPY) {} bool mousePosition(osgViewer::View* view, osg::NodeVisitor* nv, const osgGA::GUIEventAdapter& ea, int& x, int &y) const; diff --git a/include/osgVolume/Locator b/include/osgVolume/Locator index d84a5c69c..4275da1d5 100644 --- a/include/osgVolume/Locator +++ b/include/osgVolume/Locator @@ -29,6 +29,7 @@ class OSGVOLUME_EXPORT Locator : public osg::Object /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ Locator(const Locator& locator,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(locator, copyop), _transform(locator._transform) {} META_Object(osgVolume, Locator); diff --git a/include/osgWidget/Browser b/include/osgWidget/Browser index 61a8b3e0d..d19678cd9 100644 --- a/include/osgWidget/Browser +++ b/include/osgWidget/Browser @@ -37,7 +37,9 @@ class OSGWIDGET_EXPORT BrowserManager : public osg::Object protected: BrowserManager(); - BrowserManager(const BrowserManager& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) {} + BrowserManager(const BrowserManager& rhs, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(rhs,copyop) {} + virtual ~BrowserManager(); META_Object(osgWidget,BrowserManager) diff --git a/include/osgWidget/EventInterface b/include/osgWidget/EventInterface index b6860cd1f..a5f988fa8 100644 --- a/include/osgWidget/EventInterface +++ b/include/osgWidget/EventInterface @@ -172,18 +172,16 @@ class ObjectCallback: public CallbackInterface typedef bool (T::*ObjectCallbackType)(Event&); ObjectCallback(ObjectCallbackType callback, T* obj): - _callback (callback), - _object (obj) { - } + _object (obj), + _callback (callback) {} virtual bool operator()(Event& ev) { return (_object->*_callback)(ev); } private: - ObjectCallbackType _callback; T* _object; - + ObjectCallbackType _callback; }; // The object that facilitates general functions as callbacks.