Fix several compiler warnings
* -Wmaybe-uninitialized * -Wunused-parameter * -Wunused-variable * -Wnonnull * -Wstringop-truncation * -Wstringop-overflow
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
|
||||
// boost
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/range/adaptor/indexed.hpp>
|
||||
|
||||
// OpenCasCade =====================================================================================
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <Standard_Version.hxx>
|
||||
#if OCC_VERSION_HEX >= 0x070500
|
||||
#include <BRep_Builder.hxx>
|
||||
@@ -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)};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <Standard_Version.hxx>
|
||||
#include <TColStd_IndexedDataMapOfStringString.hxx>
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/geometry/geometries/register/point.hpp>
|
||||
#include <boost/graph/graph_concepts.hpp>
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -9478,6 +9478,7 @@ std::pair<std::string,std::string> 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);
|
||||
|
||||
@@ -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<Eigen::Infinity>();
|
||||
}
|
||||
|
||||
double h_norm;
|
||||
double h_norm {};
|
||||
// determine increment using adaptive damping
|
||||
int k = 0;
|
||||
while (k < 50) {
|
||||
|
||||
@@ -2214,11 +2214,11 @@ protected:
|
||||
GeoId1, static_cast<int>(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<const Part::GeomCircle*>(geo1);
|
||||
|
||||
@@ -527,7 +527,8 @@ private:
|
||||
|
||||
vCCO = generatevCC(listOfOffsetGeoIds);
|
||||
|
||||
int geoIdCandidate1, geoIdCandidate2;
|
||||
int geoIdCandidate1 {};
|
||||
int geoIdCandidate2 {};
|
||||
|
||||
int newCurveCounter = 0;
|
||||
int prevCurveCounter = 0;
|
||||
|
||||
@@ -315,7 +315,7 @@ template<typename GeoType,
|
||||
EditModeGeometryCoinConverter::AnalyseMode analysemode>
|
||||
void EditModeGeometryCoinConverter::convert(const Sketcher::GeometryFacade* geometryfacade,
|
||||
[[maybe_unused]] int geoid,
|
||||
int subLayer)
|
||||
[[maybe_unused]] int subLayer)
|
||||
{
|
||||
auto geo = static_cast<const GeoType*>(geometryfacade->getGeometry());
|
||||
auto layerId = getSafeGeomLayerId(geometryfacade);
|
||||
|
||||
@@ -154,7 +154,7 @@ private:
|
||||
template<typename GeoType, PointsMode pointmode, CurveMode curvemode, AnalyseMode analysemode>
|
||||
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
|
||||
|
||||
@@ -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<const App::PropertyFloat*>(prop)->getValue();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user