You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...):
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
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...):
osal/src/os/shared/src/osapi-common.c
Line 140 in ead5723
osal/src/os/shared/src/osapi-common.c
Line 281 in ead5723
osal/src/os/vxworks/src/os-impl-common.c
Line 74 in ead5723
Could be static const array:
osal/src/os/shared/src/osapi-idmap.c
Line 159 in ead5723
osal/src/os/shared/src/osapi-idmap.c
Line 199 in ead5723
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
The text was updated successfully, but these errors were encountered: