Trying to fix the remaining OSX warnings

This commit is contained in:
Vojtech Bubnik 2021-02-10 19:07:09 +01:00
parent 05a6cfeaea
commit 8049dd1f72
7 changed files with 27 additions and 6 deletions

View file

@ -653,8 +653,8 @@ inline bool intersect_ray_all_hits(
std::vector<igl::Hit> &hits)
{
auto ray_intersector = detail::RayIntersectorHits<VertexType, IndexedFaceType, TreeType, VectorType> {
vertices, faces, {tree},
origin, dir, VectorType(dir.cwiseInverse())
{ vertices, faces, {tree},
origin, dir, VectorType(dir.cwiseInverse()) }
};
if (! tree.empty()) {
ray_intersector.hits.reserve(8);

View file

@ -2332,7 +2332,12 @@ static std::vector<MonotonicRegionLink> chain_monotonic_regions(
}
// Probability (unnormalized) of traversing a link between two monotonic regions.
auto path_probability = [pheromone_alpha, pheromone_beta](AntPath &path) {
auto path_probability = [
#ifndef __APPLE__
// clang complains when capturing constexpr constants.
pheromone_alpha, pheromone_beta
#endif // __APPLE__
](AntPath &path) {
return pow(path.pheromone, pheromone_alpha) * pow(path.visibility, pheromone_beta);
};

View file

@ -195,8 +195,9 @@ private:
template<typename KDTreeIndirectType, typename PointType, typename FilterFn>
size_t find_closest_point(const KDTreeIndirectType &kdtree, const PointType &point, FilterFn filter)
{
using CoordType = typename KDTreeIndirectType::CoordType;
struct Visitor {
using CoordType = typename KDTreeIndirectType::CoordType;
const KDTreeIndirectType &kdtree;
const PointType &point;
const FilterFn filter;

View file

@ -147,9 +147,16 @@ public:
, m_renderer(m_raw_renderer)
, m_trafo(trafo)
{
#ifdef _MSC_VER
// suppress false MSVC warning C4723: possible division by zero
#pragma warning(push)
#pragma warning(disable : 4723)
#endif // _MSC_VER
m_pxdim_scaled.w_mm /= pd.w_mm;
m_pxdim_scaled.h_mm /= pd.h_mm;
#ifdef _MSC_VER
#pragma warning(pop)
#endif // _MSC_VER
m_renderer.color(foreground);
clear(background);