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

[all] Variable can be made constexpr #2472

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

alxbilger
Copy link
Contributor

My IDE found that some variables could be made constexpr.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request pr: clean Cleaning the code labels Nov 9, 2021
@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Nov 9, 2021
@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request and removed pr: status ready Approved a pull-request, ready to be squashed labels Nov 9, 2021
@hugtalbot
Copy link
Contributor

as @fredroy noticed, a compilation issue appeared on ubuntu @alxbilger

@hugtalbot hugtalbot added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Nov 9, 2021
@@ -43,7 +43,7 @@ namespace sofa
namespace helper
{

const unsigned long RandomGenerator::RANDOM_BASE_MAX = 4294967295U;
constexpr unsigned long RandomGenerator::RANDOM_BASE_MAX = 4294967295U;
Copy link
Contributor

@fredroy fredroy Nov 10, 2021

Choose a reason for hiding this comment

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

RANDOM_BASE_MAX is declared static in the header.
you could move the initialization in the .h (inline static initialization) I suppose.
Funnily only gcc was bothered 🤫

@alxbilger alxbilger added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Nov 12, 2021
@alxbilger
Copy link
Contributor Author

[ci-build][with-all-tests]

@fredroy fredroy added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Nov 12, 2021
@fredroy fredroy merged commit ffca80f into sofa-framework:master Nov 12, 2021
@guparan guparan added this to the v21.12 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean Cleaning the code pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants