Some int->size_t. Perform static_cast<int> as Polynomial degree is bound by int not size_t

This commit is contained in:
Andreas Fabri 2010-06-22 09:38:32 +00:00
parent 93a7d05699
commit 92a037a450
5 changed files with 12 additions and 12 deletions

View File

@ -472,10 +472,10 @@ check_integrity_and_topological_planarity(bool faces) const
first=false; first=false;
} }
int v_num = number_of_vertices() - iso_vert_num; std::size_t v_num = number_of_vertices() - iso_vert_num;
int e_num = number_of_edges(); std::size_t e_num = number_of_edges();
int c_num = number_of_connected_components() - iso_vert_num; std::size_t c_num = number_of_connected_components() - iso_vert_num;
int f_num = number_of_face_cycles() - c_num + 1; 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(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_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); // CGAL_assertion(fc_num == f_num && iv_num == iso_vert_num);
@ -492,7 +492,7 @@ typename PM_const_decorator<HDS>::Size_type
PM_const_decorator<HDS>:: PM_const_decorator<HDS>::
number_of_face_cycles() const number_of_face_cycles() const
{ {
unsigned int fc_num=0; Size_type fc_num=0;
CGAL::Unique_hash_map<Halfedge_const_handle,bool> visited; CGAL::Unique_hash_map<Halfedge_const_handle,bool> visited;
// init with bool() == false // init with bool() == false
Halfedge_const_iterator eit = phds->halfedges_begin(); Halfedge_const_iterator eit = phds->halfedges_begin();

View File

@ -87,7 +87,7 @@ class PM_io_parser : public PMDEC
std::vector<Halfedge_handle> Halfedge_of; std::vector<Halfedge_handle> Halfedge_of;
std::vector<Face_handle> Face_of; std::vector<Face_handle> Face_of;
// object mapping for input // object mapping for input
int vn,en,fn,i; std::size_t vn,en,fn,i;
// the number of objects // the number of objects

View File

@ -798,9 +798,9 @@ public:
} }
CGAL_NEF_TRACEN("current = " << current); CGAL_NEF_TRACEN("current = " << current);
if(current == VERTEX) if(current == VERTEX){
CGAL_NEF_TRACEN(point(v)); CGAL_NEF_TRACEN(point(v));
}
while (true) switch ( current ) { while (true) switch ( current ) {
case VERTEX: case VERTEX:
{ CGAL_NEF_TRACEN("vertex "<<CT.point(v)); { CGAL_NEF_TRACEN("vertex "<<CT.point(v));

View File

@ -324,7 +324,7 @@ template <class pNT> class Polynomial :
/*{\Mop a random access iterator pointing beyond $a_d$.}*/ /*{\Mop a random access iterator pointing beyond $a_d$.}*/
int degree() const int degree() const
{ return this->ptr()->coeff.size()-1; } { return static_cast<int>(this->ptr()->coeff.size())-1; }
/*{\Mop the degree of the polynomial.}*/ /*{\Mop the degree of the polynomial.}*/
const NT& operator[](unsigned int i) const const NT& operator[](unsigned int i) const
@ -658,7 +658,7 @@ class Polynomial<int> :
/*{\Xop a random access iterator pointing beyond $a_d$.}*/ /*{\Xop a random access iterator pointing beyond $a_d$.}*/
int degree() const int degree() const
{ return this->ptr()->coeff.size()-1; } { return static_cast<int>(this->ptr()->coeff.size())-1; }
/*{\Xop the degree of the polynomial.}*/ /*{\Xop the degree of the polynomial.}*/
const int& operator[](unsigned int i) const 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$.}*/ /*{\Xop a random access iterator pointing beyond $a_d$.}*/
int degree() const int degree() const
{ return this->ptr()->coeff.size()-1; } { return static_cast<int>(this->ptr()->coeff.size())-1; }
/*{\Xop the degree of the polynomial.}*/ /*{\Xop the degree of the polynomial.}*/
const double& operator[](unsigned int i) const const double& operator[](unsigned int i) const

View File

@ -107,7 +107,7 @@ public:
return s; return s;
s = K.orientation(s2,K.target(s1)); s = K.orientation(s2,K.target(s1));
if (s==0) return ( is1 - is2 ); if (s==0) return static_cast<int>( is1 - is2 );
// overlapping segments are not equal // overlapping segments are not equal
return s; return s;
} }