diff --git a/src/Gui/OverlayManager.cpp b/src/Gui/OverlayManager.cpp index 051519ce0c..f1de06a8fd 100644 --- a/src/Gui/OverlayManager.cpp +++ b/src/Gui/OverlayManager.cpp @@ -1178,7 +1178,7 @@ public: OverlayTabWidget *dst = nullptr; int dstIndex = -1; QDockWidget *dstDock = nullptr; - Qt::DockWidgetArea dstDockArea; + Qt::DockWidgetArea dstDockArea {}; if (!tabWidget) { rect = QRect(pos - dragOffset, dragSize); diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 06b4107d3c..01b92c2180 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -4727,11 +4727,12 @@ void DocumentItem::updateItemSelection(DocumentObjectItem* item) const char* docname = obj->getDocument()->getName(); const auto& subname = str.str(); +#ifdef FC_DEBUG if (!subname.empty()) { auto parentItem = item->getParentItem(); assert(parentItem); } - +#endif if (!selected) { Gui::Selection().rmvSelection(docname, objname, subname.c_str()); diff --git a/src/Mod/Import/App/PreCompiled.h b/src/Mod/Import/App/PreCompiled.h index 0343a3c77b..d9efa68e57 100644 --- a/src/Mod/Import/App/PreCompiled.h +++ b/src/Mod/Import/App/PreCompiled.h @@ -51,6 +51,7 @@ // boost #include +#include #include // OpenCasCade ===================================================================================== diff --git a/src/Mod/Import/App/ReaderGltf.cpp b/src/Mod/Import/App/ReaderGltf.cpp index 4fd2449352..7dbe50ea82 100644 --- a/src/Mod/Import/App/ReaderGltf.cpp +++ b/src/Mod/Import/App/ReaderGltf.cpp @@ -24,6 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +#include #include #if OCC_VERSION_HEX >= 0x070500 #include @@ -73,7 +74,7 @@ void ReaderGltf::read(Handle(TDocStd_Document) hDoc) processDocument(hDoc); #else - (void)hDoc; + boost::ignore_unused(hDoc); throw Base::RuntimeError("gITF support requires OCCT 7.5.0 or later"); #endif } @@ -100,6 +101,8 @@ void ReaderGltf::processDocument(Handle(TDocStd_Document) hDoc) } } } +#else + boost::ignore_unused(hDoc); #endif } @@ -138,6 +141,9 @@ TopoDS_Shape ReaderGltf::processSubShapes(Handle(TDocStd_Document) hDoc, aColorTool->SetColor(faceLabel, rgba, XCAFDoc_ColorSurf); } } +#else + boost::ignore_unused(hDoc); + boost::ignore_unused(subShapeLabels); #endif return {std::move(compound)}; diff --git a/src/Mod/Import/App/WriterGltf.cpp b/src/Mod/Import/App/WriterGltf.cpp index 43ef543c4a..e9b1e1c559 100644 --- a/src/Mod/Import/App/WriterGltf.cpp +++ b/src/Mod/Import/App/WriterGltf.cpp @@ -24,6 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ +#include #include #include #if OCC_VERSION_HEX >= 0x070500 @@ -62,6 +63,7 @@ void WriterGltf::write(Handle(TDocStd_Document) hDoc) const // NOLINT throw Base::FileException("Cannot save to file: ", file); } #else + boost::ignore_unused(hDoc); throw Base::RuntimeError("gITF support requires OCCT 7.5.0 or later"); #endif } diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.cpp b/src/Mod/Import/App/dxf/ImpExpDxf.cpp index ba989194ba..6b55fb45b9 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.cpp +++ b/src/Mod/Import/App/dxf/ImpExpDxf.cpp @@ -1073,12 +1073,11 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve& c) s = c.Value(f); ePt = c.Value(l); Base::Console().Message( - "DxfWrite::exportBSpline - no result- from:(%.3f,%.3f) to:(%.3f,%.3f) poles: %d\n", + "DxfWrite::exportBSpline - no result- from:(%.3f,%.3f) to:(%.3f,%.3f)\n", s.X(), s.Y(), ePt.X(), - ePt.Y(), - spline->NbPoles()); + ePt.Y()); TColgp_Array1OfPnt controlPoints(0, 1); controlPoints.SetValue(0, s); controlPoints.SetValue(1, ePt); diff --git a/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp b/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp index 7370cc7aae..20facc151d 100644 --- a/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp +++ b/src/Mod/Mesh/App/WildMagic4/Wm4System.cpp @@ -927,7 +927,7 @@ char* System::Strcpy (char* acDst, size_t uiDstSize, const char* acSrc) // copy failed. return nullptr; } - strncpy(acDst,acSrc,uiSrcLen); + strncpy(acDst,acSrc,uiSrcLen + 1); acDst[uiSrcLen] = 0; return acDst; #endif @@ -962,7 +962,7 @@ char* System::Strcat (char* acDst, size_t uiDstSize, const char* acSrc) // the concatenation failed. return nullptr; } - strncat(acDst,acSrc,uiSrcLen); + strncat(acDst,acSrc,uiSrcLen + 1); acDst[uiSumLen] = 0; return acDst; #endif diff --git a/src/Mod/Part/App/WireJoiner.cpp b/src/Mod/Part/App/WireJoiner.cpp index 08b133cfb2..a895ed7e48 100644 --- a/src/Mod/Part/App/WireJoiner.cpp +++ b/src/Mod/Part/App/WireJoiner.cpp @@ -21,6 +21,7 @@ ****************************************************************************/ #include "PreCompiled.h" +#include #include #include @@ -1730,6 +1731,7 @@ public: } for (auto &info : edges) { if (auto wire = info.wireInfo.get()) { + boost::ignore_unused(wire); // Originally here there was a call to the precompiler macro assertCheck(), which // has been replaced with the precompiler macro assert() diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index e1aa2e9ebf..c595c57d8b 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -9478,6 +9478,7 @@ std::pair SketchObject::getElementName( index.appendToStringBuffer(ret.second); if (auto realName = convertInternalName(ret.second.c_str())) { Data::MappedElement mappedElement; + (void)realName; // Todo: Do we need to add the InternalShape? // if (mapped) // mappedElement = InternalShape.getShape().getElementName(name); diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index 036894b8be..b630489a7c 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -2084,7 +2084,7 @@ int System::solve_BFGS(SubSystem* subsys, bool /*isFine*/, bool isRedundantsolvi } double divergingLim = 1e6 * err + 1e12; - double h_norm; + double h_norm {}; for (int iter = 1; iter < maxIterNumber; iter++) { h_norm = h.norm(); @@ -2241,7 +2241,7 @@ int System::solve_LM(SubSystem* subsys, bool isRedundantsolving) mu = tau * diag_A.lpNorm(); } - double h_norm; + double h_norm {}; // determine increment using adaptive damping int k = 0; while (k < 50) { diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 5d35fe1a04..1f05e07ebb 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -2214,11 +2214,11 @@ protected: GeoId1, static_cast(PosId1), GeoId2, ActDist); } // Circle/arc - line, circle/arc - circle/arc cases - else if (PosId1 == Sketcher::PointPos::none - && PosId2 == Sketcher::PointPos::none) { + else if (PosId1 == Sketcher::PointPos::none && PosId2 == Sketcher::PointPos::none) { const Part::Geometry* geo1 = Obj->getGeometry(GeoId1); const Part::Geometry* geo2 = Obj->getGeometry(GeoId2); - double radius1, radius2; + double radius1 {}; + double radius2 {}; Base::Vector3d center1, center2; if (isCircle(*geo1)) { auto conic = static_cast(geo1); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h index 547adab98b..b9614171b6 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerOffset.h @@ -527,7 +527,8 @@ private: vCCO = generatevCC(listOfOffsetGeoIds); - int geoIdCandidate1, geoIdCandidate2; + int geoIdCandidate1 {}; + int geoIdCandidate2 {}; int newCurveCounter = 0; int prevCurveCounter = 0; diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp index cc7acca2c7..093d5903b9 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.cpp @@ -315,7 +315,7 @@ template void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geometryfacade, [[maybe_unused]] int geoid, - int subLayer) + [[maybe_unused]] int subLayer) { auto geo = static_cast(geometryfacade->getGeometry()); auto layerId = getSafeGeomLayerId(geometryfacade); diff --git a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h index 889b5b0a2e..afbf6e4310 100644 --- a/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h +++ b/src/Mod/Sketcher/Gui/EditModeGeometryCoinConverter.h @@ -154,7 +154,7 @@ private: template void convert(const Sketcher::GeometryFacade* geometryfacade, [[maybe_unused]] int geoId, - int subLayerId = 0); + [[maybe_unused]] int subLayerId = 0); private: /// Reference to ViewProviderSketch in order to access the public and the Attorney Interface diff --git a/src/Mod/Spreadsheet/Gui/SheetModel.cpp b/src/Mod/Spreadsheet/Gui/SheetModel.cpp index 10f6b365eb..05537332c8 100644 --- a/src/Mod/Spreadsheet/Gui/SheetModel.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetModel.cpp @@ -389,8 +389,8 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const else if (prop->isDerivedFrom(App::PropertyFloat::getClassTypeId()) || prop->isDerivedFrom(App::PropertyInteger::getClassTypeId())) { /* Number */ - double d; - long l; + double d {}; + long l {}; bool isInteger = false; if (prop->isDerivedFrom(App::PropertyFloat::getClassTypeId())) { d = static_cast(prop)->getValue(); diff --git a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp index 3b4bb62fa0..6f0661ecca 100644 --- a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp @@ -2550,7 +2550,7 @@ void QGIViewDimension::drawAngle(TechDraw::DrawViewDimension* dimension, double endAngle = (endPoint - angleVertex).Angle(); double startAngle = (startPoint - angleVertex).Angle(); - double arcRadius; + double arcRadius {}; int standardStyle = viewProvider->StandardAndStyle.getValue(); int renderExtent = viewProvider->RenderingExtent.getValue();