fix unused variable warnings

This commit is contained in:
Sébastien Loriot 2015-07-16 10:15:33 +02:00
parent 3813dd7b82
commit 84d82c3a8e
9 changed files with 50 additions and 11 deletions

View File

@ -25,7 +25,7 @@
#include <CGAL/Dimension.h> #include <CGAL/Dimension.h>
#include <CGAL/Kernel_traits.h> #include <CGAL/Kernel_traits.h>
#include <CGAL/Cartesian_converter.h> #include <CGAL/Cartesian_converter.h>
#include <CGAL/use.h>
/* Definition of functors used internally to copy combinatorial maps attributes /* Definition of functors used internally to copy combinatorial maps attributes
* (we need functors as attributes are stored in tuple, thus all the access * (we need functors as attributes are stored in tuple, thus all the access
* must be done at compiling time). * must be done at compiling time).
@ -346,6 +346,7 @@ struct Default_converter_cmap_attributes
(const Map1& map1, Map2& map2, typename Map1::Dart_const_handle dh1, (const Map1& map1, Map2& map2, typename Map1::Dart_const_handle dh1,
typename Map2::Dart_handle dh2) const typename Map2::Dart_handle dh2) const
{ {
CGAL_USE(dh2);
CGAL_assertion( map1.template attribute<i>(dh1)!=Map1::null_handle ); CGAL_assertion( map1.template attribute<i>(dh1)!=Map1::null_handle );
CGAL_assertion( map2.template attribute<i>(dh2)==Map2::null_handle ); CGAL_assertion( map2.template attribute<i>(dh2)==Map2::null_handle );
return internal::Create_attribute_if_same_info_cmap return internal::Create_attribute_if_same_info_cmap
@ -363,6 +364,7 @@ struct Cast_converter_cmap_attributes
(const Map1& map1, Map2& map2, typename Map1::Dart_const_handle dh1, (const Map1& map1, Map2& map2, typename Map1::Dart_const_handle dh1,
typename Map2::Dart_handle dh2) const typename Map2::Dart_handle dh2) const
{ {
CGAL_USE(dh2);
CGAL_assertion( map1.template attribute<i>(dh1)!=Map1::null_handle ); CGAL_assertion( map1.template attribute<i>(dh1)!=Map1::null_handle );
CGAL_assertion( map2.template attribute<i>(dh2)==Map2::null_handle ); CGAL_assertion( map2.template attribute<i>(dh2)==Map2::null_handle );
typename Map2::template Attribute_handle<i>::type typename Map2::template Attribute_handle<i>::type

View File

@ -23,6 +23,7 @@
#undef CGAL_NEF_DEBUG #undef CGAL_NEF_DEBUG
#define CGAL_NEF_DEBUG 227 #define CGAL_NEF_DEBUG 227
#include <CGAL/Nef_2/debug.h> #include <CGAL/Nef_2/debug.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -75,7 +76,7 @@ class SM_walls : SM_decorator<SMap> {
} }
SHalfedge_handle find_cap(SVertex_handle sv, Sphere_point sp, Sphere_circle c) { SHalfedge_handle find_cap(SVertex_handle sv, Sphere_point sp, Sphere_circle c) {
CGAL_USE(sp);
CGAL_NEF_TRACEN( "find_cap " << sv->source()->point() << ":" << sv->point() CGAL_NEF_TRACEN( "find_cap " << sv->source()->point() << ":" << sv->point()
<< " , sp : " << sp ); << " , sp : " << sp );
/* /*

View File

@ -26,6 +26,7 @@
#define CGAL_MATRIX___H #define CGAL_MATRIX___H
#include <CGAL/Kernel_d/Vector__.h> #include <CGAL/Kernel_d/Vector__.h>
#include <CGAL/use.h>
#include <new> #include <new>
#include <cstddef> // for std::size_t, std::ptrdiff_t #include <cstddef> // for std::size_t, std::ptrdiff_t
@ -189,6 +190,7 @@ inline void deallocate_mat_space(vector_pointer*& vi, int d)
inline void check_dimensions(const Matrix_<NT_,AL_>& mat) const inline void check_dimensions(const Matrix_<NT_,AL_>& mat) const
{ {
CGAL_USE(mat);
CGAL_assertion_msg((dm_ == mat.dm_ && dn_ == mat.dn_), CGAL_assertion_msg((dm_ == mat.dm_ && dn_ == mat.dn_),
"Matrix::check_dimensions: incompatible matrix dimensions.") ; "Matrix::check_dimensions: incompatible matrix dimensions.") ;
} }

View File

@ -28,6 +28,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/memory.h> #include <CGAL/memory.h>
#include <CGAL/Kernel_d/debug.h> #include <CGAL/Kernel_d/debug.h>
#include <CGAL/use.h>
#include <cmath> #include <cmath>
#include <memory> #include <memory>
@ -120,6 +121,7 @@ protected:
inline void inline void
check_dimensions(const Vector_<NT_,AL_>& vec) const check_dimensions(const Vector_<NT_,AL_>& vec) const
{ {
CGAL_USE(vec);
CGAL_assertion_msg((d_ == vec.d_), CGAL_assertion_msg((d_ == vec.d_),
"Vector_::check_dimensions: object dimensions disagree."); "Vector_::check_dimensions: object dimensions disagree.");
} }

View File

@ -32,6 +32,8 @@
#define CGAL_NEF_DEBUG 223 #define CGAL_NEF_DEBUG 223
#include <CGAL/Nef_2/debug.h> #include <CGAL/Nef_2/debug.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -169,7 +171,7 @@ class Gaussian_map :
} }
public: public:
void visit(Vertex_const_handle v) { CGAL_NEF_TRACEN( "Vertices " << v->point() );} void visit(Vertex_const_handle v) { CGAL_USE(v); CGAL_NEF_TRACEN( "Vertices " << v->point() );}
void visit(Halfedge_const_handle ) {} void visit(Halfedge_const_handle ) {}
void visit(SHalfedge_const_handle ) {} void visit(SHalfedge_const_handle ) {}
void visit(SHalfloop_const_handle ) {} void visit(SHalfloop_const_handle ) {}

View File

@ -32,6 +32,7 @@
#undef CGAL_NEF_DEBUG #undef CGAL_NEF_DEBUG
#define CGAL_NEF_DEBUG 31 #define CGAL_NEF_DEBUG 31
#include <CGAL/Nef_2/debug.h> #include <CGAL/Nef_2/debug.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -135,8 +136,11 @@ Vertex_handle new_vertex(const Point& p) const
return p.vertex(); } return p.vertex(); }
Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v) Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v)
{ CGAL_NEF_TRACEN("new_edge "<<&*v<<" "<<edge_number+1); {
return ++edge_number; } CGAL_USE(v);
CGAL_NEF_TRACEN("new_edge "<<&*v<<" "<<edge_number+1);
return ++edge_number;
}
void supporting_segment(Halfedge_handle e, I it) void supporting_segment(Halfedge_handle e, I it)
{ if ( From[it] != E() ) Support[e] = From[it]; } { if ( From[it] != E() ) Support[e] = From[it]; }
@ -215,7 +219,9 @@ int compare_xy(const Point_2& p1, const Point_2& p2) const {
} }
Point_2 intersection(const Segment_2& s1, const Segment_2& s2) const Point_2 intersection(const Segment_2& s1, const Segment_2& s2) const
{ CGAL_assertion(target(s1).vertex()==target(s2).vertex()); {
CGAL_USE(s2);
CGAL_assertion(target(s1).vertex()==target(s2).vertex());
return target(s1); } return target(s1); }
bool left_turn(const Point_3& p1, const Point_3& p2, const Point_3& p3) const bool left_turn(const Point_3& p1, const Point_3& p2, const Point_3& p3) const

View File

@ -40,6 +40,8 @@
#define CGAL_NEF_DEBUG 43 #define CGAL_NEF_DEBUG 43
#include <CGAL/Nef_2/debug.h> #include <CGAL/Nef_2/debug.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
struct int_lt { struct int_lt {
@ -245,10 +247,12 @@ public:
} }
void visit(Vertex_handle h) { void visit(Vertex_handle h) {
CGAL_USE(h);
CGAL_NEF_TRACEN("visit v "<<h->point()); CGAL_NEF_TRACEN("visit v "<<h->point());
} }
void visit(Halfedge_handle h) { void visit(Halfedge_handle h) {
CGAL_USE(h);
CGAL_NEF_TRACEN("visit he "<< h->source()->point()); CGAL_NEF_TRACEN("visit he "<< h->source()->point());
} }

View File

@ -46,6 +46,8 @@
#include <LEDA/system/memory.h> #include <LEDA/system/memory.h>
#endif #endif
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
template <typename Decorator_, typename I> template <typename Decorator_, typename I>
@ -114,7 +116,11 @@ struct SMO_from_segs {
} }
void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const
{ CGAL_assertion(v1->mark()==v2->mark()); } {
CGAL_USE(v1);
CGAL_USE(v2);
CGAL_assertion(v1->mark()==v2->mark());
}
void discard_info(Vertex_handle v) const void discard_info(Vertex_handle v) const
{ {
@ -126,7 +132,11 @@ struct SMO_from_segs {
} }
void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const
{ CGAL_assertion(e1->mark()==e2->mark()); } {
CGAL_USE(e1);
CGAL_USE(e2);
CGAL_assertion(e1->mark()==e2->mark());
}
void discard_info(Halfedge_handle ) const {} void discard_info(Halfedge_handle ) const {}
@ -281,7 +291,10 @@ Halfedge_handle halfedge_below(Vertex_handle v) const
{ return G.halfedge_below(v); } { return G.halfedge_below(v); }
void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const
{ CGAL_NEF_TRACEV(G.mark(v1,0));CGAL_NEF_TRACEV(G.mark(v1,1)); {
CGAL_USE(v1);
CGAL_USE(v2);
CGAL_NEF_TRACEV(G.mark(v1,0));CGAL_NEF_TRACEV(G.mark(v1,1));
CGAL_NEF_TRACEV(G.mark(v2,0));CGAL_NEF_TRACEV(G.mark(v2,1)); CGAL_NEF_TRACEV(G.mark(v2,0));CGAL_NEF_TRACEV(G.mark(v2,1));
CGAL_assertion(G.mark(v1,0)==G.mark(v2,0)&& CGAL_assertion(G.mark(v1,0)==G.mark(v2,0)&&
G.mark(v1,1)==G.mark(v2,1)); } G.mark(v1,1)==G.mark(v2,1)); }
@ -289,8 +302,12 @@ void discard_info(Vertex_handle v) const
{ G.discard_info(v); } { G.discard_info(v); }
void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const
{ CGAL_assertion(G.mark(e1,0)==G.mark(e2,0) && {
G.mark(e1,1)==G.mark(e2,1)); } CGAL_USE(e1);
CGAL_USE(e2);
CGAL_assertion(G.mark(e1,0)==G.mark(e2,0) &&
G.mark(e1,1)==G.mark(e2,1));
}
void discard_info(Halfedge_handle e) const void discard_info(Halfedge_handle e) const
{ G.discard_info(e); } { G.discard_info(e); }

View File

@ -49,6 +49,8 @@
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <CGAL/use.h>
namespace OpenNL { namespace OpenNL {
@ -436,6 +438,7 @@ protected:
} }
void check_state(State s) { void check_state(State s) {
CGAL_USE(s);
CGAL_assertion(state_ == s) ; CGAL_assertion(state_ == s) ;
} }