diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h index b5d691a67bf..4f7d3d5711e 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_Delaunay_triangulation_3.h @@ -884,21 +884,21 @@ public: } inline void hide_point(Cell_handle, const Point &) {} - inline void hide(Point &p, Cell_handle ch) const { + inline void hide(Point &, Cell_handle ) const { CGAL_assertion(false); } - inline void do_hide(const Point &p, Cell_handle ch) const { + inline void do_hide(const Point &, Cell_handle ) const { CGAL_assertion(false); } template < class Tester > - inline bool replace_vertex(const Point &p, Vertex_handle vh, - const Tester &tester) const { + inline bool replace_vertex(const Point &, Vertex_handle , + const Tester &) const { return true; } template - inline void hide_points(Vertex_handle vh, - const Conflict_tester & tester) { + inline void hide_points(Vertex_handle, + const Conflict_tester &) { // No points to hide in the Delaunay triangulation. } diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h index 67feb871a08..ca1b231f6f7 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_offset_3.h @@ -130,7 +130,7 @@ inline std::ostream inline std::istream &operator>>(std::istream &is, Periodic_3_offset_3 &off) { - int x,y,z; + int x=0,y=0,z=0; if (is_ascii(is)) is >> x >> y >> z; else { diff --git a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h index 40c5ff60d72..37f07696d61 100644 --- a/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/Periodic_3_triangulation_3.h @@ -718,7 +718,7 @@ private: template < class Conflict_tester, class Point_hider > Vertex_handle periodic_insert(const Point& p, const Offset& o, Locate_type lt, - Cell_handle c, int li, int lj, const Conflict_tester &tester, + Cell_handle c, const Conflict_tester &tester, Point_hider &hider, Vertex_handle vh = Vertex_handle()); template @@ -779,19 +779,22 @@ protected: Conflict_tester &tester, Point_hider &hider) { Vertex_handle new_vertex; std::vector double_vertices; - Locate_type lt = Locate_type(), lta = Locate_type(); - int li=0, lj=0, ia=0, ja=0; + Locate_type lt = Locate_type(); + int li=0, lj=0; + CGAL_assertion_code( Locate_type lta = Locate_type(); ) + CGAL_assertion_code( int ia = 0; ) + CGAL_assertion_code( int ja = 0; ) Cell_handle hint; while (begin!=end) { tester.set_point(*begin); hint = locate(*begin, Offset(), lt, li, lj, start); - if (number_of_vertices() != 0) { + CGAL_assertion_code( if (number_of_vertices() != 0) { ); CGAL_assertion(side_of_cell(*begin,Offset(), hint, lta, ia, ja) != ON_UNBOUNDED_SIDE); CGAL_assertion(lta == lt); CGAL_assertion(ia == li); CGAL_assertion(ja == lj); - } + CGAL_assertion_code( } ); new_vertex = insert_in_conflict(*begin,lt,hint,li,lj,tester,hider); if (lt == VERTEX) double_vertices.push_back(new_vertex); @@ -1362,12 +1365,15 @@ Periodic_3_triangulation_3::locate(const Point & p, const Offset &o_p, start = cells_begin(); } - cumm_off = start->offset(0) | start->offset(1) | start->offset(2) | -start->offset(3); + cumm_off = start->offset(0) | start->offset(1) + | start->offset(2) | start->offset(3); if (is_1_cover() && cumm_off != 0) { - if (((cumm_off & 4) == 4) && (p.x() < 0.5)) off_query += Offset(1,0,0); - if (((cumm_off & 2) == 2) && (p.y() < 0.5)) off_query += Offset(0,1,0); - if (((cumm_off & 1) == 1) && (p.z() < 0.5)) off_query += Offset(0,0,1); + if (((cumm_off & 4) == 4) && (FT(2)*p.x()<(_domain.xmax()-_domain.xmin()))) + off_query += Offset(1,0,0); + if (((cumm_off & 2) == 2) && (FT(2)*p.y()<(_domain.ymax()-_domain.ymin()))) + off_query += Offset(0,1,0); + if (((cumm_off & 1) == 1) && (FT(2)*p.z()<(_domain.zmax()-_domain.zmin()))) + off_query += Offset(0,0,1); } CGAL_postcondition(start!=Cell_handle()); @@ -1532,6 +1538,7 @@ inline Bounded_side Periodic_3_triangulation_3::side_of_cell( CGAL_triangulation_precondition( number_of_vertices() != 0 ); Orientation o0,o1,o2,o3; + o0 = o1 = o2 = o3 = ZERO; int cumm_off = c->offset(0) | c->offset(1) | c->offset(2) | c->offset(3); if ((cumm_off == 0) && (is_1_cover())) { @@ -1736,8 +1743,7 @@ template < class Conflict_tester, class Point_hider > inline typename Periodic_3_triangulation_3::Vertex_handle Periodic_3_triangulation_3::periodic_insert( const Point & p, const Offset& o, - Locate_type lt, Cell_handle c, int li, int, - const Conflict_tester &tester, + Locate_type lt, Cell_handle c, const Conflict_tester &tester, Point_hider &hider, Vertex_handle vh) { Vertex_handle v; @@ -2125,7 +2131,7 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point & p, } CGAL_assertion( number_of_vertices() != 0 ); CGAL_expensive_assertion(is_valid()); - Vertex_handle vh = periodic_insert(p, Offset(), lt, c, li, lj, tester, hider); + Vertex_handle vh = periodic_insert(p, Offset(), lt, c, tester, hider); if (is_1_cover()) { return vh; } @@ -2156,7 +2162,7 @@ Periodic_3_triangulation_3::insert_in_conflict(const Point & p, // be contained in the triangulation anymore. start = start_vertices[i*9+j*3+k-1]->cell(); c = locate(p, Offset(i,j,k), lt, li, lj, start); - Vertex_handle vh2 = periodic_insert(p, Offset(i,j,k), lt, c, li, lj, + Vertex_handle vh2 = periodic_insert(p, Offset(i,j,k), lt, c, tester, hider,vh); } } @@ -3308,8 +3314,8 @@ operator>> (std::istream& is, Periodic_3_triangulation_3 &tr) tr.clear(); - unsigned int n; - int cx, cy, cz; + unsigned int n=0; + int cx=0, cy=0, cz=0; Iso_cuboid domain; if (is_ascii(is)) { @@ -3367,7 +3373,7 @@ operator>> (std::istream& is, Periodic_3_triangulation_3 &tr) tr._tds.read_cells(is, V, m, C); // read offsets - int off[4]; + int off[4] = {0,0,0,0}; for (int j=0 ; j < m; j++) { if (is_ascii(is)) is >> off[0] >> off[1] >> off[2] >> off[3]; diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h index d831674958b..cd130ba53e2 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_triangulation_3.h @@ -30,7 +30,7 @@ template void -_test_periodic_3_triangulation_3_constructors(const PeriodicTriangulation &T) +_test_periodic_3_triangulation_3_constructors(const PeriodicTriangulation &) { std::cout<<"Creation"< void -_test_cls_periodic_3_triangulation_3(const PeriodicTriangulation &T, +_test_cls_periodic_3_triangulation_3(const PeriodicTriangulation &, bool ex = false, bool hom = false) { typedef PeriodicTriangulation P3T3; diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h index 74be612dbfe..62b099bb2a6 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_periodic_3_static_filters.h @@ -68,7 +68,7 @@ Point my_rand_p3() } // Random int in [0;256). -double my_rand_int(int min, int max) +int my_rand_int(int min, int max) { return r->get_int(min, max+1); } @@ -133,9 +133,9 @@ std::pair pick_coplanar( double z = p.z()+po.z() + (q.z()+qo.z() - (p.z()+po.z()))*r1 + (r.z()+ro.z() - (p.z()+po.z()))*r2; - int ix = floor(x); - int iy = floor(y); - int iz = floor(z); + int ix = static_cast(floor(x)); + int iy = static_cast(floor(y)); + int iz = static_cast(floor(z)); return std::make_pair(Point(x-floor(x),y-floor(y),z-floor(z)), Offset(ix,iy,iz));