Switch Param Id's to not be overlapping #1758
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.
This is done by making the bottom 26 bits be the Param Id and the top 6 bits be the level.
This is able to be done as a non breaking change by making the level Id always the enum value + 1. This means that if the level is 0, we're running against an older caller, and the level passed in is used. If the level is non 0, so a new caller, the level is checked against the level parameter passed in. If these do not match, INVALID_PARAMETER is returned. In a future breaking change, the separate level param can be removed entirely, but this is a working solution for now that will make the API less error prone.
26 bits was chosen as we had a parameter that was already using bit 24. This leaves 63 valid levels. Above 32 is reserved for private levels, so we have 31 levels for future use.
Fixes #1708