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

Windows: Fix Narrowing conversion of seed in MaxPointCount #470

Closed maxGimeno closed 3 years ago

maxGimeno commented 3 years ago

Fix #469

ethzasl-jenkins commented 3 years ago

Can one of the admins verify this patch?

lrineau commented 3 years ago

The constructor of std::minstd_rand expects a std::uint_fast32_t as first argument.

And thus on Windows, passing seed to that std::uint_fast32_t argument is a narrowing conversion. As the constructor was called with {seed} and not (seed), that narrowing conversion triggered an error.

pomerlef commented 3 years ago

Ok to test

pomerlef commented 3 years ago

Thanks!