Merge pull request #5935 from janetournois/CGAL-fix_warnings_c++20-jtournois

Fix warnings for C++20
This commit is contained in:
Sébastien Loriot 2021-09-10 17:43:47 +02:00
commit a93dda81cd
5 changed files with 15 additions and 14 deletions

View File

@ -13,6 +13,7 @@
#include <deque>
#include <fstream>
#include <typeindex>
#include <iterator>
// Windows
#include <windows.h>
@ -24,7 +25,6 @@
#include <boost/concept_check.hpp>
#include <boost/config.hpp>
#include <boost/format.hpp>
#include <boost/iterator.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/iterator_facade.hpp>

View File

@ -2113,8 +2113,10 @@ insert_balls(const Vertex_handle& vp,
curve_index, d_sign)
<< ")\n";
#endif
const FT sgn = (d_sign == CGAL::POSITIVE) ? 1.
: (d_sign == CGAL::NEGATIVE ? -1. : 0.);
const Bare_point new_point =
domain_.construct_point_on_curve(vpp, curve_index, d_sign * d / 2);
domain_.construct_point_on_curve(vpp, curve_index, sgn * d / 2);
const int dim = 1; // new_point is on edge
const Index index = domain_.index_from_curve_index(curve_index);
const FT point_weight = CGAL::square(size_(new_point, dim, index));

View File

@ -121,9 +121,9 @@ struct Profile_histogram_counter
{
private:
#ifdef CGAL_CONCURRENT_PROFILE
typedef tbb::concurrent_hash_map<unsigned, unsigned> Counters;
typedef tbb::concurrent_hash_map<unsigned, unsigned> CounterMap;
#else
typedef std::map<unsigned, unsigned> Counters;
typedef std::map<unsigned, unsigned> CounterMap;
#endif
public:
@ -133,7 +133,7 @@ public:
void operator()(unsigned i)
{
#ifdef CGAL_CONCURRENT_PROFILE
Counters::accessor a;
CounterMap::accessor a;
counters.insert(a, i);
++a->second;
#else
@ -144,7 +144,7 @@ public:
~Profile_histogram_counter()
{
unsigned total=0;
for (Counters::const_iterator it=counters.begin(), end=counters.end();
for (CounterMap::const_iterator it=counters.begin(), end=counters.end();
it != end; ++it) {
std::cerr << "[CGAL::Profile_histogram_counter] " << s;
std::cerr << " [ " << std::setw(10) << internal::dot_it(it->first) << " : "
@ -158,7 +158,7 @@ public:
}
private:
Counters counters;
CounterMap counters;
const std::string s;
};

View File

@ -21,10 +21,9 @@
#define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP
#include <CGAL/iterator.h>
#include <boost/config.hpp>
#include <boost/iterator.hpp>
#include <iterator>
#include <functional>
namespace CGAL { namespace internal {

View File

@ -306,12 +306,12 @@ public :
virtual void OnCollected(const Profile& aProfile, const boost::optional<FT>& aCost) const
{
TEST_TRACE(str (format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost)));
TEST_TRACE(str (boost::format("Collecting %1% : cost=%2%") % edge2str(aProfile.v0_v1()) % optfloat2str(aCost)));
}
virtual void OnCollapsing(const Profile& aProfile, const boost::optional<Point>& aP) const
{
TEST_TRACE(str (format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP)));
TEST_TRACE(str (boost::format("S %1% - Collapsing %2% : placement=%3%") % mStep % edge2str(aProfile.v0_v1()) % optpoint2str(aP)));
//mBefore = create_edge_link(aProfile);
}
@ -323,10 +323,10 @@ public :
{
SurfaceSP lAfter = create_vertex_link(aProfile, aV);
write(mBefore, str(format("%1%.step-%2%-before.off") % mTestCase % mStep));
write(lAfter , str(format("%1%.step-%2%-after.off") % mTestCase % mStep));
write(mBefore, str(boost::format("%1%.step-%2%-before.off") % mTestCase % mStep));
write(lAfter , str(boost::format("%1%.step-%2%-after.off") % mTestCase % mStep));
REPORT_ERROR(str(format("Resulting surface self-intersects after step %1% (%2% edges left)") % mStep % (aProfile.surface().size_of_halfedges() / 2)));
REPORT_ERROR(str(boost::format("Resulting surface self-intersects after step %1% (%2% edges left)") % mStep % (aProfile.surface().size_of_halfedges() / 2)));
}
++mStep;