From 88b2cccc09980ed4ba1ae9cb722ad9f6daca0da7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 19 Feb 2024 10:19:57 +0100 Subject: [PATCH] Fix compiler warnings: fix [-Winconsistent-missing-override] fix [-Wunused-lambda-capture] fix [-Wunused-variable] fix [-Wswitch] --- src/Mod/Assembly/App/AssemblyObject.cpp | 4 +--- src/Mod/Part/App/FeaturePartSection.h | 6 ++++-- src/Mod/Part/App/PartFeatures.h | 4 ++-- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 4 ---- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 2 ++ 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Mod/Assembly/App/AssemblyObject.cpp b/src/Mod/Assembly/App/AssemblyObject.cpp index 359d00ef4c..b5a060560c 100644 --- a/src/Mod/Assembly/App/AssemblyObject.cpp +++ b/src/Mod/Assembly/App/AssemblyObject.cpp @@ -624,7 +624,7 @@ void AssemblyObject::removeUnconnectedJoints(std::vector& std::remove_if( joints.begin(), joints.end(), - [&connectedParts, this](App::DocumentObject* joint) { + [&connectedParts](App::DocumentObject* joint) { App::DocumentObject* obj1 = getLinkObjFromProp(joint, "Part1"); App::DocumentObject* obj2 = getLinkObjFromProp(joint, "Part2"); if ((connectedParts.find(obj1) == connectedParts.end()) @@ -1073,8 +1073,6 @@ std::string AssemblyObject::handleOneSideOfJoint(App::DocumentObject* joint, App::DocumentObject* obj = getObjFromNameProp(joint, propObjName, propPartName); std::shared_ptr mbdPart = getMbDPart(part); - Base::Placement partPlc = getPlacementFromProp(part, "Placement"); - Base::Placement objPlc = getPlacementFromProp(obj, "Placement"); Base::Placement plc = getPlacementFromProp(joint, propPlcName); // Now we have plc which is the JCS placement, but its relative to the Object, not to the // containing Part. diff --git a/src/Mod/Part/App/FeaturePartSection.h b/src/Mod/Part/App/FeaturePartSection.h index c830d5243f..3189744b98 100644 --- a/src/Mod/Part/App/FeaturePartSection.h +++ b/src/Mod/Part/App/FeaturePartSection.h @@ -44,9 +44,11 @@ public: //@{ /// recalculate the Feature short mustExecute() const override; + protected: - BRepAlgoAPI_BooleanOperation* makeOperation(const TopoDS_Shape&, const TopoDS_Shape&) const override; - virtual const char *opCode() const; + BRepAlgoAPI_BooleanOperation* makeOperation(const TopoDS_Shape&, + const TopoDS_Shape&) const override; + const char *opCode() const override; //@} }; diff --git a/src/Mod/Part/App/PartFeatures.h b/src/Mod/Part/App/PartFeatures.h index 6b18d9d360..2d6f7d14e6 100644 --- a/src/Mod/Part/App/PartFeatures.h +++ b/src/Mod/Part/App/PartFeatures.h @@ -86,7 +86,7 @@ public: const char* getViewProviderName() const override { return "PartGui::ViewProviderLoft"; } - void setupObject(); + void setupObject() override; //@} protected: @@ -118,7 +118,7 @@ public: const char* getViewProviderName() const override { return "PartGui::ViewProviderSweep"; } - void setupObject(); + void setupObject() override; //@} protected: diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 73d23b5eff..64c277a960 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1893,8 +1893,6 @@ protected: void makeCts_1Point1Circle(bool& selAllowed, Base::Vector2d onSketchPos) { //Distance - const Part::Geometry* geom = Obj->getGeometry(selCircleArc[0].GeoId); - if (availableConstraint == AvailableConstraint::FIRST) { restartCommand(QT_TRANSLATE_NOOP("Command", "Add length constraint")); createDistanceConstrain(selPoints[0].GeoId, selPoints[0].PosId, selCircleArc[0].GeoId, selCircleArc[0].PosId, onSketchPos); @@ -1986,8 +1984,6 @@ protected: void makeCts_1Line1Circle(bool& selAllowed, Base::Vector2d onSketchPos) { //Distance - const Part::Geometry* geom = Obj->getGeometry(selCircleArc[0].GeoId); - if (availableConstraint == AvailableConstraint::FIRST) { restartCommand(QT_TRANSLATE_NOOP("Command", "Add length constraint")); createDistanceConstrain(selCircleArc[0].GeoId, selCircleArc[0].PosId, selLine[0].GeoId, selLine[0].PosId, onSketchPos); //Line second parameter diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index d432ef0ef4..1341442222 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -1207,6 +1207,8 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe Mode = STATUS_SELECT_Constraint; } } + default: + break; } } else if (!pressed) {