From fb73c3b71247a51552ee49c9d730066a91f71746 Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Wed, 12 Feb 2025 15:26:00 +0100 Subject: [PATCH] Coding - Initialize member variables with default values #362 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 --- src/BSplCLib/BSplCLib.cxx | 2 +- src/BSplCLib/BSplCLib_2.cxx | 6 +++--- src/BSplSLib/BSplSLib.cxx | 8 ++++---- src/Bnd/Bnd_BoundSortBox.cxx | 18 ++++++++++++++---- src/Bnd/Bnd_Box.cxx | 17 ++++++++++++----- src/Bnd/Bnd_Box.hxx | 2 +- src/Bnd/Bnd_OBB.cxx | 2 +- src/CSLib/CSLib_Class2d.hxx | 14 +++++++------- ...vert_CompBezierCurves2dToBSplineCurve2d.cxx | 3 ++- .../Convert_CompBezierCurvesToBSplineCurve.cxx | 3 ++- src/Convert/Convert_ConicToBSplineCurve.cxx | 3 ++- ...nvert_ElementarySurfaceToBSplineSurface.cxx | 4 +++- src/FSD/FSD_BinaryFile.cxx | 10 +++++----- src/FSD/FSD_BinaryFile.hxx | 2 +- src/NCollection/NCollection_AccAllocator.cxx | 2 +- src/OSD/OSD_Chronometer.cxx | 2 +- src/OSD/OSD_Error.hxx | 2 +- src/Poly/Poly_CoherentTriangle.hxx | 8 ++++---- src/Quantity/Quantity_Date.cxx | 2 ++ src/Quantity/Quantity_Period.cxx | 4 ++++ src/Resource/Resource_Manager.cxx | 3 ++- src/Standard/Standard_GUID.cxx | 2 +- src/Standard/Standard_Real.cxx | 6 +++--- src/TCollection/TCollection_ExtendedString.cxx | 4 ++-- src/Units/Units_Explorer.hxx | 4 ++-- src/math/math_DirectPolynomialRoots.hxx | 4 ++-- src/math/math_DoubleTab.hxx | 2 +- src/math/math_FunctionRoot.hxx | 2 +- src/math/math_GaussLeastSquare.hxx | 4 ++-- src/math/math_GaussSingleIntegration.hxx | 4 ++-- src/math/math_GlobOptMin.hxx | 18 +++++++++--------- src/math/math_Householder.cxx | 9 ++++++--- src/math/math_Jacobi.cxx | 4 +++- src/math/math_KronrodSingleIntegration.cxx | 9 +++++++-- src/math/math_Uzawa.cxx | 8 ++++++-- 35 files changed, 120 insertions(+), 77 deletions(-) diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx index a681b7e823..e3b0590956 100644 --- a/src/BSplCLib/BSplCLib.cxx +++ b/src/BSplCLib/BSplCLib.cxx @@ -64,7 +64,7 @@ public: 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]{}; }; //================================================================================================= diff --git a/src/BSplCLib/BSplCLib_2.cxx b/src/BSplCLib/BSplCLib_2.cxx index 01165fa2f2..4cb55cf1c0 100644 --- a/src/BSplCLib/BSplCLib_2.cxx +++ b/src/BSplCLib/BSplCLib_2.cxx @@ -46,9 +46,9 @@ struct BSplCLib_DataContainer "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 diff --git a/src/BSplSLib/BSplSLib.cxx b/src/BSplSLib/BSplSLib.cxx index 4cb78c3416..be821ff61c 100644 --- a/src/BSplSLib/BSplSLib.cxx +++ b/src/BSplSLib/BSplSLib.cxx @@ -54,10 +54,10 @@ struct BSplSLib_DataContainer "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]{}; }; //************************************************************************** diff --git a/src/Bnd/Bnd_BoundSortBox.cxx b/src/Bnd/Bnd_BoundSortBox.cxx index b879a9859c..28fedb1d6c 100644 --- a/src/Bnd/Bnd_BoundSortBox.cxx +++ b/src/Bnd/Bnd_BoundSortBox.cxx @@ -418,15 +418,25 @@ void BSB_T3Bits::AppendAxisX(const Standard_Integer i, const Standard_Integer v) 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; diff --git a/src/Bnd/Bnd_Box.cxx b/src/Bnd/Bnd_Box.cxx index 1fef8b625c..366692a178 100644 --- a/src/Bnd/Bnd_Box.cxx +++ b/src/Bnd/Bnd_Box.cxx @@ -32,24 +32,31 @@ //================================================================================================= 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()); } //================================================================================================= diff --git a/src/Bnd/Bnd_Box.hxx b/src/Bnd/Bnd_Box.hxx index 42a3b6a809..8cc9848e2f 100644 --- a/src/Bnd/Bnd_Box.hxx +++ b/src/Bnd/Bnd_Box.hxx @@ -83,8 +83,8 @@ public: Ymax = -RealLast(); Zmin = RealLast(); Zmax = -RealLast(); - Flags = VoidMask; Gap = 0.0; + Flags = VoidMask; } //! Sets this bounding box so that it bounds diff --git a/src/Bnd/Bnd_OBB.cxx b/src/Bnd/Bnd_OBB.cxx index 5199f43bb9..d3b5f28aa4 100644 --- a/src/Bnd/Bnd_OBB.cxx +++ b/src/Bnd/Bnd_OBB.cxx @@ -358,7 +358,7 @@ private: //! 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]; diff --git a/src/CSLib/CSLib_Class2d.hxx b/src/CSLib/CSLib_Class2d.hxx index 9b6d2edfaa..c97f11d01b 100644 --- a/src/CSLib/CSLib_Class2d.hxx +++ b/src/CSLib/CSLib_Class2d.hxx @@ -93,13 +93,13 @@ private: const CSLib_Class2d& operator=(const CSLib_Class2d& Other) const; NCollection_Handle 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 diff --git a/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx b/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx index a3080a77dc..140300b776 100644 --- a/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx +++ b/src/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx @@ -26,7 +26,8 @@ Convert_CompBezierCurves2dToBSplineCurve2d::Convert_CompBezierCurves2dToBSplineCurve2d( const Standard_Real AngularTolerance) - : myAngular(AngularTolerance), + : myDegree(0), + myAngular(AngularTolerance), myDone(Standard_False) { } diff --git a/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx b/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx index 0cd095fd88..2537075167 100644 --- a/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx +++ b/src/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx @@ -26,7 +26,8 @@ Convert_CompBezierCurvesToBSplineCurve::Convert_CompBezierCurvesToBSplineCurve( const Standard_Real AngularTolerance) - : myAngular(AngularTolerance), + : myDegree(0), + myAngular(AngularTolerance), myDone(Standard_False) { } diff --git a/src/Convert/Convert_ConicToBSplineCurve.cxx b/src/Convert/Convert_ConicToBSplineCurve.cxx index 22abb81446..1ed3b4076c 100644 --- a/src/Convert/Convert_ConicToBSplineCurve.cxx +++ b/src/Convert/Convert_ConicToBSplineCurve.cxx @@ -39,7 +39,8 @@ Convert_ConicToBSplineCurve::Convert_ConicToBSplineCurve(const Standard_Integer const Standard_Integer Degree) : degree(Degree), nbPoles(NbPoles), - nbKnots(NbKnots) + nbKnots(NbKnots), + isperiodic(Standard_False) { if (NbPoles >= 2) diff --git a/src/Convert/Convert_ElementarySurfaceToBSplineSurface.cxx b/src/Convert/Convert_ElementarySurfaceToBSplineSurface.cxx index de89e436c8..94078dcc8d 100644 --- a/src/Convert/Convert_ElementarySurfaceToBSplineSurface.cxx +++ b/src/Convert/Convert_ElementarySurfaceToBSplineSurface.cxx @@ -38,7 +38,9 @@ Convert_ElementarySurfaceToBSplineSurface::Convert_ElementarySurfaceToBSplineSur nbUPoles(NbUPoles), nbVPoles(NbVPoles), nbUKnots(NbUKnots), - nbVKnots(NbVKnots) + nbVKnots(NbVKnots), + isuperiodic(Standard_False), + isvperiodic(Standard_False) { } diff --git a/src/FSD/FSD_BinaryFile.cxx b/src/FSD/FSD_BinaryFile.cxx index c8f7571b98..79ad577a4b 100644 --- a/src/FSD/FSD_BinaryFile.cxx +++ b/src/FSD/FSD_BinaryFile.cxx @@ -456,7 +456,7 @@ Storage_Error FSD_BinaryFile::BeginWriteInfoSection() union { char ti2[4]; Standard_Integer aResult; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.ti2[0] = 1; aWrapUnion.ti2[1] = 2; @@ -619,7 +619,7 @@ void FSD_BinaryFile::ReadInfo(Standard_Integer& nbObj, void FSD_BinaryFile::ReadCompleteInfo(Standard_IStream& theIStream, Handle(Storage_Data)& theData) { - FSD_FileHeader aHeaderPos; + FSD_FileHeader aHeaderPos{}; ReadHeader(theIStream, aHeaderPos); if (theData.IsNull()) @@ -1678,7 +1678,7 @@ Standard_Real FSD_BinaryFile::InverseReal(const Standard_Real theValue) union { Standard_Integer i[2]; Standard_Real aValue; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.aValue = theValue; @@ -1701,7 +1701,7 @@ Standard_ShortReal FSD_BinaryFile::InverseShortReal(const Standard_ShortReal the union { Standard_ShortReal aValue; Standard_Integer aResult; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.aValue = theValue; aWrapUnion.aResult = InverseInt(aWrapUnion.aResult); @@ -1729,7 +1729,7 @@ inline uint64_t OCCT_InverseSizeSpecialized<8>(const uint64_t theValue, int) union { Standard_Integer i[2]; uint64_t aValue; - } aWrapUnion; + } aWrapUnion{}; aWrapUnion.aValue = theValue; diff --git a/src/FSD/FSD_BinaryFile.hxx b/src/FSD/FSD_BinaryFile.hxx index 3fb4d952c3..a95f065e99 100644 --- a/src/FSD/FSD_BinaryFile.hxx +++ b/src/FSD/FSD_BinaryFile.hxx @@ -372,7 +372,7 @@ private: private: FSD_BStream myStream; - FSD_FileHeader myHeader; + FSD_FileHeader myHeader{}; }; #endif // _FSD_BinaryFile_HeaderFile diff --git a/src/NCollection/NCollection_AccAllocator.cxx b/src/NCollection/NCollection_AccAllocator.cxx index 1a59fc9b75..6b56beb725 100644 --- a/src/NCollection/NCollection_AccAllocator.cxx +++ b/src/NCollection/NCollection_AccAllocator.cxx @@ -86,7 +86,7 @@ void* NCollection_AccAllocator::Allocate(const size_t theSize) //======================================================================= void NCollection_AccAllocator::Free(void* theAddress) { - Key aKey; + Key aKey{}; Block* aBlock = findBlock(theAddress, aKey); #if !defined No_Exception && !defined No_Standard_ProgramError diff --git a/src/OSD/OSD_Chronometer.cxx b/src/OSD/OSD_Chronometer.cxx index a827c462c3..3ce7fb6e52 100644 --- a/src/OSD/OSD_Chronometer.cxx +++ b/src/OSD/OSD_Chronometer.cxx @@ -56,7 +56,7 @@ void OSD_Chronometer::GetProcessCPU(Standard_Real& theUserSeconds, Standard_Real static const long aCLK_TCK = CLK_TCK; #endif - tms aCurrentTMS; + tms aCurrentTMS{}; times(&aCurrentTMS); theUserSeconds = (Standard_Real)aCurrentTMS.tms_utime / aCLK_TCK; diff --git a/src/OSD/OSD_Error.hxx b/src/OSD/OSD_Error.hxx index 0cf2c452e6..ca63cbd7b5 100644 --- a/src/OSD/OSD_Error.hxx +++ b/src/OSD/OSD_Error.hxx @@ -61,7 +61,7 @@ private: TCollection_AsciiString myMessage; Standard_Integer myErrno; OSD_WhoAmI myCode; - Standard_Integer extCode; + Standard_Integer extCode{}; }; #endif // _OSD_Error_HeaderFile diff --git a/src/Poly/Poly_CoherentTriangle.hxx b/src/Poly/Poly_CoherentTriangle.hxx index 56f54e9fd5..ffad2f33a7 100644 --- a/src/Poly/Poly_CoherentTriangle.hxx +++ b/src/Poly/Poly_CoherentTriangle.hxx @@ -150,10 +150,10 @@ private: // ---------- 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; }; diff --git a/src/Quantity/Quantity_Date.cxx b/src/Quantity/Quantity_Date.cxx index 2ceb89d12d..bb60c726c3 100644 --- a/src/Quantity/Quantity_Date.cxx +++ b/src/Quantity/Quantity_Date.cxx @@ -108,6 +108,8 @@ Quantity_Date::Quantity_Date(const Standard_Integer mm, 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); diff --git a/src/Quantity/Quantity_Period.cxx b/src/Quantity/Quantity_Period.cxx index 381c35deb5..9a4f4c202f 100644 --- a/src/Quantity/Quantity_Period.cxx +++ b/src/Quantity/Quantity_Period.cxx @@ -66,6 +66,8 @@ Quantity_Period::Quantity_Period(const Standard_Integer dd, const Standard_Integer ss, const Standard_Integer mils, const Standard_Integer mics) + : mySec(0), + myUSec(0) { SetValues(dd, hh, mn, ss, mils, mics); @@ -77,6 +79,8 @@ Quantity_Period::Quantity_Period(const Standard_Integer dd, // // ------------------------------------------------------------- Quantity_Period::Quantity_Period(const Standard_Integer ss, const Standard_Integer mics) + : mySec(0), + myUSec(0) { SetValues(ss, mics); diff --git a/src/Resource/Resource_Manager.cxx b/src/Resource/Resource_Manager.cxx index eebf96c45c..59fe8e4629 100644 --- a/src/Resource/Resource_Manager.cxx +++ b/src/Resource/Resource_Manager.cxx @@ -135,7 +135,8 @@ Resource_Manager::Resource_Manager(const Standard_CString aName, const Standard_ Resource_Manager::Resource_Manager() : myName(""), - myVerbose(Standard_False) + myVerbose(Standard_False), + myInitialized(Standard_False) { } diff --git a/src/Standard/Standard_GUID.cxx b/src/Standard/Standard_GUID.cxx index b09f2719a3..faa2ba16a1 100644 --- a/src/Standard/Standard_GUID.cxx +++ b/src/Standard/Standard_GUID.cxx @@ -347,7 +347,7 @@ void Standard_GUID::ToExtString(const Standard_PExtCharacter aStrGuid) const Standard_UUID Standard_GUID::ToUUID() const { - Standard_UUID result; + Standard_UUID result{}; result.Data1 = my32b; result.Data2 = my16b1; diff --git a/src/Standard/Standard_Real.cxx b/src/Standard/Standard_Real.cxx index 9565d840c4..024e380f37 100644 --- a/src/Standard/Standard_Real.cxx +++ b/src/Standard/Standard_Real.cxx @@ -145,7 +145,7 @@ union RealMap { //-------------------------------------------------------------------- static int HardwareHighBitsOfDouble() { - RealMap MaxDouble; + RealMap MaxDouble{}; MaxDouble.real = DBL_MAX; //========================================================= // representation of the max double in IEEE is @@ -170,7 +170,7 @@ static int HardwareHighBitsOfDouble() //-------------------------------------------------------------------- static int HardwareLowBitsOfDouble() { - RealMap MaxDouble; + RealMap MaxDouble{}; MaxDouble.real = DBL_MAX; //========================================================= // representation of the max double in IEEE is @@ -193,7 +193,7 @@ static const int LowBitsOfDouble = HardwareLowBitsOfDouble(); double NextAfter(const double x, const double y) { - RealMap res; + RealMap res{}; res.real = x; diff --git a/src/TCollection/TCollection_ExtendedString.cxx b/src/TCollection/TCollection_ExtendedString.cxx index 179ae5232e..3ac022b514 100644 --- a/src/TCollection/TCollection_ExtendedString.cxx +++ b/src/TCollection/TCollection_ExtendedString.cxx @@ -197,7 +197,7 @@ TCollection_ExtendedString::TCollection_ExtendedString(const Standard_Integer aV union { int bid; char t[13]; - } CHN; + } CHN{}; Sprintf(&CHN.t[0], "%d", aValue); allocate((int)strlen(CHN.t)); @@ -213,7 +213,7 @@ TCollection_ExtendedString::TCollection_ExtendedString(const Standard_Real aValu union { int bid; char t[50]; - } CHN; + } CHN{}; Sprintf(&CHN.t[0], "%g", aValue); allocate((int)strlen(CHN.t)); diff --git a/src/Units/Units_Explorer.hxx b/src/Units/Units_Explorer.hxx index d111a7fd69..2392686e84 100644 --- a/src/Units/Units_Explorer.hxx +++ b/src/Units/Units_Explorer.hxx @@ -110,9 +110,9 @@ public: 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; }; diff --git a/src/math/math_DirectPolynomialRoots.hxx b/src/math/math_DirectPolynomialRoots.hxx index db84b03fbb..55f9a18180 100644 --- a/src/math/math_DirectPolynomialRoots.hxx +++ b/src/math/math_DirectPolynomialRoots.hxx @@ -96,8 +96,8 @@ protected: private: Standard_Boolean Done; Standard_Boolean InfiniteStatus; - Standard_Integer NbSol; - Standard_Real TheRoots[4]; + Standard_Integer NbSol{}; + Standard_Real TheRoots[4]{}; }; #include diff --git a/src/math/math_DoubleTab.hxx b/src/math/math_DoubleTab.hxx index b8204ed874..2c6fc3b37e 100644 --- a/src/math/math_DoubleTab.hxx +++ b/src/math/math_DoubleTab.hxx @@ -66,7 +66,7 @@ private: Standard_EXPORT void Allocate(); Standard_Address Addr; - Standard_Real Buf[16]; + Standard_Real Buf[16]{}; Standard_Boolean isAllocated; Standard_Integer LowR; Standard_Integer UppR; diff --git a/src/math/math_FunctionRoot.hxx b/src/math/math_FunctionRoot.hxx index 5669812fbe..9f4ed1ca45 100644 --- a/src/math/math_FunctionRoot.hxx +++ b/src/math/math_FunctionRoot.hxx @@ -88,7 +88,7 @@ protected: private: Standard_Boolean Done; Standard_Real TheRoot; - Standard_Real TheError; + Standard_Real TheError{}; Standard_Real TheDerivative; Standard_Integer NbIter; }; diff --git a/src/math/math_GaussLeastSquare.hxx b/src/math/math_GaussLeastSquare.hxx index 79fea779f8..0094045668 100644 --- a/src/math/math_GaussLeastSquare.hxx +++ b/src/math/math_GaussLeastSquare.hxx @@ -65,11 +65,11 @@ public: 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; diff --git a/src/math/math_GaussSingleIntegration.hxx b/src/math/math_GaussSingleIntegration.hxx index 9d11219a3d..05aa9ad22e 100644 --- a/src/math/math_GaussSingleIntegration.hxx +++ b/src/math/math_GaussSingleIntegration.hxx @@ -67,8 +67,8 @@ private: const Standard_Real Upper, const Standard_Integer Order); - Standard_Real Val; - Standard_Boolean Done; + Standard_Real Val{}; + Standard_Boolean Done{}; }; #include diff --git a/src/math/math_GlobOptMin.hxx b/src/math/math_GlobOptMin.hxx index 11dbe59de6..fce2741644 100644 --- a/src/math/math_GlobOptMin.hxx +++ b/src/math/math_GlobOptMin.hxx @@ -248,19 +248,19 @@ private: // 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 myCellSize; Standard_Integer myMinCellFilterSol; - Standard_Boolean isFirstCellFilterInvoke; + Standard_Boolean isFirstCellFilterInvoke{}; NCollection_CellFilter myFilter; // Continuity of local borders. diff --git a/src/math/math_Householder.cxx b/src/math/math_Householder.cxx index 539e1e36e0..74a9b1e2a5 100644 --- a/src/math/math_Householder.cxx +++ b/src/math/math_Householder.cxx @@ -39,7 +39,8 @@ math_Householder::math_Householder(const math_Matrix& A, 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(); @@ -55,7 +56,8 @@ math_Householder::math_Householder(const math_Matrix& A, 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(); @@ -73,7 +75,8 @@ math_Householder::math_Householder(const math_Matrix& A, 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; diff --git a/src/math/math_Jacobi.cxx b/src/math/math_Jacobi.cxx index 32b7535097..5a89d939e7 100644 --- a/src/math/math_Jacobi.cxx +++ b/src/math/math_Jacobi.cxx @@ -25,7 +25,9 @@ #include 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()) { diff --git a/src/math/math_KronrodSingleIntegration.cxx b/src/math/math_KronrodSingleIntegration.cxx index ebf74ab1ef..6ae2231e6b 100644 --- a/src/math/math_KronrodSingleIntegration.cxx +++ b/src/math/math_KronrodSingleIntegration.cxx @@ -26,6 +26,7 @@ math_KronrodSingleIntegration::math_KronrodSingleIntegration() : myIsDone(Standard_False), myValue(0.), myErrorReached(0.), + myAbsolutError(0.), myNbPntsReached(0), myNbIterReached(0) { @@ -43,7 +44,9 @@ math_KronrodSingleIntegration::math_KronrodSingleIntegration(math_Function& : myIsDone(Standard_False), myValue(0.), myErrorReached(0.), - myNbPntsReached(0) + myAbsolutError(0.), + myNbPntsReached(0), + myNbIterReached(0) { Perform(theFunction, theLower, theUpper, theNbPnts); } @@ -62,7 +65,9 @@ math_KronrodSingleIntegration::math_KronrodSingleIntegration(math_Function& : myIsDone(Standard_False), myValue(0.), myErrorReached(0.), - myNbPntsReached(0) + myAbsolutError(0.), + myNbPntsReached(0), + myNbIterReached(0) { Perform(theFunction, theLower, theUpper, theNbPnts, theTolerance, theMaxNbIter); } diff --git a/src/math/math_Uzawa.cxx b/src/math/math_Uzawa.cxx index b427a87db8..82762afa71 100644 --- a/src/math/math_Uzawa.cxx +++ b/src/math/math_Uzawa.cxx @@ -46,7 +46,9 @@ math_Uzawa::math_Uzawa(const math_Matrix& Cont, 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); @@ -64,7 +66,9 @@ math_Uzawa::math_Uzawa(const math_Matrix& Cont, 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);