mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -234,14 +234,13 @@
|
||||
const Standard_Real myEpsNull)
|
||||
{
|
||||
Standard_Integer aType, j, aNbRoots;
|
||||
Standard_Real t, t1, t2, f1, f2, absf1, absf2;
|
||||
Standard_Real t1, t2, f1, f2, absf2;
|
||||
|
||||
aNbRoots=mySequenceOfRoots.Length();
|
||||
|
||||
for (j=1; j<=aNbRoots; j++) {
|
||||
IntTools_Root& aR=mySequenceOfRoots.ChangeValue(j);
|
||||
|
||||
t=aR.Root();
|
||||
aR.Interval (t1, t2, f1, f2);
|
||||
|
||||
aType=aR.Type();
|
||||
@@ -263,7 +262,6 @@
|
||||
break;
|
||||
|
||||
case 2: // Smart;
|
||||
absf1=fabs(f1);
|
||||
absf2=fabs(f2);
|
||||
if (absf2 < myEpsNull) {
|
||||
aR.SetStateAfter (TopAbs_ON);
|
||||
|
@@ -1277,10 +1277,9 @@ Standard_Integer FindMaxDistPC(const Standard_Real aT1A,
|
||||
Standard_Real& aDmax,
|
||||
Standard_Real& aT1max)
|
||||
{
|
||||
Standard_Integer iErr, iCnt;
|
||||
Standard_Real aGS, aXP, aA, aB, aXL, aYP, aYL, aT2P, aT2L, aX0;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aGS, aXP, aA, aB, aXL, aYP, aYL, aT2P, aT2L;
|
||||
//
|
||||
iCnt=0;
|
||||
iErr=0;
|
||||
aDmax=0.;
|
||||
//
|
||||
@@ -1324,7 +1323,6 @@ Standard_Integer FindMaxDistPC(const Standard_Real aT1A,
|
||||
}
|
||||
//
|
||||
if ((aB-aA)<aEps1) {
|
||||
aX0=0.5*(aA+aB);
|
||||
break;
|
||||
}
|
||||
}// while(1) {
|
||||
|
@@ -699,7 +699,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
//
|
||||
//
|
||||
Standard_Boolean aVFlag1, aVFlag2, aGeomFlag1, aGeomFlag2;
|
||||
Standard_Real Df2m2, Dm2l2, Df2l2, df2m2, dm2l2, df2l2, df1m1, dm1l1, df1l1;
|
||||
Standard_Real Df2m2, Dm2l2, Df2l2, df2m2, dm2l2, df2l2, df1l1;
|
||||
Standard_Real tV1, tV2;
|
||||
//
|
||||
// parametric differences for C2
|
||||
@@ -735,8 +735,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
}
|
||||
//
|
||||
// geometric distances for C1
|
||||
df1m1=aPf1.Distance(aPm1);
|
||||
dm1l1=aPm1.Distance(aPl1);
|
||||
df1l1=aPf1.Distance(aPl1);
|
||||
//
|
||||
// if geometric distances between boundaries is less than myCriteria
|
||||
@@ -862,7 +860,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
void IntTools_EdgeEdge::IsIntersection (const Standard_Real ta,
|
||||
const Standard_Real tb)
|
||||
{
|
||||
Standard_Integer i, aNb, pri;
|
||||
Standard_Integer i, aNb;
|
||||
Standard_Real t, f;
|
||||
GeomAbs_CurveType aCT1, aCT2;
|
||||
IntTools_CArray1OfReal anArgs, aFunc;
|
||||
@@ -918,7 +916,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
}
|
||||
//
|
||||
// Prepare values of arguments for the interval [ta, tb]
|
||||
pri=IntTools::PrepareArgs (myCFrom, tb, ta, myDiscret, myDeflection, anArgs);
|
||||
IntTools::PrepareArgs (myCFrom, tb, ta, myDiscret, myDeflection, anArgs);
|
||||
aNb=anArgs.Length();
|
||||
|
||||
aFunc.Resize(aNb);
|
||||
@@ -942,7 +940,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
const IntTools_CArray1OfReal& f)
|
||||
{
|
||||
Standard_Integer i, n, k;
|
||||
Standard_Real fr, tr, anEpsNull;
|
||||
Standard_Real tr, anEpsNull;
|
||||
IntTools_CArray1OfReal fd;
|
||||
TColStd_SequenceOfReal aTSeq, aFSeq;
|
||||
|
||||
@@ -989,7 +987,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
//aa
|
||||
if (fd1*fd2 < 0.) {
|
||||
tr=FindSimpleRoot(2, t1, t2, fd1);
|
||||
fr=DistanceFunction(tr);
|
||||
myPar1=tr;
|
||||
myParallel=Standard_False;
|
||||
break;
|
||||
@@ -997,7 +994,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
|
||||
if (!bF1 && bF2) {
|
||||
tr=t2;
|
||||
fr=fd2;
|
||||
myPar1=tr;
|
||||
myParallel=Standard_False;
|
||||
break;
|
||||
@@ -1005,7 +1001,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
|
||||
if (bF1 && !bF2) {
|
||||
tr=t1;
|
||||
fr=fd1;
|
||||
myPar1=tr;
|
||||
myParallel=Standard_False;
|
||||
break;
|
||||
@@ -1248,7 +1243,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
Standard_Real aTFR1, aTLR1, aTFR2, aTLR2;
|
||||
Standard_Real aTL1, aTL2, aTC1, aTC2;
|
||||
Standard_Real aRC, aDLC, aD2, aC2, aTLx, aTCx;
|
||||
GeomAbs_CurveType aTFrom, aTTo;
|
||||
GeomAbs_CurveType aTFrom;
|
||||
gp_Circ aCirc;
|
||||
gp_Lin aLine;
|
||||
gp_Pnt aPC, aPLx, aPCx;
|
||||
@@ -1258,7 +1253,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
(aCP.Ranges2())(1).Range(aTFR2, aTLR2);
|
||||
//
|
||||
aTFrom=myCFrom.GetType();
|
||||
aTTo =myCTo.GetType();
|
||||
//
|
||||
aTL1=aTFR1;
|
||||
aTL2=aTLR1;
|
||||
@@ -1434,13 +1428,12 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt& aComm
|
||||
(myCFrom.GetType() == GeomAbs_Circle && myCTo.GetType() == GeomAbs_Line))
|
||||
{
|
||||
Standard_Real aRadius;
|
||||
GeomAbs_CurveType aTFrom, aTTo;
|
||||
GeomAbs_CurveType aTFrom;
|
||||
gp_Circ aCirc;
|
||||
gp_Lin aLine;
|
||||
gp_Pnt aPCenter, aPOnLine;
|
||||
|
||||
aTFrom=myCFrom.GetType();
|
||||
aTTo =myCTo.GetType();
|
||||
|
||||
if (aTFrom==GeomAbs_Circle) {
|
||||
aCirc=myCFrom.Circle();
|
||||
|
@@ -765,11 +765,9 @@ void IntTools_DistCC::FindMaxLocal(const Standard_Real aT11,
|
||||
Standard_Real& aDx,
|
||||
Standard_Real& aTx)
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aA, aB, aCf, aX1, aX2, aF1, aF2, aX, aF;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
iErr=0;
|
||||
aDx=0.;
|
||||
aTx=0.;
|
||||
//
|
||||
|
@@ -424,7 +424,8 @@ Standard_Boolean IntTools_EdgeFace::IsProjectable(const Standard_Real aT) const
|
||||
//=======================================================================
|
||||
Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
{
|
||||
Standard_Real Umin, Usup, Vmin, Vsup, aD;
|
||||
Standard_Real aD;
|
||||
|
||||
//
|
||||
gp_Pnt P;
|
||||
myC.D0(t, P);
|
||||
@@ -437,11 +438,6 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
return aD;
|
||||
}
|
||||
|
||||
Umin=myS.FirstUParameter();
|
||||
Usup=myS.LastUParameter();
|
||||
Vmin=myS.FirstVParameter();
|
||||
Vsup=myS.LastVParameter ();
|
||||
|
||||
//
|
||||
Standard_Boolean bFlag = Standard_False;
|
||||
|
||||
@@ -610,9 +606,6 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
|
||||
k=n-1;
|
||||
for (i=1; i<k; i++) {
|
||||
Standard_Real ti, ti1;
|
||||
ti=t(i);
|
||||
ti1=t(i-1);
|
||||
fd(i)=.5*(f(i+1)-f(i-1))/(t(i)-t(i-1));
|
||||
if (fabs(fd(i)) < dEpsNull){
|
||||
fd(i)=0.;
|
||||
@@ -916,13 +909,13 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
const Standard_Real tb)
|
||||
{
|
||||
IntTools_CArray1OfReal anArgs, aFunc;
|
||||
Standard_Integer i, aNb, pri, aCnt=0;
|
||||
Standard_Integer i, aNb, aCnt=0;
|
||||
//
|
||||
Standard_Integer aCntIncreasing=1, aCntDecreasing=1;
|
||||
Standard_Real t, f, f1;
|
||||
//
|
||||
// Prepare values of arguments for the interval [ta, tb]
|
||||
pri=IntTools::PrepareArgs (myC, tb, ta, myDiscret, myDeflection, anArgs);
|
||||
IntTools::PrepareArgs (myC, tb, ta, myDiscret, myDeflection, anArgs);
|
||||
aNb=anArgs.Length();
|
||||
|
||||
aFunc.Resize(aNb);
|
||||
@@ -983,7 +976,7 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
const IntTools_CArray1OfReal& f)
|
||||
{
|
||||
Standard_Integer i, n, k;
|
||||
Standard_Real fr, tr;
|
||||
Standard_Real tr;
|
||||
IntTools_CArray1OfReal fd;
|
||||
TColStd_SequenceOfReal aTSeq, aFSeq;
|
||||
|
||||
@@ -1030,7 +1023,7 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
//
|
||||
if (fd1*fd2 < 0.) {
|
||||
tr=FindSimpleRoot(2, t1, t2, fd1);
|
||||
fr=DistanceFunction(tr);
|
||||
DistanceFunction(tr);
|
||||
myPar1=tr;
|
||||
myParallel=Standard_False;
|
||||
break;
|
||||
@@ -1038,7 +1031,6 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
|
||||
if (!bF1 && bF2) {
|
||||
tr=t2;
|
||||
fr=fd2;
|
||||
myPar1=tr;
|
||||
myParallel=Standard_False;
|
||||
break;
|
||||
@@ -1046,7 +1038,6 @@ Standard_Real IntTools_EdgeFace::DistanceFunction(const Standard_Real t)
|
||||
|
||||
if (bF1 && !bF2) {
|
||||
tr=t1;
|
||||
fr=fd1;
|
||||
myPar1=tr;
|
||||
myParallel=Standard_False;
|
||||
break;
|
||||
@@ -1524,17 +1515,14 @@ Standard_Integer AdaptiveDiscret (const Standard_Integer iDiscret,
|
||||
|
||||
iDiscretNew=iDiscret;
|
||||
|
||||
GeomAbs_CurveType aCType;
|
||||
GeomAbs_SurfaceType aSType;
|
||||
|
||||
aCType=aCurve.GetType();
|
||||
aSType=aSurface.GetType();
|
||||
|
||||
if (aSType==GeomAbs_Cylinder) {
|
||||
Standard_Real aELength, aRadius, dL, dLR;
|
||||
Standard_Real aELength, aRadius, dLR;
|
||||
|
||||
aELength=IntTools::Length(aCurve.Edge());
|
||||
dL=aELength/iDiscret;
|
||||
|
||||
gp_Cylinder aCylinder=aSurface.Cylinder();
|
||||
aRadius=aCylinder.Radius();
|
||||
|
Reference in New Issue
Block a user