-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fix #1514, Use XOR
to swap between ping-pong buffers (style change only)
#2351
base: main
Are you sure you want to change the base?
Fix #1514, Use XOR
to swap between ping-pong buffers (style change only)
#2351
Conversation
@@ -1156,12 +1156,12 @@ | |||
{ | |||
/* Call the Application's Validation function for the Inactive Buffer */ | |||
Status = | |||
(RegRecPtr->ValidationFuncPtr)(RegRecPtr->Buffers[(1U - RegRecPtr->ActiveBufferIndex)].BufferPtr); | |||
(RegRecPtr->ValidationFuncPtr)(RegRecPtr->Buffers[(RegRecPtr->ActiveBufferIndex ^ 1)].BufferPtr); |
Check notice
Code scanning / CodeQL
Use of non-constant function pointer Note
@@ -1096,7 +1096,7 @@ | |||
UT_InitData(); | |||
DumpCmd.Payload.ActiveTableFlag = CFE_TBL_BufferSelect_INACTIVE; | |||
CFE_TBL_Global.Registry[2].DoubleBuffered = true; | |||
CFE_TBL_Global.Registry[2].Buffers[(1 - CFE_TBL_Global.Registry[2].ActiveBufferIndex)].BufferPtr = BuffPtr; | |||
CFE_TBL_Global.Registry[2].Buffers[(CFE_TBL_Global.Registry[2].ActiveBufferIndex ^ 1)].BufferPtr = BuffPtr; |
Check warning
Code scanning / CodeQL
Local variable address stored in non-local memory Warning
source
@@ -712,7 +712,7 @@ | |||
UT_InitData(); | |||
ValidateCmd.Payload.ActiveTableFlag = CFE_TBL_BufferSelect_INACTIVE; | |||
CFE_TBL_Global.Registry[0].DoubleBuffered = true; | |||
CFE_TBL_Global.Registry[0].Buffers[1 - CFE_TBL_Global.Registry[0].ActiveBufferIndex].BufferPtr = BuffPtr; | |||
CFE_TBL_Global.Registry[0].Buffers[CFE_TBL_Global.Registry[0].ActiveBufferIndex ^ 1].BufferPtr = BuffPtr; |
Check warning
Code scanning / CodeQL
Local variable address stored in non-local memory Warning
source
283aa6c
to
e133e03
Compare
Checklist
Describe the contribution
1 - ActiveBuffer
toActiveBuffer ^ 1
.Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Unit/Functional Tests etc.).
Expected behavior changes
No change to behavior.
Contributor Info
Avi Weiss @thnkslprpt