fixed warnings from the test suite

This commit is contained in:
Dmitry Anisimov 2021-08-13 11:33:47 +02:00
parent 31c2fe0da8
commit d03c669cd3
3 changed files with 13 additions and 16 deletions

View File

@ -224,8 +224,7 @@ namespace Barycentric_coordinates {
const Point_2& vertex(
const std::size_t query_index) const {
CGAL_precondition(
query_index >= 0 && query_index < number_of_vertices());
CGAL_precondition(query_index < number_of_vertices());
return m_vhs[query_index]->point();
}
@ -243,8 +242,7 @@ namespace Barycentric_coordinates {
bool is_on_boundary(
const std::size_t query_index) const {
CGAL_precondition(
query_index >= 0 && query_index < number_of_vertices());
CGAL_precondition(query_index < number_of_vertices());
return m_vhs[query_index]->info().is_on_boundary;
}
@ -267,8 +265,7 @@ namespace Barycentric_coordinates {
const std::size_t query_index,
std::vector<std::size_t>& neighbors) const {
CGAL_precondition(
query_index >= 0 && query_index < number_of_vertices());
CGAL_precondition(query_index < number_of_vertices());
const auto vh = m_vhs[query_index];
neighbors = vh->info().neighbors;
}
@ -294,7 +291,7 @@ namespace Barycentric_coordinates {
triangle.clear();
const auto fh = m_cdt.locate(query);
if (fh->is_in_domain()) {
for (std::size_t i = 0; i < 3; ++i) {
for (int i = 0; i < 3; ++i) {
triangle.push_back(fh->vertex(i)->info().index);
}
}

View File

@ -213,9 +213,9 @@ namespace Barycentric_coordinates {
const std::size_t i1 = m_element[1];
const std::size_t i2 = m_element[2];
CGAL_assertion(i0 >= 0 && i0 < m_domain.number_of_vertices());
CGAL_assertion(i1 >= 0 && i1 < m_domain.number_of_vertices());
CGAL_assertion(i2 >= 0 && i2 < m_domain.number_of_vertices());
CGAL_assertion(i0 < m_domain.number_of_vertices());
CGAL_assertion(i1 < m_domain.number_of_vertices());
CGAL_assertion(i2 < m_domain.number_of_vertices());
const auto& p0 = m_domain.vertex(i0);
const auto& p1 = m_domain.vertex(i1);
@ -276,7 +276,7 @@ namespace Barycentric_coordinates {
\return an output iterator to the element in the destination range,
one past the last coordinate stored
\pre query >= 0 && query < domain.number_of_vertices()
\pre query_index >= 0 && query_index < domain.number_of_vertices()
*/
template<typename OutIterator>
OutIterator operator()(
@ -292,7 +292,7 @@ namespace Barycentric_coordinates {
m_solve_is_called)) return c_begin;
CGAL_precondition(
query_index >= 0 && query_index < m_domain.number_of_vertices());
query_index < m_domain.number_of_vertices());
CGAL_assertion(m_boundary.size() > 0);
CGAL_assertion(m_interior.size() > 0);
@ -597,11 +597,11 @@ namespace Barycentric_coordinates {
}
} else {
triplet_list.push_back(
TripletFT(indices[i], indices[idx], w));
TripletFT(int(indices[i]), int(indices[idx]), w));
}
}
triplet_list.push_back(
TripletFT(indices[i], indices[i], W));
TripletFT(int(indices[i]), int(indices[i]), W));
}
}

View File

@ -364,7 +364,7 @@ namespace internal {
switch (location) {
case Query_point_location::ON_VERTEX: {
CGAL_assertion(index >= 0 && index < n);
CGAL_assertion(index < n);
for (std::size_t i = 0; i < n; ++i)
if (i == index) {
@ -376,7 +376,7 @@ namespace internal {
}
case Query_point_location::ON_EDGE: {
CGAL_assertion(index >= 0 && index < n);
CGAL_assertion(index < n);
if (index == n - 1) {
return coordinates_on_last_edge_2(