Fix warnings

This commit is contained in:
Laurent Rineau 2013-02-07 18:09:08 +01:00
parent 29c05b900b
commit d19578725b
26 changed files with 82 additions and 34 deletions

View File

@ -194,10 +194,9 @@ template<typename AlgebraicKernel_1,
InputIterator start,
InputIterator end,
OutputIterator output) {
typedef typename AlgebraicKernel_1::Algebraic_real_1 Alg_real;
CGAL_static_assertion
((::boost::is_same
<Alg_real,
<typename AlgebraicKernel_1::Algebraic_real_1,
typename std::iterator_traits<InputIterator>::value_type >::value));
typedef typename AlgebraicKernel_1::Bound Bound;

View File

@ -29,6 +29,10 @@
#define CGAL_ALGEBRAIC_KERNEL_FUNCTIONS_ON_ROOTS_AND_POLYNOMIAL_1_3_AND_2_3_H
#include <vector>
#include <iterator> // for std::back_inserter
#include <utility> // for std::pair and std::make_pair
#include <CGAL/enum.h> // for CGAL::Sign
#include <CGAL/use.h> // for CGAL_USE_TYPE()
namespace CGAL {
namespace AlgebraicSphereFunctors {
@ -59,6 +63,7 @@ namespace CGAL {
const typename AK::Polynomial_1_3 & p2) {
typedef typename AK::RT RT;
CGAL_USE_TYPE(RT);
CGAL_kernel_precondition(!(same_solutions<RT>(p1,p2)));
if(p1.empty_space()) return false;

View File

@ -22,6 +22,8 @@
#ifndef CGAL_APOLLONIUS_GRAPH_2_IMPL_H
#define CGAL_APOLLONIUS_GRAPH_2_IMPL_H
#include <CGAL/use.h>
// class implementation continued
//=================================
@ -1824,6 +1826,7 @@ remove_degree_d_vertex(Vertex_handle v)
} while ( ec != ec_start );
CGAL_assertion( found );
CGAL_USE(found);
}
CGAL_triangulation_precondition( degree(v) == 3 );

View File

@ -1731,11 +1731,8 @@ public:
CGAL_precondition(!xc2.is_degenerate());
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
typedef typename Kernel::Equal_2 Equal_2;
typedef typename Kernel::Counterclockwise_in_between_2
Counterclockwise_in_between_2;
typedef typename Traits::Clockwise_in_between_2
Clockwise_in_between_2;
typedef typename Kernel::Equal_3 Equal_3;
typedef std::pair<Point_2,Multiplicity> Point_2_pair;
@ -2480,9 +2477,6 @@ public:
m_is_degenerate(false),
m_is_empty(false)
{
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
typedef typename Kernel::FT FT;
CGAL_precondition(z_sign(normal) != ZERO);
#if (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_1_Y_0)
@ -2490,6 +2484,9 @@ public:
Direction_3(-(normal.dz()), 0, normal.dx()) :
Direction_3(normal.dz(), 0, -(normal.dx()));
#else
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
typedef typename Kernel::FT FT;
const Direction_2& xy = Traits::identification_xy();
FT x = xy.dx();
FT y = xy.dy();
@ -2543,8 +2540,6 @@ public:
m_is_degenerate(false),
m_is_empty(false)
{
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
CGAL_precondition(has_on(source));
CGAL_precondition(has_on(target));

View File

@ -28,6 +28,9 @@
#include <algorithm>
#include <CGAL/assertions.h>
#include <CGAL/use.h>
namespace CGAL {
//-----------------------------------------------------------------------------
@ -651,6 +654,7 @@ Trapezoidal_decomposition_2<Td_traits>
(Curve_end(he,ARR_MAX_END), p);
CGAL_assertion( is_equal_to_he_min || is_equal_to_he_max );
CGAL_USE(is_equal_to_he_max);
curr_node = is_equal_to_he_min ? curr_node.right_child() : curr_node.left_child();
continue;
@ -733,6 +737,7 @@ Trapezoidal_decomposition_2<Td_traits>
Curve_end(he_cv,ARR_MAX_END));
CGAL_warning (is_min_equal || is_max_equal);
CGAL_USE(is_max_equal);
Comparison_result res =
is_min_equal ?
@ -1093,6 +1098,7 @@ Trapezoidal_decomposition_2<Td_traits>
(Curve_end(*p_cv,ARR_MAX_END), ce);
CGAL_assertion( is_equal_to_he_min || is_equal_to_he_max );
CGAL_USE(is_equal_to_he_max);
curr_node = is_equal_to_he_min ? curr_node.right_child() : curr_node.left_child();
@ -1182,6 +1188,7 @@ Trapezoidal_decomposition_2<Td_traits>
Curve_end(he_cv,ARR_MAX_END));
CGAL_warning (is_min_equal || is_max_equal);
CGAL_USE(is_max_equal);
//the underlying point of ce
const Point& p = (ce.ce() == ARR_MIN_END) ?
@ -1319,6 +1326,7 @@ Trapezoidal_decomposition_2<Td_traits>
(Curve_end(*p_cv,ARR_MAX_END), p);
CGAL_assertion( is_equal_to_he_min || is_equal_to_he_max );
CGAL_USE(is_equal_to_he_max);
curr_node = is_equal_to_he_min ? curr_node.right_child() : curr_node.left_child();
@ -1402,6 +1410,7 @@ Trapezoidal_decomposition_2<Td_traits>
Curve_end(he_cv,ARR_MAX_END));
CGAL_warning (is_min_equal || is_max_equal);
CGAL_USE(is_max_equal);
res = is_min_equal ?
traits->compare_cw_around_point_2_object()

View File

@ -79,7 +79,6 @@ OutputIterator connect_holes(const Polygon_with_holes_2<Kernel,
OutputIterator oi)
{
typedef Polygon_2<Kernel,Container> Polygon_2;
typedef Polygon_with_holes_2<Kernel,Container> Polygon_with_holes_2;
typedef Arr_segment_traits_2<Kernel> Traits_2;
typedef typename Kernel::Point_2 Point_2;
typedef typename Traits_2::X_monotone_curve_2 Segment_2;

View File

@ -27,6 +27,7 @@
#include <CGAL/basic.h>
#include <CGAL/circulator_bases.h>
#include <CGAL/assertions.h>
#include <CGAL/use.h>
#include <cstddef>
@ -34,7 +35,6 @@
#include <iterator>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/static_assert.hpp>
// These are name redefinitions for backwards compatibility
// with the pre iterator-traits style adaptors.
@ -199,39 +199,46 @@ query_circulator_or_iterator( const C&) {
template <class C> inline
void Assert_circulator( const C &) {
typedef typename Circulator_traits<C>::category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, Circulator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, Circulator_tag>::value));
}
template <class I> inline
void Assert_iterator( const I &) {
typedef typename Circulator_traits<I>::category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, Iterator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, Iterator_tag>::value));
}
template <class I> inline
void Assert_input_category( const I &/*i*/) {
typedef typename std::iterator_traits<I>::iterator_category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, std::input_iterator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, std::input_iterator_tag>::value));
}
template <class I> inline
void Assert_output_category( const I &/*i*/) {
typedef typename std::iterator_traits<I>::iterator_category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, std::output_iterator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, std::output_iterator_tag>::value));
}
template <class IC> inline
void Assert_forward_category( const IC &/*ic*/) {
typedef typename std::iterator_traits<IC>::iterator_category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, std::forward_iterator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, std::forward_iterator_tag>::value));
}
template <class IC> inline
void Assert_bidirectional_category( const IC &/*ic*/) {
typedef typename std::iterator_traits<IC>::iterator_category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, std::bidirectional_iterator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, std::bidirectional_iterator_tag>::value));
}
template <class IC> inline
void Assert_random_access_category( const IC &/*ic*/) {
typedef typename std::iterator_traits<IC>::iterator_category category;
BOOST_STATIC_ASSERT((boost::is_convertible<category, std::random_access_iterator_tag>::value));
CGAL_USE_TYPE(category);
CGAL_static_assertion((boost::is_convertible<category, std::random_access_iterator_tag>::value));
}
// The assert at-least-category functions use the following
// functions to resolve properly. Note the proper order of the

View File

@ -45,7 +45,6 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last,
if (first == last) return result;
typedef typename Traits::Less_rotate_ccw_2 Less_rotate_ccw;
typedef typename Traits::Point_2 Point_2;
typedef typename Traits::Equal_2 Equal_2;
Equal_2 equal_points = ch_traits.equal_2_object();
@ -54,6 +53,7 @@ ch_jarvis_march(ForwardIterator first, ForwardIterator last,
|| defined(NDEBUG)
OutputIterator res(result);
#else
typedef typename Traits::Point_2 Point_2;
Tee_for_output_iterator<OutputIterator,Point_2> res(result);
#endif // no postconditions ...
CGAL_ch_assertion_code( \

View File

@ -22,6 +22,7 @@
#include <CGAL/basic.h>
#include <CGAL/Object.h>
#include <CGAL/use.h>
namespace CGAL {
@ -140,6 +141,7 @@ Object line_under_linear_constraint(const typename K::Line_2& l1,
}
// the two lines overlap
CGAL_USE_TYPE(Line_2);
CGAL_assertion_code(Line_2 dummy;);
CGAL_assertion_code(bool b = assign(dummy, obj););
CGAL_assertion(b);

View File

@ -23,6 +23,7 @@
#include <utility>
#include <CGAL/double.h>
#include <CGAL/use.h>
namespace CGAL {
@ -139,6 +140,7 @@ sibson_c1_interpolation(ForwardIterator first, ForwardIterator beyond,
if(squared_dist ==0){
ForwardIterator it = first;
CGAL_USE(it);
CGAL_assertion(++it==beyond);
return std::make_pair(f.first, true);
}
@ -212,6 +214,7 @@ sibson_c1_interpolation_square(ForwardIterator first, ForwardIterator
if(squared_dist ==0){
ForwardIterator it = first;
CGAL_USE(it);
CGAL_assertion(++it==beyond);
return std::make_pair(f.first,true);
}

View File

@ -5,7 +5,6 @@ int main()
{
typedef CGAL::Kinetic::Exact_simulation_traits Simulation_traits;
typedef Simulation_traits::Kinetic_kernel::Point_2 Moving_point_2;
typedef CGAL::Kinetic::Delaunay_triangulation_2<Simulation_traits> KDel;

View File

@ -1,17 +1,13 @@
#include <CGAL/Kinetic/basic.h>
#include <CGAL/Kinetic/Exact_simulation_traits.h>
#include <CGAL/Kinetic/Insert_event.h>
#include <CGAL/Kinetic/Sort.h>
int main()
{
typedef CGAL::Kinetic::Exact_simulation_traits Traits;
typedef CGAL::Kinetic::Insert_event<Traits::Active_points_1_table> Insert_event;
typedef Traits::Active_points_1_table::Data Moving_point;
typedef CGAL::Kinetic::Sort<Traits> Sort;
typedef Traits::Simulator::Time Time;
Traits tr(0,100000);
Sort sort(tr);

View File

@ -107,8 +107,6 @@ protected:
int main()
{
typedef My_simulation_traits::Kinetic_kernel::Point_2 Moving_point_2;
typedef CGAL::Kinetic::Delaunay_triangulation_2<My_simulation_traits> KDel;
My_simulation_traits tr(0, 10000);

View File

@ -91,7 +91,8 @@ public:
if (has_certificates_ != tf) {
has_certificates_=tf;
if (has_certificates_) {
bool ev= event_.is_valid();
CGAL_assertion_code(bool ev=)
event_.is_valid();
CGAL_assertion(!ev);
Time t= CGAL::to_interval(sp->current_time()).second+1;
event_= sp->new_event(t, Event(objects_.begin(),

View File

@ -33,6 +33,9 @@
#include <CGAL/Kinetic/listeners.h>
#include <CGAL/use.h>
#include <CGAL/assertions.h>
#if defined(BOOST_MSVC)
# pragma warning(push)
@ -840,6 +843,7 @@ protected:
}
}
CGAL_assertion(found);
CGAL_USE(found);
}
@ -872,6 +876,7 @@ protected:
}
}
CGAL_assertion(found);
CGAL_USE(found);
}
for (typename RCMap::const_iterator it= redundant_cells_.begin();

View File

@ -26,6 +26,7 @@
#include <CGAL/In_place_list.h>
#include <functional>
#include <CGAL/assertions.h>
#include <CGAL/use.h>
#include <iostream>
#include <CGAL/Kinetic/Ref_counted.h>
#include <CGAL/Kinetic/internal/infinity_or_max.h>
@ -517,6 +518,7 @@ public:
}
}
CGAL_postcondition(found);
CGAL_USE(found);
#endif
unmake_event(oi);
return Key(ni);

View File

@ -1033,7 +1033,8 @@ protected:
triangulation().incident_cells(v, std::back_inserter(ics));
for (unsigned int i=0; i< ics.size(); ++i) {
int j=-1;// disable warning
bool ret=ics[i]->has_vertex(v, j); // initializes j
CGAL_assertion_code(bool ret=)
ics[i]->has_vertex(v, j); // initializes j
CGAL_assertion(j != -1);
CGAL_assertion(ret);
for (int k=0; k<4 ; ++k) {
@ -1053,7 +1054,8 @@ protected:
triangulation().incident_cells(v, std::back_inserter(ics));
for (unsigned int i=0; i< ics.size(); ++i) {
int j=-1; // keep some dumb compiler happy
bool ret=ics[i]->has_vertex(v, j);
CGAL_assertion_code(bool ret=)
ics[i]->has_vertex(v, j);
CGAL_assertion(ret);
for (int k=0; k<4 ; ++k) {
if (k==j) continue;

View File

@ -202,7 +202,7 @@ public:
{
//hi_there<Edge>(f);
//hi_there(f);
typedef typename Edge::first_type::value_type::Vertex_handle Q;
//typedef typename Edge::first_type::value_type::Vertex_handle Q;
//Q q;
return vertex_of_edge(f, i);
}

View File

@ -28,6 +28,7 @@
#include <CGAL/Gps_circle_segment_traits_2.h>
#include <CGAL/Minkowski_sum_2/Labels.h>
#include <CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h>
#include <CGAL/use.h>
namespace CGAL {
@ -462,6 +463,7 @@ protected:
assign_success = CGAL::assign (mid_p, obj);
CGAL_assertion (assign_success);
CGAL_USE(assign_success);
// Andreas's assertions:
CGAL_assertion( right_turn(*curr, *next, op2) );
@ -523,6 +525,7 @@ protected:
for (xobj_it = xobjs.begin(); xobj_it != xobjs.end(); ++xobj_it) {
assign_success = CGAL::assign (xarc, *xobj_it);
CGAL_assertion (assign_success);
CGAL_USE(assign_success);
*oi++ = Labeled_curve_2 (xarc,
X_curve_label (xarc.is_directed_right(),
cycle_id, curve_index++));
@ -578,6 +581,7 @@ protected:
{
assign_success = CGAL::assign (xarc, *xobj_it);
CGAL_assertion (assign_success);
CGAL_USE(assign_success);
++xobj_it;
bool is_last = (xobj_it == xobjs.end());

View File

@ -25,6 +25,7 @@
#include <CGAL/Gps_traits_2.h>
#include <CGAL/Minkowski_sum_2/Labels.h>
#include <CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h>
#include <CGAL/use.h>
namespace CGAL {
@ -210,6 +211,7 @@ protected:
{
assign_success = CGAL::assign (xarc, *xobj_it);
CGAL_assertion (assign_success);
CGAL_USE(assign_success);
*oi = Labeled_curve_2 (xarc,
X_curve_label (xarc.is_directed_right(),
@ -269,6 +271,7 @@ protected:
{
assign_success = CGAL::assign (xarc, *xobj_it);
CGAL_assertion (assign_success);
CGAL_USE(assign_success);
++xobj_it;
is_last = (xobj_it == xobjs.end());

View File

@ -34,7 +34,9 @@
#define CGAL_NEF_DEBUG 13
#include <CGAL/Nef_2/debug.h>
#include <boost/static_assert.hpp>
#include <CGAL/assertions.h>
#include <CGAL/use.h>
#include <boost/type_traits/is_same.hpp>
#ifndef CGAL_USE_LEDA
@ -961,7 +963,7 @@ bool is_forward_edge(const Const_decorator& N,
void assert_type_precondition() const
{ typename PM_decorator_::Point p1; Point p2;
BOOST_STATIC_ASSERT((boost::is_same<typename PM_decorator_::Point, Point>::value)); }
CGAL_static_assertion((boost::is_same<typename PM_decorator_::Point, Point>::value)); }

View File

@ -38,6 +38,7 @@
#include <boost/random/variate_generator.hpp>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/use.h>
#include <CGAL/Triangulation_data_structure_3.h>
#include <CGAL/Periodic_3_triangulation_ds_cell_base_3.h>
@ -217,6 +218,7 @@ public:
_gt.set_domain(_domain);
typedef typename internal::Exact_type_selector<FT>::Type EFT;
typedef NT_converter<FT,EFT> NTC;
CGAL_USE_TYPE(NTC);
CGAL_triangulation_assertion_code( NTC ntc; )
CGAL_triangulation_precondition(ntc(_domain.xmax())-ntc(_domain.xmin())
== ntc(_domain.ymax())-ntc(_domain.ymin()));

View File

@ -28,6 +28,7 @@
#include <algorithm>
#include <vector>
#include <CGAL/assertions.h>
#include <CGAL/use.h>
namespace CGAL {
@ -63,6 +64,7 @@ public:
Exponent_vector(InputIterator begin , InputIterator end)
:v(begin,end){
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
CGAL_USE_TYPE(value_type);
CGAL_static_assertion(( ::boost::is_same<value_type, int>::value));
}

View File

@ -45,6 +45,8 @@ typename CGAL::internal::Innermost_coefficient_type<T>::Type , 2>::Type
#include <sstream>
#include <CGAL/Polynomial/misc.h>
#include <CGAL/use.h>
#ifdef CGAL_HAS_THREADS
# include <boost/thread/tss.hpp>
#endif
@ -900,6 +902,7 @@ public:
// the terms of q and hence in NT.
Polynomial<NT> q, r;
Polynomial<NT>::euclidean_division(p1, p2, q, r);
CGAL_USE_TYPE(AST);
CGAL_postcondition( !AST::Is_exact::value || p2 * q == p1);
return (*this) = q;
}
@ -1159,6 +1162,7 @@ void Polynomial<NT>::pseudo_division(
if (delta < 0 || A.is_zero()) {
Q = Polynomial<NT>(NT(0)); R = A; D = NT(1);
CGAL_USE_TYPE(AST);
CGAL_postcondition( !AST::Is_exact::value || Polynomial<NT>(D)*A == Q*B + R);
return;
}

View File

@ -1,8 +1,11 @@
#include <CGAL/Default.h>
#include <CGAL/use.h>
// A is a concrete type
struct A {};
void use_a(A) {}
// B is the template class which has 2 template parameters
// with default arguments : A and int.
template < typename A1_ = A, typename A2 = int >
@ -25,5 +28,5 @@ int main ()
{
B<CGAL::Default, double> b;
A a = b.a1; // It is really of type A.
use_a(b.a1); // It is really of type A.
}

View File

@ -27,6 +27,8 @@
#include <CGAL/type_traits.h>
#include <CGAL/assertions.h>
#include <CGAL/use.h>
#include <boost/mpl/if.hpp>
#include <cstddef>
@ -364,6 +366,7 @@ namespace Intern {
typedef typename T::Allocator Alloc;
typedef ::CGAL::Reference_counted_hierarchy_with_union<Alloc>
Reference_counted_hierarchy_with_union;
CGAL_USE_TYPE(Reference_counted_hierarchy_with_union);
CGAL_static_assertion((
::CGAL::is_same_or_derived< Reference_counted_hierarchy_with_union, T >::value ));
}