From 92a037a4507da1e7ee188ab00acec12ea58bb74d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 22 Jun 2010 09:38:32 +0000 Subject: [PATCH] Some int->size_t. Perform static_cast as Polynomial degree is bound by int not size_t --- Nef_2/include/CGAL/Nef_2/PM_const_decorator.h | 10 +++++----- Nef_2/include/CGAL/Nef_2/PM_io_parser.h | 2 +- Nef_2/include/CGAL/Nef_2/PM_point_locator.h | 4 ++-- Nef_2/include/CGAL/Nef_2/Polynomial.h | 6 +++--- Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h index 823b3a95cf3..7815cec05e7 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_const_decorator.h @@ -472,10 +472,10 @@ check_integrity_and_topological_planarity(bool faces) const first=false; } - int v_num = number_of_vertices() - iso_vert_num; - int e_num = number_of_edges(); - int c_num = number_of_connected_components() - iso_vert_num; - int f_num = number_of_face_cycles() - c_num + 1; + std::size_t v_num = number_of_vertices() - iso_vert_num; + std::size_t e_num = number_of_edges(); + std::size_t c_num = number_of_connected_components() - iso_vert_num; + std::size_t f_num = number_of_face_cycles() - c_num + 1; CGAL_NEF_TRACEV(fc_num);CGAL_NEF_TRACEV(iv_num);CGAL_NEF_TRACEV(iso_vert_num); CGAL_NEF_TRACEV(v_num);CGAL_NEF_TRACEV(e_num);CGAL_NEF_TRACEV(c_num);CGAL_NEF_TRACEV(f_num); // CGAL_assertion(fc_num == f_num && iv_num == iso_vert_num); @@ -492,7 +492,7 @@ typename PM_const_decorator::Size_type PM_const_decorator:: number_of_face_cycles() const { - unsigned int fc_num=0; + Size_type fc_num=0; CGAL::Unique_hash_map visited; // init with bool() == false Halfedge_const_iterator eit = phds->halfedges_begin(); diff --git a/Nef_2/include/CGAL/Nef_2/PM_io_parser.h b/Nef_2/include/CGAL/Nef_2/PM_io_parser.h index 81316c6ad9e..b30e09afa8c 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_io_parser.h +++ b/Nef_2/include/CGAL/Nef_2/PM_io_parser.h @@ -87,7 +87,7 @@ class PM_io_parser : public PMDEC std::vector Halfedge_of; std::vector Face_of; // object mapping for input - int vn,en,fn,i; + std::size_t vn,en,fn,i; // the number of objects diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 50c2d26105b..51cae9ab1b6 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -798,9 +798,9 @@ public: } CGAL_NEF_TRACEN("current = " << current); - if(current == VERTEX) + if(current == VERTEX){ CGAL_NEF_TRACEN(point(v)); - + } while (true) switch ( current ) { case VERTEX: { CGAL_NEF_TRACEN("vertex "< class Polynomial : /*{\Mop a random access iterator pointing beyond $a_d$.}*/ int degree() const - { return this->ptr()->coeff.size()-1; } + { return static_cast(this->ptr()->coeff.size())-1; } /*{\Mop the degree of the polynomial.}*/ const NT& operator[](unsigned int i) const @@ -658,7 +658,7 @@ class Polynomial : /*{\Xop a random access iterator pointing beyond $a_d$.}*/ int degree() const - { return this->ptr()->coeff.size()-1; } + { return static_cast(this->ptr()->coeff.size())-1; } /*{\Xop the degree of the polynomial.}*/ const int& operator[](unsigned int i) const @@ -959,7 +959,7 @@ determines the sign for the limit process $x \rightarrow \infty$. /*{\Xop a random access iterator pointing beyond $a_d$.}*/ int degree() const - { return this->ptr()->coeff.size()-1; } + { return static_cast(this->ptr()->coeff.size())-1; } /*{\Xop the degree of the polynomial.}*/ const double& operator[](unsigned int i) const diff --git a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h index 618d0042faa..546aa367575 100644 --- a/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h +++ b/Nef_2/include/CGAL/Nef_2/Segment_overlay_traits.h @@ -107,7 +107,7 @@ public: return s; s = K.orientation(s2,K.target(s1)); - if (s==0) return ( is1 - is2 ); + if (s==0) return static_cast( is1 - is2 ); // overlapping segments are not equal return s; }