mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0024510: Remove unused local variables
When warnings are enabled, compilers report lots of occurrences of unused local variables, which makes it harder to find other meaningful warnings. This commit does not fix all unused local variables. Fix new type conversion warning Code cleaned to avoid MSVC compiler warnings on unused function arguments. Several useless pieces of code are removed. Changes in IntTools_EdgeFace.cxx, Blend_Walking_1.gxx, Bnd_BoundSortBox.cxx, ProjLib_ProjectedCurve.cxx are reverted (separated to specific issue for more in-depth analysis).
This commit is contained in:
@@ -28,12 +28,11 @@ math_BracketedRoot::math_BracketedRoot (math_Function& F,
|
||||
|
||||
Standard_Real Fa,Fc,a,c=0,d=0,e=0;
|
||||
Standard_Real min1,min2,p,q,r,s,tol1,xm;
|
||||
Standard_Boolean Ok;
|
||||
|
||||
a = Bound1;
|
||||
TheRoot = Bound2;
|
||||
Ok = F.Value(a,Fa);
|
||||
Ok = F.Value(TheRoot,TheError);
|
||||
F.Value(a,Fa);
|
||||
F.Value(TheRoot,TheError);
|
||||
if (Fa*TheError > 0.) { Done = Standard_False;}
|
||||
else {
|
||||
Fc = TheError ;
|
||||
@@ -95,7 +94,7 @@ math_BracketedRoot::math_BracketedRoot (math_Function& F,
|
||||
else {
|
||||
TheRoot += (xm > 0. ? Abs(tol1) : -Abs(tol1));
|
||||
}
|
||||
Ok = F.Value(TheRoot,TheError);
|
||||
F.Value(TheRoot,TheError);
|
||||
}
|
||||
Done = Standard_False;
|
||||
}
|
||||
|
@@ -40,11 +40,11 @@ math_FunctionAllRoots::math_FunctionAllRoots (
|
||||
Standard_Real DebNul,FinNul;
|
||||
Standard_Integer Indd,Indf;
|
||||
Standard_Real cst,val,valsav=0,valbid;
|
||||
Standard_Boolean bid,fini;
|
||||
Standard_Boolean fini;
|
||||
Standard_Integer Nbp,i;
|
||||
|
||||
Nbp=S.NbPoints();
|
||||
bid=F.Value(S.GetParameter(1),val);
|
||||
F.Value(S.GetParameter(1),val);
|
||||
PNul=Abs(val)<=EpsNul;
|
||||
if (!PNul) {valsav=val;}
|
||||
InterNul=Standard_False;
|
||||
@@ -56,7 +56,7 @@ math_FunctionAllRoots::math_FunctionAllRoots (
|
||||
|
||||
while (!fini) {
|
||||
|
||||
bid=F.Value(S.GetParameter(i),val);
|
||||
F.Value(S.GetParameter(i),val);
|
||||
Nul=Abs(val)<=EpsNul;
|
||||
if (!Nul) {
|
||||
valsav=val;
|
||||
@@ -100,7 +100,7 @@ math_FunctionAllRoots::math_FunctionAllRoots (
|
||||
InterNul=Standard_True;
|
||||
if (i==2) {
|
||||
DebNul=S.GetParameter(1);
|
||||
bid = F.Value(DebNul,valbid);
|
||||
F.Value(DebNul,valbid);
|
||||
Indd = F.GetStateNumber();
|
||||
Nuld=Standard_True;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ math_FunctionAllRoots::math_FunctionAllRoots (
|
||||
pdeb.Append(DebNul);
|
||||
ideb.Append(Indd);
|
||||
FinNul = S.GetParameter(Nbp);
|
||||
bid = F.Value(FinNul,valbid);
|
||||
F.Value(FinNul,valbid);
|
||||
Indf = F.GetStateNumber();
|
||||
pfin.Append(FinNul);
|
||||
ifin.Append(Indf);
|
||||
|
@@ -72,7 +72,6 @@ class math_MyFunctionSetWithDerivatives : public math_FunctionSetWithDerivatives
|
||||
const Standard_Real Guess,
|
||||
const Standard_Real Tolerance,
|
||||
const Standard_Integer NbIterations ){
|
||||
Standard_Boolean Ok;
|
||||
math_Vector V(1,1), Tol(1,1);
|
||||
math_MyFunctionSetWithDerivatives Ff(F);
|
||||
V(1)=Guess;
|
||||
@@ -83,7 +82,7 @@ class math_MyFunctionSetWithDerivatives : public math_FunctionSetWithDerivatives
|
||||
F.GetStateNumber();
|
||||
TheRoot = Sol.Root()(1);
|
||||
TheDerivative = Sol.Derivative()(1,1);
|
||||
Ok = F.Value(TheRoot,TheError);
|
||||
F.Value(TheRoot,TheError);
|
||||
NbIter = Sol.NbIterations();
|
||||
}
|
||||
}
|
||||
@@ -93,7 +92,6 @@ class math_MyFunctionSetWithDerivatives : public math_FunctionSetWithDerivatives
|
||||
const Standard_Real A,
|
||||
const Standard_Real B,
|
||||
const Standard_Integer NbIterations ){
|
||||
Standard_Boolean Ok;
|
||||
math_Vector V(1,1),Aa(1,1),Bb(1,1), Tol(1,1);
|
||||
math_MyFunctionSetWithDerivatives Ff(F);
|
||||
V(1)=Guess;
|
||||
@@ -106,7 +104,7 @@ class math_MyFunctionSetWithDerivatives : public math_FunctionSetWithDerivatives
|
||||
F.GetStateNumber();
|
||||
TheRoot = Sol.Root()(1);
|
||||
TheDerivative = Sol.Derivative()(1,1);
|
||||
Ok = F.Value(TheRoot,TheError);
|
||||
F.Value(TheRoot,TheError);
|
||||
NbIter = Sol.NbIterations();
|
||||
}
|
||||
}
|
||||
|
@@ -112,7 +112,6 @@ void math_Powell::Perform(math_MultipleVarFunction& F,
|
||||
|
||||
|
||||
Done = Standard_False;
|
||||
Standard_Boolean Ok;
|
||||
Standard_Integer i, ibig, j;
|
||||
Standard_Real t, fptt, del;
|
||||
Standard_Integer n = TheLocation.Length();
|
||||
@@ -130,12 +129,12 @@ void math_Powell::Perform(math_MultipleVarFunction& F,
|
||||
|
||||
|
||||
for(Iter = 1; Iter<= Itermax; Iter++) {
|
||||
Ok = F.Value(TheLocation, PreviousMinimum);
|
||||
F.Value(TheLocation, PreviousMinimum);
|
||||
ibig = 0;
|
||||
del = 0.0;
|
||||
for (i = 1; i <= n; i++){
|
||||
for(j =1; j<= n; j++) xit(j) = TheDirections(j,i);
|
||||
Ok = F.Value(TheLocation, fptt);
|
||||
F.Value(TheLocation, fptt);
|
||||
Standard_Boolean IsGood = MinimizeDirection(TheLocation, xit,
|
||||
TheMinimum, F_Dir);
|
||||
|
||||
@@ -171,7 +170,7 @@ void math_Powell::Perform(math_MultipleVarFunction& F,
|
||||
|
||||
// Valeur de la fonction au point extrapole:
|
||||
|
||||
Ok = F.Value(ptt, fptt);
|
||||
F.Value(ptt, fptt);
|
||||
|
||||
if (fptt < PreviousMinimum) {
|
||||
t = 2.0 *(PreviousMinimum -2.0*TheMinimum +fptt)*
|
||||
|
@@ -662,11 +662,9 @@ Standard_Integer DACTCL_Solve(const math_Vector& a,
|
||||
Standard_Integer jr, jd, jh, is, k, id;
|
||||
Standard_Integer jh1, idot, idot1, idot2;
|
||||
Standard_Real aa, d, dot;
|
||||
Standard_Boolean diag;
|
||||
|
||||
jr = 0;
|
||||
for (j = 1; j <= Neq; j++) {
|
||||
diag = Standard_False;
|
||||
jd = indx(j);
|
||||
jh = jd-jr;
|
||||
is = j-jh+2;
|
||||
|
@@ -132,7 +132,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A,
|
||||
Standard_Real Teta, X;
|
||||
Standard_Real Eps, Tol1 = 1.e-15;
|
||||
TColStd_Array1OfReal ko(1,5), Zer(1,4);
|
||||
Standard_Boolean Flag3, Flag4;
|
||||
Standard_Boolean Flag4;
|
||||
InfiniteStatus = Standard_False;
|
||||
Done = Standard_True;
|
||||
|
||||
@@ -345,7 +345,6 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A,
|
||||
X = Teta -MyBorneInf;
|
||||
if ((X >= (-Epsilon(Delta))) && (X <= Delta+ Epsilon(Delta))) {
|
||||
X = Teta;
|
||||
Flag3 = Standard_False;
|
||||
|
||||
// Appel de Newton:
|
||||
//OCC541(apo): Standard_Real TetaNewton=0;
|
||||
|
Reference in New Issue
Block a user