Skip to content

Commit

Permalink
No code after unreachable()
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Sep 30, 2024
1 parent 071a9c2 commit c26dd87
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,6 @@ Aff_transformation_repH2<R>::homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT(0);
}

template < class R >
Expand Down Expand Up @@ -920,7 +919,6 @@ Translation_repH2<R>::homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT(0);
}

template < class R >
Expand Down Expand Up @@ -955,7 +953,6 @@ Translation_repH2<R>::cartesian(int i, int j) const
}
}
CGAL_unreachable();
return FT(0);
}

template < class R >
Expand Down Expand Up @@ -991,7 +988,6 @@ homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT(0);
}

template < class R >
Expand Down Expand Up @@ -1027,7 +1023,6 @@ cartesian(int i, int j) const
}
}
CGAL_unreachable();
return FT(0);
}

template < class R >
Expand Down Expand Up @@ -1063,7 +1058,6 @@ homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT(0);
}

template <class R>
Expand Down Expand Up @@ -1099,7 +1093,6 @@ cartesian(int i, int j) const
}
}
CGAL_unreachable();
return FT(0);
}

template < class R >
Expand Down Expand Up @@ -1136,7 +1129,6 @@ homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT(0);
}

template <class R>
Expand Down Expand Up @@ -1173,7 +1165,6 @@ cartesian(int i, int j) const
}
}
CGAL_unreachable();
return FT(0);
}

} //namespace CGAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT0;
}

template < class R >
Expand Down Expand Up @@ -895,7 +894,6 @@ Translation_repH3<R>::homogeneous(int i, int j) const
}
}
CGAL_unreachable();
return RT0;
}

template < class R >
Expand Down
3 changes: 1 addition & 2 deletions Intersections_2/include/CGAL/Intersections_2/Ray_2_Ray_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ Ray_2_Ray_2_pair<K>::intersection_type() const
}
}
default:
CGAL_unreachable(); // should not be reached:
return _result;
CGAL_unreachable();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ Ray_2_Segment_2_pair<K>::intersection_type() const
}
}
default:
CGAL_unreachable(); // should not be reached:
return _result;
CGAL_unreachable();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ seg_seg_do_intersect_crossing(
CGAL_unreachable();
}
CGAL_unreachable();
return S2S2_inter_info(false);
}

// used internally by Arr_segment_traits_2template <class K>
Expand Down Expand Up @@ -204,7 +203,6 @@ seg_seg_do_intersect_contained(
CGAL_unreachable();
}
CGAL_unreachable();
return S2S2_inter_info(false);
}

// used internally by Arr_segment_traits_2
Expand Down Expand Up @@ -321,7 +319,6 @@ do_intersect_with_info(const typename K::Segment_2 &seg1,
}

CGAL_unreachable();
return S2S2_inter_info(false);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ do_intersect(const typename K::Triangle_3& t,
case POSITIVE: return (orientation(p,q,c,a) != NEGATIVE);
case NEGATIVE: return (orientation(p,q,c,a) != POSITIVE);
case COPLANAR: return true;
default: // should not happen.
default:
CGAL_unreachable();
return false;
}
default: // should not happen.
default:
CGAL_unreachable();
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ do_intersect(const typename K::Triangle_3& t,
return true;
default:// should not happen.
CGAL_unreachable();
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ do_intersect(const typename K::Triangle_3& t,
case COLLINEAR: return true;
default: // should not happen.
CGAL_unreachable();
return false;
}
default: // should not happen.
CGAL_unreachable();
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ do_intersect_coplanar(const typename K::Triangle_3& t,
// a is isolated on the positive side
return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE);

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}

case NEGATIVE:
Expand All @@ -166,9 +165,8 @@ do_intersect_coplanar(const typename K::Triangle_3& t,
// a is isolated on the negative side
return visitor.result(coplanar_orientation(*b,*a,p) != POSITIVE);

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}

case COLLINEAR:
Expand All @@ -191,14 +189,12 @@ do_intersect_coplanar(const typename K::Triangle_3& t,
return visitor.result(coplanar_orientation(*a,*c,p) != POSITIVE);
// case pqc == COLLINEAR is imposiible

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}
}

Expand Down Expand Up @@ -263,9 +259,8 @@ do_intersect(const typename K::Triangle_3& t,
return visitor.result(true);
}
// case COPLANAR: should not happen
default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}

case NEGATIVE:
Expand Down Expand Up @@ -293,9 +288,8 @@ do_intersect(const typename K::Triangle_3& t,

// case COPLANAR: should not happen

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}

case COPLANAR: // p belongs to the triangle's supporting plane
Expand All @@ -317,14 +311,12 @@ do_intersect(const typename K::Triangle_3& t,

// case COPLANAR: should not happen

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}

default: // should not happen.
default:
CGAL_unreachable();
return visitor.result(false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
// a is isolated on the positive side
return coplanar_orientation(*a,*b,q) != NEGATIVE
&& coplanar_orientation(*c,*a,p) != NEGATIVE;
default:// should not happen.
default:
CGAL_unreachable();
return false;
}
case NEGATIVE:
switch ( pqb ) {
Expand Down Expand Up @@ -109,9 +108,8 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
return coplanar_orientation(*a,*b,p) != NEGATIVE
&& coplanar_orientation(*c,*a,q) != NEGATIVE;

default:// should not happen.
default:
CGAL_unreachable();
return false;
}
case COLLINEAR:
switch ( pqb ) {
Expand Down Expand Up @@ -139,14 +137,11 @@ bool do_intersect_coplanar(const typename K::Point_3& A,
// case pqc == COLLINEAR is impossible since the triangle is
// assumed to be non flat

default:// should not happen.
default:
CGAL_unreachable();
return false;

}
default:// should not happen.
default:
CGAL_unreachable();
return false;
}
}

Expand Down Expand Up @@ -215,9 +210,8 @@ do_intersect(const typename K::Triangle_3& t,
return orientation(p,q,a,b) != POSITIVE
&& orientation(p,q,b,c) != POSITIVE
&& orientation(p,q,c,a) != POSITIVE;
default: // should not happen.
default:
CGAL_unreachable();
return false;
}
case NEGATIVE:
switch ( abcq ) {
Expand All @@ -237,9 +231,8 @@ do_intersect(const typename K::Triangle_3& t,
&& orientation(q,p,b,c) != POSITIVE
&& orientation(q,p,c,a) != POSITIVE;

default: // should not happen.
default:
CGAL_unreachable();
return false;
}
case COPLANAR: // p belongs to the triangle's supporting plane
switch ( abcq ) {
Expand All @@ -259,13 +252,11 @@ do_intersect(const typename K::Triangle_3& t,
// supporting plane
return do_intersect_coplanar(t,s,k);

default: // should not happen.
default:
CGAL_unreachable();
return false;
}
default: // should not happen.
default:
CGAL_unreachable();
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,18 @@ do_intersect(const typename K::Triangle_3& t1,

case COPLANAR:
return do_intersect_coplanar(t1,t2,k);
default: // should not happen.
default:
CGAL_unreachable();
return false;
}
break;

default: // should not happen.
default:
CGAL_unreachable();
return false;
}
break;

default: // should not happen.
default:
CGAL_unreachable();
return false;
}

const Point_3* s_min2;
Expand Down Expand Up @@ -430,21 +427,18 @@ do_intersect(const typename K::Triangle_3& t1,
// since the triangles are assumed to be non-flat

return do_intersect_coplanar(t1,t2,k);
default: // should not happen.
default:
CGAL_unreachable();
return false;
}
break;

default: // should not happen.
default:
CGAL_unreachable();
return false;
}
break;

default: // should not happen.
default:
CGAL_unreachable();
return false;
}

return (orientation(*s_min1,*t_min1,*s_min2,*t_min2) != POSITIVE) &&
Expand Down
1 change: 0 additions & 1 deletion Kinetic_space_partition/include/CGAL/KSP_3/Finalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ class Finalizer {
}

CGAL_unreachable();
return false;
}

IVertex non_collinear_vertex(const PFace& pface, const IEdge& iedge) const {
Expand Down
1 change: 0 additions & 1 deletion Mesh_3/include/CGAL/Mesh_3/Robust_intersection_traits_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ ts_intersection(const typename K::Triangle_3 &t,
return result_type();
default:
CGAL_unreachable();
return result_type();
}
}
}
Expand Down
Loading

0 comments on commit c26dd87

Please sign in to comment.