Coding - Apply Clang-Tidy automatic fixes (#1245)

Flags:
aChecks="modernize-deprecated-headers,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-nullptr,modernize-use-override,performance-avoid-endl,performance-move-constructor-init,readability-braces-around-statements,readability-delete-null-pointer,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-string-init,readability-static-accessed-through-instance"

clang-tidy version: 22.1.3
This commit is contained in:
Pasukhin Dmitry
2026-04-29 15:04:38 +01:00
committed by GitHub
parent 2cafd4fa58
commit 1db8025677
3436 changed files with 95768 additions and 2933 deletions
@@ -207,9 +207,13 @@ void AdvApp2Var_ApproxAFunc2Var::Init()
ndu = std::max(myMaxDegInU + 1, 2 * iu + 2);
ndv = std::max(myMaxDegInV + 1, 2 * iv + 2);
if (ndu < 2 * iu + 2)
{
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : UMaxDegree Error");
}
if (ndv < 2 * iv + 2)
{
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VMaxDegree Error");
}
myPrecisionCode = std::max(0, std::min(myPrecisionCode, 3));
AdvApp2Var_Context Conditions(ifav,
iu,
@@ -386,26 +390,42 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting&
NumDec = 0;
if (((NbPatch + NbV) <= myMaxPatches) && ((NbPatch + NbU) > myMaxPatches) && (Umore))
{
NumDec = 1;
}
if (((NbPatch + NbV) > myMaxPatches) && ((NbPatch + NbU) <= myMaxPatches) && (Vmore))
{
NumDec = 2;
}
if (((NbPatch + NbV) <= myMaxPatches) && ((NbPatch + NbU) <= myMaxPatches))
{
if (Umore)
{
NumDec = 3;
}
if ((NbV > NbU) && Vmore)
{
NumDec = 4;
}
}
if ((NbU + 1) * (NbV + 1) <= myMaxPatches)
{
if (!Umore && !Vmore)
{
NumDec = 0;
}
if (Umore && !Vmore)
{
NumDec = 3;
}
if (!Umore && Vmore)
{
NumDec = 4;
}
if (Umore && Vmore)
{
NumDec = 5;
}
}
// approximation of the square
@@ -495,26 +515,42 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting&
NumDec = 0;
if (((NbPatch + NbV) <= myMaxPatches) && ((NbPatch + NbU) > myMaxPatches) && (Umore))
{
NumDec = 1;
}
if (((NbPatch + NbV) > myMaxPatches) && ((NbPatch + NbU) <= myMaxPatches) && (Vmore))
{
NumDec = 2;
}
if (((NbPatch + NbV) <= myMaxPatches) && ((NbPatch + NbU) <= myMaxPatches))
{
if (Umore)
{
NumDec = 3;
}
if ((NbV > NbU) && Vmore)
{
NumDec = 4;
}
}
if ((NbU + 1) * (NbV + 1) <= myMaxPatches)
{
if (!Umore && !Vmore)
{
NumDec = 0;
}
if (Umore && !Vmore)
{
NumDec = 1;
}
if (!Umore && Vmore)
{
NumDec = 2;
}
if (Umore && Vmore)
{
NumDec = 5;
}
}
// approximation of the square
@@ -527,7 +563,9 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting&
myResult(FirstNA).MakeApprox(myConditions, myConstraints, NumDec);
}
if (NumDec >= 3)
{
NumDec = NumDec - 2;
}
// evaluation of the criterion on the square
if (myResult(FirstNA).HasResult())
@@ -535,7 +573,9 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting&
Crit.Value(myResult(FirstNA), myConditions);
CritValue = myResult(FirstNA).CritValue();
if (m1 < CritValue)
{
m1 = CritValue;
}
}
// is it necessary to cut ?
decision = myResult(FirstNA).CutSense(Crit, NumDec);
@@ -1117,54 +1157,51 @@ double AdvApp2Var_ApproxAFunc2Var::CritError(const int Dimension, const int SSPI
void AdvApp2Var_ApproxAFunc2Var::Dump(Standard_OStream& o) const
{
int iesp = 1, NbKU, NbKV, ik;
o << std::endl;
o << '\n';
if (!myHasResult)
{
o << "No result" << std::endl;
o << "No result" << '\n';
}
else
{
o << "There is a result";
if (myDone)
{
o << " within the requested tolerance " << my3DTolerances->Value(iesp) << std::endl;
o << " within the requested tolerance " << my3DTolerances->Value(iesp) << '\n';
}
else if (my3DMaxError->Value(iesp) > my3DTolerances->Value(iesp))
{
o << " WITHOUT the requested tolerance " << my3DTolerances->Value(iesp) << std::endl;
o << " WITHOUT the requested tolerance " << my3DTolerances->Value(iesp) << '\n';
}
else
{
o << " WITHOUT the requested continuities " << std::endl;
o << " WITHOUT the requested continuities " << '\n';
}
o << std::endl;
o << "Result max error :" << my3DMaxError->Value(iesp) << std::endl;
o << "Result average error :" << my3DAverageError->Value(iesp) << std::endl;
o << "Result max error on U frontiers :" << my3DUFrontError->Value(iesp) << std::endl;
o << "Result max error on V frontiers :" << my3DVFrontError->Value(iesp) << std::endl;
o << std::endl;
o << "Degree of Bezier patches in U : " << myDegreeInU << " in V : " << myDegreeInV
<< std::endl;
o << std::endl;
o << '\n';
o << "Result max error :" << my3DMaxError->Value(iesp) << '\n';
o << "Result average error :" << my3DAverageError->Value(iesp) << '\n';
o << "Result max error on U frontiers :" << my3DUFrontError->Value(iesp) << '\n';
o << "Result max error on V frontiers :" << my3DVFrontError->Value(iesp) << '\n';
o << '\n';
o << "Degree of Bezier patches in U : " << myDegreeInU << " in V : " << myDegreeInV << '\n';
o << '\n';
occ::handle<Geom_BSplineSurface> S =
occ::down_cast<Geom_BSplineSurface>(mySurfaces->Value(iesp));
o << "Number of poles in U : " << S->NbUPoles() << " in V : " << S->NbVPoles() << std::endl;
o << std::endl;
o << "Number of poles in U : " << S->NbUPoles() << " in V : " << S->NbVPoles() << '\n';
o << '\n';
NbKU = S->NbUKnots();
NbKV = S->NbVKnots();
o << "Number of knots in U : " << NbKU << std::endl;
o << "Number of knots in U : " << NbKU << '\n';
for (ik = 1; ik <= NbKU; ik++)
{
o << " " << ik << " : " << S->UKnot(ik) << " mult : " << S->UMultiplicity(ik)
<< std::endl;
o << " " << ik << " : " << S->UKnot(ik) << " mult : " << S->UMultiplicity(ik) << '\n';
}
o << std::endl;
o << "Number of knots in V : " << NbKV << std::endl;
o << '\n';
o << "Number of knots in V : " << NbKV << '\n';
for (ik = 1; ik <= NbKV; ik++)
{
o << " " << ik << " : " << S->VKnot(ik) << " mult : " << S->VMultiplicity(ik)
<< std::endl;
o << " " << ik << " : " << S->VKnot(ik) << " mult : " << S->VMultiplicity(ik) << '\n';
}
o << std::endl;
o << '\n';
}
}
@@ -24,7 +24,9 @@ static bool lesparam(const int iordre, const int ncflim, const int icodeo, int&
// jacobi degree
ndgjac = ncflim; // it always keeps a reserve coefficient
if (icodeo < 0)
{
return false;
}
if (icodeo > 0)
{
ndgjac += (9 - (iordre + 1)); // iordre rescales the frequences upwards
@@ -170,7 +172,9 @@ AdvApp2Var_Context::AdvApp2Var_Context(const int
// myNbURoot,myJDegU
aCoeffLimit = nlimu;
if (aCoeffLimit < 2 * iu + 2)
{
aCoeffLimit = 2 * iu + 2;
}
if (!lesparam(iu, aCoeffLimit, iprecis, NbPntU, JDegU))
{
throw Standard_ConstructionError("AdvApp2Var_Context");
@@ -178,7 +182,9 @@ AdvApp2Var_Context::AdvApp2Var_Context(const int
myNbURoot = NbPntU;
myJDegU = JDegU;
if (iu > -1)
{
NbPntU = myNbURoot - 2;
}
// myJMaxU
int aSize = JDegU - 2 * iu - 1;
@@ -190,7 +196,9 @@ AdvApp2Var_Context::AdvApp2Var_Context(const int
// myNbVRoot,myJDegV
aCoeffLimit = nlimv;
if (aCoeffLimit < 2 * iv + 2)
{
aCoeffLimit = 2 * iv + 2;
}
if (!lesparam(iv, aCoeffLimit, iprecis, NbPntV, JDegV))
{
throw Standard_ConstructionError("AdvApp2Var_Context");
@@ -198,7 +206,9 @@ AdvApp2Var_Context::AdvApp2Var_Context(const int
myNbVRoot = NbPntV;
myJDegV = JDegV;
if (iv > -1)
{
NbPntV = myNbVRoot - 2;
}
// myJMaxV
aSize = JDegV - 2 * iv - 1;
@@ -268,7 +278,9 @@ AdvApp2Var_Context::AdvApp2Var_Context(const int
{
aTolMin = ITol->Value(anSSPIndex) / aWeight;
if (aTolMin < FTol->Value(anSSPIndex, aTolIndex))
{
FTol->SetValue(anSSPIndex, aTolIndex, aTolMin);
}
CTol->SetValue(anSSPIndex, aTolIndex, aTolMin);
}
}
@@ -147,7 +147,9 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
UVFONC[1] = myU1;
NBROOT = (Conditions.URoots())->Length();
if (myExtremOrder > -1)
{
NBROOT -= 2;
}
ROOTLG = (double*)&HUROOT->ChangeArray1()(HUROOT->Lower());
NDGJAC = Conditions.UJacDeg();
NCFLIM = Conditions.ULimit();
@@ -160,7 +162,9 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
UVFONC[3] = myV1;
NBROOT = (Conditions.VRoots())->Length();
if (myExtremOrder > -1)
{
NBROOT -= 2;
}
ROOTLG = (double*)&HVROOT->ChangeArray1()(HVROOT->Lower());
NDGJAC = Conditions.VJacDeg();
NCFLIM = Conditions.VLimit();
@@ -291,9 +295,13 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
goto FINISH;
}
if (NCOEFF <= ncfapp)
{
NCOEFF = ncfapp;
}
if (ierapp == -1)
{
IERCOD = -1;
}
// return constraints of order 0 to IORDRE of extremities
int ider, jpos = HCONTR1->Lower();
for (ider = 0; ider <= IORDRE; ider++)
@@ -420,7 +428,9 @@ void AdvApp2Var_Iso::ResetApprox()
void AdvApp2Var_Iso::OverwriteApprox()
{
if (myHasResult)
{
myApprIsDone = true;
}
}
//=================================================================================================
@@ -498,9 +508,13 @@ double AdvApp2Var_Iso::V1() const
int AdvApp2Var_Iso::UOrder() const
{
if (Type() == GeomAbs_IsoU)
{
return myDerivOrder;
}
else
{
return myExtremOrder;
}
}
//=================================================================================================
@@ -508,9 +522,13 @@ int AdvApp2Var_Iso::UOrder() const
int AdvApp2Var_Iso::VOrder() const
{
if (Type() == GeomAbs_IsoV)
{
return myDerivOrder;
}
else
{
return myExtremOrder;
}
}
//=================================================================================================
@@ -9523,7 +9523,6 @@ void AdvApp2Var_MathBase::mmwprcs_(double* epsil1,
mmprcsn_.eps4 = *epsil4;
mmprcsn_.niterm = *niter1;
mmprcsn_.niterr = *niter2;
return;
} /* mmwprcs_ */
//=================================================================================================
@@ -113,12 +113,16 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions
UROOT = (double*)&HUROOT->ChangeArray1()(HUROOT->Lower());
NBPNTU = (Conditions.URoots())->Length();
if (myOrdInU > -1)
{
NBPNTU -= 2;
}
double* VROOT;
VROOT = (double*)&HVROOT->ChangeArray1()(HVROOT->Lower());
NBPNTV = (Conditions.VRoots())->Length();
if (myOrdInV > -1)
{
NBPNTV -= 2;
}
// data stored in the Framework Constraints cad Nodes and Isos
// C1, C2, C3 and C4 are dimensionnes in FORTRAN with (NDIMEN,IORDRU+2,IORDRV+2)
@@ -771,10 +775,14 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
NDIMSE = 3;
NBPNTU = (Conditions.URoots())->Length();
if (myOrdInU > -1)
{
NBPNTU -= 2;
}
NBPNTV = (Conditions.VRoots())->Length();
if (myOrdInV > -1)
{
NBPNTV -= 2;
}
NCFLMU = Conditions.ULimit();
NCFLMV = Conditions.VLimit();
NDegU = NCFLMU - 1;
@@ -978,7 +986,9 @@ void AdvApp2Var_Patch::ResetApprox()
void AdvApp2Var_Patch::OverwriteApprox()
{
if (myHasResult)
{
myApprIsDone = true;
}
}
//=================================================================================================
@@ -1071,9 +1081,13 @@ int AdvApp2Var_Patch::NbCoeffInV() const
void AdvApp2Var_Patch::ChangeNbCoeff(const int NbCoeffU, const int NbCoeffV)
{
if (myNbCoeffInU < NbCoeffU)
{
myNbCoeffInU = NbCoeffU;
}
if (myNbCoeffInV < NbCoeffV)
{
myNbCoeffInV = NbCoeffV;
}
}
//=================================================================================================
@@ -2271,12 +2271,16 @@ int AdvApp2Var_SysBase::mcrfill_(int* size, void* tin, void* tout)
char* jmin = static_cast<char*>(tin);
char* jmout = static_cast<char*>(tout);
if (mcrfill_ABS(jmout - jmin) >= *size)
{
memcpy(tout, tin, *size);
}
else if (tin > tout)
{
int n = *size;
while (n-- > 0)
{
*jmout++ = *jmin++;
}
}
else
{
@@ -2284,7 +2288,9 @@ int AdvApp2Var_SysBase::mcrfill_(int* size, void* tin, void* tout)
jmin += n;
jmout += n;
while (n-- > 0)
{
*--jmout = *--jmin;
}
}
return 0;
}
@@ -2359,7 +2365,9 @@ int mcrgetv_(int* sz, intptr_t* iad, int* ier)
*ier = 0;
*iad = (intptr_t)Standard::Allocate(*sz);
if (!*iad)
{
*ier = 1;
}
return 0;
}