Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Fix Narrowing conversion of seed in MaxPointCount #470

Merged
merged 1 commit into from
Jul 9, 2021
Merged

Windows: Fix Narrowing conversion of seed in MaxPointCount #470

merged 1 commit into from
Jul 9, 2021

Conversation

maxGimeno
Copy link
Contributor

Fix #469

@ethzasl-jenkins
Copy link

Can one of the admins verify this patch?

@lrineau
Copy link

lrineau commented Jul 9, 2021

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

  • On a x86_64 Linux machine, that type is an unsigned long int, and thus a 64 bits unsigned.
  • It seems that on Windows with the compiler from MSVC, that type is unsigned int, and thus only a 32 bits integer.

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
Copy link
Collaborator

pomerlef commented Jul 9, 2021

Ok to test

@pomerlef pomerlef merged commit 580d29d into norlab-ulaval:master Jul 9, 2021
@pomerlef
Copy link
Collaborator

pomerlef commented Jul 9, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Narrowing conversion on windows
4 participants