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 #89, Convert int32 return codes and variables to CFE_Status_t #90

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
46 changes: 23 additions & 23 deletions fsw/src/sc_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SC_OperData_t SC_OperData; /* SC Operational Data */
void SC_AppMain(void)
{
uint32 RunStatus = CFE_ES_RunStatus_APP_RUN;
int32 Result;
CFE_Status_t Result;
CFE_SB_Buffer_t *BufPtr = NULL;

/* Performance Log (start time counter) */
Expand Down Expand Up @@ -136,9 +136,9 @@ void SC_AppMain(void)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 SC_AppInit(void)
CFE_Status_t SC_AppInit(void)

Check notice

Code scanning / CodeQL

Function too long

SC_AppInit has too many lines (89, while 60 are allowed).

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
int32 Result;
CFE_Status_t Result;

/* Clear global data structures */
memset(&SC_OperData, 0, sizeof(SC_OperData));
Expand Down Expand Up @@ -232,11 +232,11 @@ int32 SC_AppInit(void)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 SC_InitTables(void)
CFE_Status_t SC_InitTables(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.

Check notice

Code scanning / CodeQL

Function too long

SC_InitTables has too many lines (62, while 60 are allowed).
{
int32 Result;
int32 i;
int32 j;
CFE_Status_t Result;
int32 i;
int32 j;

/* Must be able to register all tables with cFE Table Services */
Result = SC_RegisterAllTables();
Expand Down Expand Up @@ -301,9 +301,9 @@ int32 SC_InitTables(void)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 SC_RegisterAllTables(void)
CFE_Status_t SC_RegisterAllTables(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
int32 Result;
CFE_Status_t Result;

Result = SC_RegisterDumpOnlyTables();
if (Result != CFE_SUCCESS)
Expand All @@ -320,11 +320,11 @@ int32 SC_RegisterAllTables(void)
return (CFE_SUCCESS);
}

int32 SC_RegisterDumpOnlyTables(void)
CFE_Status_t SC_RegisterDumpOnlyTables(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
int i;
int32 Result;
char TableName[CFE_MISSION_TBL_MAX_NAME_LENGTH];
int i;
CFE_Status_t Result;
char TableName[CFE_MISSION_TBL_MAX_NAME_LENGTH];

CFE_TBL_Handle_t *TblHandlePtr[4] = {&SC_OperData.RtsInfoHandle, &SC_OperData.RtsCtrlBlckHandle,
&SC_OperData.AtsInfoHandle, &SC_OperData.AtsCtrlBlckHandle};
Expand Down Expand Up @@ -368,11 +368,11 @@ int32 SC_RegisterDumpOnlyTables(void)
return (CFE_SUCCESS);
}

int32 SC_RegisterLoadableTables(void)
CFE_Status_t SC_RegisterLoadableTables(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
int i, j;
int32 Result;
char TableName[CFE_MISSION_TBL_MAX_NAME_LENGTH];
int i, j;
CFE_Status_t Result;
char TableName[CFE_MISSION_TBL_MAX_NAME_LENGTH];

uint16 NumTables[2] = {SC_NUMBER_OF_RTS, SC_NUMBER_OF_ATS};
const char * StrFormat[2] = {"%s%03d", "%s%d"};
Expand Down Expand Up @@ -421,10 +421,10 @@ int32 SC_RegisterLoadableTables(void)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 SC_GetDumpTablePointers(void)
CFE_Status_t SC_GetDumpTablePointers(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
int i;
int32 Result;
int i;
CFE_Status_t Result;

void ** TblAddr[4] = {(void **)&SC_OperData.RtsInfoTblAddr, (void **)&SC_OperData.RtsCtrlBlckAddr,
(void **)&SC_OperData.AtsInfoTblAddr, (void **)&SC_OperData.AtsCtrlBlckAddr};
Expand Down Expand Up @@ -466,10 +466,10 @@ int32 SC_GetDumpTablePointers(void)
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int32 SC_GetLoadTablePointers(void)
CFE_Status_t SC_GetLoadTablePointers(void)

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
{
int i;
int32 Result;
int i;
CFE_Status_t Result;

/* Get buffer address for loadable ATS tables */
for (i = 0; i < SC_NUMBER_OF_ATS; i++)
Expand Down
14 changes: 7 additions & 7 deletions fsw/src/sc_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void SC_AppMain(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 SC_AppInit(void);
CFE_Status_t SC_AppInit(void);

/**
* \brief Initialize application tables
Expand All @@ -86,7 +86,7 @@ int32 SC_AppInit(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 SC_InitTables(void);
CFE_Status_t SC_InitTables(void);

/**
* \brief Register tables with cFE Table Services
Expand All @@ -103,11 +103,11 @@ int32 SC_InitTables(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 SC_RegisterAllTables(void);
CFE_Status_t SC_RegisterAllTables(void);

int32 SC_RegisterDumpOnlyTables(void);
CFE_Status_t SC_RegisterDumpOnlyTables(void);

int32 SC_RegisterLoadableTables(void);
CFE_Status_t SC_RegisterLoadableTables(void);

/**
* \brief Get dump only table buffer pointers
Expand All @@ -124,7 +124,7 @@ int32 SC_RegisterLoadableTables(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 SC_GetDumpTablePointers(void);
CFE_Status_t SC_GetDumpTablePointers(void);

/**
* \brief Get loadable table buffer pointers
Expand All @@ -141,7 +141,7 @@ int32 SC_GetDumpTablePointers(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 SC_GetLoadTablePointers(void);
CFE_Status_t SC_GetLoadTablePointers(void);

/**
* \brief Load default RTS tables
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/sc_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void SC_ProcessAtpCmd(void)
uint8 AtsIndex; /* ATS selection index */
uint32 CmdIndex; /* ATS command index */
char TempAtsChar;
int32 Result;
CFE_Status_t Result;
bool AbortATS = false;
SC_AtsEntry_t * EntryPtr;
CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID;
Expand Down Expand Up @@ -293,7 +293,7 @@ void SC_ProcessRtpCommand(void)
SC_RtsEntry_t *EntryPtr; /* a pointer to an RTS entry header */
uint16 RtsIndex; /* the RTS index for the cmd */
uint16 CmdOffset; /* the location of the cmd */
uint32 Result;
CFE_Status_t Result;
bool ChecksumValid = false;

/*
Expand Down Expand Up @@ -813,7 +813,7 @@ void SC_ManageAtsTable(int32 ArrayIndex)

void SC_ManageTable(SC_TableType type, int32 ArrayIndex)
{
int32 Result;
CFE_Status_t Result;
CFE_TBL_Handle_t TblHandle;
uint32 ** TblAddr;
void * TblPtrNew;
Expand Down
Loading