norlab-ulaval / libpointmatcher

An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics
BSD 3-Clause "New" or "Revised" License
1.61k stars 544 forks source link

Narrowing conversion on windows #469

Closed maxGimeno closed 3 years ago

maxGimeno commented 3 years ago

I get

libpointmatcher\pointmatcher\DataPointsFilters\MaxPointCount.cpp(73,42): error C2398: Element '1': conversion from 'size_t' to 'unsigned int' requires a  a narrowing conversion

When building with MSVC 2019 on Windows.

lrineau commented 3 years ago

The culprit is fad06b95a5c3b55a27956268a4eb5247c2822a06, that changed the type of seed from unsigned int to std::size_t. I am surprised that it compiles correctly on any C++11 platform.

pomerlef commented 3 years ago

Good catch! @maxGimeno Are you organized to send a PR and validate it on Windows?

maxGimeno commented 3 years ago

@pomerlef done

pomerlef commented 3 years ago

Thanks!