Mod: fix several compiler warnings:

* fix -Wsometimes-uninitialized
* fix -Wunused-parameter
* fix -Wunused-variable
* fix -Winconsistent-missing-override
* fix -Wsign-compare
* fix -Wreorder-ctor
* fix -Wtautological-overlap-compare
This commit is contained in:
wmayer
2024-02-07 11:44:00 +01:00
committed by Chris Hennes
parent 395797d018
commit 5eabeff94e
12 changed files with 17 additions and 21 deletions

View File

@@ -140,8 +140,6 @@ void Array2D::onDataChanged(const QModelIndex& topLeft,
void Array2D::onContextMenu(const QPoint& pos)
{
QModelIndex index = ui->tableView->indexAt(pos);
QMenu contextMenu(tr("Context menu"), this);
contextMenu.addAction(&_deleteAction);

View File

@@ -54,10 +54,12 @@ public:
protected:
Materials::MaterialValue::ValueType getType(const QModelIndex& index) const override
{
Q_UNUSED(index)
return _type;
}
QString getUnits(const QModelIndex& index) const override
{
Q_UNUSED(index)
return _units;
}
QVariant getValue(const QModelIndex& index) const override;

View File

@@ -263,7 +263,7 @@ void MaterialDelegate::showImageModal(const QString& propertyName, QStandardItem
dlg->adjustSize();
connect(dlg, &QDialog::finished, this, [&](int result) {});
//connect(dlg, &QDialog::finished, this, [&](int result) {});
dlg->exec();
}
@@ -277,7 +277,7 @@ void MaterialDelegate::showListModal(const QString& propertyName, QStandardItem*
dlg->adjustSize();
connect(dlg, &QDialog::finished, this, [&](int result) {});
//connect(dlg, &QDialog::finished, this, [&](int result) {});
dlg->exec();
}
@@ -291,7 +291,7 @@ void MaterialDelegate::showMultiLineStringModal(const QString& propertyName, QSt
dlg->adjustSize();
connect(dlg, &QDialog::finished, this, [&](int result) {});
//connect(dlg, &QDialog::finished, this, [&](int result) {});
dlg->exec();
}
@@ -306,7 +306,7 @@ void MaterialDelegate::showArray2DModal(const QString& propertyName, QStandardIt
dlg->adjustSize();
connect(dlg, &QDialog::finished, this, [&](int result) {});
//connect(dlg, &QDialog::finished, this, [&](int result) {});
dlg->exec();
}
@@ -320,7 +320,7 @@ void MaterialDelegate::showArray3DModal(const QString& propertyName, QStandardIt
dlg->adjustSize();
connect(dlg, &QDialog::finished, this, [&](int result) {});
//connect(dlg, &QDialog::finished, this, [&](int result) {});
dlg->exec();
}

View File

@@ -63,8 +63,8 @@ MaterialsEditor::MaterialsEditor(QWidget* parent)
: QDialog(parent)
, ui(new Ui_MaterialsEditor)
, _material(std::make_shared<Materials::Material>())
, _edited(false)
, _rendered(nullptr)
, _edited(false)
, _recentMax(0)
{
ui->setupUi(this);

View File

@@ -52,7 +52,7 @@ public:
* planar or on the supplied plane, potentially speeding things up.
* @param plane FIXME: the plane is not propagated if processing compounds.
*/
void setPlane(const gp_Pln& plane);
void setPlane(const gp_Pln& plane) override;
std::string getUserFriendlyName() const override;
std::string getBriefExplanation() const override;

View File

@@ -1332,12 +1332,12 @@ GeomBSplineCurve::GeomBSplineCurve( const std::vector<Base::Vector3d>& poles, co
TColStd_Array1OfReal k(1,knots.size());
TColStd_Array1OfInteger m(1,knots.size());
for (int index = 1; index <= poles.size(); index++) {
for (std::size_t index = 1; index <= poles.size(); index++) {
p.SetValue(index, gp_Pnt(poles[index -1].x,poles[index -1].y,poles[index -1].z));
w.SetValue(index, weights[index -1]);
}
for (int index = 1; index <= knots.size(); index++) {
for (std::size_t index = 1; index <= knots.size(); index++) {
k.SetValue(index, knots[index -1]);
m.SetValue(index, multiplicities[index -1]);
}

View File

@@ -1991,7 +1991,6 @@ TopoDS_Compound Hole::findHoles(const TopoDS_Shape& profileshape,
builder.MakeCompound(holes);
TopTools_IndexedMapOfShape edgeMap;
TopExp::MapShapes(profileshape, TopAbs_EDGE, edgeMap);
int holePointsListSize = 0;
std::vector<gp_Pnt> holePointsList;
for (int i = 1; i <= edgeMap.Extent(); i++) {
bool dupCenter = false;

View File

@@ -138,9 +138,6 @@ void ViewProviderTrajectory::updateData(const App::Property* prop)
}
pcLines->numVertices.set1Value(0, trak.getSize());
}
else if (prop == &pcTracObj->Base) {
Base::Placement loc = *(&pcTracObj->Base.getValue());
}
}
void ViewProviderTrajectory::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)

View File

@@ -560,7 +560,7 @@ std::string PythonConverter::process(const Sketcher::Constraint* constraint, Geo
[](const Sketcher::Constraint* constr,
std::string& geoId1,
std::string& geoId2,
std::string& geoId3) {
[[maybe_unused]] std::string& geoId3) {
if (constr->Second == GeoEnum::GeoUndef) {
return boost::str(boost::format("Sketcher.Constraint('DistanceX', %s, %f)")
% geoId1 % constr->getValue());

View File

@@ -3389,7 +3389,7 @@ int Sketch::addDistanceConstraint(int geoId1, int geoId2, double* value, bool dr
return ConstraintsCounter;
}
else {
GCS::Circle *c1, *c2;
GCS::Circle *c1 {}, *c2 {};
if (Geoms[geoId1].type == Circle) {
c1 = &Circles[Geoms[geoId1].index];
}

View File

@@ -251,7 +251,7 @@ This setting is only for the toolbar. Whichever you choose, all tools are always
</widget>
</item>
<item row="4" column="0">
<widget class="QGroupBox" name="groupBox_6">
<widget class="QGroupBox" name="groupBox_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>

View File

@@ -1276,6 +1276,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
case STATUS_SKETCH_DragConstraint:
case STATUS_SKETCH_StartRubberBand:
case STATUS_SKETCH_UseRubberBand:
case STATUS_SELECT_Wire:
break;
}
}
@@ -3976,9 +3977,8 @@ void ViewProviderSketch::generateContextMenu()
if (isBsplineKnotOrEndPoint(obj, geoId, posId)) {
++selectedBsplineKnots;
}
if (Sketcher::PointPos::start != posId || Sketcher::PointPos::end != posId) {
++selectedEndPoints;
}
++selectedEndPoints;
}
else if (name.substr(0, 4) == "Cons") {
++selectedConstraints;