Merge pull request #4078 from maxGimeno/Fix_some_warnings-GF

Fix warnings
This commit is contained in:
Sebastien Loriot 2019-07-18 16:35:51 +02:00 committed by GitHub
commit e4adb62011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 58 additions and 15 deletions

View File

@ -160,7 +160,7 @@ struct Solve_1{
template <class OutputIterator> template <class OutputIterator>
OutputIterator operator()(const Polynomial_1 &p, OutputIterator operator()(const Polynomial_1 &p,
bool known_to_be_square_free, bool,
OutputIterator res)const{ OutputIterator res)const{
Isolator isol(p); Isolator isol(p);
for(int l=0;l<isol.number_of_real_roots();++l) for(int l=0;l<isol.number_of_real_roots();++l)

View File

@ -182,7 +182,7 @@ struct Solve_z_1{
template <class OutputIterator> template <class OutputIterator>
OutputIterator operator()(const Polynomial_1 &p, OutputIterator operator()(const Polynomial_1 &p,
bool known_to_be_square_free, bool,
OutputIterator res)const{ OutputIterator res)const{
ZPolynomial_1 zp=PolConverter()(p); ZPolynomial_1 zp=PolConverter()(p);
Isolator isol(zp); Isolator isol(zp);

View File

@ -56,7 +56,7 @@ class RS23_k_isolator_1{
template <class Polynomial_,class Bound_> template <class Polynomial_,class Bound_>
RS23_k_isolator_1<Polynomial_,Bound_>:: RS23_k_isolator_1<Polynomial_,Bound_>::
RS23_k_isolator_1(const Polynomial_ &p){ RS23_k_isolator_1(const Polynomial_ &){
CGAL_error_msg("not implemented for these polynomial/bound types"); CGAL_error_msg("not implemented for these polynomial/bound types");
} }

View File

@ -51,7 +51,7 @@ class RS2_isolator_1{
template <class Polynomial_,class Bound_> template <class Polynomial_,class Bound_>
RS2_isolator_1<Polynomial_,Bound_>:: RS2_isolator_1<Polynomial_,Bound_>::
RS2_isolator_1(const Polynomial_ &p){ RS2_isolator_1(const Polynomial_ &){
CGAL_error_msg("not implemented for these polynomial/bound types"); CGAL_error_msg("not implemented for these polynomial/bound types");
} }

View File

@ -33,6 +33,8 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -96,6 +98,7 @@ public:
// OPERATIONS // OPERATIONS
bool operator==( std::nullptr_t p) const { bool operator==( std::nullptr_t p) const {
CGAL_USE(p);
CGAL_assertion( p == nullptr); CGAL_assertion( p == nullptr);
return m_empty; return m_empty;
} }

View File

@ -38,6 +38,7 @@
#include <CGAL/predicates_on_points_3.h> #include <CGAL/predicates_on_points_3.h>
#include <CGAL/intersection_3.h> #include <CGAL/intersection_3.h>
#include <vector> #include <vector>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -62,6 +63,9 @@ template <class R_> struct Convex_hull_d_traits_3
struct Orientation_d { struct Orientation_d {
template <class I> template <class I>
Orientation operator()(I s, I e) { Orientation operator()(I s, I e) {
CGAL_USE(e);
Point_d A[4]; Point_d A[4];
CGAL_assertion(s != e); CGAL_assertion(s != e);
A[0] = *s; A[0] = *s;

View File

@ -38,6 +38,7 @@
#include <CGAL/Nef_2/PM_overlayer.h> #include <CGAL/Nef_2/PM_overlayer.h>
#include <CGAL/Nef_2/PM_point_locator.h> #include <CGAL/Nef_2/PM_point_locator.h>
#include <CGAL/Nef_2/Bounding_box_2.h> #include <CGAL/Nef_2/Bounding_box_2.h>
#include <CGAL/use.h>
#include <vector> #include <vector>
#include <list> #include <list>
@ -454,6 +455,7 @@ public:
Polygons, Operation op = JOIN) : Base(Nef_rep()) { Polygons, Operation op = JOIN) : Base(Nef_rep()) {
CGAL_assertion(op==JOIN); CGAL_assertion(op==JOIN);
CGAL_USE(op);
typedef typename std::iterator_traits<Forward_iterator>::value_type typedef typename std::iterator_traits<Forward_iterator>::value_type
iterator_pair; iterator_pair;

View File

@ -23,6 +23,7 @@
#include <CGAL/Dimension.h> #include <CGAL/Dimension.h>
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
#include <CGAL/NewKernel_d/utils.h> #include <CGAL/NewKernel_d/utils.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
struct Store_dimension_base { struct Store_dimension_base {
//TODO: add some assertions //TODO: add some assertions
@ -43,7 +44,10 @@ struct Dimension_base<Dimension_tag<dim_> > {
Dimension_base(){} Dimension_base(){}
Dimension_base(int CGAL_assertion_code(dim)){CGAL_assertion(dim_==dim);} Dimension_base(int CGAL_assertion_code(dim)){CGAL_assertion(dim_==dim);}
int dimension()const{return dim_;} int dimension()const{return dim_;}
void set_dimension(int dim){CGAL_assertion(dim_==dim);} void set_dimension(int dim){
CGAL_assertion(dim_==dim);
CGAL_USE(dim);
}
}; };
} }
#endif #endif

View File

@ -22,6 +22,7 @@
#define CGAL_VECTOR_DET_ITER_PTS_PTS_H #define CGAL_VECTOR_DET_ITER_PTS_PTS_H
#include <CGAL/NewKernel_d/functor_tags.h> #include <CGAL/NewKernel_d/functor_tags.h>
#include <CGAL/Dimension.h> #include <CGAL/Dimension.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -57,6 +58,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&a=*first; ++first; Vector const&a=*first; ++first;
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; CGAL_assertion(++first==end); Vector const&c=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_points(a,b,c); return LA::determinant_of_points(a,b,c);
} }
template<class Iter> template<class Iter>
@ -64,6 +66,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&a=*first; ++first; Vector const&a=*first; ++first;
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; CGAL_assertion(++first==end); Vector const&c=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_points(a,b,c); return LA::sign_of_determinant_of_points(a,b,c);
} }
}; };
@ -88,6 +91,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; CGAL_assertion(++first==end); Vector const&d=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_points(a,b,c,d); return LA::determinant_of_points(a,b,c,d);
} }
template<class Iter> template<class Iter>
@ -96,6 +100,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; CGAL_assertion(++first==end); Vector const&d=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_points(a,b,c,d); return LA::sign_of_determinant_of_points(a,b,c,d);
} }
}; };
@ -121,6 +126,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; CGAL_assertion(++first==end); Vector const&e=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_points(a,b,c,d,e); return LA::determinant_of_points(a,b,c,d,e);
} }
template<class Iter> template<class Iter>
@ -130,6 +136,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; CGAL_assertion(++first==end); Vector const&e=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_points(a,b,c,d,e); return LA::sign_of_determinant_of_points(a,b,c,d,e);
} }
}; };
@ -156,6 +163,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; ++first; Vector const&e=*first; ++first;
Vector const&f=*first; CGAL_assertion(++first==end); Vector const&f=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_points(a,b,c,d,e,f); return LA::determinant_of_points(a,b,c,d,e,f);
} }
template<class Iter> template<class Iter>
@ -166,6 +174,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; ++first; Vector const&e=*first; ++first;
Vector const&f=*first; CGAL_assertion(++first==end); Vector const&f=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_points(a,b,c,d,e,f); return LA::sign_of_determinant_of_points(a,b,c,d,e,f);
} }
}; };
@ -193,6 +202,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&e=*first; ++first; Vector const&e=*first; ++first;
Vector const&f=*first; ++first; Vector const&f=*first; ++first;
Vector const&g=*first; CGAL_assertion(++first==end); Vector const&g=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_points(a,b,c,d,e,f,g); return LA::determinant_of_points(a,b,c,d,e,f,g);
} }
template<class Iter> template<class Iter>
@ -204,6 +214,7 @@ struct Add_determinant_of_iterator_to_points_from_points
Vector const&e=*first; ++first; Vector const&e=*first; ++first;
Vector const&f=*first; ++first; Vector const&f=*first; ++first;
Vector const&g=*first; CGAL_assertion(++first==end); Vector const&g=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_points(a,b,c,d,e,f,g); return LA::sign_of_determinant_of_points(a,b,c,d,e,f,g);
} }
}; };

View File

@ -22,6 +22,7 @@
#define CGAL_VECTOR_DET_ITER_VEC_VEC_H #define CGAL_VECTOR_DET_ITER_VEC_VEC_H
#include <CGAL/NewKernel_d/functor_tags.h> #include <CGAL/NewKernel_d/functor_tags.h>
#include <CGAL/Dimension.h> #include <CGAL/Dimension.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -56,12 +57,14 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){ static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
Vector const&a=*first; ++first; Vector const&a=*first; ++first;
Vector const&b=*first; CGAL_assertion(++first==end); Vector const&b=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_vectors(a,b); return LA::determinant_of_vectors(a,b);
} }
template<class Iter> template<class Iter>
static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){ static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
Vector const&a=*first; ++first; Vector const&a=*first; ++first;
Vector const&b=*first; CGAL_assertion(++first==end); Vector const&b=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_vectors(a,b); return LA::sign_of_determinant_of_vectors(a,b);
} }
}; };
@ -85,6 +88,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&a=*first; ++first; Vector const&a=*first; ++first;
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; CGAL_assertion(++first==end); Vector const&c=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_vectors(a,b,c); return LA::determinant_of_vectors(a,b,c);
} }
template<class Iter> template<class Iter>
@ -92,6 +96,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&a=*first; ++first; Vector const&a=*first; ++first;
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; CGAL_assertion(++first==end); Vector const&c=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_vectors(a,b,c); return LA::sign_of_determinant_of_vectors(a,b,c);
} }
}; };
@ -116,6 +121,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; CGAL_assertion(++first==end); Vector const&d=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_vectors(a,b,c,d); return LA::determinant_of_vectors(a,b,c,d);
} }
template<class Iter> template<class Iter>
@ -124,6 +130,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&b=*first; ++first; Vector const&b=*first; ++first;
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; CGAL_assertion(++first==end); Vector const&d=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_vectors(a,b,c,d); return LA::sign_of_determinant_of_vectors(a,b,c,d);
} }
}; };
@ -149,6 +156,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; CGAL_assertion(++first==end); Vector const&e=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_vectors(a,b,c,d,e); return LA::determinant_of_vectors(a,b,c,d,e);
} }
template<class Iter> template<class Iter>
@ -158,6 +166,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&c=*first; ++first; Vector const&c=*first; ++first;
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; CGAL_assertion(++first==end); Vector const&e=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_vectors(a,b,c,d,e); return LA::sign_of_determinant_of_vectors(a,b,c,d,e);
} }
}; };
@ -184,6 +193,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; ++first; Vector const&e=*first; ++first;
Vector const&f=*first; CGAL_assertion(++first==end); Vector const&f=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::determinant_of_vectors(a,b,c,d,e,f); return LA::determinant_of_vectors(a,b,c,d,e,f);
} }
template<class Iter> template<class Iter>
@ -194,6 +204,7 @@ struct Add_determinant_of_iterator_to_vectors_from_vectors
Vector const&d=*first; ++first; Vector const&d=*first; ++first;
Vector const&e=*first; ++first; Vector const&e=*first; ++first;
Vector const&f=*first; CGAL_assertion(++first==end); Vector const&f=*first; CGAL_assertion(++first==end);
CGAL_USE(end);
return LA::sign_of_determinant_of_vectors(a,b,c,d,e,f); return LA::sign_of_determinant_of_vectors(a,b,c,d,e,f);
} }
}; };

View File

@ -241,7 +241,7 @@ void test(const Cont &)
assert(check_empty(c0)); assert(check_empty(c0));
assert(check_empty(c1)); assert(check_empty(c1));
typename Cont::allocator_type t20 = c0.get_allocator(); c0.get_allocator();
std::cout << "Now filling some containers" << std::endl; std::cout << "Now filling some containers" << std::endl;

View File

@ -34,6 +34,7 @@
#include <CGAL/Segment_Delaunay_graph_2/basic.h> #include <CGAL/Segment_Delaunay_graph_2/basic.h>
#include <CGAL/Segment_Delaunay_graph_2/Constructions_C2.h> #include <CGAL/Segment_Delaunay_graph_2/Constructions_C2.h>
#include <CGAL/use.h>
namespace CGAL { namespace CGAL {
@ -141,11 +142,13 @@ public:
} }
const Point_2& source_of_crossing_site(unsigned int i) const { const Point_2& source_of_crossing_site(unsigned int i) const {
CGAL_USE(i);
CGAL_precondition( is_segment() && !is_input(i) ); CGAL_precondition( is_segment() && !is_input(i) );
return p_[0]; return p_[0];
} }
const Point_2& target_of_crossing_site(unsigned int i) const { const Point_2& target_of_crossing_site(unsigned int i) const {
CGAL_USE(i);
CGAL_precondition( is_segment() && !is_input(i) ); CGAL_precondition( is_segment() && !is_input(i) );
return p_[0]; return p_[0];
} }

View File

@ -2205,6 +2205,7 @@ private:
CGAL_precondition( CGAL_precondition(
p.is_point() && q.is_point() && r.is_segment()); p.is_point() && q.is_point() && r.is_segment());
CGAL_USE(l); CGAL_USE(l);
CGAL_USE(r);
Comparison_result compare_p(EQUAL); Comparison_result compare_p(EQUAL);
Comparison_result compare_q(EQUAL); Comparison_result compare_q(EQUAL);
@ -2313,6 +2314,8 @@ private:
CGAL_precondition( CGAL_precondition(
p.is_point() && q.is_segment() && r.is_segment()); p.is_point() && q.is_segment() && r.is_segment());
CGAL_USE(l); CGAL_USE(l);
CGAL_USE(q);
CGAL_USE(r);
Comparison_result compare_p(EQUAL); Comparison_result compare_p(EQUAL);
Comparison_result compare_q(EQUAL); Comparison_result compare_q(EQUAL);
@ -2432,6 +2435,9 @@ private:
CGAL_USE(vv); CGAL_USE(vv);
CGAL_USE(l); CGAL_USE(l);
CGAL_USE(lref); CGAL_USE(lref);
CGAL_USE(p);
CGAL_USE(q);
CGAL_USE(r);
Comparison_result compare_p(EQUAL); Comparison_result compare_p(EQUAL);
Comparison_result compare_q(EQUAL); Comparison_result compare_q(EQUAL);

View File

@ -27,6 +27,7 @@
#include <CGAL/Straight_skeleton_halfedge_base_2.h> #include <CGAL/Straight_skeleton_halfedge_base_2.h>
#include <CGAL/circulator.h> #include <CGAL/circulator.h>
#include <CGAL/Origin.h> #include <CGAL/Origin.h>
#include <CGAL/use.h>
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
@ -85,6 +86,7 @@ protected :
bool operator==( std::nullptr_t p ) const bool operator==( std::nullptr_t p ) const
{ {
CGAL_USE(p);
CGAL_assertion( p == nullptr ); CGAL_assertion( p == nullptr );
HalfedgeHandle null ; HalfedgeHandle null ;
return mHandle == null ; return mHandle == null ;

View File

@ -375,8 +375,6 @@ bool write_triangle_soups_to_3mf(const std::string& file_name,
const PolygonRanges& all_polygons, const PolygonRanges& all_polygons,
const std::vector<std::string>& names) const std::vector<std::string>& names)
{ {
DWORD nErrorMessage;
LPCSTR pszErrorMessage;
HRESULT hResult; HRESULT hResult;
// Create Model Instance // Create Model Instance

View File

@ -40,7 +40,7 @@ int main(int argc, char** argv)
CGAL::read_3mf(file_name, meshes); CGAL::read_3mf(file_name, meshes);
if(nb_meshes <0) if(nb_meshes <0)
return 1; return 1;
for(std::size_t i = 0; i< nb_meshes; ++i) for(int i = 0; i< nb_meshes; ++i)
{ {
Mesh mesh = meshes[i]; Mesh mesh = meshes[i];
std::cout<<names[i]<<" is valid: "<<mesh.is_valid()<<std::endl; std::cout<<names[i]<<" is valid: "<<mesh.is_valid()<<std::endl;
@ -59,7 +59,7 @@ int main(int argc, char** argv)
else else
{ {
std::cout<<nb_polylines<<" polylines found, of "; std::cout<<nb_polylines<<" polylines found, of ";
for(std::size_t i = 0; i< nb_polylines-1; ++i){ for(int i = 0; i< nb_polylines-1; ++i){
std::cout<<all_points[i].size()<<", "; std::cout<<all_points[i].size()<<", ";
} }
std::cout<<all_points.back().size()<<" points."<<std::endl; std::cout<<all_points.back().size()<<" points."<<std::endl;
@ -73,7 +73,7 @@ int main(int argc, char** argv)
else else
{ {
std::cout<<nb_point_sets<<" point clouds found, of "; std::cout<<nb_point_sets<<" point clouds found, of ";
for(std::size_t i = 0; i< nb_point_sets-1; ++i){ for(int i = 0; i< nb_point_sets-1; ++i){
std::cout<<all_points[i].size()<<", "; std::cout<<all_points[i].size()<<", ";
} }
std::cout<<all_points.back().size()<<" points."<<std::endl; std::cout<<all_points.back().size()<<" points."<<std::endl;
@ -149,17 +149,16 @@ int main(int argc, char** argv)
//testing of point clouds //testing of point clouds
DWORD nErrorMessage;
LPCSTR pszErrorMessage;
HRESULT hResult; HRESULT hResult;
NMR::PLib3MFModel * pModel; NMR::PLib3MFModel * pModel;
hResult = NMR::lib3mf_createmodel(&pModel); hResult = NMR::lib3mf_createmodel(&pModel);
NMR::PLib3MFModelMeshObject* pMeshObject; NMR::PLib3MFModelMeshObject* pMeshObject;
if (hResult != LIB3MF_OK) { if (hResult != LIB3MF_OK) {
std::cout << "could not create model: " << std::hex << hResult << std::endl; std::cout << "could not create model: " << std::hex << hResult << std::endl;
return false; return 1;
} }
for(int i=0; i< names.size(); ++i) for(std::size_t i=0; i< names.size(); ++i)
{ {
CGAL::write_mesh_to_model(all_points[i], all_polygons[i], CGAL::write_mesh_to_model(all_points[i], all_polygons[i],
all_colors[i], names[i], &pMeshObject, pModel); all_colors[i], names[i], &pMeshObject, pModel);