Proper scope around goto labels

This commit is contained in:
Thomas Krijnen
2018-05-13 15:30:20 +02:00
parent 1ef813bf51
commit f23ffa856c
+4 -1
View File
@@ -156,7 +156,6 @@ namespace {
gp_Pnt p2 = BRep_Tool::Pnt(w21); gp_Pnt p2 = BRep_Tool::Pnt(w21);
double dist = p1.Distance(p2); double dist = p1.Distance(p2);
TopTools_IndexedDataMapOfShapeListOfShape wmap1, wmap2;
// Distance is within 2p, this is fine // Distance is within 2p, this is fine
if (dist < 2. * p_) { if (dist < 2. * p_) {
@@ -172,6 +171,9 @@ namespace {
goto check; goto check;
} }
{
TopTools_IndexedDataMapOfShapeListOfShape wmap1, wmap2;
// Find edges connected to end- and begin vertex // Find edges connected to end- and begin vertex
TopExp::MapShapesAndAncestors(w1, TopAbs_VERTEX, TopAbs_EDGE, wmap1); TopExp::MapShapesAndAncestors(w1, TopAbs_VERTEX, TopAbs_EDGE, wmap1);
TopExp::MapShapesAndAncestors(w2, TopAbs_VERTEX, TopAbs_EDGE, wmap2); TopExp::MapShapesAndAncestors(w2, TopAbs_VERTEX, TopAbs_EDGE, wmap2);
@@ -207,6 +209,7 @@ namespace {
Logger::Error("Internal error, inconsistent wire segments", inst_->entity); Logger::Error("Internal error, inconsistent wire segments", inst_->entity);
mw_.Add(w1); mw_.Add(w1);
} }
}
check: check:
if (mw_.Error() == BRepBuilderAPI_NonManifoldWire) { if (mw_.Error() == BRepBuilderAPI_NonManifoldWire) {