From 4ad20a413a77783325e770b6d2c3aabb85a9df94 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Dec 2008 11:06:57 +0000 Subject: [PATCH] Fixed warnings --- include/osg/Image | 9 ++++----- include/osgAnimation/EaseMotion | 2 +- src/osgPlugins/ive/DataOutputStream.cpp | 4 ++-- src/osgPlugins/osgWidget/Box.cpp | 8 +++++--- src/osgPlugins/osgWidget/EmbeddedWindow.cpp | 10 +++++----- src/osgPlugins/osgWidget/Frame.cpp | 8 +++++--- src/osgPlugins/osgWidget/Input.cpp | 8 +++++--- src/osgPlugins/osgWidget/Label.cpp | 8 +++++--- src/osgPlugins/osgWidget/Table.cpp | 7 ++++--- src/osgPlugins/osgWidget/Widget.cpp | 22 +++++++++++++-------- src/osgPlugins/osgWidget/WindowManager.cpp | 8 +++++--- src/osgTerrain/GeometryTechnique.cpp | 7 ++++--- src/osgTerrain/Locator.cpp | 2 +- src/osgTerrain/TerrainTile.cpp | 8 ++++---- 14 files changed, 64 insertions(+), 47 deletions(-) diff --git a/include/osg/Image b/include/osg/Image index f3c78afb6..32104069b 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -318,17 +318,16 @@ class OSG_EXPORT Image : public Object /** Get the const PixelBufferObject.*/ const PixelBufferObject* getPixelBufferObject() const { return _bufferObject.get(); } - virtual void update(NodeVisitor* nv) {} - + virtual void update(NodeVisitor* /*nv*/) {} /** method for sending pointer events to images that are acting as front ends to interactive surfaces such as a vnc or browser window. Return true if handled. */ - virtual bool sendPointerEvent(int x, int y, int buttonMask) { return false; } + virtual bool sendPointerEvent(int /*x*/, int /*y*/, int /*buttonMask*/) { return false; } /** method for sending key events to images that are acting as front ends to interactive surfaces such as a vnc or browser window. Return true if handled.*/ - virtual bool sendKeyEvent(int key, bool keyDown) { return false; } + virtual bool sendKeyEvent(int /*key*/, bool /*keyDown*/) { return false; } /** method for passing frame information to the custom Image classes, to be called only when objects associated with imagery are not culled.*/ - virtual void setFrameLastRendered(const osg::FrameStamp* frameStamp) {} + virtual void setFrameLastRendered(const osg::FrameStamp* /*frameStamp*/) {} protected : diff --git a/include/osgAnimation/EaseMotion b/include/osgAnimation/EaseMotion index 35f3e822f..df3ae8d7f 100644 --- a/include/osgAnimation/EaseMotion +++ b/include/osgAnimation/EaseMotion @@ -169,7 +169,7 @@ namespace osgAnimation { enum TimeBehaviour { CLAMP, - LOOP, + LOOP }; Motion(float startValue = 0, float duration = 1, float changeValue = 1, TimeBehaviour tb = CLAMP) : _time(0), _startValue(startValue), _changeValue(changeValue), _duration(duration), _behaviour(tb) {} virtual ~Motion() {} diff --git a/src/osgPlugins/ive/DataOutputStream.cpp b/src/osgPlugins/ive/DataOutputStream.cpp index d0e4348e1..bae1e50ec 100644 --- a/src/osgPlugins/ive/DataOutputStream.cpp +++ b/src/osgPlugins/ive/DataOutputStream.cpp @@ -646,11 +646,11 @@ void DataOutputStream::writePackedFloatArray(const osg::FloatArray* a, float max if (maxError>0.0f) { - float byteError = 0.0f; + //float byteError = 0.0f; float byteMultiplier = 255.0f/(maxValue-minValue); float byteInvMultiplier = 1.0f/byteMultiplier; - float shortError = 0.0f; + //float shortError = 0.0f; float shortMultiplier = 65535.0f/(maxValue-minValue); float shortInvMultiplier = 1.0f/shortMultiplier; diff --git a/src/osgPlugins/osgWidget/Box.cpp b/src/osgPlugins/osgWidget/Box.cpp index 9d4acc344..366e72158 100644 --- a/src/osgPlugins/osgWidget/Box.cpp +++ b/src/osgPlugins/osgWidget/Box.cpp @@ -7,7 +7,8 @@ #include #include -bool osgWidget_Box_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_Box_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ /* osgWidget::Box& box = static_cast(obj); @@ -45,8 +46,9 @@ bool osgWidget_Box_readData(osg::Object& obj, osgDB::Input& fr) { return false; } -bool osgWidget_Box_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Box& model = static_cast(obj); +bool osgWidget_Box_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::Box& model = static_cast(obj); fw.indent() << fw.wrapString("Box stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/EmbeddedWindow.cpp b/src/osgPlugins/osgWidget/EmbeddedWindow.cpp index a1b7d74e5..d528d1757 100644 --- a/src/osgPlugins/osgWidget/EmbeddedWindow.cpp +++ b/src/osgPlugins/osgWidget/EmbeddedWindow.cpp @@ -7,16 +7,16 @@ #include #include -bool osgWidget_EmbeddedWindow_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_EmbeddedWindow_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "EmbeddedWindow read" << std::endl; return false; } -bool osgWidget_EmbeddedWindow_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Window::EmbeddedWindow& model = - static_cast(obj) - ; +bool osgWidget_EmbeddedWindow_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::Window::EmbeddedWindow& model = static_cast(obj); fw.indent() << fw.wrapString("EmbeddedWindow stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/Frame.cpp b/src/osgPlugins/osgWidget/Frame.cpp index 92d698dbf..75753d4ce 100644 --- a/src/osgPlugins/osgWidget/Frame.cpp +++ b/src/osgPlugins/osgWidget/Frame.cpp @@ -7,14 +7,16 @@ #include #include -bool osgWidget_Frame_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_Frame_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "Frame read" << std::endl; return false; } -bool osgWidget_Frame_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Frame& model = static_cast(obj); +bool osgWidget_Frame_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::Frame& model = static_cast(obj); fw.indent() << fw.wrapString("Frame stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/Input.cpp b/src/osgPlugins/osgWidget/Input.cpp index 78db98f73..e1dc333ef 100644 --- a/src/osgPlugins/osgWidget/Input.cpp +++ b/src/osgPlugins/osgWidget/Input.cpp @@ -7,14 +7,16 @@ #include #include -bool osgWidget_Input_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_Input_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "Input read" << std::endl; return false; } -bool osgWidget_Input_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Input& model = static_cast(obj); +bool osgWidget_Input_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::Input& model = static_cast(obj); fw.indent() << fw.wrapString("Input stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/Label.cpp b/src/osgPlugins/osgWidget/Label.cpp index a0eee152d..0ea9ced0d 100644 --- a/src/osgPlugins/osgWidget/Label.cpp +++ b/src/osgPlugins/osgWidget/Label.cpp @@ -7,14 +7,16 @@ #include #include -bool osgWidget_Label_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_Label_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "Label read" << std::endl; return false; } -bool osgWidget_Label_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Label& model = static_cast(obj); +bool osgWidget_Label_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::Label& model = static_cast(obj); fw.indent() << fw.wrapString("Label stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/Table.cpp b/src/osgPlugins/osgWidget/Table.cpp index 33d52421f..1c687dcdb 100644 --- a/src/osgPlugins/osgWidget/Table.cpp +++ b/src/osgPlugins/osgWidget/Table.cpp @@ -7,14 +7,15 @@ #include #include -bool osgWidget_Table_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_Table_readData(osg::Object& /*obj*/, osgDB::Input& fr) { osgWidget::warn() << "Table read" << std::endl; return false; } -bool osgWidget_Table_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Table& model = static_cast(obj); +bool osgWidget_Table_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::Table& model = static_cast(obj); fw.indent() << fw.wrapString("Table stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/Widget.cpp b/src/osgPlugins/osgWidget/Widget.cpp index a9258e677..31704977d 100644 --- a/src/osgPlugins/osgWidget/Widget.cpp +++ b/src/osgPlugins/osgWidget/Widget.cpp @@ -14,36 +14,42 @@ bool osgWidget_Widget_readData(osg::Object& obj, osgDB::Input& fr) { return false; } -bool osgWidget_Widget_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::Widget& model = static_cast(obj); +bool osgWidget_Widget_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + + // const osgWidget::Widget& model = static_cast(obj); fw.indent() << fw.wrapString("Widget stuff...") << std::endl; return true; } -bool osgWidget_NotifyWidget_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_NotifyWidget_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "NotifyWidget read" << std::endl; return false; } -bool osgWidget_NotifyWidget_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::NotifyWidget& model = static_cast(obj); +bool osgWidget_NotifyWidget_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::NotifyWidget& model = static_cast(obj); fw.indent() << fw.wrapString("NotifyWidget stuff...") << std::endl; return true; } -bool osgWidget_NullWidget_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_NullWidget_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "NullWidget read" << std::endl; return false; } -bool osgWidget_NullWidget_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::NullWidget& model = static_cast(obj); +bool osgWidget_NullWidget_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::NullWidget& model = static_cast(obj); fw.indent() << fw.wrapString("NullWidget stuff...") << std::endl; diff --git a/src/osgPlugins/osgWidget/WindowManager.cpp b/src/osgPlugins/osgWidget/WindowManager.cpp index bd1157bc5..4f3fac108 100644 --- a/src/osgPlugins/osgWidget/WindowManager.cpp +++ b/src/osgPlugins/osgWidget/WindowManager.cpp @@ -7,14 +7,16 @@ #include #include -bool osgWidget_WindowManager_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_WindowManager_readData(osg::Object& /*obj*/, osgDB::Input& fr) +{ osgWidget::warn() << "WindowManager read" << std::endl; return false; } -bool osgWidget_WindowManager_writeData(const osg::Object& obj, osgDB::Output& fw) { - const osgWidget::WindowManager& model = static_cast(obj); +bool osgWidget_WindowManager_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) +{ + // const osgWidget::WindowManager& model = static_cast(obj); fw.indent() << fw.wrapString("WindowManager stuff...") << std::endl; diff --git a/src/osgTerrain/GeometryTechnique.cpp b/src/osgTerrain/GeometryTechnique.cpp index 1646414bb..5d1953955 100644 --- a/src/osgTerrain/GeometryTechnique.cpp +++ b/src/osgTerrain/GeometryTechnique.cpp @@ -283,7 +283,7 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3 geometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); - float minHeight = 0.0; + //float minHeight = 0.0; float scaleHeight = _terrainTile->getTerrain() ? _terrainTile->getTerrain()->getVerticalScale() : 1.0f; // allocate and assign tex coords @@ -311,7 +311,7 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3 if (switchLayer) { if (switchLayer->getActiveLayer()>=0 && - switchLayer->getActiveLayer()getNumLayers() && + static_cast(switchLayer->getActiveLayer())getNumLayers() && switchLayer->getLayer(switchLayer->getActiveLayer())) { locator = switchLayer->getLayer(switchLayer->getActiveLayer())->getLocator(); @@ -697,7 +697,8 @@ void GeometryTechnique::applyColorLayers() osgTerrain::SwitchLayer* switchLayer = dynamic_cast(colorLayer); if (switchLayer) { - if (switchLayer->getActiveLayer()<0 || switchLayer->getActiveLayer()>=switchLayer->getNumLayers()) + if (switchLayer->getActiveLayer()<0 || + static_cast(switchLayer->getActiveLayer())>=switchLayer->getNumLayers()) { continue; } diff --git a/src/osgTerrain/Locator.cpp b/src/osgTerrain/Locator.cpp index 9cfeae025..e724211a2 100644 --- a/src/osgTerrain/Locator.cpp +++ b/src/osgTerrain/Locator.cpp @@ -33,9 +33,9 @@ Locator::Locator(): Locator::Locator(const Locator& locator,const osg::CopyOp& copyop): osg::Object(locator,copyop), _coordinateSystemType(locator._coordinateSystemType), - _ellipsoidModel(locator._ellipsoidModel), _format(locator._format), _cs(locator._cs), + _ellipsoidModel(locator._ellipsoidModel), _transform(locator._transform), _definedInFile(locator._definedInFile), _transformScaledByResolution(locator._transformScaledByResolution) diff --git a/src/osgTerrain/TerrainTile.cpp b/src/osgTerrain/TerrainTile.cpp index 283d6eec7..9d5d9142d 100644 --- a/src/osgTerrain/TerrainTile.cpp +++ b/src/osgTerrain/TerrainTile.cpp @@ -40,10 +40,10 @@ osg::ref_ptr& TerrainTile::getTileLoadedCallbac TerrainTile::TerrainTile(): _terrain(0), + _dirty(false), _hasBeenTraversal(false), _requiresNormals(true), - _treatBoundariesToValidDataAsDefaultValue(false), - _dirty(false) + _treatBoundariesToValidDataAsDefaultValue(false) { setThreadSafeRefUnref(true); } @@ -51,12 +51,12 @@ TerrainTile::TerrainTile(): TerrainTile::TerrainTile(const TerrainTile& terrain,const osg::CopyOp& copyop): Group(terrain,copyop), _terrain(0), + _dirty(false), _hasBeenTraversal(false), _elevationLayer(terrain._elevationLayer), _colorLayers(terrain._colorLayers), _requiresNormals(terrain._requiresNormals), - _treatBoundariesToValidDataAsDefaultValue(terrain._treatBoundariesToValidDataAsDefaultValue), - _dirty(false) + _treatBoundariesToValidDataAsDefaultValue(terrain._treatBoundariesToValidDataAsDefaultValue) { if (terrain.getTerrainTechnique()) {