From 2d4e7626730c8d0bac51e9610d60f47738095b1f Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Thu, 17 May 2001 08:53:34 +0000 Subject: [PATCH] - Fix BCC/KCC warning. --- Packages/Triangulation_3/changes.txt | 1 + .../include/CGAL/Regular_triangulation_3.h | 2 +- .../include/CGAL/Triangulation_cell_3.h | 2 +- .../include/CGAL/Triangulation_handles_3.h | 83 ++++++++----------- .../include/CGAL/Triangulation_vertex_3.h | 2 +- 5 files changed, 40 insertions(+), 50 deletions(-) diff --git a/Packages/Triangulation_3/changes.txt b/Packages/Triangulation_3/changes.txt index dfeeb16c16d..e598c054ffa 100644 --- a/Packages/Triangulation_3/changes.txt +++ b/Packages/Triangulation_3/changes.txt @@ -1,5 +1,6 @@ Version 1.51 (?? May 01) - even more for() scope VC++ bug workarounds. +- fix BCC/KCC warning. Version 1.50 (4 May 01) - Fix recently introduced bug in the hierarchy when dimension() < 3. diff --git a/Packages/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Packages/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 344a47ba6e3..fa93ead57b3 100644 --- a/Packages/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Packages/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -154,7 +154,7 @@ private: bool operator()(const typename Tds::Cell *c) const { // We mark the vertices so that we can find the deleted ones easily. - if (t->in_conflict_3(p, (const Cell_handle)(const Cell*)c)) + if (t->in_conflict_3(p, (Cell_handle)(Cell*)c)) { for (int i=0; i<4; i++) { diff --git a/Packages/Triangulation_3/include/CGAL/Triangulation_cell_3.h b/Packages/Triangulation_3/include/CGAL/Triangulation_cell_3.h index ac510d5de97..ef94ed1812e 100644 --- a/Packages/Triangulation_3/include/CGAL/Triangulation_cell_3.h +++ b/Packages/Triangulation_3/include/CGAL/Triangulation_cell_3.h @@ -134,7 +134,7 @@ public: return Ctds::has_neighbor( &(*c), i); } - Cell_handle handle() const + Cell_handle handle() { return Cell_handle(this); } diff --git a/Packages/Triangulation_3/include/CGAL/Triangulation_handles_3.h b/Packages/Triangulation_3/include/CGAL/Triangulation_handles_3.h index 65aeda9d794..ea0f03f3889 100644 --- a/Packages/Triangulation_3/include/CGAL/Triangulation_handles_3.h +++ b/Packages/Triangulation_3/include/CGAL/Triangulation_handles_3.h @@ -28,61 +28,51 @@ #include #include #include - + #include CGAL_BEGIN_NAMESPACE -template < class Gt, class Tds > -class Triangulation_cell_3; - -template < class Gt, class Tds > -class Triangulation_vertex_3; - -template < class Gt, class Tds> -class Triangulation_cell_iterator_3; - -template < class Gt, class Tds> -class Triangulation_vertex_iterator_3; - -template < class Gt, class Tds> -class Triangulation_cell_circulator_3; +template < class Gt, class Tds > class Triangulation_cell_3; +template < class Gt, class Tds > class Triangulation_vertex_3; +template < class Gt, class Tds > class Triangulation_cell_iterator_3; +template < class Gt, class Tds > class Triangulation_vertex_iterator_3; +template < class Gt, class Tds > class Triangulation_cell_circulator_3; template < class Gt, class Tds> class Triangulation_vertex_handle_3 - :public Pointer > + : public Pointer > { public: - typedef Pointer > Ptr; - typedef Triangulation_vertex_3 Vertex; - typedef Triangulation_vertex_handle_3 Vertex_handle; - - typedef Triangulation_vertex_iterator_3 Vertex_iterator; - + typedef Pointer > Ptr; + typedef Triangulation_vertex_3 Vertex; + typedef Triangulation_vertex_handle_3 Vertex_handle; + + typedef Triangulation_vertex_iterator_3 Vertex_iterator; + Triangulation_vertex_handle_3() : Ptr(NULL) {} - Triangulation_vertex_handle_3(const Vertex* v) - : Ptr((Vertex*)v) - {} + Triangulation_vertex_handle_3(Vertex * v) + : Ptr(v) + {} Triangulation_vertex_handle_3(const Vertex_iterator & vit) : Ptr(&(*vit)) - {} - - Vertex_handle & operator=(const Vertex* & v) + {} + + Vertex_handle & operator=(Vertex * v) { - ptr() = const_cast(v) ; + ptr() = v; return *this; } - + Vertex_handle & operator=(const Vertex_handle & v) { ptr() = v.ptr(); return *this; } - }; template @@ -94,48 +84,47 @@ handle2pointer(const Triangulation_vertex_handle_3 v) template class Triangulation_cell_handle_3 - :public Pointer > + : public Pointer > { public: - typedef Pointer > Ptr; - typedef Triangulation_cell_3 Cell; - typedef Triangulation_cell_handle_3 Cell_handle; - - typedef Triangulation_cell_iterator_3 Cell_iterator; - typedef Triangulation_cell_circulator_3 Cell_circulator; - + typedef Pointer > Ptr; + typedef Triangulation_cell_3 Cell; + typedef Triangulation_cell_handle_3 Cell_handle; + + typedef Triangulation_cell_iterator_3 Cell_iterator; + typedef Triangulation_cell_circulator_3 Cell_circulator; + Triangulation_cell_handle_3() : Ptr(NULL) {} - Triangulation_cell_handle_3(const Cell* c) - : Ptr((Cell*)c) + Triangulation_cell_handle_3(Cell * c) + : Ptr(c) {} Triangulation_cell_handle_3(const Cell_iterator & cit) : Ptr(&(*cit)) {} - + Triangulation_cell_handle_3(const Cell_circulator & ccir) : Ptr(&(*ccir)) {} - Cell_handle & operator=(const Cell* & c) + Cell_handle & operator=(Cell * c) { - ptr() = const_cast(c) ; + ptr() = c; return *this; } - + Cell_handle & operator=(const Cell_handle & c) { ptr() = c.ptr(); return *this; } - }; template -Triangulation_cell_3 * +Triangulation_cell_3 * handle2pointer(const Triangulation_cell_handle_3 c) { return c.ptr(); diff --git a/Packages/Triangulation_3/include/CGAL/Triangulation_vertex_3.h b/Packages/Triangulation_3/include/CGAL/Triangulation_vertex_3.h index bbcad8aeb5a..a88fe5583b9 100644 --- a/Packages/Triangulation_3/include/CGAL/Triangulation_vertex_3.h +++ b/Packages/Triangulation_3/include/CGAL/Triangulation_vertex_3.h @@ -90,7 +90,7 @@ public: return (Cell *) Vtds::cell(); } - Vertex_handle handle() const + Vertex_handle handle() { return Vertex_handle(this); }