Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[all] Fix additional warnings #5180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// this library does not register any component in the Factory
// this library does not register any component in the Factory
SOFA_UNUSED(factory);

}
Expand Down
4 changes: 2 additions & 2 deletions Sofa/GUI/Qt/src/sofa/gui/qt/SimpleDataWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion Sofa/framework/Type/src/sofa/type/MatSym.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class MatSym : public VecNoInit<D * (D + 1) / 2, real>
{
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;
}
Expand Down
1 change: 1 addition & 0 deletions Sofa/framework/Type/test/StrongType_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
}

Expand Down
Loading