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

OSAL should provide a typedef for "ID" values #555

Closed
jphickey opened this issue Aug 11, 2020 · 2 comments · Fixed by #568 or #590
Closed

OSAL should provide a typedef for "ID" values #555

jphickey opened this issue Aug 11, 2020 · 2 comments · Fixed by #568 or #590
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The OSAL API uses uint32 type to identify objects/resources in an abstract way.

Describe the solution you'd like
There should be a typedef for this. For instance:

typedef uint32 OS_id_t;

This typedef can then be used in all APIs rather than using uint32 directly.

Describe alternatives you've considered
Keep using uint32.

Additional context
Providing a typedef is generally accepted as good practice in terms of future proofing the code. This wouldn't change anything immediately, as the type will remain uint32 as it currently is.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey
Copy link
Contributor Author

Ping @skliper , @acudmore --

Stuff I'm working in CFE made me think of this - we are using uint32 directly in the OSAL API for ID values. Do you think a typedef is worthwhile to squeeze into the current release before the window closes? Probably wouldn't be hard to do, just a matter of scrubbing the prototypes/declarations in the API to use the typedef. Functionality wouldn't change as long as we keep it a uint32 underneath...

@skliper
Copy link
Contributor

skliper commented Aug 11, 2020

You mean "Caelum"? If so, yes, that makes sense to me.

jphickey added a commit to jphickey/osal that referenced this issue Aug 19, 2020
Update all internal OSAL code to use the typedef when creating, storing,
or otherwise dealing with abstract ID values.

Removes/fixes any code that directly compares or casts the IDs between
normal integer values.  Replace equality comparisons with inline functions
to check for equality and validity.
jphickey added a commit to jphickey/osal that referenced this issue Aug 19, 2020
Update all internal OSAL code to use the typedef when creating, storing,
or otherwise dealing with abstract ID values.

Removes/fixes any code that directly compares or casts the IDs between
normal integer values.  Replace equality comparisons with inline functions
to check for equality and validity.
jphickey added a commit to jphickey/osal that referenced this issue Aug 19, 2020
Update all internal OSAL code to use the typedef when creating, storing,
or otherwise dealing with abstract ID values.

Removes/fixes any code that directly compares or casts the IDs between
normal integer values.  Replace equality comparisons with inline functions
to check for equality and validity.
jphickey added a commit to jphickey/osal that referenced this issue Aug 31, 2020
Update all internal OSAL code to use the typedef when creating, storing,
or otherwise dealing with abstract ID values.

Removes/fixes any code that directly compares or casts the IDs between
normal integer values.  Replace equality comparisons with inline functions
to check for equality and validity.
jphickey added a commit to jphickey/osal that referenced this issue Aug 31, 2020
Update file-sys-add-fixed-map-api-test and network-api-test to
use the osal_id_t typedef and proper conversion/test functions
for manipulating object IDs.
@skliper skliper added this to the 6.0.0 milestone Sep 1, 2020
jphickey added a commit to jphickey/osal that referenced this issue Sep 1, 2020
Update all internal OSAL code to use the typedef when creating, storing,
or otherwise dealing with abstract ID values.

Removes/fixes any code that directly compares or casts the IDs between
normal integer values.  Replace equality comparisons with inline functions
to check for equality and validity.
jphickey added a commit to jphickey/osal that referenced this issue Sep 1, 2020
Update file-sys-add-fixed-map-api-test and network-api-test to
use the osal_id_t typedef and proper conversion/test functions
for manipulating object IDs.
yammajamma added a commit that referenced this issue Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants