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

Replace use of rand()/srand() with the C++11 <random> #554

Merged
merged 3 commits into from
Sep 14, 2019

Conversation

cary-ilm
Copy link
Member

SonarCloud reports use of rand() as a "bug" and recommends the new
generator/distribution mechanism. The new "random.{h,cpp}" defines
random_int() and random_float(), which take the place of "rand() % N",
etc.

Signed-off-by: Cary Phillips cary@ilm.com

SonarCloud reports use of rand() as a "bug" and recommends the new
generator/distribution mechanism. The new "random.{h,cpp}" defines
random_int() and random_float(), which take the place of "rand() % N",
etc.

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
@@ -60,6 +60,7 @@ add_executable(IlmImfTest
testXdr.cpp
testYca.cpp
testLargeDataWindowOffsets.cpp
random
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random.cpp ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Interesting that it seems to have worked, but better to be consistent.

Signed-off-by: Cary Phillips <cary@ilm.com>
Copy link
Contributor

@kdt3rd kdt3rd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cary-ilm cary-ilm merged commit 492ddd8 into AcademySoftwareFoundation:master Sep 14, 2019
@cary-ilm cary-ilm deleted the rand-fixes branch September 14, 2019 19:02
@cary-ilm cary-ilm added this to the v2.5.0 milestone Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants