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 #76, Update const-ness of inputs #77

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Correct the const qualifiers on functions in fm_cmd_utils.c. Most of these functions do not modify their inputs, but were not const, except for the one function that was marked const and did modify its inputs (backwards).

Fixes #76

Testing performed
Build and run tests

Expected behavior changes
Nothing visible externally. Message processors no longer modify input buffers.

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

fsw/src/fm_cmd_utils.h Fixed Show fixed Hide fixed
fsw/src/fm_cmd_utils.h Fixed Show fixed Hide fixed
@@ -157,7 +157,7 @@
}
}

uint32 FM_GetFilenameState(char *Filename, uint32 BufferSize, bool FileInfoCmd)
uint32 FM_GetFilenameState(const char *Filename, uint32 BufferSize, bool FileInfoCmd)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
fsw/src/fm_cmd_utils.c Fixed Show fixed Hide fixed
@@ -157,7 +157,7 @@
}
}

uint32 FM_GetFilenameState(char *Filename, uint32 BufferSize, bool FileInfoCmd)
uint32 FM_GetFilenameState(const char *Filename, uint32 BufferSize, bool FileInfoCmd)

Check notice

Code scanning / CodeQL-coding-standard

Function too long

FM_GetFilenameState has too many lines (78, while 60 are allowed).
fsw/src/fm_cmd_utils.c Fixed Show fixed Hide fixed
Correct the const qualifiers on functions in fm_cmd_utils.c.
Most of these functions do not modify their inputs, but were not const,
except for the one function that _was_ marked const and _did_ modify its
inputs (backwards).
@@ -242,18 +242,22 @@
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

uint32 FM_VerifyNameValid(char *Name, uint32 BufferSize, uint32 EventID, const char *CmdText)
uint32 FM_VerifyNameValid(const char *Name, uint32 BufferSize, uint32 EventID, const char *CmdText)

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@@ -265,13 +269,14 @@
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

bool FM_VerifyFileState(FM_File_States State, char *Filename, uint32 BufferSize, uint32 EventID, const char *CmdText)
bool FM_VerifyFileState(FM_File_States State, const char *Filename, uint32 BufferSize, uint32 EventID,

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
@@ -265,13 +269,14 @@
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

bool FM_VerifyFileState(FM_File_States State, char *Filename, uint32 BufferSize, uint32 EventID, const char *CmdText)
bool FM_VerifyFileState(FM_File_States State, const char *Filename, uint32 BufferSize, uint32 EventID,

Check notice

Code scanning / CodeQL-coding-standard

Function too long

FM_VerifyFileState has too many lines (103, while 60 are allowed).
@dzbaker dzbaker merged commit f878c98 into nasa:main Feb 2, 2023
@jphickey jphickey deleted the fix-76-constness-correct branch March 7, 2023 16:22
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal API calls are not const-correct (possible race condition)
3 participants