From 1d47b96e3c4ec2c4d1d33739643b0ce5055a20f8 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Thu, 20 Mar 2008 16:46:25 +0000 Subject: [PATCH] Remove more useless enum_cast<>. --- .../include/CGAL/Arr_geometry_traits/Arr_plane_3.h | 2 +- .../internal_functions_on_circular_arc_2.h | 2 +- .../include/CGAL/Static_filters/Compare_y_at_x_2.h | 4 ++-- .../internal_functions_comparison_root_of_2.h | 10 +++++----- .../include/CGAL/certified_numeric_predicates.h | 2 +- .../CGAL/predicates/Straight_skeleton_pred_ftC2.h | 2 +- .../CGAL/predicates/Regular_triangulation_ftC2.h | 10 +++++----- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h index b5639932113..6b8abfc4d61 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Arr_plane_3.h @@ -194,7 +194,7 @@ public: */ Oriented_side oriented_side(const Point_3 & p) const { - return enum_cast(CGAL_NTS sign(m_a*p.x() + m_b*p.y() + m_c*p.z())); + return CGAL_NTS sign(m_a*p.x() + m_b*p.y() + m_c*p.z()); } }; diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h index baf19130713..f8d6b0007f6 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_circular_arc_2.h @@ -89,7 +89,7 @@ namespace CircularFunctors { const Root_of_2 a01 = qy-py; const Root_of_2 a10 = rx-px; const Root_of_2 a11 = ry-py; - return enum_cast(CGAL_NTS compare(a00*a11, a10*a01)); + return CGAL_NTS compare(a00*a11, a10*a01); } // template < class CK > diff --git a/Filtered_kernel/include/CGAL/Static_filters/Compare_y_at_x_2.h b/Filtered_kernel/include/CGAL/Static_filters/Compare_y_at_x_2.h index 77cace31c00..e4df1be35ed 100644 --- a/Filtered_kernel/include/CGAL/Static_filters/Compare_y_at_x_2.h +++ b/Filtered_kernel/include/CGAL/Static_filters/Compare_y_at_x_2.h @@ -51,9 +51,9 @@ public: (less_x(s.source(), p) && less_x(s.target(), p)) ) ); if( less_x( s.source(), s.target() ) ) - return enum_cast(orientation(p, s.source(), s.target() )); + return orientation(p, s.source(), s.target()); else if ( less_x( s.target(), s.source() ) ) - return enum_cast(orientation(p, s.target(), s.source() )); + return orientation(p, s.target(), s.source()); else { if( less_y(p, s.source()) && less_y(p, s.target()) ) return SMALLER; diff --git a/Number_types/include/CGAL/Number_types/internal_functions_comparison_root_of_2.h b/Number_types/include/CGAL/Number_types/internal_functions_comparison_root_of_2.h index 5924663e1ac..fb84e3934ad 100644 --- a/Number_types/include/CGAL/Number_types/internal_functions_comparison_root_of_2.h +++ b/Number_types/include/CGAL/Number_types/internal_functions_comparison_root_of_2.h @@ -58,7 +58,7 @@ compare_21_11(const FT& A2, const FT& B2, const FT& C2, FT p2 = B1 * (A1*B2 - A2*B1) - C2 * CGAL_NTS square(A1); - return enum_cast(CGAL_NTS sign(p2)); + return CGAL_NTS sign(p2); } /*2 2*/template @@ -97,7 +97,7 @@ compare_22_21( const FT& A1p, const FT& B1p, const FT& C1p, FT P4 = calcP4(J,Jp,A1,C1,A2,C2); - return enum_cast(- CGAL_NTS sign(P4)); + return - CGAL_NTS sign(P4); // if ( P4< FT(0) ) return LARGER; // r1 > l2 // if ( P4> FT(0) ) return SMALLER; // r1 < l2 // return EQUAL; @@ -111,7 +111,7 @@ compare_22_12( const FT& A1, const FT& B1, const FT& C1, // _22_12 boils down to _22_21 by : // - swapping the two polynomials // - changing the sign of the result - return opposite(compare_22_21(A2, B2, C2, A1, B1, C1)); + return - compare_22_21(A2, B2, C2, A1, B1, C1); } /*2 2*/template @@ -155,7 +155,7 @@ compare_22_11( const FT& A1p, const FT& B1p, const FT& C1p, FT P4 = calcP4(I1,I2,K); - return enum_cast(CGAL_NTS sign(P4)); + return CGAL_NTS sign(P4); } // J <= 0 @@ -173,7 +173,7 @@ compare_22_11( const FT& A1p, const FT& B1p, const FT& C1p, FT P4 = calcP4(I1,I2,K); - return enum_cast(- CGAL_NTS sign(P4)); + return - CGAL_NTS sign(P4); } /*2 2*/template inline diff --git a/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h b/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h index 17b2f49a8e4..61055e1b30a 100644 --- a/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h +++ b/Straight_skeleton_2/include/CGAL/certified_numeric_predicates.h @@ -136,7 +136,7 @@ inline Uncertain certified_sign_of_determinant2x2( const NT& a00 , const NT& a11 ) { - return enum_cast(certified_compare(a00*a11, a10*a01)) ; + return certified_compare(a00*a11, a10*a01) ; } CGAL_END_NAMESPACE diff --git a/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h b/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h index 3b91591222b..18932f920b5 100644 --- a/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h +++ b/Straight_skeleton_2/include/CGAL/predicates/Straight_skeleton_pred_ftC2.h @@ -400,7 +400,7 @@ oriented_side_of_event_point_wrt_bisectorC2 ( intrusive_ptr< Trisegment_2 > c , a, b, c ); - rResult = enum_cast(certified_side_of_oriented_lineC2(a,b,c,p.x(),p.y())); + rResult = certified_side_of_oriented_lineC2(a,b,c,p.x(),p.y()); CGAL_STSKEL_TRAITS_TRACE("Point is at " << rResult << " side of degenerate bisector through v01 " << p2str(v01)) ; } diff --git a/Triangulation_2/include/CGAL/predicates/Regular_triangulation_ftC2.h b/Triangulation_2/include/CGAL/predicates/Regular_triangulation_ftC2.h index b4a738f90c6..a0239ed7b55 100644 --- a/Triangulation_2/include/CGAL/predicates/Regular_triangulation_ftC2.h +++ b/Triangulation_2/include/CGAL/predicates/Regular_triangulation_ftC2.h @@ -59,9 +59,9 @@ power_testC2( const FT &px, const FT &py, const FT &pwt, FT dry = ry - ty; FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt; - return enum_cast(sign_of_determinant3x3(dpx, dpy, dpz, - dqx, dqy, dqz, - drx, dry, drz)); + return sign_of_determinant3x3(dpx, dpy, dpz, + dqx, dqy, dqz, + drx, dry, drz); } @@ -82,11 +82,11 @@ power_testC2( const FT &px, const FT &py, const FT &pwt, // We do an orthogonal projection on the (x) axis, if possible. Comparison_result cmpx = CGAL_NTS compare(px, qx); if (cmpx != EQUAL) - return Oriented_side(cmpx * sign_of_determinant2x2(dpx, dpz, dqx, dqz)); + return cmpx * sign_of_determinant2x2(dpx, dpz, dqx, dqz); // If not possible, then on the (y) axis. Comparison_result cmpy = CGAL_NTS compare(py, qy); - return Oriented_side(cmpy * sign_of_determinant2x2(dpy, dpz, dqy, dqz)); + return cmpy * sign_of_determinant2x2(dpy, dpz, dqy, dqz); } CGAL_END_NAMESPACE