WARNFIX: Silence a good part of unused variable/parameter warnings.

Wextra results in a dreadful wall of yellow in the test-suite and is
scary when using CGAL. Reduce some of the noise by silencing the
obvious cases with CGAL_USE or comments.
This commit is contained in:
Philipp Möller 2012-08-07 11:04:32 +00:00
parent 2cec4e33c3
commit 79b30908d5
30 changed files with 70 additions and 56 deletions

View File

@ -680,7 +680,7 @@ public:
}
size_type
number_solid_components(const Type_of_alpha& alpha) const
number_solid_components(const Type_of_alpha& /* alpha */) const
{
return number_of_solid_components(get_alpha());
}

View File

@ -30,6 +30,7 @@
#include <functional>
#include <iterator>
#include <CGAL/circulator_bases.h>
#include <CGAL/Testsuite/use.h>
// These are name redefinitions for backwards compatibility
// with the pre iterator-traits style adaptors.
@ -743,6 +744,7 @@ public:
// OPERATIONS
bool operator==( Nullptr_t p) const {
CGAL_USE(p);
CGAL_assertion( p == NULL);
return (ctnr == NULL) || (ctnr->begin() == ctnr->end());
}
@ -876,6 +878,7 @@ public:
// OPERATIONS
bool operator==( Nullptr_t p) const {
CGAL_USE(p);
CGAL_assertion( p == NULL);
return (ctnr == NULL) || (ctnr->begin() == ctnr->end());
}
@ -1028,6 +1031,7 @@ public:
// OPERATIONS
bool operator==( Nullptr_t p) const {
CGAL_USE(p);
CGAL_assertion( p == NULL);
return empty;
}

View File

@ -72,11 +72,11 @@ class Reflex_vertex_searcher : public Modifier_base<typename Nef_::SNC_structure
Reflex_vertex_map& vm)
: dir(dir_in), vertex_map(vm) {}
void visit(Vertex_handle v) const {}
void visit(Halfedge_handle e) const {}
void visit(Halffacet_handle f) const {}
void visit(SHalfloop_handle sl) const {}
void visit(SFace_handle sf) const {}
void visit(Vertex_handle /*v*/) const {}
void visit(Halfedge_handle /*e*/) const {}
void visit(Halffacet_handle /*f*/) const {}
void visit(SHalfloop_handle /*sl*/) const {}
void visit(SFace_handle /*sf*/) const {}
void visit(SHalfedge_handle se) const {
// if(vertex_map[se->source()->source()]==3) return;
int isrse = is_reflex_sedge<SNC_structure>(se, dir);

View File

@ -62,7 +62,7 @@ template <class T>
bool test_aux(const T& t,
const std::string& name,
const CGAL::Bbox_3& bbox,
bool expected, bool exact_predicates = false)
bool expected, bool /*exact_predicates*/ = false)
{
bool b = CGAL::do_intersect(t,bbox);
@ -660,7 +660,7 @@ bool test(bool exact_kernel = false)
}
template <typename K>
bool test_kernel(bool exact_predicates = true, K k = K())
bool test_kernel(bool exact_predicates = true, K /*k*/ = K())
{
bool b = test<K>(exact_predicates) &&
intensive_test<K>(exact_predicates);

View File

@ -342,7 +342,7 @@ public:
static RT FT_numerator(const FT &r)
{ return r; }
static RT FT_denominator(const FT &r)
static RT FT_denominator(const FT & /*r*/)
{ return RT(1); }
// special stuff for traits class character :

View File

@ -343,7 +343,7 @@ class No_rebind_facet_pmap
typedef unsigned int size_type;
public:
No_rebind_facet_pmap(const C3T3& c3t3, const Cell_pmap& cell_pmap)
No_rebind_facet_pmap(const C3T3& c3t3, const Cell_pmap& /*cell_pmap*/)
: r_c3t3_(c3t3) {}
int surface_index(const Facet& f) const
@ -376,7 +376,7 @@ class No_rebind_facet_pmap_first
typedef unsigned int size_type;
public:
No_rebind_facet_pmap_first(const C3T3& c3t3, const Cell_pmap& cell_pmap)
No_rebind_facet_pmap_first(const C3T3& c3t3, const Cell_pmap& /*cell_pmap*/)
: r_c3t3_(c3t3) {}
int surface_index(const Facet& f) const
@ -410,7 +410,7 @@ class No_rebind_facet_pmap_second
typedef unsigned int size_type;
public:
No_rebind_facet_pmap_second(const C3T3& c3t3, const Cell_pmap& cell_pmap)
No_rebind_facet_pmap_second(const C3T3& c3t3, const Cell_pmap& /*cell_pmap*/)
: r_c3t3_(c3t3) {}
int surface_index(const Facet& f) const

View File

@ -62,7 +62,7 @@ public:
template <typename Sizing_field>
Mesh_cell_criteria_3(const FT& radius_edge_bound,
const Sizing_field& radius_bound,
typename Sizing_field::FT dummy = 0)
typename Sizing_field::FT /*dummy*/ = 0)
{
init_radius(radius_bound);

View File

@ -111,7 +111,7 @@ public:
// as int.
template < typename Sizing_field >
Mesh_edge_criteria_3(const Sizing_field& size,
typename Sizing_field::FT dummy = 0 )
typename Sizing_field::FT /*dummy*/ = 0 )
: p_size_(new internal::Mesh_3::Sizing_field_container<Sizing_field>(size))
{}

View File

@ -79,7 +79,7 @@ public:
const FT& distance_bound,
const Mesh_facet_topology topology =
FACET_VERTICES_ON_SURFACE,
typename Sizing_field::FT dummy = 0)
typename Sizing_field::FT /*dummy*/ = 0)
{
if ( FT(0) != angle_bound )
init_aspect(angle_bound);

View File

@ -106,7 +106,7 @@ namespace parameters {
template < typename MeshDomain >
inline internal::Features_options
features(const MeshDomain& domain)
features(const MeshDomain& /*domain*/)
{
typedef typename internal::Domain_features_generator<
MeshDomain,

View File

@ -105,8 +105,8 @@ public:
SECORNER, RIGHTFRAME, NECORNER };
/*{\Xenum a type descriptor for extended points.}*/
Point_2 epoint(const Standard_FT& m1, const Standard_FT& n1,
const Standard_FT& m2, const Standard_FT& n2) const
Point_2 epoint(const Standard_FT& /*m1*/, const Standard_FT& /*n1*/,
const Standard_FT& /*m2*/, const Standard_FT& /*n2*/) const
{
CGAL_error_msg( "Bounded_kernel::epoint(..) should not be called");
return Point_2();
@ -130,7 +130,7 @@ public:
Point_2
construct_point(const Standard_point_2& ,
const Standard_point_2& ,
Point_type& t) const
Point_type& /*t*/) const
{
CGAL_error_msg( "Bounded_kernel::construct_point(Point,Point) should not be called");
return Point_2();
@ -159,21 +159,21 @@ public:
}
Point_2
construct_opposite_point(const Standard_line_2& l) const
construct_opposite_point(const Standard_line_2& /*l*/) const
{
CGAL_error_msg( "Bounded_kernel::construct_opposite_point(..) should not be called");
return Point_2();
}
Point_type
type(const Point_2& p) const
type(const Point_2& /*p*/) const
{
return STANDARD;
}
bool
is_standard(const Point_2& p) const
is_standard(const Point_2& /*p*/) const
{
return true;
}
@ -185,14 +185,14 @@ public:
}
Standard_line_2
standard_line(const Point_2& p) const
standard_line(const Point_2& /*p*/) const
{
CGAL_error_msg( "Bounded_kernel::standard_line(..) should not be called");
return Standard_line_2();
}
Standard_ray_2
standard_ray(const Point_2& p) const
standard_ray(const Point_2& /*p*/) const
{
CGAL_error_msg( "Bounded_kernel::standard_ray(..) should not be called");
return Standard_ray_2();

View File

@ -234,7 +234,7 @@ protected:
}
bool
operator()(Halfedge_handle e, const Tag_false& ) const
operator()(Halfedge_handle /*e*/, const Tag_false& ) const
{
return false;
}

View File

@ -46,7 +46,7 @@ class ID_support_handler {
int get_hash(int) { return 0; }
template<typename Handle> void initialize_hash(Handle /*h*/) {}
void initialize_hash(int i) {}
void initialize_hash(int /*i*/) {}
void handle_support(SVertex_handle ,
SHalfedge_const_handle ,
SHalfedge_const_handle ) {}

View File

@ -139,7 +139,9 @@ class Infimaximal_box {
return NT(1);
}
static void compute_min_max(const Plane_3& , NT orth_coords[3], int& /* min */, int& /* max */) { }
static void compute_min_max(const Plane_3& , NT orth_coords[3], int& /* min */, int& /* max */) {
(void)orth_coords;
}
static Point_3 scale_infibox_vertex(const Point_3& ) {
return Point_3();
@ -163,7 +165,7 @@ class Infimaximal_box {
return std::list<Point_3>();
}
static typename std::list<Point_3>::const_iterator segment_on_side(int side_of_point,
static typename std::list<Point_3>::const_iterator segment_on_side(int /*side_of_point*/,
const std::list<Point_3>& segs) {
return segs.begin();
}

View File

@ -106,7 +106,7 @@ template<typename Items,
public:
Index_matcher() {}
template<typename Handle>
void set_index(Handle h, Edge e) {}
void set_index(Handle /*h*/, Edge /*e*/) {}
};
template<typename Edge, typename CompareEdges>

View File

@ -1839,7 +1839,7 @@ protected:
/*{\Moperations 3 1 }*/
bool contains(Object_handle h) const
bool contains(Object_handle /*h*/) const
/*{\Mop returns true iff the object |h| is contained in the set
represented by |\Mvar|.}*/
// { SNC_point_locator PL(snc()); return PL.mark(h);}

View File

@ -13,7 +13,7 @@ typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
typedef Kernel::Vector_3 Vector_3;
typedef Kernel::Aff_transformation_3 Aff_transformation_3;
int main(int argc, char** argv) {
int main(int, char**) {
Polyhedron P1;
Polyhedron P2;
Polyhedron P3;

View File

@ -336,12 +336,12 @@ void link_as_target_and_append(SVertex_handle v, SHalfedge_handle e)
SHalfedge_handle new_halfedge_pair_at_source(SVertex_handle v)
{ return G.new_shalfedge_pair_at_source(v,Graph::BEFORE); }
void supporting_segment(SHalfedge_handle e, ITERATOR it) {}
void halfedge_below(SVertex_handle v, SHalfedge_handle e) {}
void trivial_segment(SVertex_handle v, ITERATOR it) {}
void starting_segment(SVertex_handle v, ITERATOR it) {}
void passing_segment(SVertex_handle v, ITERATOR it) {}
void ending_segment(SVertex_handle v, ITERATOR it) {}
void supporting_segment(SHalfedge_handle /*e*/, ITERATOR /*it*/) {}
void halfedge_below(SVertex_handle /*v*/, SHalfedge_handle /*e*/) {}
void trivial_segment(SVertex_handle /*v*/, ITERATOR /*it*/) {}
void starting_segment(SVertex_handle /*v*/, ITERATOR /*it*/) {}
void passing_segment(SVertex_handle /*v*/, ITERATOR /*it*/) {}
void ending_segment(SVertex_handle /*v*/, ITERATOR /*it*/) {}
}; // SMO_decorator

View File

@ -47,22 +47,22 @@ public:
typedef typename VECTOR::CoeffType CoeffType ;
/** y <- y + a*x */
static void axpy(CoeffType a, const VectorType& x, VectorType& y) {
static void axpy(CoeffType /*a*/, const VectorType& /*x*/, VectorType& /*y*/) {
CGAL_error();
}
/** x <- a*x */
static void scal(CoeffType a, VectorType& x) {
static void scal(CoeffType /*a*/, VectorType& /*x*/) {
CGAL_error();
}
/** y <- x */
static void copy(const VectorType& x, VectorType& y) {
static void copy(const VectorType& /*x*/, VectorType& /*y*/) {
CGAL_error();
}
/** returns x^t * y */
static CoeffType dot(const VectorType& x, const VectorType& y) {
static CoeffType dot(const VectorType& /*x*/, const VectorType& /*y*/) {
CGAL_error();
}
} ;

View File

@ -817,8 +817,8 @@ private:
Point_hider &hider, Vertex_handle vh = Vertex_handle());
template <class Point_iterator, class Offset_iterator>
void periodic_sort(Point_iterator p_begin, Point_iterator p_end,
Offset_iterator o_begin, Offset_iterator o_end) const {
void periodic_sort(Point_iterator /*p_begin*/, Point_iterator /*p_end*/,
Offset_iterator /*o_begin*/, Offset_iterator /*o_end*/) const {
std::cout << "Periodic_sort not yet implemented" << std::endl;
}

View File

@ -28,6 +28,7 @@
#include <CGAL/Index_property_map.h>
#include <CGAL/Memory_sizer.h>
#include <CGAL/point_set_processing_assertions.h>
#include <CGAL/Testsuite/use.h>
#include <iterator>
#include <list>
@ -417,6 +418,11 @@ create_mst_graph(
const Riemannian_graph<ForwardIterator>& riemannian_graph, ///< graph connecting each vertex to its knn
ForwardIterator source_point) ///< source point (with an oriented normal)
{
// prevents warnings
CGAL_USE(point_pmap);
CGAL_USE(k);
CGAL_USE(kernel);
// Bring private stuff to scope
using namespace internal;

View File

@ -46,7 +46,7 @@ namespace QP_functions_detail {
// type of LinearInequalitySystem must be convertible to ET
template <class Ar, class ET>
bool has_linearly_independent_equations
(const Ar& ar, const ET& dummy) {
(const Ar& ar, const ET& /*dummy*/) {
// we solve the following auxiliary LP, using exact type ET:
// --------
// min 0

View File

@ -29,6 +29,7 @@
#include <CGAL/circulator.h>
#include <CGAL/assertions.h>
#include <CGAL/Testsuite/use.h>
#include <vector>
#include <map>
#include <boost/type_traits.hpp>
@ -318,6 +319,7 @@ public:
Iterator current_iterator() const { return nt;}
bool operator==( Nullptr_t p) const {
CGAL_USE(p);
CGAL_assertion( p == 0);
return empty;
}

View File

@ -77,8 +77,8 @@ public:
public:
// these "constructors" are defined in order to conform with the
// specs; they will produce a run-time error if used
static Self construct_site_2(const Point_2& p1, const Point_2& p2,
const Point_2& q1, const Point_2& q2) {
static Self construct_site_2(const Point_2& /*p1*/, const Point_2& /*p2*/,
const Point_2& /*q1*/, const Point_2& /*q2*/) {
no_constructor_support();
return Self();
}
@ -125,12 +125,12 @@ public:
// the following four methods do not really make any sense but have
// been added in order for this class to be a model of the
// SegmentDelaunayGraphSite_2 concept.
const Point_2& source_of_supporting_site(unsigned int i) const {
const Point_2& source_of_supporting_site(unsigned int /*i*/) const {
CGAL_precondition( is_point() && !is_input() );
return p_[0];
}
const Point_2& target_of_supporting_site(unsigned int i) const {
const Point_2& target_of_supporting_site(unsigned int /*i*/) const {
CGAL_precondition( is_point() && !is_input() );
return p_[0];
}

View File

@ -116,7 +116,7 @@ public:
a <----------> b
H is the return halfedge connecting vertex a to b.
*/
static Halfedge* insert_edge(Polyhedron& p, Vertex* a, Vertex* b) {
static Halfedge* insert_edge(Polyhedron& /*p*/, Vertex* a, Vertex* b) {
return insert_edge(Vertex_handle(a), Vertex_handle(b)).ptr();
}
//

View File

@ -104,7 +104,7 @@ public:
pt = vertex->point();
}
//
void border_node(Halfedge_handle edge, Point& ept, Point& vpt){
void border_node(Halfedge_handle edge, Point& ept, Point& /*vpt*/){
edge_node(edge, ept);
}
};
@ -279,7 +279,7 @@ public:
public:
//
void corner_node(Halfedge_handle edge, Point& pt) {};
void corner_node(Halfedge_handle /*edge*/, Point& /*pt*/) {};
};

View File

@ -76,7 +76,7 @@ private:
template <typename Tr>
std::ostream&
operator<<(std::ostream& os,
const typename Surface_mesh_default_criteria_3<Tr>::Quality& q)
const typename Surface_mesh_default_criteria_3<Tr>::Quality& /*q*/)
{
return os << "q";
}

View File

@ -33,7 +33,7 @@ namespace VoronoiDiagram_2 { namespace Internal {
struct Null_functor
{
Null_functor() {}
template<typename T> Null_functor(T t) {}
template<typename T> Null_functor(T /*t*/) {}
};
//=========================================================================

View File

@ -127,7 +127,7 @@ class Default_caching_site_inserter<AT,Null_functor>
{
public:
Default_caching_site_inserter() {}
template<typename T> Default_caching_site_inserter(T t) {}
template<typename T> Default_caching_site_inserter(T /*t*/) {}
};
//===========================================================================

View File

@ -105,7 +105,7 @@ class Default_caching_site_remover<AT,Null_functor>
{
public:
Default_caching_site_remover() {}
template<typename T> Default_caching_site_remover(T t) {}
template<typename T> Default_caching_site_remover(T /*t*/) {}
};
//===========================================================================