From bfff44ac9da5744fd6c65102fc3c9d806a19e7f4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:01:47 +0100 Subject: [PATCH 01/94] Fixed unused parameter warning. --- .../osgAnimation/ReaderWriter.cpp | 16 ++++++++-------- .../osgAnimation/UpdateMaterial.cpp | 4 ++-- .../osgTerrain/GeometryTechnique.cpp | 4 ++-- .../osgVolume/FixedFunctionTechnique.cpp | 4 ++-- .../deprecated-dotosg/osgVolume/Property.cpp | 4 ++-- .../osgVolume/PropertyAdjustmentCallback.cpp | 4 ++-- .../osgVolume/RayTracedTechnique.cpp | 4 ++-- src/osgWrappers/serializers/CMakeLists.txt | 8 ++++++++ 8 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/osgWrappers/deprecated-dotosg/osgAnimation/ReaderWriter.cpp b/src/osgWrappers/deprecated-dotosg/osgAnimation/ReaderWriter.cpp index faf551c7d..add7f50fd 100644 --- a/src/osgWrappers/deprecated-dotosg/osgAnimation/ReaderWriter.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgAnimation/ReaderWriter.cpp @@ -126,11 +126,11 @@ RegisterDotOsgWrapperProxy g_BoneProxy -bool Skeleton_readLocalData(Object& obj, Input& fr) +bool Skeleton_readLocalData(Object& /*obj*/, Input& /*fr*/) { return false; } -bool Skeleton_writeLocalData(const Object& obj, Output& fr) +bool Skeleton_writeLocalData(const Object& /*obj*/, Output& /*fr*/) { return true; } @@ -1009,13 +1009,13 @@ RegisterDotOsgWrapperProxy g_osgAnimationMorphGeometryProxy -bool UpdateBone_readLocalData(Object& obj, Input& fr) +bool UpdateBone_readLocalData(Object& /*obj*/, Input& /*fr*/) { bool iteratorAdvanced = false; return iteratorAdvanced; } -bool UpdateBone_writeLocalData(const Object& obj, Output& fw) +bool UpdateBone_writeLocalData(const Object& /*obj*/, Output& /*fw*/) { return true; } @@ -1032,13 +1032,13 @@ RegisterDotOsgWrapperProxy g_UpdateBoneProxy -bool UpdateSkeleton_readLocalData(Object& obj, Input& fr) +bool UpdateSkeleton_readLocalData(Object& /*obj*/, Input& /*fr*/) { bool iteratorAdvanced = false; return iteratorAdvanced; } -bool UpdateSkeleton_writeLocalData(const Object& obj, Output& fw) +bool UpdateSkeleton_writeLocalData(const Object& /*obj*/, Output& /*fw*/) { return true; } @@ -1054,13 +1054,13 @@ RegisterDotOsgWrapperProxy g_UpdateSkeletonProxy ); -bool UpdateMorph_readLocalData(Object& obj, Input& fr) +bool UpdateMorph_readLocalData(Object& /*obj*/, Input& /*fr*/) { bool iteratorAdvanced = false; return iteratorAdvanced; } -bool UpdateMorph_writeLocalData(const Object& obj, Output& fw) +bool UpdateMorph_writeLocalData(const Object& /*obj*/, Output& /*fw*/) { return true; } diff --git a/src/osgWrappers/deprecated-dotosg/osgAnimation/UpdateMaterial.cpp b/src/osgWrappers/deprecated-dotosg/osgAnimation/UpdateMaterial.cpp index 8bc614cf4..858862c1c 100644 --- a/src/osgWrappers/deprecated-dotosg/osgAnimation/UpdateMaterial.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgAnimation/UpdateMaterial.cpp @@ -25,13 +25,13 @@ using namespace osg; using namespace osgDB; -bool UpdateMaterial_readLocalData(Object& obj, Input& fr) +bool UpdateMaterial_readLocalData(Object& /*obj*/, Input& /*fr*/) { bool iteratorAdvanced = false; return iteratorAdvanced; } -bool UpdateMaterial_writeLocalData(const Object& obj, Output& fw) +bool UpdateMaterial_writeLocalData(const Object& /*obj*/, Output& /*fw*/) { return true; } diff --git a/src/osgWrappers/deprecated-dotosg/osgTerrain/GeometryTechnique.cpp b/src/osgWrappers/deprecated-dotosg/osgTerrain/GeometryTechnique.cpp index 0f9347fe0..a1e9061ce 100644 --- a/src/osgWrappers/deprecated-dotosg/osgTerrain/GeometryTechnique.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgTerrain/GeometryTechnique.cpp @@ -26,14 +26,14 @@ REGISTER_DOTOSGWRAPPER(GeometryTechnique_Proxy) ); -bool GeometryTechnique_readLocalData(osg::Object& obj, osgDB::Input &fr) +bool GeometryTechnique_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { //osgTerrain::GeometryTechnique& gt = static_cast(obj); bool itrAdvanced = false; return itrAdvanced; } -bool GeometryTechnique_writeLocalData(const osg::Object& obj, osgDB::Output& fw) +bool GeometryTechnique_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/) { //const osgTerrain::GeometryTechnique& gt = static_cast(obj); return true; diff --git a/src/osgWrappers/deprecated-dotosg/osgVolume/FixedFunctionTechnique.cpp b/src/osgWrappers/deprecated-dotosg/osgVolume/FixedFunctionTechnique.cpp index 38a67069c..a9908fbca 100644 --- a/src/osgWrappers/deprecated-dotosg/osgVolume/FixedFunctionTechnique.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgVolume/FixedFunctionTechnique.cpp @@ -26,14 +26,14 @@ REGISTER_DOTOSGWRAPPER(FixedFunctionTechnique_Proxy) ); -bool FixedFunctionTechnique_readLocalData(osg::Object& obj, osgDB::Input &fr) +bool FixedFunctionTechnique_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { //osgVolume::FixedFunctionTechnique& fft = static_cast(obj); bool itrAdvanced = false; return itrAdvanced; } -bool FixedFunctionTechnique_writeLocalData(const osg::Object& obj, osgDB::Output& fw) +bool FixedFunctionTechnique_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/) { //const osgVolume::FixedFunctionTechnique& fft = static_cast(obj); return true; diff --git a/src/osgWrappers/deprecated-dotosg/osgVolume/Property.cpp b/src/osgWrappers/deprecated-dotosg/osgVolume/Property.cpp index f578cda48..f3759d2c7 100644 --- a/src/osgWrappers/deprecated-dotosg/osgVolume/Property.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgVolume/Property.cpp @@ -43,12 +43,12 @@ REGISTER_DOTOSGWRAPPER(LightingProperty_Proxy) Property_writeLocalData ); -bool Property_readLocalData(osg::Object& obj, osgDB::Input &fr) +bool Property_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { return false; } -bool Property_writeLocalData(const osg::Object& obj, osgDB::Output& fw) +bool Property_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/) { return true; } diff --git a/src/osgWrappers/deprecated-dotosg/osgVolume/PropertyAdjustmentCallback.cpp b/src/osgWrappers/deprecated-dotosg/osgVolume/PropertyAdjustmentCallback.cpp index 83bb1c1d6..d661d26e8 100644 --- a/src/osgWrappers/deprecated-dotosg/osgVolume/PropertyAdjustmentCallback.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgVolume/PropertyAdjustmentCallback.cpp @@ -26,12 +26,12 @@ REGISTER_DOTOSGWRAPPER(PropertyAdjustmentCallback_Proxy) ); -bool PropertyAdjustmentCallback_readLocalData(osg::Object& obj, osgDB::Input &fr) +bool PropertyAdjustmentCallback_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { return false; } -bool PropertyAdjustmentCallback_writeLocalData(const osg::Object& obj, osgDB::Output& fw) +bool PropertyAdjustmentCallback_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/) { return true; } diff --git a/src/osgWrappers/deprecated-dotosg/osgVolume/RayTracedTechnique.cpp b/src/osgWrappers/deprecated-dotosg/osgVolume/RayTracedTechnique.cpp index 8e57efc3e..ae8b5d28d 100644 --- a/src/osgWrappers/deprecated-dotosg/osgVolume/RayTracedTechnique.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgVolume/RayTracedTechnique.cpp @@ -26,14 +26,14 @@ REGISTER_DOTOSGWRAPPER(RayTracedTechnique_Proxy) ); -bool RayTracedTechnique_readLocalData(osg::Object& obj, osgDB::Input &fr) +bool RayTracedTechnique_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { //osgVolume::RayTracedTechnique& st = static_cast(obj); bool itrAdvanced = false; return itrAdvanced; } -bool RayTracedTechnique_writeLocalData(const osg::Object& obj, osgDB::Output& fw) +bool RayTracedTechnique_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/) { //const osgVolume::RayTracedTechnique& st = static_cast(obj); return true; diff --git a/src/osgWrappers/serializers/CMakeLists.txt b/src/osgWrappers/serializers/CMakeLists.txt index ab396dfbe..22d49e354 100644 --- a/src/osgWrappers/serializers/CMakeLists.txt +++ b/src/osgWrappers/serializers/CMakeLists.txt @@ -28,6 +28,14 @@ IF(MSVC) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zp16") ENDIF() +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + SET(TARGET_DEFAULT_PREFIX "osgdb_serializers_") SET(TARGET_DEFAULT_LABEL_PREFIX "Plugins osg serializer") SET(TARGET_COMMON_LIBRARIES From b19c87948516206b840872d195465036e2cc87a7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:04:01 +0100 Subject: [PATCH 02/94] Fixed unused parameter warning. --- src/osgWidget/CMakeLists.txt | 8 ++++++++ src/osgWidget/Input.cpp | 10 ++++++---- src/osgWidget/Lua.cpp | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/osgWidget/CMakeLists.txt b/src/osgWidget/CMakeLists.txt index c1716c21b..378a1a72f 100644 --- a/src/osgWidget/CMakeLists.txt +++ b/src/osgWidget/CMakeLists.txt @@ -4,6 +4,14 @@ ELSE() ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ENDIF() +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + SET(LIB_NAME osgWidget) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(TARGET_H diff --git a/src/osgWidget/Input.cpp b/src/osgWidget/Input.cpp index 420177a06..4458505e3 100644 --- a/src/osgWidget/Input.cpp +++ b/src/osgWidget/Input.cpp @@ -82,7 +82,8 @@ Input::Input(const std::string& name, const std::string& label, unsigned int siz _cursor->setDrawCallback( new BlinkCursorCallback(_insertMode) ); } -void Input::_calculateSize(const XYCoord& size) { +void Input::_calculateSize(const XYCoord& /*size*/) + { // An Input cannot currently set it's own size RELIABLY until the osgText implementation // is dratiscally improved. I'm getting wildly crazy results. :( // point_type height = size.y() > _cursor->getHeight() ? size.y() : _cursor->getHeight(); @@ -281,11 +282,12 @@ void Input::positioned() } } -bool Input::keyUp(int key, int mask, const WindowManager*) { +bool Input::keyUp(int /*key*/, int /*mask*/, const WindowManager*) +{ return false; } -bool Input::mouseDrag (double x, double y, const WindowManager*) +bool Input::mouseDrag (double x, double /*y*/, const WindowManager*) { _mouseClickX += x; x = _mouseClickX; @@ -306,7 +308,7 @@ bool Input::mouseDrag (double x, double y, const WindowManager*) return true; } -bool Input::mousePush (double x, double y, const WindowManager* wm) +bool Input::mousePush (double x, double /*y*/, const WindowManager* /*wm*/) { double offset = getOrigin().x(); Window* window = getParent(); diff --git a/src/osgWidget/Lua.cpp b/src/osgWidget/Lua.cpp index 9def84f2a..f55a31e9a 100644 --- a/src/osgWidget/Lua.cpp +++ b/src/osgWidget/Lua.cpp @@ -131,7 +131,7 @@ bool LuaEngine::close() { #endif } -bool LuaEngine::eval(const std::string& code) { +bool LuaEngine::eval(const std::string& /*code*/) { #ifdef OSGWIDGET_USELUA if(luaL_dostring(_data->lua, code.c_str())) { warn() << "LuaEngine::eval - " << lua_tostring(_data->lua, -1) << std::endl; @@ -146,7 +146,7 @@ bool LuaEngine::eval(const std::string& code) { #endif } -bool LuaEngine::runFile(const std::string& filePath) { +bool LuaEngine::runFile(const std::string& /*filePath*/) { #ifdef OSGWIDGET_USELUA if(!osgDB::fileExists(filePath)) { warn() << "Couldn't find file \"" << filePath << "\" for LuaEngine." << std::endl; From ee30c7d0a50e2609e80de766968bc2cacb998812 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:05:34 +0100 Subject: [PATCH 03/94] Fixed -Wextra warningsw --- src/osgUI/Callbacks.cpp | 13 ++++++++++--- src/osgUI/Dialog.cpp | 2 +- src/osgUI/LineEdit.cpp | 2 +- src/osgUI/Popup.cpp | 2 +- src/osgUI/PushButton.cpp | 2 +- src/osgUI/Validator.cpp | 4 ++-- src/osgUI/Widget.cpp | 2 +- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/osgUI/Callbacks.cpp b/src/osgUI/Callbacks.cpp index bf14e19dc..bac9d5909 100644 --- a/src/osgUI/Callbacks.cpp +++ b/src/osgUI/Callbacks.cpp @@ -27,7 +27,10 @@ CloseCallback::CloseCallback(const std::string& callbackName, osgUI::Widget* clo setName(callbackName); } -CloseCallback::CloseCallback(const CloseCallback& hc, const osg::CopyOp& copyop) +CloseCallback::CloseCallback(const CloseCallback& hc, const osg::CopyOp& copyop): + osg::Object(hc, copyop), + osg::Callback(hc, copyop), + osg::CallbackObject(hc, copyop) { } @@ -70,11 +73,13 @@ HandleCallback::HandleCallback() } HandleCallback::HandleCallback(const HandleCallback& hc, const osg::CopyOp& copyop): + osg::Object(hc, copyop), + osg::Callback(hc, copyop), osg::CallbackObject(hc, copyop) { } -bool HandleCallback::run(osg::Object* object, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const +bool HandleCallback::run(osg::Object* /*object*/, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const { if (inputParameters.size()>=2) { @@ -89,7 +94,7 @@ bool HandleCallback::run(osg::Object* object, osg::Parameters& inputParameters, return false; } -bool HandleCallback::handle(osgGA::EventVisitor* ev, osgGA::Event* event) const +bool HandleCallback::handle(osgGA::EventVisitor* /*ev*/, osgGA::Event* /*event*/) const { return false; } @@ -101,6 +106,8 @@ DragCallback::DragCallback(): } DragCallback::DragCallback(const DragCallback& hc, const osg::CopyOp& copyop): + osg::Object(hc, copyop), + osg::Callback(hc, copyop), HandleCallback(hc, copyop) { } diff --git a/src/osgUI/Dialog.cpp b/src/osgUI/Dialog.cpp index e3dd23a4e..923f9d859 100644 --- a/src/osgUI/Dialog.cpp +++ b/src/osgUI/Dialog.cpp @@ -34,7 +34,7 @@ Dialog::Dialog(const osgUI::Dialog& dialog, const osg::CopyOp& copyop): { } -bool Dialog::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event) +bool Dialog::handleImplementation(osgGA::EventVisitor* /*ev*/, osgGA::Event* event) { osgGA::GUIEventAdapter* ea = event->asGUIEventAdapter(); if (!ea) return false; diff --git a/src/osgUI/LineEdit.cpp b/src/osgUI/LineEdit.cpp index 217b77895..9587a148f 100644 --- a/src/osgUI/LineEdit.cpp +++ b/src/osgUI/LineEdit.cpp @@ -31,7 +31,7 @@ LineEdit::LineEdit(const osgUI::LineEdit& label, const osg::CopyOp& copyop): { } -bool LineEdit::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event) +bool LineEdit::handleImplementation(osgGA::EventVisitor* /*ev*/, osgGA::Event* event) { if (!getHasEventFocus()) return false; diff --git a/src/osgUI/Popup.cpp b/src/osgUI/Popup.cpp index fc9568cb8..43e5138e0 100644 --- a/src/osgUI/Popup.cpp +++ b/src/osgUI/Popup.cpp @@ -30,7 +30,7 @@ Popup::Popup(const osgUI::Popup& dialog, const osg::CopyOp& copyop): { } -bool Popup::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event) +bool Popup::handleImplementation(osgGA::EventVisitor* /*ev*/, osgGA::Event* event) { // OSG_NOTICE<<"Popup::handleImplementation"< Date: Wed, 8 Jun 2016 09:06:42 +0100 Subject: [PATCH 04/94] Fixed unused parameter warning. --- src/osgVolume/MultipassTechnique.cpp | 12 ++++++------ src/osgVolume/VolumeScene.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/osgVolume/MultipassTechnique.cpp b/src/osgVolume/MultipassTechnique.cpp index e2f97da37..30a238216 100644 --- a/src/osgVolume/MultipassTechnique.cpp +++ b/src/osgVolume/MultipassTechnique.cpp @@ -161,7 +161,7 @@ class RTTCameraCullCallback : public osg::NodeCallback _tileData(tileData), _mt(mt) {} - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(osg::Node* /*node*/, osg::NodeVisitor* nv) { osgUtil::CullVisitor* cv = nv->asCullVisitor(); @@ -935,7 +935,7 @@ class RTTBackfaceCameraCullCallback : public osg::NodeCallback _tileData(tileData), _mt(mt) {} - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(osg::Node* /*node*/, osg::NodeVisitor* nv) { osgUtil::CullVisitor* cv = nv->asCullVisitor(); @@ -963,10 +963,10 @@ class ShadingModelVisitor : public osgVolume::PropertyVisitor _shadingModel(VolumeSettings::Standard), _usesTransferFunction(false) {} - virtual void apply(IsoSurfaceProperty& iso) { _shadingModel = VolumeSettings::Isosurface; } - virtual void apply(MaximumIntensityProjectionProperty& mip) { _shadingModel = VolumeSettings::MaximumIntensityProjection; } - virtual void apply(LightingProperty& lp) { _shadingModel = VolumeSettings::Light; } - virtual void apply(TransferFunctionProperty& tf) { _usesTransferFunction = true; } + virtual void apply(IsoSurfaceProperty& /*iso*/) { _shadingModel = VolumeSettings::Isosurface; } + virtual void apply(MaximumIntensityProjectionProperty& /*mip*/) { _shadingModel = VolumeSettings::MaximumIntensityProjection; } + virtual void apply(LightingProperty& /*lp*/) { _shadingModel = VolumeSettings::Light; } + virtual void apply(TransferFunctionProperty& /*tf*/) { _usesTransferFunction = true; } virtual void apply(VolumeSettings& vs) { _shadingModel = vs.getShadingModel(); } VolumeSettings::ShadingModel _shadingModel; diff --git a/src/osgVolume/VolumeScene.cpp b/src/osgVolume/VolumeScene.cpp index 56133b798..b04684743 100644 --- a/src/osgVolume/VolumeScene.cpp +++ b/src/osgVolume/VolumeScene.cpp @@ -67,7 +67,7 @@ void VolumeScene::ViewData::clearTiles() } } -void VolumeScene::ViewData::visitTile(VolumeTile* tile) +void VolumeScene::ViewData::visitTile(VolumeTile* /*tile*/) { } From 8ba7998623a6382041dbdb424b84b4bb219ac7d2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:07:32 +0100 Subject: [PATCH 05/94] Fixed -Wextra warnings --- src/osgUtil/CullVisitor.cpp | 1 + src/osgUtil/LineSegmentIntersector.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 3112cdf2c..a955aef4b 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -58,6 +58,7 @@ CullVisitor::CullVisitor(): } CullVisitor::CullVisitor(const CullVisitor& rhs): + osg::Object(rhs), NodeVisitor(rhs), CullStack(rhs), _currentStateGraph(NULL), diff --git a/src/osgUtil/LineSegmentIntersector.cpp b/src/osgUtil/LineSegmentIntersector.cpp index 230062b4c..2ae8ba0f7 100644 --- a/src/osgUtil/LineSegmentIntersector.cpp +++ b/src/osgUtil/LineSegmentIntersector.cpp @@ -225,7 +225,7 @@ LineSegmentIntersector::LineSegmentIntersector(const osg::Vec3d& start, const os LineSegmentIntersector::LineSegmentIntersector(CoordinateFrame cf, const osg::Vec3d& start, const osg::Vec3d& end, LineSegmentIntersector* parent, osgUtil::Intersector::IntersectionLimit intersectionLimit): Intersector(cf, intersectionLimit), - _parent(0), + _parent(parent), _start(start), _end(end) { From ef73d2449e421593184f4e1aa77e82116fc62b61 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:20:16 +0100 Subject: [PATCH 06/94] Fixed -Wextra warnings --- include/osg/OperationThread | 4 ---- src/osg/CMakeLists.txt | 11 +++++++++++ src/osg/KdTree.cpp | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/osg/OperationThread b/include/osg/OperationThread index a62157ea1..a357c22e4 100644 --- a/include/osg/OperationThread +++ b/include/osg/OperationThread @@ -79,10 +79,6 @@ protected: Operation(): _keep(false) {} - Operation(const Operation& op): - _name(op._name), - _keep(op._keep) {} - virtual ~Operation() {} std::string _name; diff --git a/src/osg/CMakeLists.txt b/src/osg/CMakeLists.txt index 7fae3aceb..f1ff8321b 100644 --- a/src/osg/CMakeLists.txt +++ b/src/osg/CMakeLists.txt @@ -420,6 +420,17 @@ SET(TARGET_SRC ${OPENSCENEGRAPH_VERSIONINFO_RC} ) + +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + + + SET(TARGET_LIBRARIES OpenThreads) SET(TARGET_EXTERNAL_LIBRARIES diff --git a/src/osg/KdTree.cpp b/src/osg/KdTree.cpp index a1afac029..329b91bc1 100644 --- a/src/osg/KdTree.cpp +++ b/src/osg/KdTree.cpp @@ -795,6 +795,7 @@ KdTreeBuilder::KdTreeBuilder(): } KdTreeBuilder::KdTreeBuilder(const KdTreeBuilder& rhs): + osg::Object(rhs), osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _buildOptions(rhs._buildOptions), _kdTreePrototype(rhs._kdTreePrototype) From d71278417773bfcb64248a0dce1acff6f4f5bbc4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:33:56 +0100 Subject: [PATCH 07/94] Disabled the -Wextra warning as resolve the warnings will create other warnings under other compilers --- src/osgViewer/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgViewer/CMakeLists.txt b/src/osgViewer/CMakeLists.txt index 8c09c129a..4872aaf86 100644 --- a/src/osgViewer/CMakeLists.txt +++ b/src/osgViewer/CMakeLists.txt @@ -7,8 +7,18 @@ ENDIF() SET(LIB_NAME osgViewer) + +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) + FILE(GLOB CONFIG_HEADER_FILES ${HEADER_PATH}/config/*) FILE(GLOB CONFIG_SOURCE_FILES config/*.cpp) From 1a3a851f6e9bd7026676c39bd4f41a7d1685ccec Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:34:34 +0100 Subject: [PATCH 08/94] Fixed unused parameter warning. --- src/OpenThreads/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OpenThreads/CMakeLists.txt b/src/OpenThreads/CMakeLists.txt index b3cafb424..f2d48d429 100644 --- a/src/OpenThreads/CMakeLists.txt +++ b/src/OpenThreads/CMakeLists.txt @@ -44,6 +44,14 @@ IF(MSVC) ENDIF() +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + # INSTALL_FILES(/include/OpenThreads/ FILES "${OPENTHREADS_CONFIG_HEADER}") ################################################################################ From 2955fc8bb2eb3202a7022d47aaff78055bf3076c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:37:43 +0100 Subject: [PATCH 09/94] Disabled the -Wextra warnin the warnings that can't be fixed due to optional code paths. --- src/osgShadow/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/osgShadow/CMakeLists.txt b/src/osgShadow/CMakeLists.txt index 2dcd76985..1e2aa74f7 100644 --- a/src/osgShadow/CMakeLists.txt +++ b/src/osgShadow/CMakeLists.txt @@ -5,6 +5,15 @@ ELSE() ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ENDIF() + +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + SET(LIB_NAME osgShadow) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(TARGET_H From 6f68915425dae0754cd8d2873e1308123054ee54 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:38:22 +0100 Subject: [PATCH 10/94] Fixed unused parameter warning. --- src/osgText/GlyphGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgText/GlyphGeometry.cpp b/src/osgText/GlyphGeometry.cpp index f86953dca..5a08f0672 100644 --- a/src/osgText/GlyphGeometry.cpp +++ b/src/osgText/GlyphGeometry.cpp @@ -486,7 +486,7 @@ public: } } - void addBoundaryToGeometry(osg::Geometry* geometry, float targetThickness, const std::string& faceName, const std::string& bevelName) + void addBoundaryToGeometry(osg::Geometry* geometry, float /*targetThickness*/, const std::string& faceName, const std::string& bevelName) { if (_segments.empty()) return; From f21386867388eca1e8d5951b9df3864ecfd2c456 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:43:05 +0100 Subject: [PATCH 11/94] Fixed unused parameter warning. --- src/osgTerrain/DisplacementMappingTechnique.cpp | 4 +--- src/osgTerrain/GeometryPool.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/osgTerrain/DisplacementMappingTechnique.cpp b/src/osgTerrain/DisplacementMappingTechnique.cpp index a037bbbee..292850160 100644 --- a/src/osgTerrain/DisplacementMappingTechnique.cpp +++ b/src/osgTerrain/DisplacementMappingTechnique.cpp @@ -35,13 +35,11 @@ DisplacementMappingTechnique::~DisplacementMappingTechnique() { } -void DisplacementMappingTechnique::init(int dirtyMask, bool assumeMultiThreaded) +void DisplacementMappingTechnique::init(int /*dirtyMask*/, bool /*assumeMultiThreaded*/) { if (!_terrainTile) return; if (!_terrainTile->getTerrain()) return; - //OSG_NOTICE<<"DisplacementMappingTechnique::init("<getTerrain()->getGeometryPool(); _transform = geometryPool->getTileSubgraph(_terrainTile); diff --git a/src/osgTerrain/GeometryPool.cpp b/src/osgTerrain/GeometryPool.cpp index b0e237913..d03ad3e30 100644 --- a/src/osgTerrain/GeometryPool.cpp +++ b/src/osgTerrain/GeometryPool.cpp @@ -812,7 +812,7 @@ void GeometryPool::applyLayers(osgTerrain::TerrainTile* tile, osg::StateSet* sta } } -osg::StateSet* GeometryPool::getRootStateSetForTerrain(Terrain* terrain) +osg::StateSet* GeometryPool::getRootStateSetForTerrain(Terrain* /*terrain*/) { //OSG_NOTICE<<"getRootStateSetForTerrain("< Date: Wed, 8 Jun 2016 09:43:40 +0100 Subject: [PATCH 12/94] Fixed unused parameter warnings --- src/osgPresentation/SlideShowConstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPresentation/SlideShowConstructor.cpp b/src/osgPresentation/SlideShowConstructor.cpp index b8dd09512..108cdcc10 100644 --- a/src/osgPresentation/SlideShowConstructor.cpp +++ b/src/osgPresentation/SlideShowConstructor.cpp @@ -2564,7 +2564,7 @@ struct VolumeSettingsCallback : public osgGA::GUIEventHandler int _saveKey; int _editKey; - bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv) + bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/, osg::Object* object, osg::NodeVisitor* /*nv*/) { if (ea.getHandled()) return false; From 7bb0f437c14684b5d44224c463758ef23e6cf10d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:44:39 +0100 Subject: [PATCH 13/94] Fixed unused parameter warning. --- src/osgPlugins/zip/ReaderWriterZIP.cpp | 2 +- src/osgPlugins/zip/ZipArchive.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/zip/ReaderWriterZIP.cpp b/src/osgPlugins/zip/ReaderWriterZIP.cpp index 06a2f2887..d49c20d2e 100644 --- a/src/osgPlugins/zip/ReaderWriterZIP.cpp +++ b/src/osgPlugins/zip/ReaderWriterZIP.cpp @@ -20,7 +20,7 @@ class ReaderWriterZIP : public osgDB::ReaderWriter virtual const char* className() const { return "ZIP Database Reader/Writer"; } - virtual ReadResult openArchive(const std::string& file,ArchiveStatus status, unsigned int indexBlockSize = 4096, const Options* options = NULL) const + virtual ReadResult openArchive(const std::string& file,ArchiveStatus /*status*/, unsigned int /*indexBlockSize*/ = 4096, const Options* options = NULL) const { std::string ext = osgDB::getLowerCaseFileExtension(file); diff --git a/src/osgPlugins/zip/ZipArchive.cpp b/src/osgPlugins/zip/ZipArchive.cpp index ae5a8df2e..44f249f66 100644 --- a/src/osgPlugins/zip/ZipArchive.cpp +++ b/src/osgPlugins/zip/ZipArchive.cpp @@ -111,7 +111,7 @@ bool ZipArchive::getFileNames(osgDB::Archive::FileNameList& fileNameList) const } } -bool ZipArchive::open(const std::string& file, ArchiveStatus status, const osgDB::ReaderWriter::Options* options) +bool ZipArchive::open(const std::string& file, ArchiveStatus /*status*/, const osgDB::ReaderWriter::Options* options) { if ( !_zipLoaded ) { @@ -371,7 +371,7 @@ osgDB::ReaderWriter::WriteResult ZipArchive::writeShader(const osg::Shader& /*sh } -osgDB::ReaderWriter* ZipArchive::ReadFromZipEntry(const ZIPENTRY* ze, const osgDB::ReaderWriter::Options* options, std::stringstream& buffer) const +osgDB::ReaderWriter* ZipArchive::ReadFromZipEntry(const ZIPENTRY* ze, const osgDB::ReaderWriter::Options* /*options*/, std::stringstream& buffer) const { if (ze != 0) { From aef2574b8dac57b817c3f5a7877ae1b51cc9f9b3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:46:09 +0100 Subject: [PATCH 14/94] Fixed -Wextra warnings --- include/osgAnimation/StackedTransform | 3 +++ src/osgAnimation/ActionCallback.cpp | 2 +- src/osgAnimation/AnimationManagerBase.cpp | 5 ++++- src/osgAnimation/Skeleton.cpp | 1 + src/osgAnimation/StackedTransform.cpp | 3 ++- src/osgAnimation/UpdateMatrixTransform.cpp | 5 ++++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/osgAnimation/StackedTransform b/include/osgAnimation/StackedTransform index c91a51996..296dc5f74 100644 --- a/include/osgAnimation/StackedTransform +++ b/include/osgAnimation/StackedTransform @@ -32,6 +32,9 @@ namespace osgAnimation const osg::Matrix& getMatrix() const; protected: + + typedef osg::MixinVector > inherited; + osg::Matrix _matrix; }; diff --git a/src/osgAnimation/ActionCallback.cpp b/src/osgAnimation/ActionCallback.cpp index 143d8f435..ebfb7735b 100644 --- a/src/osgAnimation/ActionCallback.cpp +++ b/src/osgAnimation/ActionCallback.cpp @@ -15,7 +15,7 @@ #include #include -void osgAnimation::RunAction::operator()(Action* action, ActionVisitor* visitor) +void osgAnimation::RunAction::operator()(Action* /*action*/, ActionVisitor* visitor) { Timeline* tm = visitor->getCurrentTimeline(); tm->addActionNow(_action.get(), _priority); diff --git a/src/osgAnimation/AnimationManagerBase.cpp b/src/osgAnimation/AnimationManagerBase.cpp index f5b3c1aeb..da6b8b040 100644 --- a/src/osgAnimation/AnimationManagerBase.cpp +++ b/src/osgAnimation/AnimationManagerBase.cpp @@ -62,7 +62,10 @@ void AnimationManagerBase::operator()(osg::Node* node, osg::NodeVisitor* nv) } -AnimationManagerBase::AnimationManagerBase(const AnimationManagerBase& b, const osg::CopyOp& copyop) : osg::NodeCallback(b,copyop) // TODO check this +AnimationManagerBase::AnimationManagerBase(const AnimationManagerBase& b, const osg::CopyOp& copyop) : + osg::Object(b,copyop), + osg::Callback(b,copyop), + osg::NodeCallback(b,copyop) // TODO check this { const AnimationList& animationList = b.getAnimationList(); for (AnimationList::const_iterator it = animationList.begin(); diff --git a/src/osgAnimation/Skeleton.cpp b/src/osgAnimation/Skeleton.cpp index 9bc09ab72..85da3cc71 100644 --- a/src/osgAnimation/Skeleton.cpp +++ b/src/osgAnimation/Skeleton.cpp @@ -26,6 +26,7 @@ Skeleton::UpdateSkeleton::UpdateSkeleton() : _needValidate(true) {} Skeleton::UpdateSkeleton::UpdateSkeleton(const UpdateSkeleton& us, const osg::CopyOp& copyop) : osg::Object(us, copyop), + osg::Callback(us, copyop), osg::NodeCallback(us, copyop) { _needValidate = true; diff --git a/src/osgAnimation/StackedTransform.cpp b/src/osgAnimation/StackedTransform.cpp index a56b35f1a..9be0a4652 100644 --- a/src/osgAnimation/StackedTransform.cpp +++ b/src/osgAnimation/StackedTransform.cpp @@ -18,7 +18,8 @@ using namespace osgAnimation; StackedTransform::StackedTransform() {} -StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co) +StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co): + inherited(rhs) { reserve(rhs.size()); for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it) diff --git a/src/osgAnimation/UpdateMatrixTransform.cpp b/src/osgAnimation/UpdateMatrixTransform.cpp index e3c0147ef..7de9f1afb 100644 --- a/src/osgAnimation/UpdateMatrixTransform.cpp +++ b/src/osgAnimation/UpdateMatrixTransform.cpp @@ -18,7 +18,10 @@ using namespace osgAnimation; -UpdateMatrixTransform::UpdateMatrixTransform( const UpdateMatrixTransform& apc,const osg::CopyOp& copyop) : osg::Object(apc,copyop), AnimationUpdateCallback(apc, copyop) +UpdateMatrixTransform::UpdateMatrixTransform( const UpdateMatrixTransform& apc,const osg::CopyOp& copyop) : + osg::Object(apc,copyop), + osg::Callback(apc,copyop), + AnimationUpdateCallback(apc, copyop) { _transforms = StackedTransform(apc.getStackedTransforms(), copyop); } From b1539418b3c9ca981e6508e063e98ee20c588497 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:46:58 +0100 Subject: [PATCH 15/94] Fixed unused parameter warning. --- include/osgVolume/Property | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/osgVolume/Property b/include/osgVolume/Property index c4d2dfabb..bec70bd4a 100644 --- a/include/osgVolume/Property +++ b/include/osgVolume/Property @@ -88,7 +88,7 @@ class OSGVOLUME_EXPORT Property : public osg::Object unsigned int getModifiedCount() const { return _modifiedCount; } virtual void accept(PropertyVisitor& pv) { pv.apply(*this); } - virtual void traverse(PropertyVisitor& pv) {} + virtual void traverse(PropertyVisitor& /*pv*/) {} protected: From 0be65027115cfc2e8a9d33e5c308e9e8296d27fd Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:47:30 +0100 Subject: [PATCH 16/94] Fixed unused parameter warning. --- src/osgPlugins/vtf/ReaderWriterVTF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/vtf/ReaderWriterVTF.cpp b/src/osgPlugins/vtf/ReaderWriterVTF.cpp index 01d792624..89683b76f 100644 --- a/src/osgPlugins/vtf/ReaderWriterVTF.cpp +++ b/src/osgPlugins/vtf/ReaderWriterVTF.cpp @@ -702,7 +702,7 @@ osg::Image* ReadVTFFile(std::istream& _istream) } -bool WriteVTFFile(const osg::Image *img, std::ostream& fout) +bool WriteVTFFile(const osg::Image* /*img*/, std::ostream& /*fout*/) { // Not supported return false; From c7b64cb9a7133029c827c2f1785c2a3e2633f227 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:48:14 +0100 Subject: [PATCH 17/94] Fixed -Wextra warnings --- src/osgPlugins/txp/TXPParser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/txp/TXPParser.h b/src/osgPlugins/txp/TXPParser.h index a0ecaa1a4..a17987db2 100644 --- a/src/osgPlugins/txp/TXPParser.h +++ b/src/osgPlugins/txp/TXPParser.h @@ -180,7 +180,7 @@ public: // Returns true if we are under billboard subgraph - inline const bool underBillboardSubgraph() const + inline bool underBillboardSubgraph() const { return _underBillboardSubgraph; } @@ -216,7 +216,7 @@ public: DeferredLightAttribute& getLightAttribute(int ix); // Returns if we are under layer subgraph - inline const bool underLayerSubgraph() const + inline bool underLayerSubgraph() const { return _underLayerSubgraph; } From 2acca80be892617a159db4198c487949aa8ec12f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:48:39 +0100 Subject: [PATCH 18/94] Fixed unused parameter warning. --- src/osgPlugins/stl/ReaderWriterSTL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/stl/ReaderWriterSTL.cpp b/src/osgPlugins/stl/ReaderWriterSTL.cpp index 2665c971a..d17d5a323 100644 --- a/src/osgPlugins/stl/ReaderWriterSTL.cpp +++ b/src/osgPlugins/stl/ReaderWriterSTL.cpp @@ -346,7 +346,7 @@ private: osg::Matrix m_mat; bool m_dontSaveNormals; - inline void operator () (const osg::Vec3& _v1, const osg::Vec3& _v2, const osg::Vec3& _v3, bool treatVertexDataAsTemporary) + inline void operator () (const osg::Vec3& _v1, const osg::Vec3& _v2, const osg::Vec3& _v3, bool /*treatVertexDataAsTemporary*/) { osg::Vec3 v1 = _v1 * m_mat; osg::Vec3 v2 = _v2 * m_mat; From 1a093ca98d20d866fd7ad93e780d0421cda8f7f0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:49:10 +0100 Subject: [PATCH 19/94] Fixed unused parameter warning. --- src/osgPlugins/revisions/ReaderWriterRevisions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/revisions/ReaderWriterRevisions.cpp b/src/osgPlugins/revisions/ReaderWriterRevisions.cpp index 2dac02fbf..3c6ba6ee7 100644 --- a/src/osgPlugins/revisions/ReaderWriterRevisions.cpp +++ b/src/osgPlugins/revisions/ReaderWriterRevisions.cpp @@ -48,7 +48,7 @@ class ReaderWriterRevisions : public osgDB::ReaderWriter else return readFileList(fin, fileName, options); } - ReadResult readFileList(std::istream& fin, const std::string& name, const osgDB::ReaderWriter::Options* options) const + ReadResult readFileList(std::istream& fin, const std::string& name, const osgDB::ReaderWriter::Options* /*options*/) const { OSG_INFO<<" readFileList="< Date: Wed, 8 Jun 2016 09:49:29 +0100 Subject: [PATCH 20/94] Fixed unused parameter warning. --- src/osgPlugins/png/ReaderWriterPNG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/png/ReaderWriterPNG.cpp b/src/osgPlugins/png/ReaderWriterPNG.cpp index 83c1ab893..29ef345cb 100644 --- a/src/osgPlugins/png/ReaderWriterPNG.cpp +++ b/src/osgPlugins/png/ReaderWriterPNG.cpp @@ -49,7 +49,7 @@ private: std::string _message; }; -void user_error_fn(png_structp png_ptr, png_const_charp error_msg) +void user_error_fn(png_structp /*png_ptr*/, png_const_charp error_msg) { #ifdef OSG_CPP_EXCEPTIONS_AVAILABLE throw PNGError(error_msg); @@ -58,7 +58,7 @@ void user_error_fn(png_structp png_ptr, png_const_charp error_msg) #endif } -void user_warning_fn(png_structp png_ptr, png_const_charp warning_msg) +void user_warning_fn(png_structp /*png_ptr*/, png_const_charp warning_msg) { OSG_WARN << "PNG lib warning : " << warning_msg << std::endl; } From bfd1d7c55b2697a5b972f3edfc118c85c78ba117 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:49:58 +0100 Subject: [PATCH 21/94] Fixed unused parameter warning. --- src/osgPlugins/osgjs/JSON_Objects | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/osgjs/JSON_Objects b/src/osgPlugins/osgjs/JSON_Objects index 3977f6d3b..b75f8a640 100644 --- a/src/osgPlugins/osgjs/JSON_Objects +++ b/src/osgPlugins/osgjs/JSON_Objects @@ -40,7 +40,7 @@ struct JSONObjectBase : public osg::Referenced { static int level; static std::string indent(); - virtual void write(json_stream& str, WriteVisitor& visitor) {} + virtual void write(json_stream& /*str*/, WriteVisitor& /*visitor*/) {} }; template struct JSONValue; @@ -144,7 +144,7 @@ struct JSONValue : public JSONObject _value = v; } T& getValue() { return _value; } - virtual void write(json_stream& str, WriteVisitor& visitor) { + virtual void write(json_stream& str, WriteVisitor& /*visitor*/) { str << _value ; } @@ -157,7 +157,7 @@ struct JSONValue : public JSONObject JSONValue(const double& v) { _value = v; } - void write(json_stream& str, WriteVisitor& visitor) { + void write(json_stream& str, WriteVisitor& /*visitor*/) { if (osg::isNaN(_value)) { _value = 0.0; } @@ -174,7 +174,7 @@ struct JSONValue : public JSONObject _value = jsonEscape(v); } - void write(json_stream& str, WriteVisitor& visitor) { + void write(json_stream& str, WriteVisitor& /*visitor*/) { str << '"' << _value << '"'; } From 85a77f42a4633468a15baccb721d5fb053e8cad4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:50:38 +0100 Subject: [PATCH 22/94] Fixed -Wextra warnings --- src/osgPlugins/osc/OscReceivingDevice.cpp | 12 ++-- src/osgPlugins/osc/OscReceivingDevice.hpp | 66 ++++++++++---------- src/osgPlugins/osc/osc/OscReceivedElements.h | 32 +++++----- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/osgPlugins/osc/OscReceivingDevice.cpp b/src/osgPlugins/osc/OscReceivingDevice.cpp index 4b6cbb73b..80356730c 100644 --- a/src/osgPlugins/osc/OscReceivingDevice.cpp +++ b/src/osgPlugins/osc/OscReceivingDevice.cpp @@ -135,7 +135,7 @@ private: -bool StandardRequestHandler::operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) +bool StandardRequestHandler::operator()(const std::string& /*request_path*/, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { @@ -566,7 +566,7 @@ public: } } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { float x(0.0f), y(0.0f); osc::int32 btn(0); @@ -619,7 +619,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { float pressure(0.0f); @@ -650,7 +650,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { osc::int32 pt(osgGA::GUIEventAdapter::UNKNOWN); @@ -684,7 +684,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { float rotation(0.0f), tilt_x(0.0f), tilt_y(0.0f); @@ -744,7 +744,7 @@ public: } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) { // std::cout << m << std::endl; diff --git a/src/osgPlugins/osc/OscReceivingDevice.hpp b/src/osgPlugins/osc/OscReceivingDevice.hpp index d74d8cdb3..1846dfc2a 100644 --- a/src/osgPlugins/osc/OscReceivingDevice.hpp +++ b/src/osgPlugins/osc/OscReceivingDevice.hpp @@ -17,7 +17,7 @@ /** * OscReceivingDevice can be used to receive osg-events via OSC from other hosts/ applications * It can even translate custom osc-message to user-events with attached user-data. - * + * * It uses the TUIO 1.1 Cursor2D-profile to receive multitouch-events * * This device adds to every message-bundle a message-id, so you can check, if you miss events or similar. @@ -26,20 +26,20 @@ * /my_user_event/value_1 23 * /my_user_event/value_2 42 * - * this will result in one osgGA:Event (when both messages are bundled) witht the name "/my_user_event", + * this will result in one osgGA:Event (when both messages are bundled) witht the name "/my_user_event", * and two user-values (value_1 and value_2) * To get value_1 you'll do something like event->getUserValue("value_1", my_int); - * - * Currently osg's user-data can not cast to different types, they have to match, so + * + * Currently osg's user-data can not cast to different types, they have to match, so * event->getUserValue("value_1", my_string) will fail. * * The receiving device will try to combine multiple osc arguments intelligently, multiple osc-arguments are * bundled into Vec2, Vec3, Vec4 or Matrix, it depends on the number of arguments. - + * TUIO-specific notes: * If multiple TUIO-applications are transmitting their touch-points to one oscReceivingDevice, all - * touchpoints get multiplexed, so you'll get one event with x touchpoints. - * You can differentiate the specific applications by the touch_ids, the upper 16bits + * touchpoints get multiplexed, so you'll get one event with x touchpoints. + * You can differentiate the specific applications by the touch_ids, the upper 16bits * are specific to an application, the lower 16bits contain the touch-id for that application. * If you need "better" separation, use multiple oscReceivingDevices listening on different ports. * @@ -61,7 +61,7 @@ class OscReceivingDevice : public osgGA::Device, OpenThreads::Thread, osc::OscPa public: typedef OscSendingDevice::MsgIdType MsgIdType; - + class RequestHandler : public osg::Referenced { public: RequestHandler(const std::string& request_path) @@ -70,58 +70,58 @@ public: , _device(NULL) { } - + virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) = 0; - virtual void operator()(osgGA::EventQueue* queue) {} - + virtual void operator()(osgGA::EventQueue* /*queue*/) {} + const std::string& getRequestPath() const { return _requestPath; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << ": no description available"; } - + protected: virtual void setDevice(OscReceivingDevice* device) { _device = device; } OscReceivingDevice* getDevice() const { return _device; } - + /// set the request-path, works only from the constructor void setRequestPath(const std::string& request_path) { _requestPath = request_path; } - + void handleException(const osc::Exception& e) { OSG_WARN << "OscDevice :: error while handling " << getRequestPath() << ": " << e.what() << std::endl; } - + double getLocalTime() const { return getDevice()->getEventQueue()->getTime(); } private: std::string _requestPath; OscReceivingDevice* _device; friend class OscReceivingDevice; }; - + typedef std::multimap > RequestHandlerMap; - + OscReceivingDevice(const std::string& server_address, int listening_port); ~OscReceivingDevice(); - - + + virtual void run(); - - + + virtual void ProcessMessage( const osc::ReceivedMessage& m, const IpEndpointName& remoteEndpoint ); virtual void ProcessPacket( const char *data, int size, const IpEndpointName& remoteEndpoint ); virtual void ProcessBundle( const osc::ReceivedBundle& b, const IpEndpointName& remoteEndpoint ); void addRequestHandler(RequestHandler* handler); - + void describeTo(std::ostream& out) const; - + friend std::ostream& operator<<(std::ostream& out, const OscReceivingDevice& device) { device.describeTo(out); return out; } - + osgGA::Event* getOrCreateUserDataEvent() { if (!_userDataEvent.valid()) @@ -130,20 +130,20 @@ public: } return _userDataEvent.get(); } - + virtual const char* className() const { return "OSC receiving device"; } - + void addHandleOnCheckEvents(RequestHandler* handler) { _handleOnCheckEvents.push_back(handler); } - + virtual bool checkEvents() { osgGA::EventQueue* queue = getEventQueue(); - + for(std::vector::iterator i = _handleOnCheckEvents.begin(); i != _handleOnCheckEvents.end(); ++i) { (*i)->operator()(queue); } return osgGA::Device::checkEvents(); } - + private: std::string _listeningAddress; unsigned int _listeningPort; @@ -160,14 +160,14 @@ private: class SendKeystrokeRequestHandler : public OscReceivingDevice::RequestHandler { public: SendKeystrokeRequestHandler(const std::string& request_path, int key) : OscReceivingDevice::RequestHandler(request_path), _key(key) {} - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& arguments, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& /*arguments*/, const IpEndpointName& /*remoteEndPoint*/) { getDevice()->getEventQueue()->keyPress(_key); getDevice()->getEventQueue()->keyRelease(_key); - + return true; } - + virtual void describeTo(std::ostream& out) const { out << getRequestPath() << ": send KEY_DOWN + KEY_UP, code: 0x" << std::hex << _key << std::dec; diff --git a/src/osgPlugins/osc/osc/OscReceivedElements.h b/src/osgPlugins/osc/osc/OscReceivedElements.h index 483640610..99390510b 100644 --- a/src/osgPlugins/osc/osc/OscReceivedElements.h +++ b/src/osgPlugins/osc/osc/OscReceivedElements.h @@ -144,7 +144,7 @@ private: inline bool operator==(const ReceivedBundleElementIterator& lhs, const ReceivedBundleElementIterator& rhs ) -{ +{ return lhs.IsEqualTo( rhs ); } @@ -162,8 +162,8 @@ public: , argument_( argument ) {} friend class ReceivedMessageArgumentIterator; - - const char TypeTag() const { return *typeTag_; } + + char TypeTag() const { return *typeTag_; } // the unchecked methods below don't check whether the argument actually // is of the specified type. they should only be used if you've already @@ -220,7 +220,7 @@ public: bool IsBlob() const { return *typeTag_ == BLOB_TYPE_TAG; } void AsBlob( const void*& data, unsigned long& size ) const; void AsBlobUnchecked( const void*& data, unsigned long& size ) const; - + private: const char *typeTag_; const char *argument_; @@ -265,13 +265,13 @@ private: inline bool operator==(const ReceivedMessageArgumentIterator& lhs, const ReceivedMessageArgumentIterator& rhs ) -{ +{ return lhs.IsEqualTo( rhs ); } inline bool operator!=(const ReceivedMessageArgumentIterator& lhs, const ReceivedMessageArgumentIterator& rhs ) -{ +{ return !( lhs == rhs ); } @@ -284,7 +284,7 @@ class ReceivedMessageArgumentStream{ , end_( end ) {} ReceivedMessageArgumentIterator p_, end_; - + public: // end of stream @@ -309,7 +309,7 @@ public: rhs = (*p_++).AsInt32(); return *this; - } + } ReceivedMessageArgumentStream& operator>>( float& rhs ) { @@ -355,7 +355,7 @@ public: rhs = (*p_++).AsInt64(); return *this; } - + ReceivedMessageArgumentStream& operator>>( TimeTag& rhs ) { if( Eos() ) @@ -382,7 +382,7 @@ public: (*p_++).AsBlob( rhs.data, rhs.size ); return *this; } - + ReceivedMessageArgumentStream& operator>>( const char*& rhs ) { if( Eos() ) @@ -391,7 +391,7 @@ public: rhs = (*p_++).AsString(); return *this; } - + ReceivedMessageArgumentStream& operator>>( Symbol& rhs ) { if( Eos() ) @@ -401,7 +401,7 @@ public: return *this; } - ReceivedMessageArgumentStream& operator>>( MessageTerminator& rhs ) + ReceivedMessageArgumentStream& operator>>( MessageTerminator& /*rhs*/ ) { if( !Eos() ) throw ExcessArgumentException(); @@ -429,12 +429,12 @@ public: typedef ReceivedMessageArgumentIterator const_iterator; - + ReceivedMessageArgumentIterator ArgumentsBegin() const { return ReceivedMessageArgumentIterator( typeTagsBegin_, arguments_ ); } - + ReceivedMessageArgumentIterator ArgumentsEnd() const { return ReceivedMessageArgumentIterator( typeTagsEnd_, 0 ); @@ -464,12 +464,12 @@ public: unsigned long ElementCount() const { return elementCount_; } typedef ReceivedBundleElementIterator const_iterator; - + ReceivedBundleElementIterator ElementsBegin() const { return ReceivedBundleElementIterator( timeTag_ + 8 ); } - + ReceivedBundleElementIterator ElementsEnd() const { return ReceivedBundleElementIterator( end_ ); From bc7156cd26b8954fdfda274394cbd5f31c68f315 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:51:50 +0100 Subject: [PATCH 23/94] Fixed unused parameter warning. --- src/osgPlugins/ogr/ReaderWriterOGR.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/osgPlugins/ogr/ReaderWriterOGR.cpp b/src/osgPlugins/ogr/ReaderWriterOGR.cpp index ed50169d2..b3e81ec7f 100644 --- a/src/osgPlugins/ogr/ReaderWriterOGR.cpp +++ b/src/osgPlugins/ogr/ReaderWriterOGR.cpp @@ -71,7 +71,8 @@ struct TriangulizeFunctor osg::Vec3Array* _vertexes; // do nothing - void operator ()(const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3, bool treatVertexDataAsTemporary) { + void operator ()(const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3, bool /*treatVertexDataAsTemporary*/) + { _vertexes->push_back(v1); _vertexes->push_back(v2); _vertexes->push_back(v3); @@ -145,9 +146,9 @@ public: GDALAllRegister(); // Try to open data source - GDALDataset* file = (GDALDataset*) GDALOpenEx( fileName.c_str(), GDAL_OF_VECTOR, NULL, NULL, NULL ); + GDALDataset* file = (GDALDataset*) GDALOpenEx( fileName.c_str(), GDAL_OF_VECTOR, NULL, NULL, NULL ); #endif - + if (!file) return 0; @@ -165,7 +166,7 @@ public: osg::Group* group = new osg::Group; -#if GDAL_VERSION_MAJOR<2 +#if GDAL_VERSION_MAJOR<2 for (int i = 0; i < file->GetLayerCount(); i++) { osg::Group* node = readLayer(file->GetLayer(i), file->GetName(), useRandomColorByFeature, addGroupPerFeature); @@ -176,18 +177,18 @@ public: #else for (int i = 0; i < GDALDatasetGetLayerCount(file); i++) { - OGRLayer* layer = (OGRLayer *)GDALDatasetGetLayer(file, i); + OGRLayer* layer = (OGRLayer *)GDALDatasetGetLayer(file, i); osg::Group* node = readLayer(layer, layer->GetName(), useRandomColorByFeature, addGroupPerFeature); if (node) group->addChild( node ); } GDALClose( file ); -#endif - +#endif + return group; } - osg::Group* readLayer(OGRLayer* ogrLayer, const std::string& name, bool useRandomColorByFeature, bool addGroupPerFeature) const + osg::Group* readLayer(OGRLayer* ogrLayer, const std::string& /*name*/, bool useRandomColorByFeature, bool addGroupPerFeature) const { if (!ogrLayer) return 0; From e9b8069204596aa592af0751d36fd53a955e884f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:52:09 +0100 Subject: [PATCH 24/94] Fixed unused parameter warning. --- src/osgPlugins/obj/ReaderWriterOBJ.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/obj/ReaderWriterOBJ.cpp b/src/osgPlugins/obj/ReaderWriterOBJ.cpp index cb2e43d31..2b6727e30 100644 --- a/src/osgPlugins/obj/ReaderWriterOBJ.cpp +++ b/src/osgPlugins/obj/ReaderWriterOBJ.cpp @@ -89,7 +89,7 @@ public: return WriteResult(WriteResult::FILE_NOT_HANDLED); } - virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* options =NULL) const + virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* /*options*/ =NULL) const { if (!acceptsExtension(osgDB::getFileExtension(fileName))) return WriteResult(WriteResult::FILE_NOT_HANDLED); From 322cf0c39e3ea5d881c0fc1e0623b466d725afa5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:54:10 +0100 Subject: [PATCH 25/94] Fixed unused parameter warning. --- src/osgPlugins/ffmpeg/FFmpegHeaders.hpp | 2 +- src/osgPlugins/ffmpeg/FFmpegImageStream.cpp | 3 ++- src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp b/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp index 54b08de81..fd9bd2c92 100644 --- a/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp +++ b/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp @@ -23,7 +23,7 @@ extern "C" # include - inline AVAudioResampleContext * swr_alloc_set_opts_proxy(SwrContext *ctx, int64_t out_ch_layout, enum AVSampleFormat out_sample_format, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_format, int in_sample_rate, int /*log_offset*/, void * /*log_ctx*/) + inline AVAudioResampleContext * swr_alloc_set_opts_proxy(SwrContext* /*ctx*/, int64_t out_ch_layout, enum AVSampleFormat out_sample_format, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_format, int in_sample_rate, int /*log_offset*/, void * /*log_ctx*/) { AVAudioResampleContext *avr = avresample_alloc_context(); av_opt_set_int(avr, "in_channel_layout", in_ch_layout, 0); diff --git a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp index 70b350a6c..e285aa3c7 100644 --- a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp @@ -33,7 +33,8 @@ FFmpegImageStream::FFmpegImageStream() : FFmpegImageStream::FFmpegImageStream(const FFmpegImageStream & image, const osg::CopyOp & copyop) : - osg::ImageStream(image, copyop) + osg::ImageStream(image, copyop), + OpenThreads::Thread() { // TODO: probably incorrect or incomplete } diff --git a/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp b/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp index 4defbb2f2..2d52bff23 100644 --- a/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp +++ b/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp @@ -28,7 +28,7 @@ extern "C" { -static void log_to_osg(void *ptr, int level, const char *fmt, va_list vl) +static void log_to_osg(void* /*ptr*/, int level, const char *fmt, va_list vl) { char logbuf[256]; vsnprintf(logbuf, sizeof(logbuf), fmt, vl); From 1778b15a4d051ba2abe2dfc3ed0729b06b339ace Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:55:15 +0100 Subject: [PATCH 26/94] Fixed unused parameter warning. --- src/osgPlugins/mdl/MDLReader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osgPlugins/mdl/MDLReader.cpp b/src/osgPlugins/mdl/MDLReader.cpp index 6c0ed886d..91a1dbee5 100644 --- a/src/osgPlugins/mdl/MDLReader.cpp +++ b/src/osgPlugins/mdl/MDLReader.cpp @@ -103,8 +103,7 @@ MDLReader::~MDLReader() } -std::string MDLReader::getToken(std::string str, const char * delim, - size_t & index) +std::string MDLReader::getToken(std::string str, const char * /*delim*/, size_t & index) { size_t start; size_t end = std::string::npos; From 4d3a54972707eee3b3c366ac868b7a72cb5a777d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:55:33 +0100 Subject: [PATCH 27/94] Fixed unused parameter warning. --- src/osgPlugins/gles/GeometryUniqueVisitor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/gles/GeometryUniqueVisitor b/src/osgPlugins/gles/GeometryUniqueVisitor index c89b02bf1..8edbd15ae 100644 --- a/src/osgPlugins/gles/GeometryUniqueVisitor +++ b/src/osgPlugins/gles/GeometryUniqueVisitor @@ -44,7 +44,7 @@ public: apply(*geometry); } - virtual void apply(osg::Geometry& geometry) {} // to be implemented by actual visitors + virtual void apply(osg::Geometry& /*geometry*/) {} // to be implemented by actual visitors protected: bool isProcessed(osg::Geometry* node) { From f4078251bead461ec7c58abf78e0b18a4be15838 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:56:35 +0100 Subject: [PATCH 28/94] Fixed -Wextra warning --- src/osgPlugins/gdal/DataSetLayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/gdal/DataSetLayer.cpp b/src/osgPlugins/gdal/DataSetLayer.cpp index 19ac67b5e..aa5f0baa5 100644 --- a/src/osgPlugins/gdal/DataSetLayer.cpp +++ b/src/osgPlugins/gdal/DataSetLayer.cpp @@ -37,7 +37,7 @@ _dataset(0), _gdalReader(0) } DataSetLayer::DataSetLayer(const DataSetLayer& dataSetLayer,const osg::CopyOp& copyop): - Layer(dataSetLayer), _gdalReader(dataSetLayer._gdalReader) + Layer(dataSetLayer, copyop), _gdalReader(dataSetLayer._gdalReader) { if (dataSetLayer._dataset) open(); } From 3783061c2a376105f6f4c686b8264482a9f6d6fb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:57:02 +0100 Subject: [PATCH 29/94] Fixed -Wextra warnings --- src/osgPlugins/dxf/DXFWriterNodeVisitor.h | 2 +- src/osgPlugins/dxf/ReaderWriterDXF.cpp | 2 +- src/osgPlugins/dxf/dxfEntity.h | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osgPlugins/dxf/DXFWriterNodeVisitor.h b/src/osgPlugins/dxf/DXFWriterNodeVisitor.h index f5b0ae961..a5ef761f7 100644 --- a/src/osgPlugins/dxf/DXFWriterNodeVisitor.h +++ b/src/osgPlugins/dxf/DXFWriterNodeVisitor.h @@ -229,7 +229,7 @@ class DXFWriterNodeVisitor: public osg::NodeVisitor { } } - int getNodeAcadColor(osg::Geometry *geo,int index=0) { return 0;} + int getNodeAcadColor(osg::Geometry* /*geo*/,int /*index*/=0) { return 0;} protected: struct CompareStateSet diff --git a/src/osgPlugins/dxf/ReaderWriterDXF.cpp b/src/osgPlugins/dxf/ReaderWriterDXF.cpp index 4806f1884..b38e952bd 100644 --- a/src/osgPlugins/dxf/ReaderWriterDXF.cpp +++ b/src/osgPlugins/dxf/ReaderWriterDXF.cpp @@ -77,7 +77,7 @@ public: return WriteResult(WriteResult::FILE_SAVED); } - virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* options =NULL) const + virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* /*options*/ =NULL) const { if (!acceptsExtension(osgDB::getFileExtension(fileName))) return WriteResult(WriteResult::FILE_NOT_HANDLED); diff --git a/src/osgPlugins/dxf/dxfEntity.h b/src/osgPlugins/dxf/dxfEntity.h index 532aa89ab..071f42b45 100644 --- a/src/osgPlugins/dxf/dxfEntity.h +++ b/src/osgPlugins/dxf/dxfEntity.h @@ -186,10 +186,10 @@ public: virtual void assign(dxfFile* dxf, codeValue& cv); void getVertex(double &x, double &y, double &z) { x=_vertex.x();y=_vertex.y();z=_vertex.z(); } const osg::Vec3d& getVertex() const { return _vertex; } - const unsigned int getIndice1() const { return _indice1; } - const unsigned int getIndice2() const { return _indice2; } - const unsigned int getIndice3() const { return _indice3; } - const unsigned int getIndice4() const { return _indice4; } + unsigned int getIndice1() const { return _indice1; } + unsigned int getIndice2() const { return _indice2; } + unsigned int getIndice3() const { return _indice3; } + unsigned int getIndice4() const { return _indice4; } protected: osg::Vec3d _vertex; From 8d4a976477fe5ef7d3036e6471542c19df066d4c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:57:30 +0100 Subject: [PATCH 30/94] Fixed unused parameter warning. --- src/osgPlugins/dot/BaseDotVisitor.cpp | 27 +++++++++---------------- src/osgPlugins/dot/SimpleDotVisitor.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/osgPlugins/dot/BaseDotVisitor.cpp b/src/osgPlugins/dot/BaseDotVisitor.cpp index 262ae1559..f0ee16cf0 100644 --- a/src/osgPlugins/dot/BaseDotVisitor.cpp +++ b/src/osgPlugins/dot/BaseDotVisitor.cpp @@ -140,17 +140,13 @@ namespace osgDot { } - void BaseDotVisitor::handle(osg::Node& node, int id) { - } + void BaseDotVisitor::handle(osg::Node&, int) {} - void BaseDotVisitor::handle(osg::Geode& node, int id) { - } + void BaseDotVisitor::handle(osg::Geode&, int) {} - void BaseDotVisitor::handle(osg::Group& node, int id) { - } + void BaseDotVisitor::handle(osg::Group&, int) {} - void BaseDotVisitor::handle(osg::Group& parent, osg::Node& child, int parentID, int childID ) { - } + void BaseDotVisitor::handle(osg::Group&, osg::Node&, int, int) {} void BaseDotVisitor::handleNodeAndTraverse(osg::Node& node, int id) { osg::StateSet* ss = node.getStateSet(); @@ -164,20 +160,15 @@ namespace osgDot { traverse(node); } - void BaseDotVisitor::handle(osg::StateSet& stateset, int id) { - } + void BaseDotVisitor::handle(osg::StateSet&, int) {} - void BaseDotVisitor::handle(osg::Node& node, osg::StateSet& stateset, int parentID, int childID) { - } + void BaseDotVisitor::handle(osg::Node&, osg::StateSet&, int, int) {} - void BaseDotVisitor::handle(osg::Drawable& drawable, int id) { - } + void BaseDotVisitor::handle(osg::Drawable&, int) {} - void BaseDotVisitor::handle(osg::Drawable& drawable, osg::StateSet& stateset, int parentID, int childID ) { - } + void BaseDotVisitor::handle(osg::Drawable&, osg::StateSet&, int, int) {} - void BaseDotVisitor::handle(osg::Geode& geode, osg::Drawable& drawable, int parentID, int childID ) { - } + void BaseDotVisitor::handle(osg::Geode&, osg::Drawable&, int, int) {} bool BaseDotVisitor::getOrCreateId( osg::Object* object, int &id ) { assert( object ); diff --git a/src/osgPlugins/dot/SimpleDotVisitor.cpp b/src/osgPlugins/dot/SimpleDotVisitor.cpp index 62831ff62..60fad98d0 100644 --- a/src/osgPlugins/dot/SimpleDotVisitor.cpp +++ b/src/osgPlugins/dot/SimpleDotVisitor.cpp @@ -42,7 +42,7 @@ namespace osgDot { drawNode( id, "record", "solid", label.str(), "black", "white" ); } - void SimpleDotVisitor::handle(osg::Group& parent, osg::Node& child, int parentID, int childID ) { + void SimpleDotVisitor::handle(osg::Group&, osg::Node&, int parentID, int childID ) { drawEdge( parentID, childID, "setlinewidth(2)" ); } @@ -53,7 +53,7 @@ namespace osgDot { drawNode( id, "Mrecord", "solid", label.str(), "green", "white" ); } - void SimpleDotVisitor::handle(osg::Node& node, osg::StateSet& stateset, int parentID, int childID ) { + void SimpleDotVisitor::handle(osg::Node&, osg::StateSet&, int parentID, int childID ) { drawEdge( parentID, childID, "dashed" ); } @@ -64,11 +64,11 @@ namespace osgDot { drawNode( id, "record", "solid", label.str(), "blue", "white" ); } - void SimpleDotVisitor::handle(osg::Geode& geode, osg::Drawable& drawable, int parentID, int childID ) { + void SimpleDotVisitor::handle(osg::Geode&, osg::Drawable&, int parentID, int childID ) { drawEdge( parentID, childID, "dashed" ); } - void SimpleDotVisitor::handle(osg::Drawable& drawable, osg::StateSet& stateset, int parentID, int childID ) { + void SimpleDotVisitor::handle(osg::Drawable&, osg::StateSet&, int parentID, int childID ) { drawEdge( parentID, childID, "dashed" ); } From 39a2d755dbabfb9871dae34971e3b51bdb7d4a14 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:57:57 +0100 Subject: [PATCH 31/94] Fixed -Wextra warning --- src/osgPlugins/dw/ReaderWriterDW.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/dw/ReaderWriterDW.cpp b/src/osgPlugins/dw/ReaderWriterDW.cpp index cce6e6f96..cbadf3942 100644 --- a/src/osgPlugins/dw/ReaderWriterDW.cpp +++ b/src/osgPlugins/dw/ReaderWriterDW.cpp @@ -331,7 +331,7 @@ public: GLUtesselator *ts, _dwobj *dwob, const RefMatrix *tmat) const; void link(const int idop, const _face *f2, const int idop2,const std::vector verts, const dwmaterial *themat) const; // to join up opposed faces of a hole - inline const int getidx(int i) const { return idx[i];} + inline int getidx(int i) const { return idx[i];} private: void linkholes(const std::vector verts, const dwmaterial *themat, const _face *f2) const; void reverse() { // reverse order of the vertices From 37e83f7c6256b4f5c8d43c75803c590b2fbf114d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 09:59:33 +0100 Subject: [PATCH 32/94] Disabled -Wextra for dae build as warnings in COLLADA_DOM headers can't be fixed --- src/osgPlugins/dae/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgPlugins/dae/CMakeLists.txt b/src/osgPlugins/dae/CMakeLists.txt index 676b5d29d..4e66afce7 100644 --- a/src/osgPlugins/dae/CMakeLists.txt +++ b/src/osgPlugins/dae/CMakeLists.txt @@ -1,5 +1,15 @@ INCLUDE_DIRECTORIES( ${COLLADA_INCLUDE_DIR} ${COLLADA_INCLUDE_DIR}/1.4) + +################################################################################ +## Quieten warnings that a due to dae headers + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + + SET(TARGET_SRC daeReader.cpp daeRAnimations.cpp From b4900811a749011d3907a02bf3c576d73a7b82e7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:00:18 +0100 Subject: [PATCH 33/94] Fixed -Wextra warning --- src/osgPlugins/curl/ReaderWriterCURL.cpp | 11 +++++------ src/osgPlugins/curl/ReaderWriterCURL.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/osgPlugins/curl/ReaderWriterCURL.cpp b/src/osgPlugins/curl/ReaderWriterCURL.cpp index c682a76c5..e0562f6d8 100644 --- a/src/osgPlugins/curl/ReaderWriterCURL.cpp +++ b/src/osgPlugins/curl/ReaderWriterCURL.cpp @@ -378,7 +378,7 @@ ReaderWriterCURL::ReaderWriterCURL() supportsProtocol("https","Read from https port using libcurl."); supportsProtocol("ftp","Read from ftp port using libcurl."); supportsProtocol("ftps","Read from ftps port using libcurl."); - + supportsExtension("curl","Pseudo file extension, used to select curl plugin."); supportsExtension("*","Passes all read files to other plugins to handle actual model loading."); supportsOption("OSG_CURL_PROXY","Specify the http proxy."); @@ -706,8 +706,7 @@ bool ReaderWriterCURL::read(std::istream& fin, std::string& destination) const } #endif -size_t empty_write_data(const char *buffer, size_t size, size_t nmemb, char -*userp) +size_t empty_write_data(const char* /*buffer*/, size_t size, size_t nmemb, char* /*userp*/) { return size*nmemb; } @@ -726,12 +725,12 @@ bool ReaderWriterCURL::fileExists(const std::string& filename, const osgDB::Opti curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, &empty_write_data); int result = curl_easy_perform(curl_handle); - + long http_return_code(0); curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &http_return_code); - + curl_easy_cleanup(curl_handle); - + return ((result == 0) && ((http_return_code == 200) || (http_return_code == 0))); } else diff --git a/src/osgPlugins/curl/ReaderWriterCURL.h b/src/osgPlugins/curl/ReaderWriterCURL.h index ad65786c7..bac63bcd9 100644 --- a/src/osgPlugins/curl/ReaderWriterCURL.h +++ b/src/osgPlugins/curl/ReaderWriterCURL.h @@ -79,7 +79,7 @@ class EasyCurl : public osg::Referenced virtual ~EasyCurl(); // disallow copying - EasyCurl(const EasyCurl& rhs):_curl(rhs._curl) {} + EasyCurl(const EasyCurl& rhs) : osg::Referenced(rhs), _curl(rhs._curl) {} EasyCurl& operator = (const EasyCurl&) { return *this; } void setOptions(const std::string& proxyAddress, const std::string& fileName, StreamObject& sp, const osgDB::ReaderWriter::Options *options); From 4dfd655b0cc2486d752e716b369d58fec14b2390 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:14:56 +0100 Subject: [PATCH 34/94] Fixed unused parameter warning. --- src/osgPlugins/ac/Geode.cpp | 2 +- src/osgPlugins/ac/Geode.h | 2 +- src/osgPlugins/ac/ac3d.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/ac/Geode.cpp b/src/osgPlugins/ac/Geode.cpp index 7421d32ea..e656ae94e 100644 --- a/src/osgPlugins/ac/Geode.cpp +++ b/src/osgPlugins/ac/Geode.cpp @@ -659,7 +659,7 @@ void Geode::OutputPolygonDelsUInt(const int iCurrentMaterial, const unsigned int } -const int Geode::ProcessMaterial(ostream& fout, const unsigned int igeode) +int Geode::ProcessMaterial(ostream& fout, const unsigned int igeode) { // outputs materials from one geode // extended for multiple geode models, GWM 2003. diff --git a/src/osgPlugins/ac/Geode.h b/src/osgPlugins/ac/Geode.h index acf86744a..65b88c971 100644 --- a/src/osgPlugins/ac/Geode.h +++ b/src/osgPlugins/ac/Geode.h @@ -9,7 +9,7 @@ namespace ac3d class Geode : public osg::Geode { public: - const int ProcessMaterial(std::ostream& fout, const unsigned int igeode); + int ProcessMaterial(std::ostream& fout, const unsigned int igeode); void ProcessGeometry(std::ostream& fout, const unsigned int igeode); private: void OutputTriangle(const int iCurrentMaterial,const unsigned int surfaceFlags, diff --git a/src/osgPlugins/ac/ac3d.cpp b/src/osgPlugins/ac/ac3d.cpp index 7c315a4a9..acca77b46 100644 --- a/src/osgPlugins/ac/ac3d.cpp +++ b/src/osgPlugins/ac/ac3d.cpp @@ -768,7 +768,7 @@ class LineBin : public PrimitiveBin return true; } - virtual osg::Geode* finalize(const MaterialData& material, const TextureData& textureData) + virtual osg::Geode* finalize(const MaterialData& material, const TextureData& /*textureData*/) { _geode->addDrawable(_geometry.get()); material.toStateSet(_geode->getOrCreateStateSet()); From eae28e4d91d72bb222af8c96193975300d00bd9f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:15:51 +0100 Subject: [PATCH 35/94] Fixed unused parameter warning. --- src/osgPlugins/3ds/ReaderWriter3DS.cpp | 2 +- src/osgPlugins/3ds/WriterNodeVisitor.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/osgPlugins/3ds/ReaderWriter3DS.cpp b/src/osgPlugins/3ds/ReaderWriter3DS.cpp index 277706f28..cff23d388 100644 --- a/src/osgPlugins/3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/3ds/ReaderWriter3DS.cpp @@ -693,7 +693,7 @@ static size_t fileo_write_func(void *self, const void *buffer, size_t size) return f->fail() ? 0 : size; } -static void fileio_log_func(void *self, Lib3dsLogLevel level, int indent, const char *msg) +static void fileio_log_func(void* /*self*/, Lib3dsLogLevel level, int /*indent*/, const char *msg) { osg::NotifySeverity l = osg::INFO; // Intentionally NOT mapping 3DS levels with OSG levels diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.cpp b/src/osgPlugins/3ds/WriterNodeVisitor.cpp index af9189a03..0f94456cc 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.cpp +++ b/src/osgPlugins/3ds/WriterNodeVisitor.cpp @@ -145,14 +145,14 @@ public: virtual void setVertexArray(unsigned int,const osg::Vec2*) {} - virtual void setVertexArray(unsigned int count,const osg::Vec3* vecs) {} + virtual void setVertexArray(unsigned int,const osg::Vec3*) {} - virtual void setVertexArray(unsigned int,const osg::Vec4* ) {} + virtual void setVertexArray(unsigned int,const osg::Vec4*) {} virtual void setVertexArray(unsigned int,const osg::Vec2d*) {} - virtual void setVertexArray(unsigned int ,const osg::Vec3d* ) {} - virtual void setVertexArray(unsigned int,const osg::Vec4d* ) {} + virtual void setVertexArray(unsigned int ,const osg::Vec3d*) {} + virtual void setVertexArray(unsigned int,const osg::Vec4d*) {} // operator for triangles From 883e195bba8d1e5a485944fc242a2e5c7dc7fb76 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:16:20 +0100 Subject: [PATCH 36/94] Fixed unused parameter warning. --- src/osgPlugins/3dc/ReaderWriter3DC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/3dc/ReaderWriter3DC.cpp b/src/osgPlugins/3dc/ReaderWriter3DC.cpp index 027b3f3c1..d9cb3b567 100644 --- a/src/osgPlugins/3dc/ReaderWriter3DC.cpp +++ b/src/osgPlugins/3dc/ReaderWriter3DC.cpp @@ -185,7 +185,7 @@ class ReaderWriter3DC : public osgDB::ReaderWriter } - virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* options =NULL) const + virtual WriteResult writeNode(const osg::Node& node,const std::string& fileName,const Options* /*options*/ =NULL) const { std::string ext = osgDB::getLowerCaseFileExtension(fileName); if( !acceptsExtension(ext)) return WriteResult::FILE_NOT_HANDLED; From 5bdd65c3004319e0a067fea81beae1958ac38a63 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:17:47 +0100 Subject: [PATCH 37/94] Fixed unused parameter warning. --- src/osgManipulator/AntiSquish.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgManipulator/AntiSquish.cpp b/src/osgManipulator/AntiSquish.cpp index 9ba61164e..287fba780 100644 --- a/src/osgManipulator/AntiSquish.cpp +++ b/src/osgManipulator/AntiSquish.cpp @@ -49,7 +49,7 @@ AntiSquish::~AntiSquish() } -bool AntiSquish::computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const +bool AntiSquish::computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* /*nv*/) const { osg::Matrix unsquishedMatrix; if ( !computeUnSquishedMatrix( unsquishedMatrix ) ) From de80cac99f8e65d1b96927a0854cd5b7e2ba8c5a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:18:23 +0100 Subject: [PATCH 38/94] Fixed -Wextra warnings --- src/osgGA/CameraManipulator.cpp | 4 +++- src/osgGA/EventHandler.cpp | 2 +- src/osgGA/FirstPersonManipulator.cpp | 3 ++- src/osgGA/FlightManipulator.cpp | 3 ++- src/osgGA/MultiTouchTrackballManipulator.cpp | 2 +- src/osgGA/NodeTrackerManipulator.cpp | 3 ++- src/osgGA/OrbitManipulator.cpp | 3 ++- src/osgGA/StandardManipulator.cpp | 4 +++- src/osgGA/TerrainManipulator.cpp | 3 ++- src/osgGA/TrackballManipulator.cpp | 3 ++- src/osgGA/Widget.cpp | 4 ++-- 11 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/osgGA/CameraManipulator.cpp b/src/osgGA/CameraManipulator.cpp index c957f880b..a206e0f12 100644 --- a/src/osgGA/CameraManipulator.cpp +++ b/src/osgGA/CameraManipulator.cpp @@ -21,7 +21,9 @@ CameraManipulator::CameraManipulator() CameraManipulator::CameraManipulator(const CameraManipulator& mm, const CopyOp& copyOp) - : inherited(mm, copyOp), + : osg::Object(mm, copyOp), + osg::Callback(mm, copyOp), + inherited(mm, copyOp), _intersectTraversalMask(mm._intersectTraversalMask), _autoComputeHomePosition(mm._autoComputeHomePosition), _homeEye(mm._homeEye), diff --git a/src/osgGA/EventHandler.cpp b/src/osgGA/EventHandler.cpp index 9ab3f3fb5..84117cdff 100644 --- a/src/osgGA/EventHandler.cpp +++ b/src/osgGA/EventHandler.cpp @@ -45,7 +45,7 @@ void EventHandler::event(osg::NodeVisitor* nv, osg::Drawable* drawable) } } -bool EventHandler::handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv) +bool EventHandler::handle(osgGA::Event* event, osg::Object* /*object*/, osg::NodeVisitor* /*nv*/) { OSG_NOTICE<<"Handle event "< Date: Wed, 8 Jun 2016 10:19:57 +0100 Subject: [PATCH 39/94] Fixed unused parameter warning. --- src/osgDB/CMakeLists.txt | 8 ++++++++ src/osgDB/ClassInterface.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt index 1e9b6d73a..1d0f614d0 100644 --- a/src/osgDB/CMakeLists.txt +++ b/src/osgDB/CMakeLists.txt @@ -165,6 +165,14 @@ IF( ZLIB_FOUND ) SET(COMPRESSION_LIBRARIES ZLIB_LIBRARY) ENDIF() +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + ADD_DEFINITIONS(-DOSG_PLUGIN_EXTENSION=${CMAKE_SHARED_MODULE_SUFFIX}) SET(TARGET_LIBRARIES diff --git a/src/osgDB/ClassInterface.cpp b/src/osgDB/ClassInterface.cpp index c51838cad..f2e638082 100644 --- a/src/osgDB/ClassInterface.cpp +++ b/src/osgDB/ClassInterface.cpp @@ -59,8 +59,8 @@ public: virtual void writeFloat( float f ) { write(f); } virtual void writeDouble( double d ) { write(d); } virtual void writeString( const std::string& s ) { _str.insert(_str.end(), s.begin(), s.end()); } - virtual void writeStream( std::ostream& (*fn)(std::ostream&) ) {} - virtual void writeBase( std::ios_base& (*fn)(std::ios_base&) ) {} + virtual void writeStream( std::ostream& (*)(std::ostream&) ) {} + virtual void writeBase( std::ios_base& (*)(std::ios_base&) ) {} virtual void writeGLenum( const osgDB::ObjectGLenum& value ) { writeInt(value.get()); } virtual void writeProperty( const osgDB::ObjectProperty& prop ) { _propertyName = prop._name; } virtual void writeMark( const osgDB::ObjectMark& mark ) { _markName = mark._name; } @@ -123,12 +123,12 @@ public: virtual void readDouble( double& d ) { read(d); } virtual void readString( std::string& s ) { s = std::string(_bufferData, _bufferSize); } - virtual void readStream( std::istream& (*fn)(std::istream&) ) {} - virtual void readBase( std::ios_base& (*fn)(std::ios_base&) ) {} + virtual void readStream( std::istream& (*)(std::istream&) ) {} + virtual void readBase( std::ios_base& (*)(std::ios_base&) ) {} virtual void readGLenum( ObjectGLenum& value ) { readUInt(value._value); } - virtual void readProperty( ObjectProperty& prop ) {} - virtual void readMark( ObjectMark& mark ) {} + virtual void readProperty( ObjectProperty& ) {} + virtual void readMark( ObjectMark&) {} virtual void readCharArray( char* s, unsigned int size ) { if ( size>0 ) _in->read( s, size ); } virtual void readWrappedString( std::string& str ) { readString(str); } @@ -388,7 +388,7 @@ bool ClassInterface::copyPropertyDataToObject(osg::Object* object, const std::st } } -bool ClassInterface::copyPropertyObjectFromObject(const osg::Object* object, const std::string& propertyName, void* valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType) +bool ClassInterface::copyPropertyObjectFromObject(const osg::Object* object, const std::string& propertyName, void* valuePtr, unsigned int /*valueSize*/, osgDB::BaseSerializer::Type valueType) { osgDB::BaseSerializer::Type sourceType; osgDB::BaseSerializer* serializer = getSerializer(object, propertyName, sourceType); @@ -411,7 +411,7 @@ bool ClassInterface::copyPropertyObjectFromObject(const osg::Object* object, con } } -bool ClassInterface::copyPropertyObjectToObject(osg::Object* object, const std::string& propertyName, const void* valuePtr, unsigned int valueSize, osgDB::BaseSerializer::Type valueType) +bool ClassInterface::copyPropertyObjectToObject(osg::Object* object, const std::string& propertyName, const void* valuePtr, unsigned int /*valueSize*/, osgDB::BaseSerializer::Type valueType) { osgDB::BaseSerializer::Type destinationType; osgDB::BaseSerializer* serializer = getSerializer(object, propertyName, destinationType); From 16645b1e256dba40ade6dc67ef97fab2995ee7ec Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:21:57 +0100 Subject: [PATCH 40/94] Added -Wmaybe-uninitialized -Wextra warnings to GNU CXX build. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c4a8915b..b77552022 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -957,7 +957,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX) SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused) IF(${CMAKE_MAJOR_VERSION} GREATER 2 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) - SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wshadow) + SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wshadow -Wmaybe-uninitialized -Wextra) ENDIF() # Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors From 782e867a7c4359a191348d1ea869f01727d6d9e8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:34:40 +0100 Subject: [PATCH 41/94] Fixed unused parameter warning. --- src/osgWrappers/deprecated-dotosg/osgWidget/Box.cpp | 2 +- .../deprecated-dotosg/osgWidget/EmbeddedWindow.cpp | 2 +- src/osgWrappers/deprecated-dotosg/osgWidget/Frame.cpp | 2 +- src/osgWrappers/deprecated-dotosg/osgWidget/Input.cpp | 2 +- src/osgWrappers/deprecated-dotosg/osgWidget/Label.cpp | 2 +- src/osgWrappers/deprecated-dotosg/osgWidget/Table.cpp | 2 +- src/osgWrappers/deprecated-dotosg/osgWidget/Widget.cpp | 6 +++--- .../deprecated-dotosg/osgWidget/WindowManager.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/Box.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/Box.cpp index ea0302826..691914b3b 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/Box.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/Box.cpp @@ -7,7 +7,7 @@ #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); diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/EmbeddedWindow.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/EmbeddedWindow.cpp index 3cbdc54f9..b9f1b023e 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/EmbeddedWindow.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/EmbeddedWindow.cpp @@ -7,7 +7,7 @@ #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; diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/Frame.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/Frame.cpp index 54624d031..962012d2a 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/Frame.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/Frame.cpp @@ -7,7 +7,7 @@ #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; diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/Input.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/Input.cpp index 280e24e96..b0c523294 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/Input.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/Input.cpp @@ -7,7 +7,7 @@ #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; diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/Label.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/Label.cpp index 8556a3811..b810cf349 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/Label.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/Label.cpp @@ -7,7 +7,7 @@ #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; diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/Table.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/Table.cpp index a98a7f4be..a0333c241 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/Table.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/Table.cpp @@ -7,7 +7,7 @@ #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; diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/Widget.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/Widget.cpp index f9dace966..22e8cd12a 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/Widget.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/Widget.cpp @@ -8,7 +8,7 @@ #include #include -bool osgWidget_Widget_readData(osg::Object& obj, osgDB::Input& fr) { +bool osgWidget_Widget_readData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { osgWidget::warn() << "Widget read" << std::endl; return false; @@ -24,7 +24,7 @@ bool osgWidget_Widget_writeData(const osg::Object& /*obj*/, osgDB::Output& fw) 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; @@ -40,7 +40,7 @@ bool osgWidget_NotifyWidget_writeData(const osg::Object& /*obj*/, osgDB::Output& 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; diff --git a/src/osgWrappers/deprecated-dotosg/osgWidget/WindowManager.cpp b/src/osgWrappers/deprecated-dotosg/osgWidget/WindowManager.cpp index 42efec7dd..16bc44d27 100644 --- a/src/osgWrappers/deprecated-dotosg/osgWidget/WindowManager.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgWidget/WindowManager.cpp @@ -7,7 +7,7 @@ #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; From 1d37501262baf82c52f06c834803c979bc5bf75b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:42:00 +0100 Subject: [PATCH 42/94] Fixed unused parameter warning. --- src/osgPlugins/cfg/ReaderWriterCFG.cpp | 2 +- src/osgPlugins/cfg/RenderSurface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/cfg/ReaderWriterCFG.cpp b/src/osgPlugins/cfg/ReaderWriterCFG.cpp index 7197c0a8c..52602b281 100644 --- a/src/osgPlugins/cfg/ReaderWriterCFG.cpp +++ b/src/osgPlugins/cfg/ReaderWriterCFG.cpp @@ -91,7 +91,7 @@ static osg::GraphicsContext::Traits* buildTrait(RenderSurface& rs) return traits; } -static osgViewer::View* load(const std::string& file, const osgDB::ReaderWriter::Options* option) +static osgViewer::View* load(const std::string& file, const osgDB::ReaderWriter::Options* /*option*/) { osg::ref_ptr config = new CameraConfig; //std::cout << "Parse file " << file << std::endl; diff --git a/src/osgPlugins/cfg/RenderSurface.cpp b/src/osgPlugins/cfg/RenderSurface.cpp index c7649f906..caf696d7f 100644 --- a/src/osgPlugins/cfg/RenderSurface.cpp +++ b/src/osgPlugins/cfg/RenderSurface.cpp @@ -258,7 +258,7 @@ int RenderSurface::getScreenNum( void ) const return _screen; } -void RenderSurface::setWindowRectangle( int x, int y, unsigned int width, unsigned int height, bool resize) +void RenderSurface::setWindowRectangle( int x, int y, unsigned int width, unsigned int height, bool /*resize*/) { if( _useCustomFullScreen ) { From e23798d630b165c898d45290c35936d49107b038 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:43:57 +0100 Subject: [PATCH 43/94] Fixed unused parameter warning. --- src/osgPlugins/cfg/ConfigParser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp index 0e51f35b9..263c82896 100644 --- a/src/osgPlugins/cfg/ConfigParser.cpp +++ b/src/osgPlugins/cfg/ConfigParser.cpp @@ -1118,6 +1118,7 @@ yydestruct (yytype, yyvaluep) #endif { /* Pacify ``unused variable'' warnings. */ + (void) yytype; (void) yyvaluep; } From bc866c51de43887c96ba4fc6f71b20389a44ad39 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:45:32 +0100 Subject: [PATCH 44/94] Fixed unused parameter warning. --- src/osgPlugins/dicom/ReaderWriterDICOM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/dicom/ReaderWriterDICOM.cpp b/src/osgPlugins/dicom/ReaderWriterDICOM.cpp index c63fdd519..697ac1737 100644 --- a/src/osgPlugins/dicom/ReaderWriterDICOM.cpp +++ b/src/osgPlugins/dicom/ReaderWriterDICOM.cpp @@ -255,7 +255,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter } - virtual ReadResult readImage(std::istream& fin,const osgDB::ReaderWriter::Options*) const + virtual ReadResult readImage(std::istream&,const osgDB::ReaderWriter::Options*) const { return 0; } From 4e442f483f28540ca206c0c00b6bb1566a46801f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:46:45 +0100 Subject: [PATCH 45/94] Fixed unused parameter warning. --- src/osgPlugins/p3d/ReaderWriterPaths.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/p3d/ReaderWriterPaths.cpp b/src/osgPlugins/p3d/ReaderWriterPaths.cpp index 4a77a8b27..6a520ac9b 100644 --- a/src/osgPlugins/p3d/ReaderWriterPaths.cpp +++ b/src/osgPlugins/p3d/ReaderWriterPaths.cpp @@ -123,7 +123,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(std::istream& fin, return ReadResult::FILE_NOT_HANDLED; } -osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_material(std::istream& fin, const osgDB::Options* options) const +osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_material(std::istream& fin, const osgDB::Options* /*options*/) const { osg::ref_ptr animationMaterial = new osgPresentation::AnimationMaterial; animationMaterial->read(fin); @@ -131,14 +131,14 @@ osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_material(std::istream& f return animationMaterial.get(); } -osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_path(std::istream& fin, const osgDB::Options* options) const +osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_path(std::istream& fin, const osgDB::Options* /*options*/) const { osg::ref_ptr animation = new osg::AnimationPath; animation->read(fin); return animation.get(); } -osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_pivot_path(std::istream& fin, const osgDB::Options* options) const +osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_pivot_path(std::istream& fin, const osgDB::Options* /*options*/) const { osg::ref_ptr animation = new osg::AnimationPath; @@ -203,7 +203,7 @@ struct RotationPathData }; -osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_rotation_path(std::istream& fin, const osgDB::Options* options) const +osgDB::ReaderWriter::ReadResult ReaderWriterPaths::read_rotation_path(std::istream& fin, const osgDB::Options* /*options*/) const { osg::ref_ptr animation = new osg::AnimationPath; From 19ec9bbef6d6d832b17f46c62877aa7f48dbba31 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:51:45 +0100 Subject: [PATCH 46/94] Fixed unused parameter warning. --- src/osgPlugins/OpenFlight/LightPointRecords.cpp | 4 ++-- src/osgPlugins/OpenFlight/PrimaryRecords.cpp | 2 +- src/osgPlugins/OpenFlight/ReaderWriterATTR.cpp | 2 +- src/osgPlugins/OpenFlight/VertexPaletteManager.cpp | 2 +- src/osgPlugins/OpenFlight/expGeometryRecords.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osgPlugins/OpenFlight/LightPointRecords.cpp b/src/osgPlugins/OpenFlight/LightPointRecords.cpp index 7f069bce0..058562ae8 100644 --- a/src/osgPlugins/OpenFlight/LightPointRecords.cpp +++ b/src/osgPlugins/OpenFlight/LightPointRecords.cpp @@ -447,7 +447,7 @@ protected: virtual ~LightPointSystem() {} - virtual void readRecord(RecordInputStream& in, Document& document) + virtual void readRecord(RecordInputStream& in, Document& /*document*/) { std::string id = in.readString(8); @@ -483,7 +483,7 @@ protected: _parent->addChild(*((osg::Group*)_switch.get())); } - virtual void dispose(Document& document) + virtual void dispose(Document& /*document*/) { if (!_switch.valid()) return; diff --git a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp index 8e8594a7a..d15fb5be0 100644 --- a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp +++ b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp @@ -767,7 +767,7 @@ public: protected: virtual ~InstanceDefinition() {} - virtual void readRecord(RecordInputStream& in, Document& document) + virtual void readRecord(RecordInputStream& in, Document& /*document*/) { in.forward(2); _number = (int)in.readUInt16(); diff --git a/src/osgPlugins/OpenFlight/ReaderWriterATTR.cpp b/src/osgPlugins/OpenFlight/ReaderWriterATTR.cpp index f1ea127be..f2fbfdbca 100644 --- a/src/osgPlugins/OpenFlight/ReaderWriterATTR.cpp +++ b/src/osgPlugins/OpenFlight/ReaderWriterATTR.cpp @@ -185,7 +185,7 @@ ReaderWriter::ReadResult ReaderWriterATTR::readObject(const std::string& file, c ReaderWriter::WriteResult -ReaderWriterATTR::writeObject(const osg::Object& object, const std::string& fileName, const Options* options) const +ReaderWriterATTR::writeObject(const osg::Object& object, const std::string& fileName, const Options* /*options*/) const { using std::ios; diff --git a/src/osgPlugins/OpenFlight/VertexPaletteManager.cpp b/src/osgPlugins/OpenFlight/VertexPaletteManager.cpp index 7005a3e61..8c647cb09 100644 --- a/src/osgPlugins/OpenFlight/VertexPaletteManager.cpp +++ b/src/osgPlugins/OpenFlight/VertexPaletteManager.cpp @@ -172,7 +172,7 @@ VertexPaletteManager::write( DataOutputStream& dos ) const VertexPaletteManager::PaletteRecordType -VertexPaletteManager::recordType( const osg::Array* v, const osg::Array* c, +VertexPaletteManager::recordType( const osg::Array* /*v*/, const osg::Array* /*c*/, const osg::Array* n, const osg::Array* t ) { if (t) diff --git a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp index 31f0595e0..8198db440 100644 --- a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp @@ -50,7 +50,7 @@ static unsigned int LAYER_7( 0x80000000 >> 6 ); bool -FltExportVisitor::isLit( const osg::Geometry& geom ) const +FltExportVisitor::isLit( const osg::Geometry& /*geom*/ ) const { const osg::StateSet* ss = getCurrentStateSet(); if ( ss->getMode( GL_LIGHTING ) & osg::StateAttribute::ON ) From f774a38cf2fce99c3b643c738f8d37280973d044 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:52:40 +0100 Subject: [PATCH 47/94] Fixed unused parameter warning. --- src/osgPlugins/nvtt/NVTTImageProcessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/nvtt/NVTTImageProcessor.cpp b/src/osgPlugins/nvtt/NVTTImageProcessor.cpp index b11000a21..4c149ff08 100644 --- a/src/osgPlugins/nvtt/NVTTImageProcessor.cpp +++ b/src/osgPlugins/nvtt/NVTTImageProcessor.cpp @@ -155,7 +155,7 @@ bool NVTTProcessor::OSGImageOutputHandler::assignImage(osg::Image& image) } /// Indicate the start of a new compressed image that's part of the final texture. -void NVTTProcessor::OSGImageOutputHandler::beginImage(int size, int width, int height, int depth, int face, int miplevel) +void NVTTProcessor::OSGImageOutputHandler::beginImage(int size, int width, int height, int /*depth*/, int /*face*/, int miplevel) { // store the new width/height of the texture if (miplevel == 0) From 8bfe67b37ba2e2064b829e2d692070e17ff7b29c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:54:36 +0100 Subject: [PATCH 48/94] Fixed unused parameter warning. --- include/osgQt/QWidgetImage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/osgQt/QWidgetImage b/include/osgQt/QWidgetImage index a64948de8..bd368127c 100644 --- a/include/osgQt/QWidgetImage +++ b/include/osgQt/QWidgetImage @@ -31,7 +31,7 @@ class OSGQT_EXPORT QWidgetImage : public osg::Image QGraphicsViewAdapter* getQGraphicsViewAdapter() { return _adapter; } virtual bool requiresUpdateCall() const { return true; } - virtual void update( osg::NodeVisitor* nv ) { render(); } + virtual void update( osg::NodeVisitor* /*nv*/ ) { render(); } void clearWriteBuffer(); From 801d41c47a63f012d760c1fe299750eb3fca7aad Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:55:22 +0100 Subject: [PATCH 49/94] Fixed unused parameter warning. --- src/osgPlugins/qfont/ReaderQFont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/qfont/ReaderQFont.cpp b/src/osgPlugins/qfont/ReaderQFont.cpp index 481f1a54f..4b04ad412 100644 --- a/src/osgPlugins/qfont/ReaderQFont.cpp +++ b/src/osgPlugins/qfont/ReaderQFont.cpp @@ -33,7 +33,7 @@ class ReaderQFont : public osgDB::ReaderWriter virtual const char* className() const { return "QFont Font Reader"; } - virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options* options) const + virtual ReadResult readObject(const std::string& file, const osgDB::ReaderWriter::Options* /*options*/) const { if (!acceptsExtension(osgDB::getLowerCaseFileExtension(file))) return ReadResult::FILE_NOT_HANDLED; From 7b7899154caed797c205dd2f50154ccb13a1ca9e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:58:14 +0100 Subject: [PATCH 50/94] Fixed unused parameter warning. --- src/osgPlugins/osc/OscReceivingDevice.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/osgPlugins/osc/OscReceivingDevice.cpp b/src/osgPlugins/osc/OscReceivingDevice.cpp index 80356730c..51a04b8c1 100644 --- a/src/osgPlugins/osc/OscReceivingDevice.cpp +++ b/src/osgPlugins/osc/OscReceivingDevice.cpp @@ -298,7 +298,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { float x_min(-1.0f), y_min(-1.0f), x_max(1.0f), y_max(1.0f); @@ -330,7 +330,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { bool increasing_upwards(false); @@ -364,7 +364,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { osc::int32 keycode(0); @@ -401,7 +401,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { osc::int32 keycode(0); @@ -438,7 +438,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { @@ -473,7 +473,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { try { @@ -514,7 +514,7 @@ public: { } - virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint) + virtual bool operator()(const std::string& /*request_path*/, const std::string& /*full_request_path*/, const osc::ReceivedMessage& m, const IpEndpointName& /*remoteEndPoint*/) { float down(0.0f); From ae9859340313ed9a3a6d2bc38499dcb3f63e9d4e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 10:59:55 +0100 Subject: [PATCH 51/94] Fixed unused parameter warning. --- src/osgPlugins/lua/LuaScriptEngine.cpp | 2 +- src/osgPlugins/lua/ReaderWriterLua.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/lua/LuaScriptEngine.cpp b/src/osgPlugins/lua/LuaScriptEngine.cpp index de760f82a..08e9a1b30 100644 --- a/src/osgPlugins/lua/LuaScriptEngine.cpp +++ b/src/osgPlugins/lua/LuaScriptEngine.cpp @@ -1843,7 +1843,7 @@ LuaScriptEngine::LuaScriptEngine(): initialize(); } -LuaScriptEngine::LuaScriptEngine(const LuaScriptEngine& rhs, const osg::CopyOp&): +LuaScriptEngine::LuaScriptEngine(const LuaScriptEngine&, const osg::CopyOp&): osg::ScriptEngine("lua"), _lua(0), _scriptCount(0) diff --git a/src/osgPlugins/lua/ReaderWriterLua.cpp b/src/osgPlugins/lua/ReaderWriterLua.cpp index b08d8def7..dd50127d4 100644 --- a/src/osgPlugins/lua/ReaderWriterLua.cpp +++ b/src/osgPlugins/lua/ReaderWriterLua.cpp @@ -160,7 +160,7 @@ class ReaderWriterLua : public osgDB::ReaderWriter return readNode(istream, local_opt.get()); } - virtual ReadResult readScript(std::istream& fin,const osgDB::ReaderWriter::Options* options =NULL) const + virtual ReadResult readScript(std::istream& fin,const osgDB::ReaderWriter::Options* /*options*/ =NULL) const { osg::ref_ptr script = new osg::Script; script->setLanguage("lua"); From fff4b4ae657861282e41ca01b38696793ebd4ba6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:02:51 +0100 Subject: [PATCH 52/94] Fixed unused parameter warning. --- applications/present3D/Cluster.h | 2 +- applications/present3D/SpellChecker.cpp | 2 +- applications/present3D/present3D.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/present3D/Cluster.h b/applications/present3D/Cluster.h index 9afa01b81..9d5f367e4 100644 --- a/applications/present3D/Cluster.h +++ b/applications/present3D/Cluster.h @@ -141,7 +141,7 @@ class CameraPacket { void writeEventQueue(osgViewer::Viewer& viewer); void setMasterKilled(const bool flag) { _masterKilled = flag; } - const bool getMasterKilled() const { return _masterKilled; } + bool getMasterKilled() const { return _masterKilled; } unsigned int _byte_order; bool _masterKilled; diff --git a/applications/present3D/SpellChecker.cpp b/applications/present3D/SpellChecker.cpp index ae2da32ad..56b9220a8 100644 --- a/applications/present3D/SpellChecker.cpp +++ b/applications/present3D/SpellChecker.cpp @@ -86,7 +86,7 @@ bool SpellChecker::isCorrect(const std::string& word) const return true; } -SpellChecker::WordList SpellChecker::suggest(const std::string& word) const +SpellChecker::WordList SpellChecker::suggest(const std::string& /*word*/) const { return WordList(); } diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index a757f4786..0e0c6abec 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -137,7 +137,7 @@ class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler { public: ForwardToDeviceEventHandler(osgGA::Device* device, bool format_mouse_events) : osgGA::GUIEventHandler(), _device(device), _forwardMouseEvents(format_mouse_events) {} - virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *) + virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *) { switch (ea.getEventType()) { @@ -180,7 +180,7 @@ class DumpEventHandler : public osgGA::GUIEventHandler { public: DumpEventHandler() : osgGA::GUIEventHandler() {} - virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *) + virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *) { switch (ea.getEventType()) { From 2052b2741e142387124bf5ecb56c7a9bda59810f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:04:24 +0100 Subject: [PATCH 53/94] Fixed unused parameter warning. --- examples/osganalysis/osganalysis.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/osganalysis/osganalysis.cpp b/examples/osganalysis/osganalysis.cpp index 9c81bf37c..bfae86de2 100644 --- a/examples/osganalysis/osganalysis.cpp +++ b/examples/osganalysis/osganalysis.cpp @@ -552,7 +552,7 @@ public: { } - virtual void operator () (osg::Object* object) + virtual void operator () (osg::Object* /*object*/) { osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename< Date: Wed, 8 Jun 2016 11:05:29 +0100 Subject: [PATCH 54/94] Fixed unused parameter warning. --- examples/osgcallback/osgcallback.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgcallback/osgcallback.cpp b/examples/osgcallback/osgcallback.cpp index 485825ce1..661b8e08e 100644 --- a/examples/osgcallback/osgcallback.cpp +++ b/examples/osgcallback/osgcallback.cpp @@ -162,7 +162,7 @@ struct TestDrawableUpdateCallback : public osg::DrawableUpdateCallback { TestDrawableUpdateCallback(const std::string &message): _message(message) {} - virtual void update(osg::NodeVisitor*, osg::Drawable* drw) { + virtual void update(osg::NodeVisitor*, osg::Drawable* /*drw*/) { printf("%s\n", _message.c_str()); } std::string _message; @@ -172,7 +172,7 @@ struct TestNodeUpdateCallback : public osg::NodeCallback { TestNodeUpdateCallback(const std::string &message): _message(message) {} - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { + virtual void operator()(osg::Node* /*node*/, osg::NodeVisitor* /*nv*/) { printf("%s\n", _message.c_str()); } std::string _message; From 43f8a13d0347fc8f0a33e8e6b0098d65af36c6b5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:06:52 +0100 Subject: [PATCH 55/94] Fixed ignored qualifiers warning --- examples/osgcluster/osgcluster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index de5f3eaa5..c9ddf2cd8 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -74,7 +74,7 @@ class CameraPacket { void writeEventQueue(osgViewer::Viewer& viewer); void setMasterKilled(const bool flag) { _masterKilled = flag; } - const bool getMasterKilled() const { return _masterKilled; } + bool getMasterKilled() const { return _masterKilled; } unsigned int _byte_order; bool _masterKilled; From 54aa65f4965e3b35a72f7064589e28240abe89e4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:07:56 +0100 Subject: [PATCH 56/94] Fixed ignored qualifiers warning --- examples/osgdistortion/osgdistortion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 7af13d564..96376b4d7 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -106,7 +106,7 @@ public: { } - virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv) + virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object* object, osg::NodeVisitor* nv) { osg::Camera* camera = dynamic_cast(object); if (!camera) return false; From 772368ed1f31f31f959ddb789c99f902fdf63818 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:18:20 +0100 Subject: [PATCH 57/94] Fixed unused parameter warning. --- .../osggpucull/AggregateGeometryVisitor.h | 56 +++++++++---------- .../osggpucull/DrawIndirectPrimitiveSet.cpp | 24 ++++---- .../osggpucull/DrawIndirectPrimitiveSet.h | 4 +- examples/osggpucull/osggpucull.cpp | 2 +- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/examples/osggpucull/AggregateGeometryVisitor.h b/examples/osggpucull/AggregateGeometryVisitor.h index 8a2091247..c8005d45f 100644 --- a/examples/osggpucull/AggregateGeometryVisitor.h +++ b/examples/osggpucull/AggregateGeometryVisitor.h @@ -1,14 +1,14 @@ /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield * Copyright (C) 2014 Pawel Ksiezopolski * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. * */ @@ -25,14 +25,14 @@ // with data matching users needs struct ConvertTrianglesOperator : public osg::Referenced { - ConvertTrianglesOperator() + ConvertTrianglesOperator() : osg::Referenced() { } virtual void initGeometry( osg::Geometry* outputGeometry ) = 0; - virtual bool pushNode( osg::Node* node ) - { - return false; + virtual bool pushNode( osg::Node* /*node*/ ) + { + return false; } virtual void popNode() = 0; virtual void setGeometryData( const osg::Matrix &matrix, osg::Geometry *inputGeometry, osg::Geometry* outputGeometry, float typeID, float lodNumber ) = 0; @@ -47,7 +47,7 @@ public: } void apply( GLfloat& value ) { - out = osg::Vec2( value, 0.0 ); + out = osg::Vec2( value, 0.0 ); } void apply( osg::Vec2& value ) { @@ -83,7 +83,7 @@ public: // texCoord1 holds additional information about vertex ( typeID, lodNumber, boneIndex ) struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator { - ConvertTrianglesOperatorClassic() + ConvertTrianglesOperatorClassic() : ConvertTrianglesOperator(), _typeID(0.0f), _lodNumber(0.0f) { @@ -113,18 +113,18 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator virtual void setGeometryData( const osg::Matrix &matrix, osg::Geometry *inputGeometry, osg::Geometry* outputGeometry, float typeID, float lodNumber ) { _matrix = matrix; - + _inputVertices = dynamic_cast( inputGeometry->getVertexArray() ); _inputColors = dynamic_cast( inputGeometry->getColorArray() ); _inputNormals = dynamic_cast( inputGeometry->getNormalArray() ); _inputTexCoord0 = inputGeometry->getTexCoordArray(0); - + _outputVertices = dynamic_cast( outputGeometry->getVertexArray() ); _outputColors = dynamic_cast( outputGeometry->getColorArray() ); _outputNormals = dynamic_cast( outputGeometry->getNormalArray() ); _outputTexCoord0 = dynamic_cast( outputGeometry->getTexCoordArray(0) ); _outputTexCoord1 = dynamic_cast( outputGeometry->getTexCoordArray(1) ); - + _typeID = typeID; _lodNumber = lodNumber; } @@ -147,7 +147,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator _outputVertices->push_back( _inputVertices->at( i1 ) * _matrix ); _outputVertices->push_back( _inputVertices->at( i2 ) * _matrix ); _outputVertices->push_back( _inputVertices->at( i3 ) * _matrix ); - + if( _inputColors != NULL ) { _outputColors->push_back( _inputColors->at( ic1 ) ); @@ -159,7 +159,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator for(unsigned int i=0; i<3; ++i) _outputColors->push_back( osg::Vec4(1.0,1.0,1.0,1.0) ); } - + if( _inputNormals != NULL ) { _outputNormals->push_back( osg::Matrix::transform3x3( _inputNormals->at( in1 ), _matrix ) ); @@ -185,7 +185,7 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator for(unsigned int i=0; i<3; ++i) _outputTexCoord0->push_back( osg::Vec2(0.0,0.0) ); } - + for(unsigned int i=0; i<3; ++i) _outputTexCoord1->push_back( osg::Vec3( _typeID, _lodNumber, _boneIndices.back() ) ); } @@ -195,24 +195,24 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator } osg::Matrix _matrix; - + osg::Vec3Array* _inputVertices; osg::Vec4Array* _inputColors; osg::Vec3Array* _inputNormals; osg::Array* _inputTexCoord0; - + osg::Vec3Array* _outputVertices; osg::Vec4Array* _outputColors; osg::Vec3Array* _outputNormals; osg::Vec2Array* _outputTexCoord0; osg::Vec3Array* _outputTexCoord1; - + float _typeID; float _lodNumber; std::vector _boneIndices; - + std::map _boneNames; - + GetVec2FromArrayVisitor _inputTexCoord0Visitor; }; @@ -220,10 +220,10 @@ struct ConvertTrianglesOperatorClassic : public ConvertTrianglesOperator class AggregateGeometryVisitor : public osg::NodeVisitor { -public: +public: AggregateGeometryVisitor( ConvertTrianglesOperator* ctOperator ); void init(); - + // osg::TriangleIndexFunctor uses its template parameter as a base class, so we must use an adapter pattern to hack it struct ConvertTrianglesBridge { @@ -251,10 +251,10 @@ public: { _converter->operator()(i1,i2,i3); } - + osg::ref_ptr _converter; }; - + // struct returning information about added object ( first vertex, vertex count, primitiveset index ) // used later to create indirect command texture buffers @@ -269,11 +269,11 @@ public: unsigned int index; }; AddObjectResult addObject( osg::Node* object, unsigned int typeID, unsigned int lodNumber ); - + void apply( osg::Node& node ); void apply( osg::Transform& transform ); void apply( osg::Geode& geode ); - + inline osg::Geometry* getAggregatedGeometry() { return _aggregatedGeometry.get(); @@ -282,7 +282,7 @@ protected: osg::ref_ptr _aggregatedGeometry; osg::TriangleIndexFunctor _ctOperator; std::vector _matrixStack; - + unsigned int _currentTypeID; unsigned int _currentLodNumber; }; diff --git a/examples/osggpucull/DrawIndirectPrimitiveSet.cpp b/examples/osggpucull/DrawIndirectPrimitiveSet.cpp index 36e06586e..047d59bcd 100644 --- a/examples/osggpucull/DrawIndirectPrimitiveSet.cpp +++ b/examples/osggpucull/DrawIndirectPrimitiveSet.cpp @@ -1,14 +1,14 @@ /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield * Copyright (C) 2014 Pawel Ksiezopolski * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. * */ @@ -19,32 +19,32 @@ #include #include -void DrawArraysIndirect::draw(osg::State& state, bool useVertexBufferObjects) const +void DrawArraysIndirect::draw(osg::State& state, bool /*useVertexBufferObjects*/) const { if( !_buffer.valid() ) return; _buffer->bindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER ); -// if you want to see how many primitives were rendered - uncomment code below, but +// if you want to see how many primitives were rendered - uncomment code below, but // be warned : it is a serious performance killer ( because of GPU->CPU roundtrip ) - + // osg::Drawable::Extensions *dext = osg::Drawable::getExtensions( state.getContextID(),true ); // int* tab = (int*)dext->glMapBuffer(GL_DRAW_INDIRECT_BUFFER,GL_READ_ONLY); // int val = _indirect/sizeof(int); // OSG_WARN<<"DrawArraysIndirect ("<glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER); - + DrawIndirectGLExtensions *ext = DrawIndirectGLExtensions::getExtensions( state.getContextID(),true ); ext->glDrawArraysIndirect( _mode, reinterpret_cast(_indirect) ); _buffer->unbindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER ); } -void MultiDrawArraysIndirect::draw(osg::State& state, bool useVertexBufferObjects) const +void MultiDrawArraysIndirect::draw(osg::State& state, bool /*useVertexBufferObjects*/) const { if( !_buffer.valid() ) return; _buffer->bindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER ); - + DrawIndirectGLExtensions *ext = DrawIndirectGLExtensions::getExtensions( state.getContextID(),true ); ext->glMultiDrawArraysIndirect( _mode, reinterpret_cast(_indirect), _drawcount, _stride ); _buffer->unbindBufferAs( state.getContextID(), GL_DRAW_INDIRECT_BUFFER ); @@ -80,7 +80,7 @@ void DrawIndirectGLExtensions::lowestCommonDenominator( const DrawIndirectGLExte } } -void DrawIndirectGLExtensions::setupGLExtensions( unsigned int contextID ) +void DrawIndirectGLExtensions::setupGLExtensions( unsigned int /*contextID*/ ) { _glDrawArraysIndirect = 0; _glMultiDrawArraysIndirect = 0; @@ -110,7 +110,7 @@ void DrawIndirectGLExtensions::glMultiDrawArraysIndirect(GLenum mode, const void else { OSG_WARN<<"Error: glMultiDrawArraysIndirect not supported by OpenGL driver"<(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawArraysIndirect"; } @@ -57,7 +57,7 @@ public: { } virtual osg::Object* cloneType() const { return new MultiDrawArraysIndirect(); } - virtual osg::Object* clone(const osg::CopyOp& copyop) const { return NULL; } + virtual osg::Object* clone(const osg::CopyOp& /*copyop*/) const { return NULL; } virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "MultiDrawArraysIndirect"; } diff --git a/examples/osggpucull/osggpucull.cpp b/examples/osggpucull/osggpucull.cpp index b199578fc..413af29a2 100644 --- a/examples/osggpucull/osggpucull.cpp +++ b/examples/osggpucull/osggpucull.cpp @@ -692,7 +692,7 @@ struct ResetTexturesCallback : public osg::StateSet::Callback texUnitsDirtyParams.push_back(texUnit); } - virtual void operator() (osg::StateSet* stateset, osg::NodeVisitor* nv) + virtual void operator() (osg::StateSet* stateset, osg::NodeVisitor* /*nv*/) { std::vector::iterator it,eit; for(it=texUnitsDirty.begin(), eit=texUnitsDirty.end(); it!=eit; ++it) From 93a8b916cc33e7ad2f5a820438f9b3f6842e7bdb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:30:35 +0100 Subject: [PATCH 58/94] Fixed -Wextra warnings --- examples/osggpx/osggpx.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/osggpx/osggpx.cpp b/examples/osggpx/osggpx.cpp index c95bacc9a..d6f36d6e1 100644 --- a/examples/osggpx/osggpx.cpp +++ b/examples/osggpx/osggpx.cpp @@ -42,7 +42,8 @@ class TrackSegment : public osg::Object public: TrackSegment() {} - TrackSegment(const TrackSegment& ts, const osg::CopyOp=osg::CopyOp::SHALLOW_COPY) {} + TrackSegment(const TrackSegment& ts, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(ts, copyop) {} META_Object(osg, TrackSegment) @@ -78,7 +79,8 @@ class Track : public osg::Object public: Track() {} - Track(const Track& track, const osg::CopyOp=osg::CopyOp::SHALLOW_COPY) {} + Track(const Track& track, const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(track, copyop) {} META_Object(osg, Track) From fe2b4f92a160e611563cc3c319437dffac3ae318 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:31:11 +0100 Subject: [PATCH 59/94] Fixed unused parameter warning. --- examples/osgimagesequence/osgimagesequence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgimagesequence/osgimagesequence.cpp b/examples/osgimagesequence/osgimagesequence.cpp index cc64ae49b..4246d1c0c 100644 --- a/examples/osgimagesequence/osgimagesequence.cpp +++ b/examples/osgimagesequence/osgimagesequence.cpp @@ -330,7 +330,7 @@ void MovieEventHandler::set(osg::Node* node) } -bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv) +bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&, osg::Object*, osg::NodeVisitor*) { switch(ea.getEventType()) { From 77289a13961957f16f564d0128aec129d9fa5297 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:34:06 +0100 Subject: [PATCH 60/94] Fixed -Wextra warnings --- examples/osgmovie/osgmovie.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 7221e6f37..7fa9f3af0 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -701,8 +701,8 @@ void SDLAudioSink::play() - SDL_AudioSpec specs = { 0 }; - SDL_AudioSpec wanted_specs = { 0 }; + SDL_AudioSpec specs; + SDL_AudioSpec wanted_specs; wanted_specs.freq = _audioStream->audioFrequency(); wanted_specs.channels = _audioStream->audioNbChannels(); From 34dc153ff254ccccb468c9d82e4bcffdc63ae2fd Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:35:21 +0100 Subject: [PATCH 61/94] Fixed unused parameter warning. --- examples/osgmultiplemovies/osgmultiplemovies.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgmultiplemovies/osgmultiplemovies.cpp b/examples/osgmultiplemovies/osgmultiplemovies.cpp index 4e2a42feb..8ee1e9711 100644 --- a/examples/osgmultiplemovies/osgmultiplemovies.cpp +++ b/examples/osgmultiplemovies/osgmultiplemovies.cpp @@ -141,7 +141,7 @@ protected: }; -bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv) +bool MovieEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* /*nv*/) { switch(ea.getEventType()) { @@ -490,7 +490,7 @@ public: loadSlide(_currentFile); } - bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor* nv) + bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/, osg::Object*, osg::NodeVisitor* /*nv*/) { switch(ea.getEventType()) { From 5f34cddc31ee1998a6237156c11b3c354b26d7a7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:38:40 +0100 Subject: [PATCH 62/94] Fixed unused parameter warning. --- examples/osgocclusionquery/osgocclusionquery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgocclusionquery/osgocclusionquery.cpp b/examples/osgocclusionquery/osgocclusionquery.cpp index 9d2643d43..bc558d610 100644 --- a/examples/osgocclusionquery/osgocclusionquery.cpp +++ b/examples/osgocclusionquery/osgocclusionquery.cpp @@ -285,7 +285,7 @@ OcclusionQueryVisitor::getOccluderThreshold() const } void -OcclusionQueryVisitor::apply( osg::OcclusionQueryNode& oqn ) +OcclusionQueryVisitor::apply( osg::OcclusionQueryNode& /*oqn*/ ) { // A subgraph is already under osgOQ control. // Don't traverse further. From 34ef8e5f461589d7c46ef0005302e173bd81c766 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:39:47 +0100 Subject: [PATCH 63/94] Fixed unused parameter warning. --- examples/osgoscdevice/osgoscdevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgoscdevice/osgoscdevice.cpp b/examples/osgoscdevice/osgoscdevice.cpp index 71ffcbb36..88e96adad 100644 --- a/examples/osgoscdevice/osgoscdevice.cpp +++ b/examples/osgoscdevice/osgoscdevice.cpp @@ -198,7 +198,7 @@ private: std::ostringstream _ss; }; -bool UserEventHandler::handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv) +bool UserEventHandler::handle(osgGA::Event* event, osg::Object* /*object*/, osg::NodeVisitor* nv) { OSG_ALWAYS << "handle user-event: " << event->getName() << std::endl; @@ -347,7 +347,7 @@ class ForwardToDeviceEventHandler : public osgGA::EventHandler { public: ForwardToDeviceEventHandler(osgGA::Device* device) : osgGA::EventHandler(), _device(device) {} - virtual bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv) + virtual bool handle(osgGA::Event* event, osg::Object* /*object*/, osg::NodeVisitor* /*nv*/) { _device->sendEvent(*event); return false; From 82cd2d4515e89dc531887576fe3b00a4823d74e1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:40:51 +0100 Subject: [PATCH 64/94] Fixed unused parameter warning. --- examples/osgposter/PosterPrinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgposter/PosterPrinter.cpp b/examples/osgposter/PosterPrinter.cpp index 1f949724a..5d9b137a7 100644 --- a/examples/osgposter/PosterPrinter.cpp +++ b/examples/osgposter/PosterPrinter.cpp @@ -321,7 +321,7 @@ void PosterPrinter::frame( const osg::FrameStamp* fs, osg::Node* node ) } } -bool PosterPrinter::addCullCallbacks( const osg::FrameStamp* fs, osg::Node* node ) +bool PosterPrinter::addCullCallbacks( const osg::FrameStamp* fs, osg::Node* /*node*/ ) { if ( !_visitor->inQueue() || done() ) return false; @@ -335,7 +335,7 @@ bool PosterPrinter::addCullCallbacks( const osg::FrameStamp* fs, osg::Node* node return true; } -void PosterPrinter::removeCullCallbacks( osg::Node* node ) +void PosterPrinter::removeCullCallbacks( osg::Node* /*node*/ ) { _visitor->setAddingCallbacks( false ); _camera->accept( *_visitor ); From 8a3b56cc59ef7c37d2c497ab4a96b2eee3f7c952 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:41:54 +0100 Subject: [PATCH 65/94] Fixed unused parameter warning. --- examples/osgSSBO/osgSSBO.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgSSBO/osgSSBO.cpp b/examples/osgSSBO/osgSSBO.cpp index a98baab82..61b4f9aa1 100644 --- a/examples/osgSSBO/osgSSBO.cpp +++ b/examples/osgSSBO/osgSSBO.cpp @@ -142,7 +142,7 @@ enum Channel class ShaderStorageBufferCallback : public osg::StateAttributeCallback { public: - void operator() (osg::StateAttribute* attr, osg::NodeVisitor* nv) + void operator() (osg::StateAttribute* /*attr*/, osg::NodeVisitor* /*nv*/) { //if you need to process the data in your app-code , better leaving it on GPU and processing there, uploading per frame will make it slow #if 0 From c8d14a17455c05c34687775082c8ef5425da5e9d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:48:02 +0100 Subject: [PATCH 66/94] Fixed unused parameter warning. --- examples/osgshadow/osgshadow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/osgshadow/osgshadow.cpp b/examples/osgshadow/osgshadow.cpp index dab9e7057..6876e8a41 100644 --- a/examples/osgshadow/osgshadow.cpp +++ b/examples/osgshadow/osgshadow.cpp @@ -72,7 +72,7 @@ public: } /** Deprecated, Handle events, return true if handled, false otherwise. */ - virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) + virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/) { if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP) { @@ -122,7 +122,7 @@ public: void set( bool value ) { _value = value; } /** Deprecated, Handle events, return true if handled, false otherwise. */ - virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) + virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/) { if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP) { @@ -149,7 +149,7 @@ public: bool getAnimating() const { return _animating; } /** Deprecated, Handle events, return true if handled, false otherwise. */ - virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) + virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/) { if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP) { @@ -622,7 +622,7 @@ namespace ModelFive return apcb.release(); } - osg::Group* createModel(osg::ArgumentParser& arguments) + osg::Group* createModel(osg::ArgumentParser& /*arguments*/) { // Set the ground (only receives shadow) osg::ref_ptr groundNode = new osg::MatrixTransform; From 744421631e6958b47d2e064859fde04f229f63f7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 11:50:18 +0100 Subject: [PATCH 67/94] Fixed unused parameter warning. --- examples/osgsharedarray/osgsharedarray.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/osgsharedarray/osgsharedarray.cpp b/examples/osgsharedarray/osgsharedarray.cpp index 75cbc5b6c..643ddbd64 100644 --- a/examples/osgsharedarray/osgsharedarray.cpp +++ b/examples/osgsharedarray/osgsharedarray.cpp @@ -52,7 +52,7 @@ public: } /** Copy ctor. */ - MyArray(const MyArray& other, const osg::CopyOp& copyop) : + MyArray(const MyArray& other, const osg::CopyOp& /*copyop*/) : osg::Array(osg::Array::Vec3ArrayType,3,GL_FLOAT), _numElements(other._numElements), _ptr(other._ptr) { @@ -125,8 +125,8 @@ public: return _numElements * sizeof(osg::Vec3); } - virtual void reserveArray(unsigned int num) { OSG_NOTICE<<"reserveArray() not supported"< Date: Wed, 8 Jun 2016 12:07:14 +0100 Subject: [PATCH 68/94] Fixed -Wextra warnings --- examples/osgsidebyside/osgsidebyside.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/osgsidebyside/osgsidebyside.cpp b/examples/osgsidebyside/osgsidebyside.cpp index b946b1a23..c4acad979 100644 --- a/examples/osgsidebyside/osgsidebyside.cpp +++ b/examples/osgsidebyside/osgsidebyside.cpp @@ -49,7 +49,12 @@ public: { } - SwitchDOFVisitor(const SwitchDOFVisitor& sdfv, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY) {} + SwitchDOFVisitor(const SwitchDOFVisitor& sdfv, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(sdfv, copyop), + osg::Callback(sdfv, copyop), + osg::NodeVisitor(sdfv, copyop), + osgGA::GUIEventHandler(sdfv, copyop) + {} META_Object(osg, SwitchDOFVisitor) From 0223fff99cdd4743714f337aa8882687c9f687c0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:09:00 +0100 Subject: [PATCH 69/94] Fixed unused parameter warning. --- examples/osgspheresegment/osgspheresegment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgspheresegment/osgspheresegment.cpp b/examples/osgspheresegment/osgspheresegment.cpp index b5bacadfc..d61000f15 100644 --- a/examples/osgspheresegment/osgspheresegment.cpp +++ b/examples/osgspheresegment/osgspheresegment.cpp @@ -160,7 +160,7 @@ class RotateUpdateCallback : public osg::NodeCallback { public: RotateUpdateCallback() { i=0;} - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(osg::Node* node, osg::NodeVisitor* /*nv*/) { osgSim::SphereSegment * ss = dynamic_cast(node); if (ss) From e6252256e08eea6c912116c94ee38971ed28981b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:10:00 +0100 Subject: [PATCH 70/94] Fixed unused parameter warning. --- examples/osgterrain/osgterrain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgterrain/osgterrain.cpp b/examples/osgterrain/osgterrain.cpp index ce2bd11cc..ba6817688 100644 --- a/examples/osgterrain/osgterrain.cpp +++ b/examples/osgterrain/osgterrain.cpp @@ -85,7 +85,7 @@ public: _terrain(terrain), _mtc(mtc) {} - bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa) + bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/) { switch(ea.getEventType()) { From 0acb419cf51373486bb0c178f6abb8c516d54614 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:14:35 +0100 Subject: [PATCH 71/94] Fixed unused parameter warning. --- examples/osgtransferfunction/osgtransferfunction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/osgtransferfunction/osgtransferfunction.cpp b/examples/osgtransferfunction/osgtransferfunction.cpp index 9cb305b50..aad85e3e5 100644 --- a/examples/osgtransferfunction/osgtransferfunction.cpp +++ b/examples/osgtransferfunction/osgtransferfunction.cpp @@ -103,12 +103,12 @@ struct PopulateHistogram void luminance(float l) { update(l); } void alpha(float a) { update(a); } - void luminance_alpha(float l, float a) { update(l); } - void rgb(float r, float g, float b) { update(r); } - void rgba(float r, float g, float b, float a) { update(a); } + void luminance_alpha(float l, float /*a*/) { update(l); } + void rgb(float r, float /*g*/, float /*b*/) { update(r); } + void rgba(float /*r*/, float /*g*/, float /*b*/, float a) { update(a); } }; -void Histogram::analyse(const osg::Image* image, double interval) +void Histogram::analyse(const osg::Image* image, double /*interval*/) { PopulateHistogram populateHistogram(_valueMap); readImage(image, populateHistogram); From 6fab8cadd32db3d466b1062f01bb098bd1b318ae Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:15:51 +0100 Subject: [PATCH 72/94] Fixed unused parameter warning. --- examples/osgtext3D/osgtext3D_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/osgtext3D/osgtext3D_test.cpp b/examples/osgtext3D/osgtext3D_test.cpp index ce88ce153..70263aba2 100644 --- a/examples/osgtext3D/osgtext3D_test.cpp +++ b/examples/osgtext3D/osgtext3D_test.cpp @@ -25,7 +25,7 @@ osg::Group* test_create3DText(const osg::Vec3& center,float radius) float characterSize=radius*0.2f; float characterDepth=characterSize*0.2f; - + osg::Vec3 pos(center.x()-radius*.5f,center.y()-radius*.5f,center.z()-radius*.5f); #define SHOW_INTESECTION_CEASH #ifdef SHOW_INTESECTION_CEASH @@ -72,22 +72,22 @@ osg::Group* test_create3DText(const osg::Vec3& center,float radius) stateset->setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); rootNode->setStateSet(stateset); #endif - - - return rootNode; + + + return rootNode; } ////////////////////////////////////////////////////////////////////////// #include #include -class CInputHandler : public osgGA::GUIEventHandler +class CInputHandler : public osgGA::GUIEventHandler { public: CInputHandler( osg::PositionAttitudeTransform* pPatSphere ) { m_rPatSphere = pPatSphere; } - virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* pObject, osg::NodeVisitor* pNodeVisitor ) + virtual bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa, osg::Object* /*pObject*/, osg::NodeVisitor* /*pNodeVisitor*/ ) { osgViewer::Viewer* pViewer = dynamic_cast(&aa); if ( !pViewer ) From d9ddf7c5bedb818c13a20d1638975372a573b666 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:16:58 +0100 Subject: [PATCH 73/94] Fixed unused parameter warning. --- examples/osgtexture1D/osgtexture1D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgtexture1D/osgtexture1D.cpp b/examples/osgtexture1D/osgtexture1D.cpp index d4778991a..6deee88aa 100644 --- a/examples/osgtexture1D/osgtexture1D.cpp +++ b/examples/osgtexture1D/osgtexture1D.cpp @@ -30,7 +30,7 @@ // Creates a stateset which contains a 1D texture which is populated by contour banded color, // and allows tex gen to override the S texture coordinate -osg::StateSet* create1DTextureStateToDecorate(osg::Node* loadedModel) +osg::StateSet* create1DTextureStateToDecorate(osg::Node* /*loadedModel*/) { osg::Image* image = new osg::Image; From 6c8bcc5009e343d818f173446478a8aeaffabf1d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:19:53 +0100 Subject: [PATCH 74/94] Fixed unused parameter warning. --- examples/osgvolume/osgvolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index e444db521..29efa4e3f 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -312,7 +312,7 @@ public: errorMessage(), maximumTextureSize(256) {} - virtual void operator () (osg::GraphicsContext* gc) + virtual void operator () (osg::GraphicsContext* /*gc*/) { OpenThreads::ScopedLock lock(mutex); From b67a331627723143ffa337838627b3715d8e08bc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:21:29 +0100 Subject: [PATCH 75/94] Fixed unused parameter warning. --- examples/osganimationtimeline/osganimationtimeline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osganimationtimeline/osganimationtimeline.cpp b/examples/osganimationtimeline/osganimationtimeline.cpp index 4885e7b06..17f87b2ad 100644 --- a/examples/osganimationtimeline/osganimationtimeline.cpp +++ b/examples/osganimationtimeline/osganimationtimeline.cpp @@ -38,7 +38,7 @@ struct NoseBegin : public osgAnimation::Action::Callback { - virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv) + virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* /*nv*/) { std::cout << "sacrebleu, it scratches my nose, let me scratch it" << std::endl; std::cout << "process NoseBegin call back " << action->getName() << std::endl << std::endl; @@ -47,7 +47,7 @@ struct NoseBegin : public osgAnimation::Action::Callback struct NoseEnd : public osgAnimation::Action::Callback { - virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv) + virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* /*nv*/) { std::cout << "shhhrt shrrrrt shhhhhhrrrrt, haaa it's better"<< std::endl; std::cout << "process NoseEnd call back " << action->getName() << std::endl << std::endl; From c7c1f6a27e884b9b71799b4e7e828c5b98f09bd7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:21:51 +0100 Subject: [PATCH 76/94] Fixed unused parameter warning. --- examples/osgtexture2DArray/osgtexture2DArray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgtexture2DArray/osgtexture2DArray.cpp b/examples/osgtexture2DArray/osgtexture2DArray.cpp index c5bd52ead..9f4fe7c30 100644 --- a/examples/osgtexture2DArray/osgtexture2DArray.cpp +++ b/examples/osgtexture2DArray/osgtexture2DArray.cpp @@ -42,8 +42,8 @@ typedef std::vector< osg::ref_ptr > ImageList; class SubloadCallback : public osg::Texture2DArray::SubloadCallback { public: - virtual void load(const osg::Texture2DArray& texture, osg::State& state) const { } - virtual void subload(const osg::Texture2DArray& texture, osg::State& state) const { } + virtual void load(const osg::Texture2DArray& /*texture*/, osg::State& /*state*/) const { } + virtual void subload(const osg::Texture2DArray& /*texture*/, osg::State& /*state*/) const { } }; From 8653c83342442f75e8be5c549e2e4ea7c4472d02 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:22:12 +0100 Subject: [PATCH 77/94] Fixed unused parameter warning. --- examples/osgthreadedterrain/osgthreadedterrain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/osgthreadedterrain/osgthreadedterrain.cpp b/examples/osgthreadedterrain/osgthreadedterrain.cpp index c454a867c..26c67198e 100644 --- a/examples/osgthreadedterrain/osgthreadedterrain.cpp +++ b/examples/osgthreadedterrain/osgthreadedterrain.cpp @@ -87,7 +87,7 @@ public: _incrementalCompileOperation(ico), _block(block) {} - virtual void operator () (osg::Object* object) + virtual void operator () (osg::Object* /*object*/) { // osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename< Date: Wed, 8 Jun 2016 12:22:27 +0100 Subject: [PATCH 78/94] Fixed unused parameter warning. --- examples/osgvertexattributes/osgvertexattributes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgvertexattributes/osgvertexattributes.cpp b/examples/osgvertexattributes/osgvertexattributes.cpp index 4494dc9c3..deec04f9b 100644 --- a/examples/osgvertexattributes/osgvertexattributes.cpp +++ b/examples/osgvertexattributes/osgvertexattributes.cpp @@ -105,7 +105,7 @@ class ConvertToVertexAttibArrays : public osg::NodeVisitor shader.setShaderSource(source); } - void convertFragmentShader(osg::Program& program, osg::Shader& shader) + void convertFragmentShader(osg::Program& /*program*/, osg::Shader& /*shader*/) { } From 59a1d797134a52be31bab5deba3bd556fde42f32 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:24:46 +0100 Subject: [PATCH 79/94] Fixed -Wextra warnings --- examples/osganimationnode/osganimationnode.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/osganimationnode/osganimationnode.cpp b/examples/osganimationnode/osganimationnode.cpp index 2ded576e6..4612ee745 100644 --- a/examples/osganimationnode/osganimationnode.cpp +++ b/examples/osganimationnode/osganimationnode.cpp @@ -35,6 +35,7 @@ public: } AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): osg::Object(val, copyop), + osg::Callback(val, copyop), osg::NodeCallback(val, copyop), _sampler(val._sampler), _startTime(val._startTime), @@ -98,6 +99,7 @@ public: AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): osg::Object(val, copyop), + osg::Callback(val, copyop), osg::StateSet::Callback(val, copyop), _sampler(val._sampler), _startTime(val._startTime), From 0cb00424eee5e13f7710adde6c2200c4b0cb7f19 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 12:26:40 +0100 Subject: [PATCH 80/94] Fixed -Wextra warnings --- .../osganimationmakepath.cpp | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/examples/osganimationmakepath/osganimationmakepath.cpp b/examples/osganimationmakepath/osganimationmakepath.cpp index 69416e925..9b91fecd8 100644 --- a/examples/osganimationmakepath/osganimationmakepath.cpp +++ b/examples/osganimationmakepath/osganimationmakepath.cpp @@ -1,14 +1,14 @@ -/* -*-c++-*- +/* -*-c++-*- * Copyright (C) 2008 Cedric Pinson * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. * * Authors: @@ -33,7 +33,7 @@ public: META_Object(osgAnimation, AnimtkUpdateCallback); - AnimtkUpdateCallback() + AnimtkUpdateCallback() { _sampler = new osgAnimation::Vec3CubicBezierSampler; _playing = false; @@ -41,6 +41,7 @@ } AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): osg::Object(val, copyop), + osg::Callback(val, copyop), osg::NodeCallback(val, copyop), _sampler(val._sampler), _startTime(val._startTime), @@ -52,16 +53,16 @@ /** Callback method called by the NodeVisitor when visiting a node.*/ virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) - { - if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && - nv->getFrameStamp() && - nv->getFrameStamp()->getFrameNumber() != _lastUpdate) + { + if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && + nv->getFrameStamp() && + nv->getFrameStamp()->getFrameNumber() != _lastUpdate) { _lastUpdate = nv->getFrameStamp()->getFrameNumber(); _currentTime = osg::Timer::instance()->tick(); - if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) + if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) { osg::MatrixTransform* transform = dynamic_cast(node); if (transform) { @@ -97,7 +98,7 @@ class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback public: META_Object(osgAnimation, AnimtkStateSetUpdateCallback); - AnimtkStateSetUpdateCallback() + AnimtkStateSetUpdateCallback() { _sampler = new osgAnimation::Vec4LinearSampler; _playing = false; @@ -106,6 +107,7 @@ public: AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY): osg::Object(val, copyop), + osg::Callback(val, copyop), osg::StateSet::Callback(val, copyop), _sampler(val._sampler), _startTime(val._startTime), @@ -117,19 +119,19 @@ public: /** Callback method called by the NodeVisitor when visiting a node.*/ virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv) - { - if (state && - nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && - nv->getFrameStamp() && + { + if (state && + nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR && + nv->getFrameStamp() && nv->getFrameStamp()->getFrameNumber() != _lastUpdate) { _lastUpdate = nv->getFrameStamp()->getFrameNumber(); _currentTime = osg::Timer::instance()->tick(); - if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) + if (_playing && _sampler.get() && _sampler->getKeyframeContainer()) { osg::Material* material = dynamic_cast(state->getAttribute(osg::StateAttribute::MATERIAL)); - if (material) + if (material) { osg::Vec4 result; float t = osg::Timer::instance()->delta_s(_startTime, _currentTime); @@ -155,7 +157,7 @@ public: // This won't really give good results in any situation, but it does demonstrate // on possible "fast" usage... -class MakePathTimeCallback: public AnimtkUpdateCallback +class MakePathTimeCallback: public AnimtkUpdateCallback { osg::ref_ptr _geode; float _lastAdd; @@ -168,11 +170,11 @@ public: _addSeconds(0.08f) { } - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { float t = osg::Timer::instance()->delta_s(_startTime, _currentTime); - if(_lastAdd + _addSeconds <= t && t <= 8.0f) + if(_lastAdd + _addSeconds <= t && t <= 8.0f) { osg::Vec3 pos; @@ -190,7 +192,7 @@ public: // This will give great results if you DO NOT have VSYNC enabled and can generate // decent FPS. -class MakePathDistanceCallback: public AnimtkUpdateCallback +class MakePathDistanceCallback: public AnimtkUpdateCallback { osg::ref_ptr _geode; osg::Vec3 _lastAdd; @@ -203,7 +205,7 @@ public: _threshold(0.5f), _count(0) {} - virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) + virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { static bool countReported = false; @@ -215,13 +217,13 @@ public: osg::Vec3 distance = _lastAdd - pos; - if(t <= 8.0f && distance.length() >= _threshold) + if(t <= 8.0f && distance.length() >= _threshold) { _geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f))); _lastAdd = pos; _count++; } - else if(t > 8.0f) + else if(t > 8.0f) { if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl; countReported = true; @@ -231,13 +233,13 @@ public: } }; -osg::StateSet* setupStateSet() +osg::StateSet* setupStateSet() { osg::StateSet* st = new osg::StateSet(); - + st->setAttributeAndModes(new osg::Material(), true); st->setMode(GL_BLEND, true); - + AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback(); osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer(); keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1))); @@ -248,11 +250,11 @@ osg::StateSet* setupStateSet() keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1))); callback->start(); st->setUpdateCallback(callback); - + return st; } -osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode) +osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode) { osg::Vec3 v[5]; @@ -300,20 +302,20 @@ osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode) node->setUpdateCallback(callback); osg::Geode* geode = new osg::Geode(); - + geode->setStateSet(setupStateSet()); geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2))); - + node->addChild(geode); return node; } -int main(int argc, char** argv) +int main(int argc, char** argv) { osg::ArgumentParser arguments(&argc, argv); osgViewer::Viewer viewer(arguments); - + osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator(); viewer.setCameraManipulator(tbm); From b72929d84b3235ec9939deaffd76540c78cba76a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:20:07 +0100 Subject: [PATCH 81/94] Fixed unused parameter warning. --- examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp index fd732e4f4..f6d2edc2b 100644 --- a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp +++ b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp @@ -188,7 +188,7 @@ public: TerrainHandler(osgTerrain::Terrain* terrain): _terrain(terrain) {} - bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa) + bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/) { switch(ea.getEventType()) { From d022da5906e6b286235937e1803f618d063fa356 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:22:54 +0100 Subject: [PATCH 82/94] Disabled -Wextra as the warning it generates is bengin and fixing it would introduce warnings on other platforms --- examples/osguserdata/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/osguserdata/CMakeLists.txt b/examples/osguserdata/CMakeLists.txt index 0cf0f1203..1e0339aae 100644 --- a/examples/osguserdata/CMakeLists.txt +++ b/examples/osguserdata/CMakeLists.txt @@ -1,4 +1,14 @@ SET(TARGET_SRC osguserdata.cpp) + +################################################################################ +## Quieten warnings that a due to optional code paths + +IF(CMAKE_COMPILER_IS_GNUCXX) + # Remove -Wextra flag as it barfs on ffmoeg headers + STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF() + + #### end var setup ### SETUP_EXAMPLE(osguserdata) From 1eaaaac3403d6230bb327c377d283406bdc62db1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:25:02 +0100 Subject: [PATCH 83/94] Fixed unused parameter warning. --- examples/osgtessellationshaders/osgtessellationshaders.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/osgtessellationshaders/osgtessellationshaders.cpp b/examples/osgtessellationshaders/osgtessellationshaders.cpp index 8e54f22a7..766e7fd7e 100644 --- a/examples/osgtessellationshaders/osgtessellationshaders.cpp +++ b/examples/osgtessellationshaders/osgtessellationshaders.cpp @@ -120,7 +120,7 @@ static const char* fragSource = { "}\n" }; -osg::ref_ptr CreateIcosahedron(osg::Program *program) +osg::ref_ptr CreateIcosahedron(osg::Program* /*program*/) { osg::Geode *geode=new osg::Geode(); osg::Geometry *geometry = new osg::Geometry(); @@ -264,7 +264,7 @@ private: } }; -int main(int argc, char* argv[]) +int main(int, char* []) { osgViewer::Viewer viewer; viewer.setUpViewInWindow(100,100,800,600); From 4e39f988545d00cf8fa4e0226feae82bdc6dd322 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:26:00 +0100 Subject: [PATCH 84/94] Fixed unused parameter warning. --- examples/osganimationeasemotion/osganimationeasemotion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/osganimationeasemotion/osganimationeasemotion.cpp b/examples/osganimationeasemotion/osganimationeasemotion.cpp index a58367915..9e73c1cff 100644 --- a/examples/osganimationeasemotion/osganimationeasemotion.cpp +++ b/examples/osganimationeasemotion/osganimationeasemotion.cpp @@ -317,7 +317,8 @@ public: } }; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( From 67361b8947868405dafbbda1969c4d5d89363004 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:28:18 +0100 Subject: [PATCH 85/94] Fixed unused parameter warning. --- .../osgwidgetaddremove/osgwidgetaddremove.cpp | 15 ++++++++------- examples/osgwidgetcanvas/osgwidgetcanvas.cpp | 17 +++++++++-------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/examples/osgwidgetaddremove/osgwidgetaddremove.cpp b/examples/osgwidgetaddremove/osgwidgetaddremove.cpp index 050263abe..49c0d2e54 100644 --- a/examples/osgwidgetaddremove/osgwidgetaddremove.cpp +++ b/examples/osgwidgetaddremove/osgwidgetaddremove.cpp @@ -41,13 +41,13 @@ public: virtual bool mousePush(double, double, const osgWidget::WindowManager*) { addColor(0.2f, 0.2f, 0.2f, 0.0f); - + return true; } virtual bool mouseRelease(double, double, const osgWidget::WindowManager*) { addColor(-0.2f, -0.2f, -0.2f, 0.0f); - + return true; } }; @@ -86,7 +86,7 @@ public: wm->addChild(_win1.get()); } - bool handlePressAdd(osgWidget::Event& ev) { + bool handlePressAdd(osgWidget::Event& /*ev*/) { static unsigned int num = 0; std::stringstream ss; @@ -100,10 +100,10 @@ public: return true; } - bool handlePressRemove(osgWidget::Event& ev) { + bool handlePressRemove(osgWidget::Event& /*ev*/) { // TODO: Temporary hack! const osgWidget::Box::Vector& v = _win1->getObjects(); - + if(!v.size()) return false; osgWidget::Widget* w = _win1->getObjects()[v.size() - 1].get(); @@ -114,7 +114,8 @@ public: } }; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( @@ -123,7 +124,7 @@ int main(int argc, char** argv) { 1024.0f, MASK_2D ); - + osgWidget::Box* buttons = new AddRemove(); wm->addChild(buttons); diff --git a/examples/osgwidgetcanvas/osgwidgetcanvas.cpp b/examples/osgwidgetcanvas/osgwidgetcanvas.cpp index 553266127..b62d90525 100644 --- a/examples/osgwidgetcanvas/osgwidgetcanvas.cpp +++ b/examples/osgwidgetcanvas/osgwidgetcanvas.cpp @@ -11,7 +11,7 @@ bool colorWidgetEnter(osgWidget::Event& event) { event.getWidget()->addColor(0.5f, 0.2f, 0.3f, 0.0f); // osgWidget::warn() << "WIDGET mouseEnter " << event.getWidget()->getName() << std::endl; - + return false; } @@ -19,7 +19,7 @@ bool colorWidgetLeave(osgWidget::Event& event) { event.getWidget()->addColor(-0.5f, -0.2f, -0.3f, 0.0f); // osgWidget::warn() << "WIDGET mouseLeave" << std::endl; - + return true; } @@ -52,11 +52,12 @@ osgWidget::Widget* createWidget( widget->addCallback(new osgWidget::Callback(&widgetMouseOver, osgWidget::EVENT_MOUSE_OVER)); widget->setColor(col, col, col, 0.5f); widget->setLayer(layer); - + return widget; } -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( @@ -66,7 +67,7 @@ int main(int argc, char** argv) { MASK_2D, osgWidget::WindowManager::WM_PICK_DEBUG ); - + osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); canvas->addCallback(new osgWidget::Callback(&windowMouseOver, osgWidget::EVENT_MOUSE_OVER)); @@ -79,7 +80,7 @@ int main(int argc, char** argv) { 0.0f, 0.0f ); - + canvas->addWidget( createWidget("w2", 0.4f, osgWidget::Widget::LAYER_MIDDLE), 200.0f, @@ -103,7 +104,7 @@ int main(int argc, char** argv) { osgWidget::warn() << canvas->getWidth() << std::endl; canvas->addWidget(relWidget, 0.4f, 0.4f); - + relWidget->addOrigin(0.1f, 0.1f); relWidget->addSize(0.2f, 0.2f); @@ -126,7 +127,7 @@ int main(int argc, char** argv) { MASK_2D, osgWidget::WindowManager::WM_PICK_DEBUG ); - + osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); canvas->addWidget(new osgWidget::Widget("spacer", 2.0f, 300.0f), 1280.0f, 0.0f); From d2129d4b9a5b056e9491805152de39847003aedc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:30:09 +0100 Subject: [PATCH 86/94] Fixed unused parameter warning. --- examples/osgwidgetframe/osgwidgetframe.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/osgwidgetframe/osgwidgetframe.cpp b/examples/osgwidgetframe/osgwidgetframe.cpp index 276291765..c0ff83260 100644 --- a/examples/osgwidgetframe/osgwidgetframe.cpp +++ b/examples/osgwidgetframe/osgwidgetframe.cpp @@ -9,7 +9,8 @@ const unsigned int MASK_2D = 0xF0000000; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( From ec0e30017c0c5d7d1ceeb6caaf663328f71170ff Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:32:14 +0100 Subject: [PATCH 87/94] Fixed unused parameter warning. --- examples/osgwidgetinput/osgwidgetinput.cpp | 5 +++-- examples/osgwidgetlabel/osgwidgetlabel.cpp | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/osgwidgetinput/osgwidgetinput.cpp b/examples/osgwidgetinput/osgwidgetinput.cpp index aefb266d6..808b47704 100644 --- a/examples/osgwidgetinput/osgwidgetinput.cpp +++ b/examples/osgwidgetinput/osgwidgetinput.cpp @@ -11,7 +11,8 @@ const unsigned int MASK_2D = 0xF0000000; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( @@ -21,7 +22,7 @@ int main(int argc, char** argv) { MASK_2D, osgWidget::WindowManager::WM_PICK_DEBUG ); - + osgWidget::Box* box = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL); osgWidget::Input* input = new osgWidget::Input("input", "", 50); diff --git a/examples/osgwidgetlabel/osgwidgetlabel.cpp b/examples/osgwidgetlabel/osgwidgetlabel.cpp index 1895e2302..39d86fefe 100644 --- a/examples/osgwidgetlabel/osgwidgetlabel.cpp +++ b/examples/osgwidgetlabel/osgwidgetlabel.cpp @@ -16,7 +16,7 @@ const char* LABEL1 = "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in..." ; -const char* LABEL2 = +const char* LABEL2 = "...reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla\n" "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in \n" "culpa qui officia deserunt mollit anim id est laborum. BBBBB" @@ -39,7 +39,8 @@ osgWidget::Label* createLabel(const std::string& l, unsigned int size=13) { return label; } -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( @@ -50,7 +51,7 @@ int main(int argc, char** argv) { // osgWidget::WindowManager::WM_USE_RENDERBINS | osgWidget::WindowManager::WM_PICK_DEBUG ); - + osgWidget::Box* box = new osgWidget::Box("HBOX", osgWidget::Box::HORIZONTAL); osgWidget::Box* vbox = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL); osgWidget::Label* label1 = createLabel(LABEL1); @@ -86,7 +87,7 @@ int main(int argc, char** argv) { label3->setColor(0.0f, 0.0f, 0.5f, 0.5f); label4->setColor(0.0f, 0.0f, 0.5f, 0.5f); label5->setColor(0.0f, 0.0f, 0.5f, 0.5f); - + //label5->setAlignHorizontal(osgWidget::Widget::HA_LEFT); //label5->setAlignVertical(osgWidget::Widget::VA_BOTTOM); @@ -111,7 +112,7 @@ int main(int argc, char** argv) { // Test our label-in-window copy construction... osgWidget::Box* clonedBox = osg::clone(box, "HBOX-new", osg::CopyOp::DEEP_COPY_ALL); - + clonedBox->getBackground()->setColor(0.0f, 1.0f, 0.0f, 0.5f); wm->addChild(box); From 69a0a7331cd90ae5639f3e4b327b15f42f08e457 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:34:33 +0100 Subject: [PATCH 88/94] Fixed unused parameter warning. --- examples/osgwidgetbox/osgwidgetbox.cpp | 5 +++-- examples/osgwidgetmessagebox/osgwidgetmessagebox.cpp | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/osgwidgetbox/osgwidgetbox.cpp b/examples/osgwidgetbox/osgwidgetbox.cpp index 91dbae4e3..a1645d6d2 100644 --- a/examples/osgwidgetbox/osgwidgetbox.cpp +++ b/examples/osgwidgetbox/osgwidgetbox.cpp @@ -49,7 +49,7 @@ struct ColorWidget: public osgWidget::Widget { return true; } - bool keyUp(int key, int keyMask, osgWidget::WindowManager*) { + bool keyUp(int /*key*/, int /*keyMask*/, osgWidget::WindowManager*) { // osgWidget::warn() << "..." << key << " - " << keyMask << std::endl; return true; @@ -78,7 +78,8 @@ osgWidget::Box* createBox(const std::string& name, osgWidget::Box::BoxType bt) { return box; } -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( diff --git a/examples/osgwidgetmessagebox/osgwidgetmessagebox.cpp b/examples/osgwidgetmessagebox/osgwidgetmessagebox.cpp index acd1b5655..af662ad34 100644 --- a/examples/osgwidgetmessagebox/osgwidgetmessagebox.cpp +++ b/examples/osgwidgetmessagebox/osgwidgetmessagebox.cpp @@ -300,9 +300,8 @@ const char* LABEL1 = "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in..." ; -int main(int argc, char** argv) +int main(int, char**) { - osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( From dbb88b54568ec81e31b06e3dacd9d05797ed0baa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:34:55 +0100 Subject: [PATCH 89/94] Fixed unused parameter warning. --- examples/osgwidgetmenu/osgwidgetmenu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/osgwidgetmenu/osgwidgetmenu.cpp b/examples/osgwidgetmenu/osgwidgetmenu.cpp index 1e5c8238e..d25c9a446 100644 --- a/examples/osgwidgetmenu/osgwidgetmenu.cpp +++ b/examples/osgwidgetmenu/osgwidgetmenu.cpp @@ -97,7 +97,8 @@ public: } }; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( From 4e042652126f18484484bcdd518396b0b2d6e179 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:35:46 +0100 Subject: [PATCH 90/94] Fixed unused parameter warning. --- examples/osgwidgetnotebook/osgwidgetnotebook.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/osgwidgetnotebook/osgwidgetnotebook.cpp b/examples/osgwidgetnotebook/osgwidgetnotebook.cpp index 362438fe1..cd8ee0e1d 100644 --- a/examples/osgwidgetnotebook/osgwidgetnotebook.cpp +++ b/examples/osgwidgetnotebook/osgwidgetnotebook.cpp @@ -104,7 +104,7 @@ public: label->addSize(20.0f, 20.0f); label->setShadow(0.08f); label->setCanFill(true); - + addWidget(label); addWidget(_tabs->embed()); addWidget(_windows->embed()); @@ -117,7 +117,8 @@ void bound(osg::Node* node) { osgWidget::warn() << "center: " << bs.center() << " radius: " << bs.radius() << std::endl; } -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( From d55b64061b58552c53fdb4a829463f6f088a9227 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:36:18 +0100 Subject: [PATCH 91/94] Fixed unused parameter warning. --- examples/osgwidgetshader/osgwidgetshader.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/osgwidgetshader/osgwidgetshader.cpp b/examples/osgwidgetshader/osgwidgetshader.cpp index af1e2ec69..b50fd985c 100644 --- a/examples/osgwidgetshader/osgwidgetshader.cpp +++ b/examples/osgwidgetshader/osgwidgetshader.cpp @@ -21,7 +21,8 @@ osgWidget::Widget* createWidget( return widget; } -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( @@ -30,7 +31,7 @@ int main(int argc, char** argv) { 1024.0f, MASK_2D ); - + osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); canvas->attachMoveCallback(); @@ -41,7 +42,7 @@ int main(int argc, char** argv) { 0.0f, 0.0f ); - + canvas->addWidget( createWidget("w2", 0.4f, osgWidget::Widget::LAYER_MIDDLE), 200.0f, @@ -63,7 +64,7 @@ int main(int argc, char** argv) { osg::Shader::VERTEX, osgDB::findDataFile("osgWidget/osgwidgetshader-vert.glsl") )); - + program->addShader(osg::Shader::readShaderFile( osg::Shader::FRAGMENT, osgDB::findDataFile("osgWidget/osgwidgetshader-frag.glsl") From 018022fd9b54e26e5a6c6fa2f12dc53d929bab73 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:37:17 +0100 Subject: [PATCH 92/94] Fixed unused parameter warning. --- examples/osgwidgetscrolled/osgwidgetscrolled.cpp | 3 ++- examples/osgwidgettable/osgwidgettable.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/osgwidgetscrolled/osgwidgetscrolled.cpp b/examples/osgwidgetscrolled/osgwidgetscrolled.cpp index 21f984b04..f04675de4 100644 --- a/examples/osgwidgetscrolled/osgwidgetscrolled.cpp +++ b/examples/osgwidgetscrolled/osgwidgetscrolled.cpp @@ -77,7 +77,8 @@ bool changeTheme(osgWidget::Event& ev) { return true; } -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( diff --git a/examples/osgwidgettable/osgwidgettable.cpp b/examples/osgwidgettable/osgwidgettable.cpp index 3a152abf1..64389df1f 100644 --- a/examples/osgwidgettable/osgwidgettable.cpp +++ b/examples/osgwidgettable/osgwidgettable.cpp @@ -12,7 +12,8 @@ const unsigned int MASK_2D = 0xF0000000; // dynamically added to. Secondly, a table is matrix Layout, with both vertical and // horizontal placement cells. A Box, on the other hand, can only be vertical or horizontal. -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( @@ -22,7 +23,7 @@ int main(int argc, char** argv) { MASK_2D, osgWidget::WindowManager::WM_PICK_DEBUG ); - + osgWidget::Table* table = new osgWidget::Table("table", 3, 3); // Here we create our "cells" manually, though it will often be convenient to @@ -32,11 +33,11 @@ int main(int argc, char** argv) { table->addWidget(new osgWidget::Widget("0, 0", 100.0f, 25.0f), 0, 0); table->addWidget(new osgWidget::Widget("0, 1", 100.0f, 25.0f), 0, 1); table->addWidget(new osgWidget::Widget("0, 2", 100.0f, 75.0f), 0, 2); - + table->addWidget(new osgWidget::Widget("1, 0", 200.0f, 45.0f), 1, 0); table->addWidget(new osgWidget::Widget("1, 1", 200.0f, 45.0f), 1, 1); table->addWidget(new osgWidget::Widget("1, 2", 200.0f, 45.0f), 1, 2); - + table->addWidget(new osgWidget::Widget("2, 0", 300.0f, 65.0f), 2, 0); table->addWidget(new osgWidget::Widget("2, 1", 300.0f, 65.0f), 2, 1); table->addWidget(new osgWidget::Widget("2, 2", 300.0f, 65.0f), 2, 2); @@ -58,7 +59,7 @@ int main(int argc, char** argv) { table->getByName("0, 0")->setAlignVertical(osgWidget::Widget::VA_BOTTOM); table->getByName("0, 0")->setPadLeft(50.0f); table->getByName("0, 0")->setPadTop(3.0f); - + // Change the colors a bit to differentiate this row from the others. table->getByName("2, 0")->setColor(1.0f, 0.0f, 0.0f, 1.0f, osgWidget::Widget::LOWER_LEFT); table->getByName("2, 1")->setColor(1.0f, 0.0f, 0.0f, 0.5f); From 9290aaad0f2254fac45e088878d30c2476b8f68f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:38:40 +0100 Subject: [PATCH 93/94] Fixed unused parameter warning. --- examples/osgwidgetstyled/osgwidgetstyled.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/osgwidgetstyled/osgwidgetstyled.cpp b/examples/osgwidgetstyled/osgwidgetstyled.cpp index a6ad7d04a..fa9131dd4 100644 --- a/examples/osgwidgetstyled/osgwidgetstyled.cpp +++ b/examples/osgwidgetstyled/osgwidgetstyled.cpp @@ -30,7 +30,7 @@ class CustomStyled: public osgWidget::Widget { }; class CustomStyle: public osgWidget::Style { - virtual bool applyStyle(osgWidget::Widget* w, osgWidget::Reader r) { + virtual bool applyStyle(osgWidget::Widget* w, osgWidget::Reader /*r*/) { CustomStyled* cs = dynamic_cast(w); if(!cs) return false; @@ -41,7 +41,8 @@ class CustomStyle: public osgWidget::Style { } }; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( From 656649084d21a323a13df4d11c8f19aed26ed850 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Jun 2016 13:40:02 +0100 Subject: [PATCH 94/94] Fixed unused parameter warning. --- examples/osgviewerQt/osgviewerQt.cpp | 2 +- examples/osgwidgetwindow/osgwidgetwindow.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/osgviewerQt/osgviewerQt.cpp b/examples/osgviewerQt/osgviewerQt.cpp index defb79c8a..1a2eac464 100644 --- a/examples/osgviewerQt/osgviewerQt.cpp +++ b/examples/osgviewerQt/osgviewerQt.cpp @@ -81,7 +81,7 @@ public: return new osgQt::GraphicsWindowQt(traits.get()); } - virtual void paintEvent( QPaintEvent* event ) + virtual void paintEvent( QPaintEvent* /*event*/ ) { frame(); } protected: diff --git a/examples/osgwidgetwindow/osgwidgetwindow.cpp b/examples/osgwidgetwindow/osgwidgetwindow.cpp index 96a5e8a9f..7b145f8a9 100644 --- a/examples/osgwidgetwindow/osgwidgetwindow.cpp +++ b/examples/osgwidgetwindow/osgwidgetwindow.cpp @@ -51,14 +51,15 @@ struct CallbackObject: public osgWidget::Callback { osgWidget::Callback(evType) { } - virtual bool operator()(osgWidget::Event& ev) { + virtual bool operator()(osgWidget::Event& /*ev*/) { std::cout << "here" << std::endl; return false; } }; -int main(int argc, char** argv) { +int main(int, char**) +{ osgViewer::Viewer viewer; // Let's get busy! The WindowManager class is actually an osg::Switch,