1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024172: Compiler warnings 'unreacheable code' and 'unreferenced local function' in OCAF

Files _Sample.cxx containing unused sample code are removed from several OCAF packages.
Cycles for() with body always ending with 'break' are replaced by equivalent if() statements.
This commit is contained in:
szy
2013-09-30 15:53:00 +04:00
committed by bugmaster
parent eb4320f2d9
commit b2197f9397
12 changed files with 16 additions and 1223 deletions

View File

@@ -984,18 +984,14 @@ Standard_Boolean TNaming::OuterWire(const TopoDS_Face& theFace, TopoDS_Wire& the
//purpose :
//=======================================================================
static Standard_Boolean IsInternal(const TopoDS_Shape& aSx)
{
Standard_Boolean bInternal;
TopAbs_Orientation aOr;
TopoDS_Iterator aIt;
bInternal = Standard_False;
aIt.Initialize(aSx);
for (; aIt.More(); aIt.Next())
{
const TopoDS_Shape& aSy=aIt.Value();
aOr=aSy.Orientation();
bInternal = (aOr == TopAbs_INTERNAL || aOr == TopAbs_EXTERNAL);
break;
{
TopAbs_Orientation aOr;
Standard_Boolean bInternal(Standard_False);
TopoDS_Iterator aIt(aSx);
if(aIt.More()) {
const TopoDS_Shape& aSy = aIt.Value();
aOr = aSy.Orientation();
bInternal = (aOr == TopAbs_INTERNAL || aOr == TopAbs_EXTERNAL);
}
return bInternal;
}

View File

@@ -314,12 +314,10 @@ void TNaming_Localizer::GoBack (const TopoDS_Shape& S,
//-----------------------------------------------------------
// Pas d'ascendants => Recherche et exploration du contenant
//----------------------------------------------------------
TDF_Label Father = Lab.Father();
const TDF_Label& Father = Lab.Father();
TNaming_Iterator itLab(Father);
for (; itLab.More(); itLab.Next()) {
Sol = itLab.OldShape();
break;
}
if(itLab.More())
Sol = itLab.OldShape();
//-------------------------------------------
// Recherche des ancetres dans des features.
//-------------------------------------------

View File

@@ -1086,7 +1086,7 @@ static TopoDS_Shape FindShape(const TNaming_DataMapOfShapeMapOfShape& DM)
if(aNum < 1) return aResult;
TopTools_ListOfShape List;
TNaming_DataMapIteratorOfDataMapOfShapeMapOfShape it(DM);
for (;it.More();it.Next()) {
if(it.More()) {
const TopoDS_Shape& aKey1 = it.Key();
const TNaming_MapOfShape& aMap = it.Value();
@@ -1104,7 +1104,6 @@ static TopoDS_Shape FindShape(const TNaming_DataMapOfShapeMapOfShape& DM)
if(isCand)
List.Append(aS);
}
break;
}
if(List.IsEmpty()) return aResult;
if(List.Extent() == 1) return List.First();

View File

@@ -553,12 +553,10 @@ static Standard_Boolean TestSolution(const TNaming_Scope& MDF,
static void FindNewShapeInFather (const Handle(TNaming_NamedShape)& NS,
TopoDS_Shape& SC)
{
TDF_Label Father = NS->Label().Father();
const TDF_Label& Father = NS->Label().Father();
TNaming_Iterator itLab(Father);
for (; itLab.More(); itLab.Next()) {
SC= itLab.NewShape();
break;
}
if(itLab.More())
SC = itLab.NewShape();
}
//=======================================================================