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