diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h index de3f6434e0e..771d9988465 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_overlay_2.h @@ -155,8 +155,8 @@ void overlay (const Arrangement_on_surface_2& arr1, // In case both arrangement do not contain isolated vertices, go on and // overlay them. - const unsigned int total_iso_verts = arr1.number_of_isolated_vertices() + - arr2.number_of_isolated_vertices(); + const std::size_t total_iso_verts = arr1.number_of_isolated_vertices() + + arr2.number_of_isolated_vertices(); if (total_iso_verts == 0) { // Clear the result arrangement and perform the sweep to construct it. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h index 10b3cf0355b..254b5a67fba 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -1973,7 +1973,7 @@ void Trapezoidal_decomposition_2 int num_of_new_nodes = 0; Dag_node tmp = container2dag(new_array, last_index[!inc_btm ? 0 : 1], - new_array.size()-1, num_of_new_nodes); + static_cast(new_array.size())-1, num_of_new_nodes); deactivate_trapezoid( *(tr.dag_node()), &tmp); //it->remove(&tmp); //tmp is the root of a sub graph. diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index 8669bbc4f99..723a2473ff7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -954,7 +954,8 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2, compare_x_at_limit_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + // compare with NULL, in order to avoid a performance warning with VC++ + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_x_at_limit_2( p, *dynamic_cast< const Kernel_arc_2* >(this), ce ); @@ -981,7 +982,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2, compare_x_at_limit_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_x_at_limit_2( *dynamic_cast< const Kernel_arc_2* >(this), ce1, cv2, ce2 ); @@ -1007,7 +1008,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_near_limit_2, compare_x_near_limit_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_x_near_limit_2( p, *dynamic_cast< const Kernel_arc_2* >(this), ce ); @@ -1032,7 +1033,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_near_limit_2, compare_x_near_limit_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_x_near_limit_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, ce); } @@ -1056,7 +1057,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_near_boundary_2, compare_y_near_boundary_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_y_near_boundary_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, ce ); @@ -1077,7 +1078,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_2, compare_y_at_x_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_y_at_x_2(p, *dynamic_cast< const Kernel_arc_2* >(this)); } @@ -1102,7 +1103,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_left_2, compare_y_at_x_left_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_y_at_x_left_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, p ); @@ -1129,7 +1130,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_right_2, compare_y_at_x_right_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return compare_y_at_x_right_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, p ); @@ -1230,7 +1231,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Equal_2, equal_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return equal_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2); } @@ -1245,7 +1246,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Do_overlap_2, do_overlap_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return do_overlap_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2); } @@ -1327,7 +1328,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Intersect_2, intersect_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return intersect_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, oi ); @@ -1430,7 +1431,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Trim_2, trim_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return trim_2(*dynamic_cast< const Kernel_arc_2* >(this), p, q); } @@ -1447,7 +1448,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Split_2, split_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); split_2(*dynamic_cast< const Kernel_arc_2* >(this), p, s1, s2); } @@ -1462,7 +1463,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Are_mergeable_2, are_mergeable_2) - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); return are_mergeable_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2 ); @@ -1481,7 +1482,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Merge_2, merge_2) Kernel_arc_2 tmp; - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); merge_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, tmp); return tmp; } @@ -1630,7 +1631,7 @@ public: bool trim_by_arc(const Kernel_arc_2& cv2, Kernel_arc_2& trimmed1, Kernel_arc_2& trimmed2) const { - CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_arc_2* >(this) != NULL); const Kernel_arc_2& cv1 = static_cast< const Kernel_arc_2& >(*this); @@ -1929,7 +1930,7 @@ protected: CGAL::Sign perturb = CGAL::ZERO) const { CGAL_precondition(!is_on_bottom_top(where)); - CGAL_assertion(dynamic_cast< const Kernel_arc_2*>(this)); + CGAL_assertion(dynamic_cast< const Kernel_arc_2*>(this) != NULL); Kernel_arc_2::simplify(*dynamic_cast< const Kernel_arc_2*>(this), cv2); if(curve().is_identical(cv2.curve())) return CGAL::sign(arcno() - cv2.arcno()); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index 52e3ca560b6..b2826173d5d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -496,7 +496,7 @@ public: CGAL_precondition(q.ptr()->_m_xy); CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Compare_x_2, compare_x_2) - CGAL_precondition(dynamic_cast< const Kernel_point_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_point_2* >(this) != NULL); return compare_x_2(*dynamic_cast< const Kernel_point_2* >(this), q); } @@ -518,7 +518,7 @@ public: CGAL_precondition(q.ptr()->_m_xy); CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Compare_xy_2, compare_xy_2) - CGAL_precondition(dynamic_cast< const Kernel_point_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_point_2* >(this) != NULL); return compare_xy_2( *dynamic_cast< const Kernel_point_2* >(this), q, equal_x ); @@ -537,7 +537,7 @@ public: CGAL_precondition(this->ptr()->_m_xy); CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Is_on_2, is_on_2) - CGAL_precondition(dynamic_cast< const Kernel_point_2* >(this)); + CGAL_precondition(dynamic_cast< const Kernel_point_2* >(this) != NULL); return is_on_2(*dynamic_cast< const Kernel_point_2* >(this), curve); } diff --git a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h index b90756b2859..d25c4684d42 100644 --- a/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h +++ b/Arrangement_on_surface_2/include/CGAL/Sweep_line_2/Sweep_line_event.h @@ -313,13 +313,13 @@ public: /*! Returns the number of curves defined to the left of the event. */ unsigned int number_of_left_curves() { - return m_leftCurves.size(); + return static_cast(m_leftCurves.size()); } /*! Returns the number of curves defined to the right of the event. */ unsigned int number_of_right_curves() { - return (m_rightCurves.size()); + return static_cast(m_rightCurves.size()); } /*! Checks if at least one curve is defined to the left of the event. */