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

core/include/kernel_defines.h: add index_of() macro #17142

Merged
merged 2 commits into from Nov 5, 2021

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Nov 5, 2021

Contribution description

It can be quite useful to have a macro to get the index of an element in an array.
Instead of open-coding it, add a macro to kernel_defines.h so that everyone can use it without code duplication.

Testing procedure

Issues/PRs references

@benpicco benpicco requested a review from maribu November 5, 2021 14:33
@github-actions github-actions bot added Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: tests Area: tests and testing framework labels Nov 5, 2021
@benpicco benpicco added Type: new feature The issue requests / The PR implemements a new feature for RIOT and removed Area: tests Area: tests and testing framework labels Nov 5, 2021
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

ACK. That's indeed quite useful in a lot of places.

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 5, 2021
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Nov 5, 2021
@benpicco benpicco merged commit 321918c into RIOT-OS:master Nov 5, 2021
@benpicco benpicco deleted the index_of branch November 5, 2021 22:19
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants