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

Fix #2339, Refactor common logic out of CFE_TIME_SetTime/MET/STCFCmd() #2340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thnkslprpt
Copy link
Contributor

Checklist

Describe the contribution

Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Coverage/Functional Tests etc.).
Local tests confirm the modified commands are working as expected:
Screenshot 2023-05-19 19 49 12
Net coverage is unchanged (total lines reduced by 22, total branches reduced by 4).

Expected behavior changes
Behavior/logic is unchanged.
Code duplication reduced, easing future maintenance.

System(s) tested on
Debian GNU/Linux 11 (bullseye)
Current main branch of cFS bundle.

Contributor Info
Avi Weiss @thnkslprpt

@@ -791,11 +793,11 @@
NewTime.Seconds = CommandPtr->Seconds;
NewTime.Subseconds = CFE_TIME_Micro2SubSecs(CommandPtr->MicroSeconds);

CFE_TIME_SetTime(NewTime);
SetTimeFunc(NewTime);

Check notice

Code scanning / CodeQL

Use of non-constant function pointer

This call does not go through a const function pointer.
*
*-----------------------------------------------------------------*/
int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTimeCmd_t *data)
static void CFE_TIME_SetCommand(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, void (*SetTimeFunc)(CFE_TIME_SysTime_t),

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor common logic out of CFE_TIME_SetTime/MET/STCFCmd()
1 participant