mirror of https://github.com/CGAL/cgal
CGAL_USE
This commit is contained in:
parent
b22839067e
commit
c724f2ff9a
|
|
@ -58,8 +58,7 @@ Polyhedron* poisson_reconstruct(const Point_set& points,
|
||||||
// Checks requirements
|
// Checks requirements
|
||||||
//***************************************
|
//***************************************
|
||||||
|
|
||||||
int nb_points = points.size();
|
if (points.size() == 0)
|
||||||
if (nb_points == 0)
|
|
||||||
{
|
{
|
||||||
std::cerr << "Error: empty point set" << std::endl;
|
std::cerr << "Error: empty point set" << std::endl;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,7 @@
|
||||||
// So I cast to bool manually (needed when the automatic conversion is switched off).
|
// So I cast to bool manually (needed when the automatic conversion is switched off).
|
||||||
#define bool_assert(X) assert(bool(X))
|
#define bool_assert(X) assert(bool(X))
|
||||||
|
|
||||||
// "unused variable" warning killer
|
|
||||||
template <typename T>
|
|
||||||
void use(T) {}
|
|
||||||
|
|
||||||
// generic test, for both enums and bool
|
// generic test, for both enums and bool
|
||||||
template < typename T >
|
template < typename T >
|
||||||
|
|
@ -36,6 +34,7 @@ void test()
|
||||||
const U v = t0;
|
const U v = t0;
|
||||||
U w = U (T(), T());
|
U w = U (T(), T());
|
||||||
U v2 = u;
|
U v2 = u;
|
||||||
|
CGAL_USE(v2);
|
||||||
w = (w = t0);
|
w = (w = t0);
|
||||||
|
|
||||||
// Various functions
|
// Various functions
|
||||||
|
|
@ -53,6 +52,7 @@ void test()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
U indet = U::indeterminate();
|
U indet = U::indeterminate();
|
||||||
|
CGAL_USE(indet);
|
||||||
|
|
||||||
t = CGAL::inf(u);
|
t = CGAL::inf(u);
|
||||||
t = CGAL::sup(u);
|
t = CGAL::sup(u);
|
||||||
|
|
@ -80,7 +80,7 @@ void test()
|
||||||
CGAL::make_certain(u);
|
CGAL::make_certain(u);
|
||||||
#ifndef CGAL_NO_UNCERTAIN_CONVERSION_OPERATOR
|
#ifndef CGAL_NO_UNCERTAIN_CONVERSION_OPERATOR
|
||||||
T t = u;
|
T t = u;
|
||||||
use(t);
|
CGAL_USE(t);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
catch (CGAL::Uncertain_conversion_exception) { ok = true; }
|
catch (CGAL::Uncertain_conversion_exception) { ok = true; }
|
||||||
|
|
@ -88,6 +88,8 @@ void test()
|
||||||
|
|
||||||
U u2 = CGAL::make_uncertain(u);
|
U u2 = CGAL::make_uncertain(u);
|
||||||
U u3 = CGAL::make_uncertain(T());
|
U u3 = CGAL::make_uncertain(T());
|
||||||
|
CGAL_USE(u2);
|
||||||
|
CGAL_USE(u3);
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
bool_assert( v == v );
|
bool_assert( v == v );
|
||||||
|
|
@ -97,8 +99,8 @@ void test()
|
||||||
bool_assert( ! (v != t0) );
|
bool_assert( ! (v != t0) );
|
||||||
bool_assert( ! (t0 != v) );
|
bool_assert( ! (t0 != v) );
|
||||||
|
|
||||||
use(t);
|
CGAL_USE(t);
|
||||||
use(t2);
|
CGAL_USE(t2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -292,7 +294,7 @@ void test_bool()
|
||||||
|
|
||||||
// Test exceptions
|
// Test exceptions
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
try { bool b = indet; use(b); }
|
try { bool b = indet; CGAL_USE(b); }
|
||||||
catch (CGAL::Uncertain_conversion_exception) { ok = true; }
|
catch (CGAL::Uncertain_conversion_exception) { ok = true; }
|
||||||
bool_assert(ok);
|
bool_assert(ok);
|
||||||
// The following must throw.
|
// The following must throw.
|
||||||
|
|
|
||||||
|
|
@ -730,7 +730,7 @@ private:
|
||||||
// get #variables
|
// get #variables
|
||||||
constrain_one_vertex_on_convex_hull();
|
constrain_one_vertex_on_convex_hull();
|
||||||
m_tr->index_unconstrained_vertices();
|
m_tr->index_unconstrained_vertices();
|
||||||
unsigned int nb_variables = m_tr->number_of_vertices()-1;
|
unsigned int nb_variables = static_cast<unsigned int>(m_tr->number_of_vertices()-1);
|
||||||
|
|
||||||
CGAL_TRACE(" Number of variables: %ld\n", (long)(nb_variables));
|
CGAL_TRACE(" Number of variables: %ld\n", (long)(nb_variables));
|
||||||
|
|
||||||
|
|
@ -1074,8 +1074,8 @@ private:
|
||||||
// sum up areas
|
// sum up areas
|
||||||
FT area = 0.0;
|
FT area = 0.0;
|
||||||
const Point& a = voronoi_points[0];
|
const Point& a = voronoi_points[0];
|
||||||
unsigned int nb_triangles = voronoi_points.size() - 1;
|
std::size_t nb_triangles = voronoi_points.size() - 1;
|
||||||
for(unsigned int i=1;i<nb_triangles;i++)
|
for(std::size_t i=1;i<nb_triangles;i++)
|
||||||
{
|
{
|
||||||
const Point& b = voronoi_points[i];
|
const Point& b = voronoi_points[i];
|
||||||
const Point& c = voronoi_points[i+1];
|
const Point& c = voronoi_points[i+1];
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ public:
|
||||||
fractions.clear();
|
fractions.clear();
|
||||||
fractions.push_back(1.0);
|
fractions.push_back(1.0);
|
||||||
|
|
||||||
double m = n;
|
double m = static_cast<double>(n);
|
||||||
|
|
||||||
while(m > 500){
|
while(m > 500){
|
||||||
m /= 2;
|
m /= 2;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue