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

AP_RangeFinder: Remove preprocessor in enum definition #25787

Conversation

muramura
Copy link
Contributor

ENUM definitions do not consume memory.
This ENUM definition is used only for the SWITCH statement.
Adding DEFAULT to the SWITCH statement suppresses errors for undefined definitions.
There are many preprocessors with ENUM definitions that are undefined.
I remove preprocessors in the ENUM definition.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

You're correct that the enumerations don't take up space.

However, as a pattern removing the values from the enumeration if the driver is not compiled in means that no code which is dependent on that enumeration entry can remain in the code when the compiler is not compiled in - it's a code-cleanliness enhancer.

We're moving to use this pattern - not away from it.

@peterbarker peterbarker closed this Apr 5, 2024
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.

2 participants