From c1b7d38b271fe102d10e3eed3ba1b9abdc80816f Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 7 May 2024 16:00:12 +0200 Subject: [PATCH] Assembly: Fix warning: -Wunused-variable --- src/Mod/Assembly/App/AssemblyObject.cpp | 3 +++ src/Mod/Assembly/App/PreCompiled.h | 2 ++ src/Mod/Assembly/Gui/PreCompiled.h | 2 ++ src/Mod/Assembly/Gui/ViewProviderAssembly.cpp | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Mod/Assembly/App/AssemblyObject.cpp b/src/Mod/Assembly/App/AssemblyObject.cpp index 4dd6010b51..62b9e979a0 100644 --- a/src/Mod/Assembly/App/AssemblyObject.cpp +++ b/src/Mod/Assembly/App/AssemblyObject.cpp @@ -23,6 +23,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +#include #include #include #include @@ -1277,10 +1278,12 @@ int AssemblyObject::slidingPartIndex(App::DocumentObject* joint) { App::DocumentObject* part1 = getLinkObjFromProp(joint, "Part1"); App::DocumentObject* obj1 = getObjFromNameProp(joint, "Object1", "Part1"); + boost::ignore_unused(obj1); Base::Placement plc1 = getPlacementFromProp(joint, "Placement1"); App::DocumentObject* part2 = getLinkObjFromProp(joint, "Part2"); App::DocumentObject* obj2 = getObjFromNameProp(joint, "Object2", "Part2"); + boost::ignore_unused(obj2); Base::Placement plc2 = getPlacementFromProp(joint, "Placement2"); int slidingFound = 0; diff --git a/src/Mod/Assembly/App/PreCompiled.h b/src/Mod/Assembly/App/PreCompiled.h index f70a22f5f1..02eade24a0 100644 --- a/src/Mod/Assembly/App/PreCompiled.h +++ b/src/Mod/Assembly/App/PreCompiled.h @@ -42,6 +42,8 @@ #include #include +#include + #include #include #include diff --git a/src/Mod/Assembly/Gui/PreCompiled.h b/src/Mod/Assembly/Gui/PreCompiled.h index 79ef18d8f4..0aedfe99d2 100644 --- a/src/Mod/Assembly/Gui/PreCompiled.h +++ b/src/Mod/Assembly/Gui/PreCompiled.h @@ -37,6 +37,8 @@ #include #include +#include + // Qt #ifndef __QtAll__ #include diff --git a/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp b/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp index 6e568beda6..d9ea2ea4c5 100644 --- a/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp +++ b/src/Mod/Assembly/Gui/ViewProviderAssembly.cpp @@ -24,6 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +#include #include #include #include @@ -389,6 +390,7 @@ bool ViewProviderAssembly::mouseMove(const SbVec2s& cursorPos, Gui::View3DInvent Base::Vector3d projInitialPositionRot = initialPositionRot.ProjectToPlane(newJcsGlobalPlc.getPosition(), norm); + boost::ignore_unused(projInitialPositionRot); double angle = (newPosRot - center).GetAngleOriented(initialPositionRot - center, norm); // Base::Console().Warning("angle %f\n", angle); @@ -818,7 +820,6 @@ void ViewProviderAssembly::initMoveDragger() // find the placement for the dragger. App::DocumentObject* obj = docsToMove[0].first; - AssemblyObject* assemblyPart = static_cast(getObject()); draggerInitPlc = AssemblyObject::getGlobalPlacement(obj, obj); std::vector listOfObjs; for (auto& pair : docsToMove) { @@ -841,6 +842,7 @@ void ViewProviderAssembly::endMoveDragger() void ViewProviderAssembly::draggerMotionCallback(void* data, SoDragger* d) { + boost::ignore_unused(d); auto sudoThis = static_cast(data); Base::Placement draggerPlc = sudoThis->getDraggerPlacement();