compare with NULL, int -> size_t

This commit is contained in:
Andreas Fabri 2013-02-08 17:53:13 +01:00
parent 747d005898
commit 0fccc8a246
5 changed files with 26 additions and 25 deletions

View File

@ -155,7 +155,7 @@ void overlay (const Arrangement_on_surface_2<GeomTraitsA, TopTraitsA>& arr1,
// In case both arrangement do not contain isolated vertices, go on and // In case both arrangement do not contain isolated vertices, go on and
// overlay them. // overlay them.
const unsigned int total_iso_verts = arr1.number_of_isolated_vertices() + const std::size_t total_iso_verts = arr1.number_of_isolated_vertices() +
arr2.number_of_isolated_vertices(); arr2.number_of_isolated_vertices();
if (total_iso_verts == 0) { if (total_iso_verts == 0) {

View File

@ -1973,7 +1973,7 @@ void Trapezoidal_decomposition_2<Td_traits>
int num_of_new_nodes = 0; int num_of_new_nodes = 0;
Dag_node tmp = Dag_node tmp =
container2dag(new_array, last_index[!inc_btm ? 0 : 1], container2dag(new_array, last_index[!inc_btm ? 0 : 1],
new_array.size()-1, num_of_new_nodes); static_cast<int>(new_array.size())-1, num_of_new_nodes);
deactivate_trapezoid( *(tr.dag_node()), &tmp); //it->remove(&tmp); deactivate_trapezoid( *(tr.dag_node()), &tmp); //it->remove(&tmp);
//tmp is the root of a sub graph. //tmp is the root of a sub graph.

View File

@ -954,7 +954,8 @@ public:
CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2,
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( return compare_x_at_limit_2(
p, *dynamic_cast< const Kernel_arc_2* >(this), ce 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2,
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( return compare_x_at_limit_2(
*dynamic_cast< const Kernel_arc_2* >(this), ce1, cv2, ce2 *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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_near_limit_2,
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( return compare_x_near_limit_2(
p, *dynamic_cast< const Kernel_arc_2* >(this), ce 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_near_limit_2,
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); 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_near_boundary_2,
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( return compare_y_near_boundary_2(
*dynamic_cast< const Kernel_arc_2* >(this), cv2, ce *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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_2,
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)); 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_left_2,
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( return compare_y_at_x_left_2(
*dynamic_cast< const Kernel_arc_2* >(this), cv2, p *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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_right_2,
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( return compare_y_at_x_right_2(
*dynamic_cast< const Kernel_arc_2* >(this), cv2, p *dynamic_cast< const Kernel_arc_2* >(this), cv2, p
); );
@ -1230,7 +1231,7 @@ public:
CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Equal_2, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Equal_2,
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); 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Do_overlap_2,
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); 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Intersect_2,
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( return intersect_2(
*dynamic_cast< const Kernel_arc_2* >(this), cv2, oi *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_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); 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Split_2,
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); 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, CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Are_mergeable_2,
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( return are_mergeable_2(
*dynamic_cast< const Kernel_arc_2* >(this), cv2 *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) CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Merge_2, merge_2)
Kernel_arc_2 tmp; 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); merge_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, tmp);
return tmp; return tmp;
} }
@ -1630,7 +1631,7 @@ public:
bool trim_by_arc(const Kernel_arc_2& cv2, Kernel_arc_2& trimmed1, bool trim_by_arc(const Kernel_arc_2& cv2, Kernel_arc_2& trimmed1,
Kernel_arc_2& trimmed2) const { 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); const Kernel_arc_2& cv1 = static_cast< const Kernel_arc_2& >(*this);
@ -1929,7 +1930,7 @@ protected:
CGAL::Sign perturb = CGAL::ZERO) const { CGAL::Sign perturb = CGAL::ZERO) const {
CGAL_precondition(!is_on_bottom_top(where)); 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); Kernel_arc_2::simplify(*dynamic_cast< const Kernel_arc_2*>(this), cv2);
if(curve().is_identical(cv2.curve())) if(curve().is_identical(cv2.curve()))
return CGAL::sign(arcno() - cv2.arcno()); return CGAL::sign(arcno() - cv2.arcno());

View File

@ -496,7 +496,7 @@ public:
CGAL_precondition(q.ptr()->_m_xy); CGAL_precondition(q.ptr()->_m_xy);
CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Compare_x_2, compare_x_2) 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); return compare_x_2(*dynamic_cast< const Kernel_point_2* >(this), q);
} }
@ -518,7 +518,7 @@ public:
CGAL_precondition(q.ptr()->_m_xy); CGAL_precondition(q.ptr()->_m_xy);
CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Compare_xy_2, compare_xy_2) 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( return compare_xy_2(
*dynamic_cast< const Kernel_point_2* >(this), q, equal_x *dynamic_cast< const Kernel_point_2* >(this), q, equal_x
); );
@ -537,7 +537,7 @@ public:
CGAL_precondition(this->ptr()->_m_xy); CGAL_precondition(this->ptr()->_m_xy);
CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Is_on_2, is_on_2) 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); return is_on_2(*dynamic_cast< const Kernel_point_2* >(this), curve);
} }

View File

@ -313,13 +313,13 @@ public:
/*! Returns the number of curves defined to the left of the event. */ /*! Returns the number of curves defined to the left of the event. */
unsigned int number_of_left_curves() { unsigned int number_of_left_curves() {
return m_leftCurves.size(); return static_cast<unsigned int>(m_leftCurves.size());
} }
/*! Returns the number of curves defined to the right of the event. */ /*! Returns the number of curves defined to the right of the event. */
unsigned int number_of_right_curves() unsigned int number_of_right_curves()
{ {
return (m_rightCurves.size()); return static_cast<unsigned int>(m_rightCurves.size());
} }
/*! Checks if at least one curve is defined to the left of the event. */ /*! Checks if at least one curve is defined to the left of the event. */