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

Document/verify CFE_RESOURCEID_MAX is power of 2 - 1 and sometimes used as MASK (and MAX) #1365

Closed
skliper opened this issue Apr 14, 2021 · 0 comments · Fixed by #1371 or #1431
Closed
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Apr 14, 2021

Is your feature request related to a problem? Please describe.
CFE_RESOURCEID_MAX is used in some places as MAX and others as a mask, also has to be power of 2 - 1:

return (CFE_ResourceId_ToInteger(ResourceId) & ~((uint32)CFE_RESOURCEID_MAX));

Describe the solution you'd like
Document and verify

Describe alternatives you've considered
None

Additional context
Code review

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added this to the 7.0.0 milestone Apr 14, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Apr 16, 2021
Add a compile time assert to ensure that this value is
actually a power of two-1.  Notes in the comments that
it serves as both a numeric limit and a mask.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 16, 2021
Add a compile time assert to ensure that this value is
actually a power of two-1.  Notes in the comments that
it serves as both a numeric limit and a mask.
astrogeco added a commit that referenced this issue Apr 28, 2021
Fix #1365, assert CFE_RESOURCEID_MAX is a bitmask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants