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

improvement: replace (un)likely macro with C++20 attribute #1516

Merged
merged 2 commits into from
Jun 17, 2023
Merged

improvement: replace (un)likely macro with C++20 attribute #1516

merged 2 commits into from
Jun 17, 2023

Conversation

SamantaTarun
Copy link
Contributor

@SamantaTarun SamantaTarun commented Jun 16, 2023

resolves #1514

@heinezen heinezen added improvement Enhancement of an existing component lang: c++ Done in C++ code code quality Does not alter behavior, but beauty of our code labels Jun 16, 2023
Copy link
Member

@heinezen heinezen left a comment

Choose a reason for hiding this comment

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

Looks good so far :)

Now you only need to pass the sanity checks.

  • Update the copyright years. You can run python3 -m buildsystem.codecompliance --all --fix in the repo to let the buildsystem do this for you.
  • Add you name/username/commit email to copying.md
  • You can check if everything's correct by running make checkall before pushing

@heinezen
Copy link
Member

Also, you can remove the macros in line 52 and 55 in the file below since they're not needed anymore:

#define unlikely(x) __builtin_expect(!!(x), 0)
#else
#define likely(x) (x)
#define unlikely(x) (x)

@SamantaTarun SamantaTarun requested a review from heinezen June 16, 2023 20:59
Copy link
Member

@heinezen heinezen left a comment

Choose a reason for hiding this comment

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

Great!

@heinezen heinezen merged commit 0ce207f into SFTtech:master Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Does not alter behavior, but beauty of our code improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace likely macro with C++20 attribute
2 participants