Skip to content

Commit

Permalink
Merge pull request nasa#1232 from skliper/fix1200-fix_types
Browse files Browse the repository at this point in the history
Fix nasa#1200, Resolve type issues with CFE_ES_FileWriteByteCntErr and CFE_TBL_FindTableInRegistry
  • Loading branch information
astrogeco authored Mar 18, 2021
2 parents 63f4eb2 + 6b76dd7 commit c642d5e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions modules/es/fsw/src/cfe_es_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -1990,12 +1990,12 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data)
/* a byte count discrepancy has been*/
/* detected during the file write */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, size_t Actual)
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 Status)
{

CFE_EVS_SendEvent(CFE_ES_FILEWRITE_ERR_EID, CFE_EVS_EventType_ERROR,
"File write,byte cnt err,file %s,request=%u,actual=%u", Filename, (unsigned int)Requested,
(unsigned int)Actual);
"File write,byte cnt err,file %s,request=%u,status=0x%08x", Filename, (unsigned int)Requested,
(unsigned int)Status);

} /* End of CFE_ES_FileWriteByteCntErr() */

Expand Down
2 changes: 1 addition & 1 deletion modules/es/fsw/src/cfe_es_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data);
*/
bool CFE_ES_ValidateHandle(CFE_ES_MemHandle_t Handle);
bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength);
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, size_t Actual);
void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 Status);

/*************************************************************************/

Expand Down
9 changes: 5 additions & 4 deletions modules/tbl/fsw/src/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
CFE_TBL_File_Hdr_t TblFileHeader;
osal_id_t FileDescriptor;
int32 Status;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
char LoadFilename[OS_MAX_PATH_LEN];
Expand All @@ -379,17 +380,17 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
if (Status == CFE_SUCCESS)
{
/* Locate specified table in registry */
Status = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);
RegIndex = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);

if (Status == CFE_TBL_NOT_FOUND)
if (RegIndex == CFE_TBL_NOT_FOUND)
{
CFE_EVS_SendEvent(CFE_TBL_NO_SUCH_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"Unable to locate '%s' in Table Registry", TblFileHeader.TableName);
}
else
{
/* Translate the registry index into a record pointer */
RegRecPtr = &CFE_TBL_Global.Registry[Status];
RegRecPtr = &CFE_TBL_Global.Registry[RegIndex];

if (RegRecPtr->DumpOnly)
{
Expand Down Expand Up @@ -1321,7 +1322,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data)
char TableName[CFE_TBL_MAX_FULL_NAME_LEN];
CFE_TBL_CritRegRec_t * CritRegRecPtr = NULL;
uint32 i;
uint32 RegIndex;
int16 RegIndex;
int32 Status;

/* Make sure all strings are null terminated before attempting to process them */
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ void Test_CFE_TBL_Manage(void)
{
int32 RtnCode;
bool EventsCorrect;
int32 RegIndex;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
UT_Table1_t TestTable1;
Expand Down

0 comments on commit c642d5e

Please sign in to comment.