diff --git a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/init.cpp b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/init.cpp index 562f561e99c..63f7ecf1791 100644 --- a/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/init.cpp +++ b/Sofa/Component/Collision/Response/Mapper/src/sofa/component/collision/response/mapper/init.cpp @@ -48,9 +48,10 @@ const char* getModuleVersion() return MODULE_VERSION; } -void registerObjects(sofa::core::ObjectFactory* factory) +void registerObjects(sofa::core::ObjectFactory* /*factory*/) { // this library does not register any component in the Factory + SOFA_UNUSED(factory); } void init() diff --git a/Sofa/GUI/Qt/src/sofa/gui/qt/SimpleDataWidget.cpp b/Sofa/GUI/Qt/src/sofa/gui/qt/SimpleDataWidget.cpp index 7942456a333..0cca21cc8c3 100644 --- a/Sofa/GUI/Qt/src/sofa/gui/qt/SimpleDataWidget.cpp +++ b/Sofa/GUI/Qt/src/sofa/gui/qt/SimpleDataWidget.cpp @@ -241,8 +241,8 @@ SelectableItemWidget::SelectableItemWidget(QWidget* parent, const char* name, bool SelectableItemWidget::createWidgets() { - if (Tdata && Tdata->getValueTypeString() != "SelectableItem" || - baseData && baseData->getValueTypeString() != "SelectableItem") + if ((Tdata && Tdata->getValueTypeString() != "SelectableItem") || + (baseData && baseData->getValueTypeString() != "SelectableItem")) { return false; } diff --git a/Sofa/framework/LinearAlgebra/src/sofa/linearalgebra/CompressedRowSparseMatrixConstraintEigenUtils.h b/Sofa/framework/LinearAlgebra/src/sofa/linearalgebra/CompressedRowSparseMatrixConstraintEigenUtils.h index 434d8758e37..3096d8d1c49 100644 --- a/Sofa/framework/LinearAlgebra/src/sofa/linearalgebra/CompressedRowSparseMatrixConstraintEigenUtils.h +++ b/Sofa/framework/LinearAlgebra/src/sofa/linearalgebra/CompressedRowSparseMatrixConstraintEigenUtils.h @@ -68,7 +68,7 @@ struct CompressedRowSparseMatrixToEigenSparseVec if (row.index() < eigenMat.rows()) { const auto colInsertion = colIndex + i; - if (colInsertion < eigenMat.cols()) + if (colInsertion < (std::size_t)eigenMat.cols()) { triplets.emplace_back(row.index(), colInsertion, vec[i]); } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp index 8032425b1dc..f4f2ce91e80 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Node.cpp @@ -94,13 +94,13 @@ Node::Node(const std::string& name) , configurationSetting(initLink("configurationSetting", "The ConfigurationSetting(s) attached to this node")) , shaders(initLink("shaders", "The shaders attached to this node")) , visualModel(initLink("visualModel", "The VisualModel(s) attached to this node")) - , visualStyle(initLink("visualStyle", "The VisualStyle(s) attached to this node")) , visualManager(initLink("visualManager", "The VisualManager(s) attached to this node")) , collisionModel(initLink("collisionModel", "The CollisionModel(s) attached to this node")) , unsorted(initLink("unsorted", "The remaining objects attached to this node")) , animationManager(initLink("animationLoop","The AnimationLoop attached to this node (only valid for root node)")) , visualLoop(initLink("visualLoop", "The VisualLoop attached to this node (only valid for root node)")) + , visualStyle(initLink("visualStyle", "The VisualStyle(s) attached to this node")) , topology(initLink("topology", "The Topology attached to this node")) , meshTopology(initLink("meshTopology", "The MeshTopology / TopologyContainer attached to this node")) , state(initLink("state", "The State attached to this node (storing vectors such as position, velocity)")) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/VisualVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/VisualVisitor.cpp index e64d50dda39..3c048b2568f 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/VisualVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/VisualVisitor.cpp @@ -48,12 +48,14 @@ Visitor::Result VisualVisitor::processNodeTopDown(simulation::Node* node) void VisualVisitor::fwdProcessVisualStyle(simulation::Node* node, core::visual::BaseVisualStyle* vm) { + SOFA_UNUSED(node); vm-> updateVisualFlags(vparams); } void VisualVisitor::bwdProcessVisualStyle(simulation::Node* node, core::visual::BaseVisualStyle* vm) { + SOFA_UNUSED(node); vm-> applyBackupFlags(vparams); } diff --git a/Sofa/framework/Type/src/sofa/type/MatSym.h b/Sofa/framework/Type/src/sofa/type/MatSym.h index 8a4140fdfb4..5de7389e6d1 100644 --- a/Sofa/framework/Type/src/sofa/type/MatSym.h +++ b/Sofa/framework/Type/src/sofa/type/MatSym.h @@ -137,7 +137,7 @@ class MatSym : public VecNoInit { for (sofa::Size j = 0; j < D; j++) { - for (int i = 0; i <= j; i++) + for (sofa::Size i = 0; i <= j; i++) { W(i, j) = (M(i, j) + M(j, i)) / 2; } diff --git a/Sofa/framework/Type/test/StrongType_test.cpp b/Sofa/framework/Type/test/StrongType_test.cpp index 767813b0baa..e18426be54e 100644 --- a/Sofa/framework/Type/test/StrongType_test.cpp +++ b/Sofa/framework/Type/test/StrongType_test.cpp @@ -31,6 +31,7 @@ TEST(StrongType, constructor) // myint a; //this is not possible as the default constructor is explicit constexpr myint a ( 2 ); + EXPECT_EQ(a.get(), 2); } TEST(StrongType, preIncrementable) diff --git a/applications/projects/SofaPhysicsAPI/src/SofaPhysicsAPI/SofaPhysicsSimulation.cpp b/applications/projects/SofaPhysicsAPI/src/SofaPhysicsAPI/SofaPhysicsSimulation.cpp index f0e53e0ac62..56e4c217bec 100644 --- a/applications/projects/SofaPhysicsAPI/src/SofaPhysicsAPI/SofaPhysicsSimulation.cpp +++ b/applications/projects/SofaPhysicsAPI/src/SofaPhysicsAPI/SofaPhysicsSimulation.cpp @@ -1123,13 +1123,12 @@ void SofaPhysicsSimulation::calcProjection() xFactor *= 0.01; yFactor *= 0.01; - //std::cout << xNear << " " << yNear << std::endl; - - double zForeground = -vparams->zNear() - offset; - double zBackground = -vparams->zFar() + offset; - if (currentCamera->getCameraType() == sofa::core::visual::VisualParams::PERSPECTIVE_TYPE) - gluPerspective(currentCamera->getFieldOfView(), (double) width / (double) height, vparams->zNear(), vparams->zFar()); + { + gluPerspective(currentCamera->getFieldOfView(), + (double) width / (double) height, + vparams->zNear(),vparams->zFar()); + } else { double ratio = vparams->zFar() / (vparams->zNear() * 20); @@ -1138,8 +1137,8 @@ void SofaPhysicsSimulation::calcProjection() { ratio = -300 * (tcenter.norm2()) / tcenter[2]; } - glOrtho((-xNear * xFactor) * ratio, (xNear * xFactor) * ratio, (-yNear - * yFactor) * ratio, (yNear * yFactor) * ratio, + glOrtho((-xNear * xFactor) * ratio, (xNear * xFactor) * ratio, + (-yNear * yFactor) * ratio, (yNear * yFactor) * ratio, vparams->zNear(), vparams->zFar()); }