Clang-tidy applying rule for cppcoreguidelines-pro-type-member-init.
Updated: TKernel and TKMath
Update constructor in some classes instead of direct initialization
Refactor Bnd_BoundSortBox and Bnd_Box constructors to initialize member variables directly
private:
// local buffer, to be sufficient for addressing by index [Degree+1][Degree+1]
// (see math_Matrix implementation)
- Standard_Real myBuffer[27 * 27];
+ Standard_Real myBuffer[27 * 27]{};
};
//=================================================================================================
"BSplCLib: bspline degree is greater than maximum supported");
}
- Standard_Real poles[2 * (25 + 1)];
- Standard_Real knots[2 * 25];
- Standard_Real ders[4];
+ Standard_Real poles[2 * (25 + 1)]{};
+ Standard_Real knots[2 * 25]{};
+ Standard_Real ders[4]{};
};
// methods for 1 dimensional BSplines
"BSplSLib: bspline degree is greater than maximum supported");
}
- Standard_Real poles[4 * (25 + 1) * (25 + 1)];
- Standard_Real knots1[2 * 25];
- Standard_Real knots2[2 * 25];
- Standard_Real ders[48];
+ Standard_Real poles[4 * (25 + 1) * (25 + 1)]{};
+ Standard_Real knots1[2 * 25]{};
+ Standard_Real knots2[2 * 25]{};
+ Standard_Real ders[48]{};
};
//**************************************************************************
axisX[0][i] = n;
}
-//=======================================================================
//=================================================================================================
Bnd_BoundSortBox::Bnd_BoundSortBox()
- : discrX(0),
+ : myBox(),
+ myBndComponents(nullptr),
+ Xmin(0.),
+ Ymin(0.),
+ Zmin(0.),
+ deltaX(0.),
+ deltaY(0.),
+ deltaZ(0.),
+ discrX(0),
discrY(0),
- discrZ(0)
+ discrZ(0),
+ theFound(0),
+ Crible(),
+ lastResult(),
+ TabBits(0)
{
- TabBits = 0;
#if DEBUG
NBCOMPARE = 0L;
NBBOITES = 0L;
//=================================================================================================
Bnd_Box::Bnd_Box()
+ // Equal to SetVoid();
: Xmin(RealLast()),
Xmax(-RealLast()),
Ymin(RealLast()),
Ymax(-RealLast()),
Zmin(RealLast()),
Zmax(-RealLast()),
- Gap(0.0)
+ Gap(0.0),
+ Flags(VoidMask)
{
- SetVoid();
}
//=================================================================================================
Bnd_Box::Bnd_Box(const gp_Pnt& theMin, const gp_Pnt& theMax)
- : Gap(0.0)
+ // Equal to Update(theMin.X(), theMin.Y(), theMin.Z(), theMax.X(), theMax.Y(), theMax.Z());
+ : Xmin(theMin.X()),
+ Xmax(theMax.X()),
+ Ymin(theMin.Y()),
+ Ymax(theMax.Y()),
+ Zmin(theMin.Z()),
+ Zmax(theMax.Z()),
+ Gap(0.0),
+ Flags(0)
{
- SetVoid();
- Update(theMin.X(), theMin.Y(), theMin.Z(), theMax.X(), theMax.Y(), theMax.Z());
}
//=================================================================================================
Ymax = -RealLast();
Zmin = RealLast();
Zmax = -RealLast();
- Flags = VoidMask;
Gap = 0.0;
+ Flags = VoidMask;
}
//! Sets this bounding box so that it bounds
//! Points of ditetrahedron
//! given by their indices in myLExtremalPoints.
- Standard_Integer myTriIdx[5];
+ Standard_Integer myTriIdx[5]{};
//! List of extremal points
gp_XYZ myLExtremalPoints[myNbExtremalPoints];
const CSLib_Class2d& operator=(const CSLib_Class2d& Other) const;
NCollection_Handle<TColStd_Array1OfReal> MyPnts2dX, MyPnts2dY;
- Standard_Real Tolu;
- Standard_Real Tolv;
- Standard_Integer N;
- Standard_Real Umin;
- Standard_Real Vmin;
- Standard_Real Umax;
- Standard_Real Vmax;
+ Standard_Real Tolu{};
+ Standard_Real Tolv{};
+ Standard_Integer N{};
+ Standard_Real Umin{};
+ Standard_Real Vmin{};
+ Standard_Real Umax{};
+ Standard_Real Vmax{};
};
#endif // _CSLib_Class2d_HeaderFile
Convert_CompBezierCurves2dToBSplineCurve2d::Convert_CompBezierCurves2dToBSplineCurve2d(
const Standard_Real AngularTolerance)
- : myAngular(AngularTolerance),
+ : myDegree(0),
+ myAngular(AngularTolerance),
myDone(Standard_False)
{
}
Convert_CompBezierCurvesToBSplineCurve::Convert_CompBezierCurvesToBSplineCurve(
const Standard_Real AngularTolerance)
- : myAngular(AngularTolerance),
+ : myDegree(0),
+ myAngular(AngularTolerance),
myDone(Standard_False)
{
}
const Standard_Integer Degree)
: degree(Degree),
nbPoles(NbPoles),
- nbKnots(NbKnots)
+ nbKnots(NbKnots),
+ isperiodic(Standard_False)
{
if (NbPoles >= 2)
nbUPoles(NbUPoles),
nbVPoles(NbVPoles),
nbUKnots(NbUKnots),
- nbVKnots(NbVKnots)
+ nbVKnots(NbVKnots),
+ isuperiodic(Standard_False),
+ isvperiodic(Standard_False)
{
}
union {
char ti2[4];
Standard_Integer aResult;
- } aWrapUnion;
+ } aWrapUnion{};
aWrapUnion.ti2[0] = 1;
aWrapUnion.ti2[1] = 2;
void FSD_BinaryFile::ReadCompleteInfo(Standard_IStream& theIStream, Handle(Storage_Data)& theData)
{
- FSD_FileHeader aHeaderPos;
+ FSD_FileHeader aHeaderPos{};
ReadHeader(theIStream, aHeaderPos);
if (theData.IsNull())
union {
Standard_Integer i[2];
Standard_Real aValue;
- } aWrapUnion;
+ } aWrapUnion{};
aWrapUnion.aValue = theValue;
union {
Standard_ShortReal aValue;
Standard_Integer aResult;
- } aWrapUnion;
+ } aWrapUnion{};
aWrapUnion.aValue = theValue;
aWrapUnion.aResult = InverseInt(aWrapUnion.aResult);
union {
Standard_Integer i[2];
uint64_t aValue;
- } aWrapUnion;
+ } aWrapUnion{};
aWrapUnion.aValue = theValue;
private:
FSD_BStream myStream;
- FSD_FileHeader myHeader;
+ FSD_FileHeader myHeader{};
};
#endif // _FSD_BinaryFile_HeaderFile
//=======================================================================
void NCollection_AccAllocator::Free(void* theAddress)
{
- Key aKey;
+ Key aKey{};
Block* aBlock = findBlock(theAddress, aKey);
#if !defined No_Exception && !defined No_Standard_ProgramError
static const long aCLK_TCK = CLK_TCK;
#endif
- tms aCurrentTMS;
+ tms aCurrentTMS{};
times(&aCurrentTMS);
theUserSeconds = (Standard_Real)aCurrentTMS.tms_utime / aCLK_TCK;
TCollection_AsciiString myMessage;
Standard_Integer myErrno;
OSD_WhoAmI myCode;
- Standard_Integer extCode;
+ Standard_Integer extCode{};
};
#endif // _OSD_Error_HeaderFile
// ---------- PRIVATE FIELDS ----------
Standard_Integer myNConnections;
- Standard_Integer myNodes[3];
- Standard_Integer myNodesOnConnected[3];
- const Poly_CoherentTriangle* mypConnected[3];
- const Poly_CoherentLink* mypLink[3];
+ Standard_Integer myNodes[3]{};
+ Standard_Integer myNodesOnConnected[3]{};
+ const Poly_CoherentTriangle* mypConnected[3]{};
+ const Poly_CoherentLink* mypLink[3]{};
friend class Poly_CoherentTriangulation;
};
const Standard_Integer ss,
const Standard_Integer mis,
const Standard_Integer mics)
+ : mySec(0),
+ myUSec(0)
{
SetValues(mm, dd, yy, hh, mn, ss, mis, mics);
const Standard_Integer ss,
const Standard_Integer mils,
const Standard_Integer mics)
+ : mySec(0),
+ myUSec(0)
{
SetValues(dd, hh, mn, ss, mils, mics);
//
// -------------------------------------------------------------
Quantity_Period::Quantity_Period(const Standard_Integer ss, const Standard_Integer mics)
+ : mySec(0),
+ myUSec(0)
{
SetValues(ss, mics);
Resource_Manager::Resource_Manager()
: myName(""),
- myVerbose(Standard_False)
+ myVerbose(Standard_False),
+ myInitialized(Standard_False)
{
}
Standard_UUID Standard_GUID::ToUUID() const
{
- Standard_UUID result;
+ Standard_UUID result{};
result.Data1 = my32b;
result.Data2 = my16b1;
//--------------------------------------------------------------------
static int HardwareHighBitsOfDouble()
{
- RealMap MaxDouble;
+ RealMap MaxDouble{};
MaxDouble.real = DBL_MAX;
//=========================================================
// representation of the max double in IEEE is
//--------------------------------------------------------------------
static int HardwareLowBitsOfDouble()
{
- RealMap MaxDouble;
+ RealMap MaxDouble{};
MaxDouble.real = DBL_MAX;
//=========================================================
// representation of the max double in IEEE is
double NextAfter(const double x, const double y)
{
- RealMap res;
+ RealMap res{};
res.real = x;
union {
int bid;
char t[13];
- } CHN;
+ } CHN{};
Sprintf(&CHN.t[0], "%d", aValue);
allocate((int)strlen(CHN.t));
union {
int bid;
char t[50];
- } CHN;
+ } CHN{};
Sprintf(&CHN.t[0], "%g", aValue);
allocate((int)strlen(CHN.t));
protected:
private:
- Standard_Integer thecurrentquantity;
+ Standard_Integer thecurrentquantity{};
Handle(Units_QuantitiesSequence) thequantitiessequence;
- Standard_Integer thecurrentunit;
+ Standard_Integer thecurrentunit{};
Handle(Units_UnitsSequence) theunitssequence;
Handle(TColStd_HSequenceOfInteger) theactiveunitssequence;
};
private:
Standard_Boolean Done;
Standard_Boolean InfiniteStatus;
- Standard_Integer NbSol;
- Standard_Real TheRoots[4];
+ Standard_Integer NbSol{};
+ Standard_Real TheRoots[4]{};
};
#include <math_DirectPolynomialRoots.lxx>
Standard_EXPORT void Allocate();
Standard_Address Addr;
- Standard_Real Buf[16];
+ Standard_Real Buf[16]{};
Standard_Boolean isAllocated;
Standard_Integer LowR;
Standard_Integer UppR;
private:
Standard_Boolean Done;
Standard_Real TheRoot;
- Standard_Real TheError;
+ Standard_Real TheError{};
Standard_Real TheDerivative;
Standard_Integer NbIter;
};
Standard_EXPORT void Dump(Standard_OStream& o) const;
protected:
- Standard_Boolean Singular;
+ Standard_Boolean Singular{};
math_Matrix LU;
math_Matrix A2;
math_IntegerVector Index;
- Standard_Real D;
+ Standard_Real D{};
private:
Standard_Boolean Done;
const Standard_Real Upper,
const Standard_Integer Order);
- Standard_Real Val;
- Standard_Boolean Done;
+ Standard_Real Val{};
+ Standard_Boolean Done{};
};
#include <math_GaussSingleIntegration.lxx>
// Algorithm data.
Standard_Real myZ;
- Standard_Real myE1; // Border coefficient.
- Standard_Real myE2; // Minimum step size.
- Standard_Real myE3; // Local extrema starting parameter.
+ Standard_Real myE1{}; // Border coefficient.
+ Standard_Real myE2{}; // Minimum step size.
+ Standard_Real myE3{}; // Local extrema starting parameter.
- math_Vector myX; // Current modified solution.
- math_Vector myTmp; // Current modified solution.
- math_Vector myV; // Steps array.
- math_Vector myMaxV; // Max Steps array.
- Standard_Real myLastStep; // Last step.
+ math_Vector myX; // Current modified solution.
+ math_Vector myTmp; // Current modified solution.
+ math_Vector myV; // Steps array.
+ math_Vector myMaxV; // Max Steps array.
+ Standard_Real myLastStep{}; // Last step.
NCollection_Array1<Standard_Real> myCellSize;
Standard_Integer myMinCellFilterSol;
- Standard_Boolean isFirstCellFilterInvoke;
+ Standard_Boolean isFirstCellFilterInvoke{};
NCollection_CellFilter<NCollection_CellFilter_Inspector> myFilter;
// Continuity of local borders.
const math_Vector& B,
const Standard_Real EPS)
: Sol(1, A.ColNumber(), 1, 1),
- Q(1, A.RowNumber(), 1, A.ColNumber())
+ Q(1, A.RowNumber(), 1, A.ColNumber()),
+ Done(Standard_False)
{
mylowerArow = A.LowerRow();
const math_Matrix& B,
const Standard_Real EPS)
: Sol(1, A.ColNumber(), 1, B.ColNumber()),
- Q(1, A.RowNumber(), A.LowerCol(), A.UpperCol())
+ Q(1, A.RowNumber(), A.LowerCol(), A.UpperCol()),
+ Done(Standard_False)
{
mylowerArow = A.LowerRow();
const Standard_Integer upperAcol,
const Standard_Real EPS)
: Sol(1, upperAcol - lowerAcol + 1, 1, B.ColNumber()),
- Q(1, upperArow - lowerArow + 1, 1, upperAcol - lowerAcol + 1)
+ Q(1, upperArow - lowerArow + 1, 1, upperAcol - lowerAcol + 1),
+ Done(Standard_False)
{
mylowerArow = lowerArow;
myupperArow = upperArow;
#include <math_Recipes.hxx>
math_Jacobi::math_Jacobi(const math_Matrix& A)
- : AA(1, A.RowNumber(), 1, A.RowNumber()),
+ : Done(Standard_False),
+ AA(1, A.RowNumber(), 1, A.RowNumber()),
+ NbRotations(0),
EigenValues(1, A.RowNumber()),
EigenVectors(1, A.RowNumber(), 1, A.RowNumber())
{
: myIsDone(Standard_False),
myValue(0.),
myErrorReached(0.),
+ myAbsolutError(0.),
myNbPntsReached(0),
myNbIterReached(0)
{
: myIsDone(Standard_False),
myValue(0.),
myErrorReached(0.),
- myNbPntsReached(0)
+ myAbsolutError(0.),
+ myNbPntsReached(0),
+ myNbIterReached(0)
{
Perform(theFunction, theLower, theUpper, theNbPnts);
}
: myIsDone(Standard_False),
myValue(0.),
myErrorReached(0.),
- myNbPntsReached(0)
+ myAbsolutError(0.),
+ myNbPntsReached(0),
+ myNbIterReached(0)
{
Perform(theFunction, theLower, theUpper, theNbPnts, theTolerance, theMaxNbIter);
}
Erruza(1, Cont.ColNumber()),
Errinit(1, Cont.ColNumber()),
Vardua(1, Cont.RowNumber()),
- CTCinv(1, Cont.RowNumber(), 1, Cont.RowNumber())
+ CTCinv(1, Cont.RowNumber(), 1, Cont.RowNumber()),
+ NbIter(0),
+ Done(Standard_False)
{
Perform(Cont, Secont, StartingPoint, Cont.RowNumber(), 0, EpsLix, EpsLic, NbIterations);
Erruza(1, Cont.ColNumber()),
Errinit(1, Cont.ColNumber()),
Vardua(1, Cont.RowNumber()),
- CTCinv(1, Cont.RowNumber(), 1, Cont.RowNumber())
+ CTCinv(1, Cont.RowNumber(), 1, Cont.RowNumber()),
+ NbIter(0),
+ Done(Standard_False)
{
Perform(Cont, Secont, StartingPoint, Nce, Nci, EpsLix, EpsLic, NbIterations);