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 #217, Convert remaining int32 CFE status variables to CFE_Status_t #218

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions fsw/src/sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
void SAMPLE_APP_Main(void)
{
int32 status;
CFE_Status_t status;
CFE_SB_Buffer_t *SBBufPtr;

/*
Expand Down Expand Up @@ -107,10 +107,10 @@
/* Initialization */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
int32 SAMPLE_APP_Init(void)
CFE_Status_t SAMPLE_APP_Init(void)
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

Check notice

Code scanning / CodeQL-coding-standard

Function too long Note

SAMPLE_APP_Init has too many lines (93, while 60 are allowed).

Check notice

Code scanning / CodeQL-coding-standard

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
{
int32 status;
char VersionString[SAMPLE_APP_CFG_MAX_VERSION_STR_LEN];
CFE_Status_t status;
char VersionString[SAMPLE_APP_CFG_MAX_VERSION_STR_LEN];

/* Zero out the global data structure */
memset(&SAMPLE_APP_Data, 0, sizeof(SAMPLE_APP_Data));
Expand Down Expand Up @@ -173,7 +173,6 @@
{
CFE_ES_WriteToSysLog("Sample App: Error Subscribing to Command, RC = 0x%08lX\n", (unsigned long)status);
}

}

if (status == CFE_SUCCESS)
Expand All @@ -192,8 +191,8 @@
status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_TABLE_FILE);
}

CFE_Config_GetVersionString(VersionString, SAMPLE_APP_CFG_MAX_VERSION_STR_LEN, "Sample App",
SAMPLE_APP_VERSION, SAMPLE_APP_BUILD_CODENAME, SAMPLE_APP_LAST_OFFICIAL);
CFE_Config_GetVersionString(VersionString, SAMPLE_APP_CFG_MAX_VERSION_STR_LEN, "Sample App", SAMPLE_APP_VERSION,
SAMPLE_APP_BUILD_CODENAME, SAMPLE_APP_LAST_OFFICIAL);

CFE_EVS_SendEvent(SAMPLE_APP_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "Sample App Initialized.%s",
VersionString);
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extern SAMPLE_APP_Data_t SAMPLE_APP_Data;
** Note: Except for the entry point (SAMPLE_APP_Main), these
** functions are not called from any other source module.
*/
void SAMPLE_APP_Main(void);
int32 SAMPLE_APP_Init(void);
void SAMPLE_APP_Main(void);
CFE_Status_t SAMPLE_APP_Init(void);

#endif /* SAMPLE_APP_H */
2 changes: 1 addition & 1 deletion fsw/src/sample_app_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Ms
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
{
int32 status;
CFE_Status_t status;
void * TblAddr;
SAMPLE_APP_ExampleTable_t *TblPtr;
const char * TableName = "SAMPLE_APP.ExampleTable";
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/sample_app_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
/* Verify contents of First Example Table buffer contents */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 SAMPLE_APP_TblValidationFunc(void *TblData)
CFE_Status_t SAMPLE_APP_TblValidationFunc(void *TblData)
{
int32 ReturnCode = CFE_SUCCESS;
CFE_Status_t ReturnCode = CFE_SUCCESS;
SAMPLE_APP_ExampleTable_t *TblDataPtr = (SAMPLE_APP_ExampleTable_t *)TblData;

/*
Expand All @@ -58,7 +58,7 @@ int32 SAMPLE_APP_TblValidationFunc(void *TblData)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void SAMPLE_APP_GetCrc(const char *TableName)
{
int32 status;
CFE_Status_t status;
uint32 Crc;
CFE_TBL_Info_t TblInfoPtr;

Expand Down
4 changes: 2 additions & 2 deletions fsw/src/sample_app_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
#include "sample_app.h"

int32 SAMPLE_APP_TblValidationFunc(void *TblData);
void SAMPLE_APP_GetCrc(const char *TableName);
CFE_Status_t SAMPLE_APP_TblValidationFunc(void *TblData);
void SAMPLE_APP_GetCrc(const char *TableName);

#endif /* SAMPLE_APP_UTILS_H */
2 changes: 1 addition & 1 deletion unit-test/coveragetest/coveragetest_sample_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void Test_SAMPLE_APP_Init(void)
{
/*
* Test Case For:
* int32 SAMPLE_APP_Init( void )
* CFE_Status_t SAMPLE_APP_Init( void )
*/

/* nominal case should return CFE_SUCCESS */
Expand Down
2 changes: 1 addition & 1 deletion unit-test/coveragetest/coveragetest_sample_app_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void Test_SAMPLE_APP_TblValidationFunc(void)
{
/*
* Test Case For:
* int32 SAMPLE_APP_TblValidationFunc( void *TblData )
* CFE_Status_t SAMPLE_APP_TblValidationFunc( void *TblData )
*/
SAMPLE_APP_ExampleTable_t TestTblData;

Expand Down
6 changes: 3 additions & 3 deletions unit-test/stubs/sample_app_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
* Generated stub function for SAMPLE_APP_Init()
* ----------------------------------------------------
*/
int32 SAMPLE_APP_Init(void)
CFE_Status_t SAMPLE_APP_Init(void)
{
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_Init, int32);
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_Init, CFE_Status_t);

UT_GenStub_Execute(SAMPLE_APP_Init, Basic, NULL);

return UT_GenStub_GetReturnValue(SAMPLE_APP_Init, int32);
return UT_GenStub_GetReturnValue(SAMPLE_APP_Init, CFE_Status_t);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions unit-test/stubs/sample_app_utils_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ void SAMPLE_APP_GetCrc(const char *TableName)
* Generated stub function for SAMPLE_APP_TblValidationFunc()
* ----------------------------------------------------
*/
int32 SAMPLE_APP_TblValidationFunc(void *TblData)
CFE_Status_t SAMPLE_APP_TblValidationFunc(void *TblData)
{
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_TblValidationFunc, int32);
UT_GenStub_SetupReturnBuffer(SAMPLE_APP_TblValidationFunc, CFE_Status_t);

UT_GenStub_AddParam(SAMPLE_APP_TblValidationFunc, void *, TblData);

UT_GenStub_Execute(SAMPLE_APP_TblValidationFunc, Basic, NULL);

return UT_GenStub_GetReturnValue(SAMPLE_APP_TblValidationFunc, int32);
return UT_GenStub_GetReturnValue(SAMPLE_APP_TblValidationFunc, CFE_Status_t);
}
Loading