1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00: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:
Denis Barbier
2014-01-09 12:20:06 +04:00
committed by bugmaster
parent b467a87036
commit 96a95605cd
230 changed files with 455 additions and 1286 deletions

View File

@@ -51,17 +51,13 @@ static
const Handle_Adaptor2d_HCurve2d& C2);
static
void RecadreMemePeriode(const IntSurf_Quadric aQuad1,
const IntSurf_Quadric aQuad2,
Standard_Real& u1,
void RecadreMemePeriode(Standard_Real& u1,
Standard_Real& u2,
const Standard_Real anu1,
const Standard_Real anu2);
static
void CorrectFirstPartOfLine(Handle(IntSurf_LineOn2S)& LinOn2S,
const IntSurf_Quadric aQuad1,
const IntSurf_Quadric aQuad2,
const Standard_Real ref_u1,
const Standard_Real ref_u2,
Standard_Real& new_u1,
@@ -485,7 +481,7 @@ static
//// Modified by jgv, 17.09.09 for OCC21255 ////
if (!Corrected && U >= refpar)
{
CorrectFirstPartOfLine(LinOn2S, quad1, quad2, ref_u1, ref_u2, anu1, anu2);
CorrectFirstPartOfLine(LinOn2S, ref_u1, ref_u2, anu1, anu2);
Corrected = Standard_True;
}
////////////////////////////////////////////////
@@ -495,7 +491,7 @@ static
Pnt3d = aline->Value(U);
quad1.Parameters(Pnt3d,u1,v1);
quad2.Parameters(Pnt3d,u2,v2);
RecadreMemePeriode(quad1, quad2, u1,u2,anu1,anu2);
RecadreMemePeriode(u1,u2,anu1,anu2);
anu1 = u1;
anu2 = u2;
POn2S.SetValue(Pnt3d,u1,v1,u2,v2);
@@ -527,7 +523,7 @@ static
//
RefineParameters(aline, firstparam, lastparam, lastparam, -1, quad2, 10.*myTol3D, u2,v2);
//
RecadreMemePeriode(quad1, quad2, u1,u2,anu1,anu2);
RecadreMemePeriode(u1,u2,anu1,anu2);
POn2S.SetValue(Pnt3d,u1,v1,u2,v2);
LinOn2S->Add(POn2S);
nbpwline++;
@@ -535,7 +531,7 @@ static
//// Modified by jgv, 17.09.09 for OCC21255 ////
if (!Corrected &&
(lastparam >= refpar || refpar-lastparam < Precision::Confusion()))
CorrectFirstPartOfLine(LinOn2S, quad1, quad2, ref_u1, ref_u2, anu1, anu2);
CorrectFirstPartOfLine(LinOn2S, ref_u1, ref_u2, anu1, anu2);
////////////////////////////////////////////////
//
@@ -630,7 +626,7 @@ static
do {
Standard_Boolean RemoveVtxo, RemoveVtx;
Standard_Integer vo, voo;
Standard_Real ponl, ponlo, ponloo, aDist13, aDist23;
Standard_Real ponl, ponlo, aDist13, aDist23;
//
APointHasBeenRemoved = Standard_False;
RemoveVtxo = Standard_False;
@@ -656,7 +652,6 @@ static
if(voo!=v && voo!=vo) {
if(newparamvertex(voo)>=0.) {
const IntPatch_Point& Vtxoo = aline->Vertex(voo);
ponloo = Vtxoo.ParameterOnLine();
const gp_Pnt& aPoo=Vtxoo.Value();
//
aDist13=aP.Distance(aPoo);
@@ -804,7 +799,7 @@ static
//
if(v==1) {
ParamVtxPrecedent=refpointonwline;
RecadreMemePeriode(quad1, quad2, u1,u2,anu1,anu2);
RecadreMemePeriode(u1,u2,anu1,anu2);
NewPoint.SetParameter(refpointonwline);
//
NewPoint.SetParameters(u1,v1,u2,v2);
@@ -816,7 +811,7 @@ static
//-- 2 vertex renseignent le meme point de la LineOn2S
//-- On insere un nv point = vtx
//-- On decale tous les vtx apres de 1
RecadreMemePeriode(quad1, quad2, u1,u2,anu1,anu2);
RecadreMemePeriode(u1,u2,anu1,anu2);
POn2S.SetValue(Pnt3d,u1,v1,u2,v2);
LinOn2S->InsertBefore(refpointonwline+1, POn2S);
nbpwline++;
@@ -834,7 +829,7 @@ static
}
//
else {
RecadreMemePeriode(quad1, quad2, u1,u2, anu1, anu2);
RecadreMemePeriode(u1,u2, anu1, anu2);
NewPoint.SetParameter(refpointonwline);
//
NewPoint.SetParameters(u1, v1, u2, v2);
@@ -928,19 +923,11 @@ Standard_Boolean SameCurve(const Handle_Adaptor2d_HCurve2d& C1,const Handle_Adap
//function : RecadreMemePeriode
//purpose :
//=======================================================================
void RecadreMemePeriode(const IntSurf_Quadric aQuad1,
const IntSurf_Quadric aQuad2,
Standard_Real& u1,
void RecadreMemePeriode(Standard_Real& u1,
Standard_Real& u2,
const Standard_Real anu1,
const Standard_Real anu2)
{
Standard_Boolean bBothCylinders;
GeomAbs_SurfaceType aType1, aType2;
//
aType1=aQuad1.TypeQuadric();
aType2=aQuad2.TypeQuadric();
bBothCylinders=(aType1==GeomAbs_Cylinder && aType2==GeomAbs_Cylinder);
//
while(anu1-u1 > 5.0) {
u1+=M_PI+M_PI;
@@ -987,8 +974,6 @@ void RecadreMemePeriode(const IntSurf_Quadric aQuad1,
//purpose :
//=======================================================================
void CorrectFirstPartOfLine(Handle(IntSurf_LineOn2S)& LinOn2S,
const IntSurf_Quadric aQuad1,
const IntSurf_Quadric aQuad2,
const Standard_Real ref_u1,
const Standard_Real ref_u2,
Standard_Real& new_u1,
@@ -1002,7 +987,7 @@ void CorrectFirstPartOfLine(Handle(IntSurf_LineOn2S)& LinOn2S,
new_u1 = u1;
new_u2 = u2;
RecadreMemePeriode(aQuad1, aQuad2, new_u1, new_u2, ref_u1, ref_u2);
RecadreMemePeriode(new_u1, new_u2, ref_u1, ref_u2);
OffsetOnS1 = new_u1 - u1;
OffsetOnS2 = new_u2 - u2;
if (Abs(OffsetOnS1) > 1. || Abs(OffsetOnS2) > 1.) //recadre on n*2*PI is done

View File

@@ -429,10 +429,8 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
gp_Pnt P;
IntPatch_Point point;
Standard_Real u1,v1,u2,v2;
Standard_Integer nbv;
if(slin.Value(i)->ArcType() == IntPatch_Circle) {
const Handle(IntPatch_GLine)& glin = *((Handle(IntPatch_GLine)*)&slin.Value(i));
nbv = glin->NbVertex();
if(glin->NbVertex() == 0) {
gp_Circ Circ = glin->Circle();
P=ElCLib::Value(0.0,Circ);
@@ -455,7 +453,6 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
else if(slin.Value(i)->ArcType() == IntPatch_Ellipse) {
const Handle(IntPatch_GLine)& glin = *((Handle(IntPatch_GLine)*)&slin.Value(i));
nbv = glin->NbVertex();
if(glin->NbVertex() == 0) {
gp_Elips Elips = glin->Ellipse();
P=ElCLib::Value(0.0,Elips);

View File

@@ -906,7 +906,6 @@ Standard_Boolean IntCyCo(const IntSurf_Quadric& Quad1,
IntAna_Curve aC;
IntAna_ListOfCurve aLC;
IntAna_ListIteratorOfListOfCurve aIt;
Standard_Boolean bToSplit;
//
NbSol = anaint.NbCurve();
@@ -915,7 +914,7 @@ Standard_Boolean IntCyCo(const IntSurf_Quadric& Quad1,
//curvsol = anaint.Curve(i);
aC=anaint.Curve(i);
aLC.Clear();
bToSplit=ExploreCurve(Cy, Co, aC, 10.*Tol, aLC);
ExploreCurve(Cy, Co, aC, 10.*Tol, aLC);
//
aIt.Initialize(aLC);
for (; aIt.More(); aIt.Next()) {

View File

@@ -203,7 +203,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
case IntAna_Circle:
{
Standard_Real para;
IntPatch_Point aPtsol;
gp_Vec Tgt;
gp_Pnt ptref;
@@ -229,7 +228,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
Quad2.Parameters(aPChar, U2, V2);
aPtsol.SetValue(aPChar, Tol, Standard_False);
aPtsol.SetParameters(U1, V1, U2, V2);
para = ElCLib::Parameter(cirsol, aPChar);
aPtsol.SetParameter(0.);
glig->AddVertex(aPtsol);
}
@@ -241,7 +239,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
case IntAna_Ellipse:
{
Standard_Real para;
IntPatch_Point aPtsol;
gp_Elips elipsol = inter.Ellipse(1);
@@ -268,7 +265,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
Quad2.Parameters(aPChar, U2, V2);
aPtsol.SetValue(aPChar, Tol, Standard_False);
aPtsol.SetParameters(U1, V1, U2, V2);
para = ElCLib::Parameter(elipsol, aPChar);
aPtsol.SetParameter(0.);
glig->AddVertex(aPtsol);
}
@@ -280,7 +276,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
case IntAna_Hyperbola:
{
Standard_Real para;
IntPatch_Point aPtsol;
gp_Vec Tgt;
gp_Pnt ptref;
@@ -306,7 +301,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
Quad2.Parameters(aPChar, U2, V2);
aPtsol.SetValue(aPChar, Tol, Standard_False);
aPtsol.SetParameters(U1, V1, U2, V2);
para = ElCLib::Parameter(hyprsol, aPChar);
aPtsol.SetParameter(0.);
glig->AddVertex(aPtsol);
}
@@ -317,7 +311,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
case IntAna_Parabola:
{
Standard_Real para;
IntPatch_Point aPtsol;
gp_Parab parabsol = inter.Parabola(1);
@@ -343,7 +336,6 @@ Standard_Boolean IntCoCo(const IntSurf_Quadric& Quad1,
Quad2.Parameters(aPChar, U2, V2);
aPtsol.SetValue(aPChar, Tol, Standard_False);
aPtsol.SetParameters(U1, V1, U2, V2);
para = ElCLib::Parameter(parabsol, aPChar);
aPtsol.SetParameter(0.);
glig->AddVertex(aPtsol);
}

View File

@@ -1802,7 +1802,6 @@ static void ToSmooth(Handle(IntSurf_LineOn2S)& Line,
Standard_Integer Index3 = (IsFirst) ? 3 : (Line->NbPoints()-2);
Standard_Boolean doU = Standard_False;
Standard_Boolean doV = Standard_False;
Standard_Real U1 = 0., U2 = 0., V1 = 0., V2 = 0., U3 = 0., V3 = 0.;
@@ -1842,8 +1841,6 @@ static void ToSmooth(Handle(IntSurf_LineOn2S)& Line,
}
}
if(fabs(fabs(V1)-fabs(V2)) > DDV) doV = Standard_True;
if(doU) {
Standard_Real dU = Min((DDU/10.),5.e-8);
Standard_Real U = (U2 > U3) ? (U2 + dU) : (U2 - dU);
@@ -2327,7 +2324,7 @@ void DecomposeResult(Handle(IntPatch_Line)& Line,
Standard_Real BAPEX = M_PI/16.; // delta U crossing apex
Standard_Integer k = 0;
Standard_Real U1 = 0., U2 = 0., V1 = 0., V2 = 0., AnU1 = 0., AnV1 = 0., DU1 = 0., DV1 = 0.;
Standard_Real U1 = 0., U2 = 0., V1 = 0., V2 = 0., AnU1 = 0.;
Standard_Integer Findex = 1, Lindex = NbPnts, Bindex = 0;
gp_Pnt aPnt, aSPnt;
@@ -2346,8 +2343,7 @@ void DecomposeResult(Handle(IntPatch_Line)& Line,
// reset variables
Standard_Boolean isDecomposited = Standard_False;
Standard_Boolean is2PIDecomposed = Standard_False;
U1 = 0.; V1 = 0.; U2 = 0.; V2 = 0.; AnU1 = 0.; AnV1 = 0.; DU1 = 0.; DV1 = 0.;
U1 = 0.; V1 = 0.; U2 = 0.; V2 = 0.; AnU1 = 0.;
// analyze other points
for(k = Findex; k <= Lindex; k++) {
@@ -2361,7 +2357,6 @@ void DecomposeResult(Handle(IntPatch_Line)& Line,
SSLine->Value(k).ParametersOnS1(AnU1,V1); // S1 - quadric, set U,V by Pnt3D
}
sline->Add(SSLine->Value(k));
AnV1 = V1;
continue;
}
@@ -2376,7 +2371,6 @@ void DecomposeResult(Handle(IntPatch_Line)& Line,
if(DeltaU > BSEAM) {
Bindex = k;
isDecomposited = Standard_True;
is2PIDecomposed = Standard_True;
break;
}
else if((DeltaU > BAPEX) && (k >= (Findex+10) && k <= (Lindex-10))) {
@@ -2388,7 +2382,6 @@ void DecomposeResult(Handle(IntPatch_Line)& Line,
sline->Add(SSLine->Value(k));
AnU1=U1;
AnV1=V1;
}
IntSurf_PntOn2S aVF,aVL;

View File

@@ -1074,7 +1074,7 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref,
// check that the middle point is on arc
(WLine->Point(midInd).*piParOnS)(utst,vtst);
if (midInd == ParamMinOnLine) {
Standard_Real utst1,vtst1;
Standard_Real utst1=0.0,vtst1=0.0;
(WLine->Point(midInd+1).*piParOnS)(utst1,vtst1);
utst = (utst+utst1)*0.5;
vtst = (vtst+vtst1)*0.5;

View File

@@ -508,11 +508,10 @@ Standard_Integer IntPatch_Polyhedron::TriConnex (const Standard_Integer Triang,
#if MSG_DEBUG
cout<<" Probleme ds IntCurveSurface_Polyhedron : OtherP et PEdge Confondus "<<endl;
#endif
Standard_Integer TempTri,TempOtherP;
TempTri = TriCon;
TempOtherP = OtherP;
return(0); //-- BUG NON CORRIGE ( a revoir le role de nbdeltaU et nbdeltaV)
// Standard_Integer TempTri,TempOtherP;
// TempTri = TriCon;
// TempOtherP = OtherP;
// return(TriConnex(TempTri,Pivot,TempOtherP,TriCon,OtherP));
}
return TriCon;

View File

@@ -2812,7 +2812,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S
//modified by NIZNHY-PKV Wed May 25 06:47:12 2011t
Standard_Integer iC15, SU1, SV1, SU2, SV2;
Standard_Real U0, U1, V0, V1, U, V;
Standard_Real resu0,resu1,resv0,resv1;
Standard_Real resu0,resv0;
Standard_Real du1,du2,dv1,dv2, dmaxOn1, dmaxOn2;
Standard_Real x0,y0,z0, x1,y1,z1,d;
Bnd_Box Box1, Box2;
@@ -2842,8 +2842,6 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S
V1 = S1->LastVParameter();
//
resu0=U0;
resu1=U1;
resv1=V1;
resv0=V0;
//
dmaxOn1 = 0.0;

View File

@@ -104,9 +104,6 @@ void IntPatch_RLine::ComputeVertexParameters(const Standard_Real )
{
Standard_Integer i,j,nbvtx;//k;
Standard_Real ParamMinOnLine,ParamMaxOnLine;
if(fipt) { ParamMinOnLine = Vertex(indf).ParameterOnLine(); } else { ParamMinOnLine = -100000.0; }
if(lapt) { ParamMaxOnLine = Vertex(indl).ParameterOnLine(); } else { ParamMaxOnLine = 100000.0; }
Standard_Boolean APointDeleted = Standard_False;
//----------------------------------------------------------
//-- F i l t r e s u r r e s t r i c t i o n s --

View File

@@ -699,13 +699,15 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
(!Domain->Has3d() && Standard_Integer(nptCh)+1 < Nbptlin);
if (!isNptLow && !IsSegment2dSmall(Brise,UMinAr,UMaxAr,tolU,tolV)) {
// treat both ends
Standard_Real UMinChP,UMaxChP,UMinArP,UMaxArP;
UMinChP = IntegerPart(UMinCh); UMinArP = IntegerPart(UMinAr);
UMaxChP = IntegerPart(UMaxCh); UMaxArP = IntegerPart(UMaxAr);
Standard_Integer irangCh1,irangCh2,irangAr1,irangAr2;
irangCh1 = Standard_Integer(UMinChP)+1; irangCh2 = Standard_Integer(UMaxChP)+1;
irangAr1 = Standard_Integer(UMinArP)+1; irangAr2 = Standard_Integer(UMaxArP)+1;
UMinChP = UMinCh - UMinChP; UMinArP = UMinAr - UMinArP;
Standard_Real UMinChP,UMinArP,UMaxArP;
UMinChP = IntegerPart(UMinCh);
UMinArP = IntegerPart(UMinAr);
UMaxArP = IntegerPart(UMaxAr);
Standard_Integer irangAr1,irangAr2;
irangAr1 = Standard_Integer(UMinArP)+1;
irangAr2 = Standard_Integer(UMaxArP)+1;
UMinChP = UMinCh - UMinChP;
UMinArP = UMinAr - UMinArP;
//UMaxChP = UMaxCh - UMaxChP; UMaxArP = UMaxAr - UMaxArP;
const Standard_Real eps = 1e-10;
// Standard_Boolean isChExtr1 = irangCh1==1 && UMinChP<eps;

View File

@@ -247,9 +247,6 @@ void IntPatch_WLine::ComputeVertexParameters(const Standard_Real RTol) {
Standard_Integer indicevertexonline;
Standard_Real indicevertex;
Standard_Real ParamMinOnLine,ParamMaxOnLine;
if(fipt) { ParamMinOnLine = Vertex(indf).ParameterOnLine(); } else { ParamMinOnLine = -100000.0; }
if(lapt) { ParamMaxOnLine = Vertex(indl).ParameterOnLine(); } else { ParamMaxOnLine = 100000.0; }
Standard_Boolean APointDeleted = Standard_False;
//----------------------------------------------------------
//-- F i l t r e s u r r e s t r i c t i o n s --