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

Convert long switch's to static const array/jump tables/function pointer tables #872

Open
skliper opened this issue Mar 10, 2021 · 0 comments

Comments

@skliper
Copy link
Contributor

skliper commented Mar 10, 2021

Is your feature request related to a problem? Please describe.
Don't really need a switch, could use a function pointer table, aka jump table (as long as you are OK using function pointers...):

switch (idtype)

switch (OS_IdentifyObject(object_id))

Could be static const array:

switch (idtype)

switch (idtype)

Describe the solution you'd like
Convert to function pointer table

Describe alternatives you've considered
Leave as-is (future work)

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC, OSAL code review

@skliper skliper changed the title Convert long switch's that call functions to a function pointer table Convert long switch's to static const array/jump tables/function pointer tables Mar 10, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Fix nasa#846, Deconflict CFE_ES_LIB_ALREADY_LOADED and CFE_ES_ERR_SYS_LOG_TRUNCATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant