Skip to content

Commit

Permalink
Mod: Fix several compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 29, 2024
1 parent 4185605 commit 8c968f4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/Mod/Material/Gui/DlgInspectAppearance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ void DlgInspectAppearance::update(std::vector<Gui::ViewProvider*>& views)
auto& material = (prop->getValues())[index];
auto* tab = makeAppearanceTab(material);
ui->tabAppearance->addTab(tab, QString::number(index));

index++;
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/Mod/Part/App/AppPartPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,19 +901,21 @@ class Module : public Py::ExtensionModule<Module>
pcDoc->recompute();
return Py::asObject(pcFeature->getPyObject());
#else
App::Document *pcSrcDoc = nullptr;
TopoShape shape;
if (PyObject_TypeCheck(pcObj, &TopoShapePy::Type))
if (PyObject_TypeCheck(pcObj, &TopoShapePy::Type)) {
shape = *static_cast<TopoShapePy*>(pcObj)->getTopoShapePtr();
else if (PyObject_TypeCheck(pcObj, &GeometryPy::Type))
}
else if (PyObject_TypeCheck(pcObj, &GeometryPy::Type)) {
shape = static_cast<GeometryPy*>(pcObj)->getGeometryPtr()->toShape();
}
else if (PyObject_TypeCheck(pcObj, &App::DocumentObjectPy::Type)) {
auto obj = static_cast<App::DocumentObjectPy*>(pcObj)->getDocumentObjectPtr();
pcSrcDoc = obj->getDocument();
shape = Feature::getTopoShape(obj);
}
else
else {
throw Py::TypeError("Expects argument of type DocumentObject, Shape, or Geometry");
}

Part::Feature *pcFeature = static_cast<Part::Feature*>(pcDoc->addObject("Part::Feature", name));
// copy the data
pcFeature->Shape.setValue(shape);
Expand Down
5 changes: 3 additions & 2 deletions src/Mod/Part/App/TopoShapeExpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ void TopoShape::copyElementMap(const TopoShape& topoShape, const char* op)
setMappedChildElements(children);
}

#ifndef FC_USE_TNP_FIX
namespace
{
void warnIfLogging()
Expand Down Expand Up @@ -722,7 +723,7 @@ void checkAndMatchHasher(TopoShape& topoShape1, const TopoShape& topoShape2)
}
}
} // namespace

#endif

// TODO: Refactor mapSubElementTypeForShape to reduce complexity
void TopoShape::mapSubElementTypeForShape(const TopoShape& other,
Expand Down Expand Up @@ -4454,7 +4455,7 @@ TopoShape& TopoShape::makeElementRevolve(const TopoShape& _base,

TopoShape& TopoShape::makeElementRevolution(const TopoShape& _base,
const gp_Ax1& axis,
double d,
[[maybe_unused]]double d,
const TopoDS_Face& supportface,
const TopoDS_Face& uptoface,
const char* face_maker,
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/App/FeatureRevolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ App::DocumentObjectExecReturn* Revolution::execute()
if (!Ex.More()) {
supportface = TopoDS_Face();
}
RevolMode mode = RevolMode::None;
#ifdef FC_USE_TNP_FIX
// revolve the face to a solid
// TopoShape result(0);
Expand All @@ -205,6 +204,7 @@ App::DocumentObjectExecReturn* Revolution::execute()
return new App::DocumentObjectExecReturn("Could not revolve the sketch!");
}
#else
RevolMode mode = RevolMode::None;
generateRevolution(result,
base.getShape(),
sketchshape.getShape(),
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/TechDraw/Gui/QGIViewDimension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,8 @@ void QGIDatumLabel::snapPosition(QPointF& pos)
else if (type == "DistanceY") {
ip2 = Base::Vector2d(ip1.x, ip2.y);
}
Base::Vector2d imid = (ip1 + ip2) * 0.5;

Base::Vector2d idir = ip2 - ip1;
Base::Vector2d inormal = Base::Vector2d(-idir.y, idir.x);

if (type == "Distance" && fabs(dir.x * idir.y - dir.y * idir.x) > Precision::Confusion()) {
//dimensions not parallel
Expand Down Expand Up @@ -2222,6 +2221,10 @@ void QGIViewDimension::drawAreaExecutive(const Base::Vector2d& centerPoint, doub
double centerOverhang, int standardStyle,
int renderExtent, bool flipArrow) const
{
Q_UNUSED(area)
Q_UNUSED(centerOverhang)
Q_UNUSED(renderExtent)

QPainterPath areaPath;

Base::Vector2d labelCenter(labelRectangle.GetCenter());
Expand Down Expand Up @@ -2718,9 +2721,6 @@ void QGIViewDimension::drawArea(TechDraw::DrawViewDimension* dimension,
fromQtGui(mapRectFromItem(datumLabel, datumLabel->boundingRect())));
areaPoint areaPoint = dimension->getAreaPoint();

double endAngle;
double startRotation;

drawAreaExecutive(
fromQtApp(areaPoint.center), areaPoint.area, labelRectangle, 0.0, viewProvider->StandardAndStyle.getValue(),
viewProvider->RenderingExtent.getValue(), viewProvider->FlipArrowheads.getValue());
Expand Down
1 change: 1 addition & 0 deletions src/Mod/TechDraw/Gui/ViewProviderLeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ void ViewProviderLeader::handleChangedPropertyType(Base::XMLReader &reader, cons

bool ViewProviderLeader::onDelete(const std::vector<std::string> & parameters)
{
Q_UNUSED(parameters)
// a leader line cannot be deleted if it has a child weld symbol

// get childs
Expand Down

0 comments on commit 8c968f4

Please sign in to comment.