Add style for enums and prefer enum classes #5149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recommend enum classes since they are commonly used. Provide a style recommendation for them.
ArduPilot/ardupilot#23877
ArduPilot/ardupilot#23830
https://github.com/ArduPilot/ardupilot/pull/23768/files#diff-ed061f26ab421c524f35bb9112b56bc1322892589f95b77e9497345eb48eafbe
https://github.com/ArduPilot/ardupilot/pull/23119/files#diff-a98f7c976f44f4a82c8c4882b638ca053d70a95f603861216630e20243689dd2
I did not cover the aspect of using
#DEFINE
to enable/disable enums, and to be sure to pin all the numbers so they don't change value when you change your build options. Seems too advanced for the style guide.