Fix #288, Remove unnecessary CF_UnionArgs_Payload_t union#400
Fix #288, Remove unnecessary CF_UnionArgs_Payload_t union#400thnkslprpt wants to merge 1 commit intonasa:mainfrom
CF_UnionArgs_Payload_t union#400Conversation
| else if (cmd->byte[0] < CF_NUM_CHANNELS) | ||
| { | ||
| ret = fn(cmd->data.byte[0], context); | ||
| ret = fn(cmd->byte[0], context); |
Check notice
Code scanning / CodeQL
Use of non-constant function pointer
0dd858e to
6cd5bd0
Compare
jphickey
left a comment
There was a problem hiding this comment.
We need to also do this but I'd like to approach it a bit differently. Although only the "byte" field is used now, it is still used for a few different things in different commands. Now that each command has its own definition, this should be made type-correct.
@jphickey So you want to create command-specific struct members for each command? |
Checklist
Describe the contribution
Fixes CF_UnionArgs_Payload_t elements dword and hword not used, union not necessary #288
CF_UnionArgs_Payload_thas been removed, given that only a single member of the 3 is used in CF. That member variable -byte- has been moved into theCF_UnionArgsCmd_tstruct, which was the only place whereCF_UnionArgs_Payload_twas used.Re-introduced from Fix #288, Remove unnecessary CF_UnionArgs_Payload_t union #341. Move PR #341 into Equuleus-rc2 #393, Fix #393, revert merge of PR #341. #395 reverted this PR due to integration issues. Resubmitting here for consideration in next release.
Testing performed
GitHub CI actions (incl. Build + Run, Unit Tests etc.) all passing successfully.
Expected behavior changes
No impact on logic.
Code is simplified and clearer.
Contributor Info
Avi Weiss @thnkslprpt