From fa0b094e6a0badefb7da5017ade469144fa0826d Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 22 Sep 2016 18:53:24 +0200 Subject: [PATCH] fix -Wextra & -Wdeprecated in Path --- src/Mod/Path/App/Command.cpp | 4 ++-- src/Mod/Path/App/Command.h | 4 ++-- src/Mod/Path/App/Path.cpp | 5 ++--- src/Mod/Path/App/PropertyPath.cpp | 3 +-- src/Mod/Path/App/PropertyTooltable.cpp | 1 - src/Mod/Path/App/Tooltable.cpp | 2 +- src/Mod/Path/Gui/Command.cpp | 2 ++ src/Mod/Path/Gui/TaskDlgPathCompound.cpp | 1 + src/Mod/Path/Gui/ViewProviderPathCompound.cpp | 2 ++ 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Mod/Path/App/Command.cpp b/src/Mod/Path/App/Command.cpp index 96156065e79b..e523c349cf34 100644 --- a/src/Mod/Path/App/Command.cpp +++ b/src/Mod/Path/App/Command.cpp @@ -109,7 +109,7 @@ Vector3d Command::getCenter (void) return vec; } -const double Command::getValue(const std::string& attr) +double Command::getValue(const std::string& attr) { std::string a(attr); boost::to_upper(a); @@ -119,7 +119,7 @@ const double Command::getValue(const std::string& attr) return val; } -const bool Command::has(const std::string& attr) +bool Command::has(const std::string& attr) { std::string a(attr); boost::to_upper(a); diff --git a/src/Mod/Path/App/Command.h b/src/Mod/Path/App/Command.h index 8adf6c613334..ebd8f926bc08 100644 --- a/src/Mod/Path/App/Command.h +++ b/src/Mod/Path/App/Command.h @@ -55,9 +55,9 @@ namespace Path std::string toGCode (void) const; // returns a GCode string representation of the command void setFromGCode (const std::string&); // sets the parameters from the contents of the given GCode string void setFromPlacement (const Base::Placement&); // sets the parameters from the contents of the given placement - const bool has(const std::string&); // returns true if the given string exists in the parameters + bool has(const std::string&); // returns true if the given string exists in the parameters Command transform(const Base::Placement); // returns a transformed copy of this command - const double getValue(const std::string&); // returns the value of a given parameter + double getValue(const std::string&); // returns the value of a given parameter // attributes std::string Name; diff --git a/src/Mod/Path/App/Path.cpp b/src/Mod/Path/App/Path.cpp index 4f609b9a608a..179d69d83e91 100644 --- a/src/Mod/Path/App/Path.cpp +++ b/src/Mod/Path/App/Path.cpp @@ -26,7 +26,6 @@ #ifndef _PreComp_ #endif -#include #include #include @@ -43,7 +42,7 @@ #include "Path.h" using namespace Path; -using namespace Base; +using namespace Base; TYPESYSTEM_SOURCE(Path::Toolpath , Base::Persistence); @@ -329,4 +328,4 @@ void Toolpath::RestoreDocFile(Base::Reader &reader) - + diff --git a/src/Mod/Path/App/PropertyPath.cpp b/src/Mod/Path/App/PropertyPath.cpp index e96ce5b30534..003b2b3da811 100644 --- a/src/Mod/Path/App/PropertyPath.cpp +++ b/src/Mod/Path/App/PropertyPath.cpp @@ -28,7 +28,6 @@ #endif -#include #include #include #include @@ -118,7 +117,7 @@ void PropertyPath::Restore(Base::XMLReader &reader) } } -void PropertyPath::SaveDocFile (Base::Writer &writer) const +void PropertyPath::SaveDocFile (Base::Writer &) const { // does nothing } diff --git a/src/Mod/Path/App/PropertyTooltable.cpp b/src/Mod/Path/App/PropertyTooltable.cpp index d740873054fa..6bc72c30e139 100644 --- a/src/Mod/Path/App/PropertyTooltable.cpp +++ b/src/Mod/Path/App/PropertyTooltable.cpp @@ -28,7 +28,6 @@ #endif -#include #include #include #include diff --git a/src/Mod/Path/App/Tooltable.cpp b/src/Mod/Path/App/Tooltable.cpp index 8fa89d913337..c61f816bcdbe 100644 --- a/src/Mod/Path/App/Tooltable.cpp +++ b/src/Mod/Path/App/Tooltable.cpp @@ -44,7 +44,7 @@ TYPESYSTEM_SOURCE(Path::Tool , Base::Persistence); Tool::Tool(const char* name, ToolType type, - ToolMaterial material, + ToolMaterial /*material*/, double diameter, double lengthoffset, double flatradius, diff --git a/src/Mod/Path/Gui/Command.cpp b/src/Mod/Path/Gui/Command.cpp index 9c0f07374ff1..9dc8085f9bb8 100644 --- a/src/Mod/Path/Gui/Command.cpp +++ b/src/Mod/Path/Gui/Command.cpp @@ -62,6 +62,7 @@ CmdPathCompound::CmdPathCompound() void CmdPathCompound::activated(int iMsg) { + Q_UNUSED(iMsg); std::vector Sel = getSelection().getSelection(); if (Sel.size() > 0) { std::ostringstream cmd; @@ -115,6 +116,7 @@ CmdPathShape::CmdPathShape() void CmdPathShape::activated(int iMsg) { + Q_UNUSED(iMsg); std::vector Sel = getSelection().getSelection(); if (Sel.size() == 1) { if (Sel[0].pObject->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { diff --git a/src/Mod/Path/Gui/TaskDlgPathCompound.cpp b/src/Mod/Path/Gui/TaskDlgPathCompound.cpp index 91e792e8eea8..430c35cea0bd 100644 --- a/src/Mod/Path/Gui/TaskDlgPathCompound.cpp +++ b/src/Mod/Path/Gui/TaskDlgPathCompound.cpp @@ -127,6 +127,7 @@ void TaskDlgPathCompound::open() void TaskDlgPathCompound::clicked(int button) { + Q_UNUSED(button); } bool TaskDlgPathCompound::accept() diff --git a/src/Mod/Path/Gui/ViewProviderPathCompound.cpp b/src/Mod/Path/Gui/ViewProviderPathCompound.cpp index 58bccecd62bf..40dccfbccf64 100644 --- a/src/Mod/Path/Gui/ViewProviderPathCompound.cpp +++ b/src/Mod/Path/Gui/ViewProviderPathCompound.cpp @@ -42,6 +42,7 @@ PROPERTY_SOURCE(PathGui::ViewProviderPathCompound, PathGui::ViewProviderPath) bool ViewProviderPathCompound::setEdit(int ModNum) { + Q_UNUSED(ModNum); Gui::TaskView::TaskDialog* dlg = new TaskDlgPathCompound(this); Gui::Control().showDialog(dlg); return true; @@ -49,6 +50,7 @@ bool ViewProviderPathCompound::setEdit(int ModNum) void ViewProviderPathCompound::unsetEdit(int ModNum) { + Q_UNUSED(ModNum); // when pressing ESC make sure to close the dialog Gui::Control().closeDialog(); }