From 519e70938f96dc6c760c504fc18fd1cd7fec179f Mon Sep 17 00:00:00 2001 From: Avi Date: Mon, 7 Nov 2022 11:51:15 +1000 Subject: [PATCH] Fix #39, Remove initializations causing Cppcheck errors --- fsw/src/md_cmds.c | 32 ++++++++++++++++---------------- fsw/src/md_dwell_pkt.c | 8 ++++---- fsw/src/md_dwell_tbl.c | 2 +- fsw/src/md_utils.c | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fsw/src/md_cmds.c b/fsw/src/md_cmds.c index 0e9af9b..a853e51 100644 --- a/fsw/src/md_cmds.c +++ b/fsw/src/md_cmds.c @@ -42,11 +42,11 @@ extern MD_AppData_t MD_AppData; void MD_ProcessStartCmd(const CFE_SB_Buffer_t *BufPtr) { - int32 ErrorCount = 0; - int32 Status = CFE_SUCCESS; - int32 NumTblInMask = 0; /* Purely as info for event message */ - uint16 TableId = 0; - uint16 TableIndex = 0; + int32 ErrorCount = 0; + int32 Status; + int32 NumTblInMask = 0; /* Purely as info for event message */ + uint16 TableId = 0; + uint16 TableIndex; MD_CmdStartStop_t *Start = (MD_CmdStartStop_t *)BufPtr; bool AnyTablesInMask = false; @@ -130,12 +130,12 @@ void MD_ProcessStartCmd(const CFE_SB_Buffer_t *BufPtr) void MD_ProcessStopCmd(const CFE_SB_Buffer_t *BufPtr) { - int32 ErrorCount = 0; - int32 Status = CFE_SUCCESS; - int32 NumTblInMask = 0; /* Purely as info for event message */ - MD_CmdStartStop_t *Stop = (MD_CmdStartStop_t *)BufPtr; - uint16 TableId = 0; - uint16 TableIndex = 0; + int32 ErrorCount = 0; + int32 Status; + int32 NumTblInMask = 0; /* Purely as info for event message */ + MD_CmdStartStop_t *Stop = (MD_CmdStartStop_t *)BufPtr; + uint16 TableId = 0; + uint16 TableIndex; bool AnyTablesInMask = false; for (TableId = 1; TableId <= MD_NUM_DWELL_TABLES; TableId++) @@ -192,13 +192,13 @@ void MD_ProcessStopCmd(const CFE_SB_Buffer_t *BufPtr) void MD_ProcessJamCmd(const CFE_SB_Buffer_t *BufPtr) { /* Local variables */ - int32 Status = CFE_SUCCESS; + int32 Status; MD_CmdJam_t * Jam = 0; bool AllInputsValid = true; cpuaddr ResolvedAddr = 0; - MD_DwellControlEntry_t *DwellEntryPtr = 0; /* points to local task data */ - uint16 EntryIndex = 0; - uint8 TableIndex = 0; + MD_DwellControlEntry_t *DwellEntryPtr; /* points to local task data */ + uint16 EntryIndex; + uint8 TableIndex = 0; MD_SymAddr_t NewDwellAddress; /* @@ -407,7 +407,7 @@ void MD_ProcessJamCmd(const CFE_SB_Buffer_t *BufPtr) void MD_ProcessSignatureCmd(const CFE_SB_Buffer_t *BufPtr) { - int32 Status = CFE_SUCCESS; + int32 Status; MD_CmdSetSignature_t *SignatureCmd = (MD_CmdSetSignature_t *)BufPtr; uint16 TblId = 0; uint16 StringLength; diff --git a/fsw/src/md_dwell_pkt.c b/fsw/src/md_dwell_pkt.c index 904d66a..b3bb10e 100644 --- a/fsw/src/md_dwell_pkt.c +++ b/fsw/src/md_dwell_pkt.c @@ -37,11 +37,11 @@ extern MD_AppData_t MD_AppData; void MD_DwellLoop(void) { - int32 Result = 0; + int32 Result; uint16 TblIndex; - uint16 EntryIndex = 0; - uint16 NumDwellAddresses = 0; - MD_DwellPacketControl_t *TblPtr = NULL; + uint16 EntryIndex; + uint16 NumDwellAddresses; + MD_DwellPacketControl_t *TblPtr = NULL; /* Check each dwell table */ for (TblIndex = 0; TblIndex < MD_NUM_DWELL_TABLES; TblIndex++) diff --git a/fsw/src/md_dwell_tbl.c b/fsw/src/md_dwell_tbl.c index a3e6bf6..1264d12 100644 --- a/fsw/src/md_dwell_tbl.c +++ b/fsw/src/md_dwell_tbl.c @@ -171,7 +171,7 @@ int32 MD_ReadDwellTable(const MD_DwellTableLoad_t *TblPtr, uint16 *ActiveAddrCou /******************************************************************************/ int32 MD_CheckTableEntries(MD_DwellTableLoad_t *TblPtr, uint16 *ErrorEntryArg) { - int32 Status = CFE_SUCCESS; + int32 Status; int32 FirstErrorCode = CFE_SUCCESS; uint16 EntryIndex; int32 FirstBadIndex = -1; diff --git a/fsw/src/md_utils.c b/fsw/src/md_utils.c index a2ddc04..62e174e 100644 --- a/fsw/src/md_utils.c +++ b/fsw/src/md_utils.c @@ -189,7 +189,7 @@ bool MD_Verify16Aligned(cpuaddr Address, uint32 Size) bool MD_ResolveSymAddr(MD_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr) { bool Valid; - int32 OS_Status = OS_SUCCESS; + int32 OS_Status; /* ** NUL terminate the very end of the symbol name string array as a