From 2d7ea4387e54711d6536a9cd47ee83a6a65aac7c Mon Sep 17 00:00:00 2001 From: Avi Date: Tue, 27 Sep 2022 16:08:33 +1000 Subject: [PATCH 1/2] Fix #39, Remove unnecessary parentheses around return values. --- fsw/src/lc_action.c | 6 +++--- fsw/src/lc_app.c | 32 ++++++++++++++++---------------- fsw/src/lc_cmds.c | 2 +- fsw/src/lc_custom.c | 2 +- fsw/src/lc_utils.c | 16 ++++++++-------- fsw/src/lc_watch.c | 22 +++++++++++----------- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index 41db97a..5a40903 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -473,7 +473,7 @@ uint8 LC_EvaluateRPN(uint16 APNumber) EvalResult = LC_ACTION_FAIL; } - return (EvalResult); + return EvalResult; } /* end LC_EvaluateRPN */ @@ -603,7 +603,7 @@ int32 LC_ValidateADT(void *TableData) "ADT verify results: good = %d, bad = %d, unused = %d", (int)GoodCount, (int)BadCount, (int)UnusedCount); - return (TableResult); + return TableResult; } /* end LC_ValidateADT */ @@ -703,7 +703,7 @@ int32 LC_ValidateRPN(const uint16 *RPNPtr, int32 *IndexValue, int32 *StackDepthV *StackDepthValue = StackDepth; } - return (Result); + return Result; } /* end LC_ValidateRPN */ diff --git a/fsw/src/lc_app.c b/fsw/src/lc_app.c index 14d7e54..6bdbbb6 100644 --- a/fsw/src/lc_app.c +++ b/fsw/src/lc_app.c @@ -220,7 +220,7 @@ int32 LC_AppInit(void) LC_MAJOR_VERSION, LC_MINOR_VERSION, LC_REVISION, LC_MISSION_REV); } - return (Status); + return Status; } /* end LC_AppInit */ @@ -249,7 +249,7 @@ int32 LC_EvsInit(void) CFE_ES_WriteToSysLog("LC App: Error Registering For Event Services, RC = 0x%08X\n", (unsigned int)Status); } - return (Status); + return Status; } /* end LC_EvsInit */ @@ -319,7 +319,7 @@ int32 LC_SbInit(void) } } - return (Status); + return Status; } /* end LC_SbInit */ @@ -383,7 +383,7 @@ int32 LC_TableInit(void) */ if ((Result = LC_CreateResultTables()) != CFE_SUCCESS) { - return (Result); + return Result; } /* @@ -403,7 +403,7 @@ int32 LC_TableInit(void) */ if ((Result = LC_CreateDefinitionTables()) != CFE_SUCCESS) { - return (Result); + return Result; } /* @@ -435,7 +435,7 @@ int32 LC_TableInit(void) { CFE_EVS_SendEvent(LC_WDT_GETADDR_ERR_EID, CFE_EVS_EventType_ERROR, "Error getting WDT address, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } /* @@ -447,7 +447,7 @@ int32 LC_TableInit(void) { CFE_EVS_SendEvent(LC_ADT_GETADDR_ERR_EID, CFE_EVS_EventType_ERROR, "Error getting ADT address, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } } else @@ -455,7 +455,7 @@ int32 LC_TableInit(void) Result = LC_LoadDefaultTables(); if ((Result != CFE_SUCCESS) && (Result != CFE_TBL_INFO_UPDATED)) { - return (Result); + return Result; } } @@ -488,7 +488,7 @@ int32 LC_TableInit(void) (unsigned int)LC_OperData.TableResults); } - return (CFE_SUCCESS); + return CFE_SUCCESS; } /* LC_TableInit() */ @@ -565,7 +565,7 @@ int32 LC_CreateResultTables(void) LC_OperData.TableResults |= LC_ART_TBL_CREATED; } - return (Result); + return Result; } /* LC_CreateResultTables() */ @@ -722,7 +722,7 @@ int32 LC_CreateDefinitionTables(void) } } - return (Result); + return Result; } /* LC_CreateDefinitionTables() */ @@ -768,7 +768,7 @@ int32 LC_CreateTaskCDS(void) { CFE_EVS_SendEvent(LC_WRT_CDS_REGISTER_ERR_EID, CFE_EVS_EventType_ERROR, "Error registering WRT CDS Area, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } /* @@ -802,7 +802,7 @@ int32 LC_CreateTaskCDS(void) { CFE_EVS_SendEvent(LC_ART_CDS_REGISTER_ERR_EID, CFE_EVS_EventType_ERROR, "Error registering ART CDS Area, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } /* @@ -847,10 +847,10 @@ int32 LC_CreateTaskCDS(void) { CFE_EVS_SendEvent(LC_APP_CDS_REGISTER_ERR_EID, CFE_EVS_EventType_ERROR, "Error registering application data CDS Area, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } - return (CFE_SUCCESS); + return CFE_SUCCESS; } /* LC_CreateTaskCDS() */ @@ -970,7 +970,7 @@ int32 LC_LoadDefaultTables(void) } } - return (Result); + return Result; } /* LC_LoadDefaultTables() */ diff --git a/fsw/src/lc_cmds.c b/fsw/src/lc_cmds.c index 4bed495..4406b9a 100644 --- a/fsw/src/lc_cmds.c +++ b/fsw/src/lc_cmds.c @@ -122,7 +122,7 @@ int32 LC_AppPipe(const CFE_SB_Buffer_t *BufPtr) } /* end MessageID switch */ - return (Status); + return Status; } /* End LC_AppPipe */ diff --git a/fsw/src/lc_custom.c b/fsw/src/lc_custom.c index 6a08905..e6b79f5 100644 --- a/fsw/src/lc_custom.c +++ b/fsw/src/lc_custom.c @@ -90,7 +90,7 @@ uint8 LC_CustomFunction(uint16 WatchIndex, uint32 ProcessedWPData, const CFE_SB_ } /* end WatchIndex switch */ - return (EvalResult); + return EvalResult; } /* end LC_CustomFunction */ diff --git a/fsw/src/lc_utils.c b/fsw/src/lc_utils.c index 9cf34a3..83a6e34 100644 --- a/fsw/src/lc_utils.c +++ b/fsw/src/lc_utils.c @@ -94,7 +94,7 @@ bool LC_VerifyMsgLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) result = false; } - return (result); + return result; } /* End of LC_VerifyMsgLength */ @@ -145,7 +145,7 @@ int32 LC_ManageTables(void) { CFE_EVS_SendEvent(LC_WDT_GETADDR_ERR_EID, CFE_EVS_EventType_ERROR, "Error getting WDT address, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } Result = CFE_TBL_GetAddress((void *)&LC_OperData.ADTPtr, LC_OperData.ADTHandle); @@ -161,10 +161,10 @@ int32 LC_ManageTables(void) { CFE_EVS_SendEvent(LC_ADT_GETADDR_ERR_EID, CFE_EVS_EventType_ERROR, "Error getting ADT address, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } - return (CFE_SUCCESS); + return CFE_SUCCESS; } /* LC_ManageTables() */ @@ -187,7 +187,7 @@ int32 LC_UpdateTaskCDS(void) { CFE_EVS_SendEvent(LC_WRT_NO_SAVE_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to update watchpoint results in CDS, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } /* @@ -199,7 +199,7 @@ int32 LC_UpdateTaskCDS(void) { CFE_EVS_SendEvent(LC_ART_NO_SAVE_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to update actionpoint results in CDS, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } /* @@ -216,10 +216,10 @@ int32 LC_UpdateTaskCDS(void) { CFE_EVS_SendEvent(LC_APP_NO_SAVE_START_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to update application data in CDS, RC=0x%08X", (unsigned int)Result); - return (Result); + return Result; } - return (CFE_SUCCESS); + return CFE_SUCCESS; } /* LC_UpdateTaskCDS() */ diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index 3a8afaa..9ffc40b 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -236,7 +236,7 @@ LC_WatchPtList_t *LC_AddWatchpoint(CFE_SB_MsgId_t MessageID) } /* Return pointer to last link in watchpoint linked list */ - return (WatchPtLink); + return WatchPtLink; } /* End of LC_AddWatchpoint() */ @@ -540,7 +540,7 @@ uint8 LC_OperatorCompare(uint16 WatchIndex, uint32 ProcessedWPData) break; } - return (EvalResult); + return EvalResult; } /* end LC_OperatorCompare */ @@ -594,7 +594,7 @@ uint8 LC_SignedCompare(uint16 WatchIndex, int32 WPValue, int32 CompareValue) break; } - return (EvalResult); + return EvalResult; } /* end LC_SignedCompare */ @@ -648,7 +648,7 @@ uint8 LC_UnsignedCompare(uint16 WatchIndex, uint32 WPValue, uint32 CompareValue) break; } - return (EvalResult); + return EvalResult; } /* end LC_UnsignedCompare */ @@ -735,7 +735,7 @@ uint8 LC_FloatCompare(uint16 WatchIndex, LC_MultiType_t *WPMultiType, LC_MultiTy EvalResult = LC_WATCH_ERROR; } - return (EvalResult); + return EvalResult; } /* end LC_FloatCompare */ @@ -796,7 +796,7 @@ bool LC_WPOffsetValid(uint16 WatchIndex, const CFE_SB_Buffer_t *BufPtr) LC_OperData.WRTPtr[WatchIndex].WatchResult = LC_WATCH_ERROR; LC_OperData.WRTPtr[WatchIndex].CountdownToStale = 0; - return (false); + return false; break; } /* end switch */ @@ -820,7 +820,7 @@ bool LC_WPOffsetValid(uint16 WatchIndex, const CFE_SB_Buffer_t *BufPtr) LC_OperData.WRTPtr[WatchIndex].CountdownToStale = 0; } - return (OffsetValid); + return OffsetValid; } /* end LC_WPOffsetValid */ @@ -933,7 +933,7 @@ bool LC_GetSizedWPData(uint16 WatchIndex, const uint8 *WPDataPtr, uint32 *SizedD /* ** Return success flag */ - return (Success); + return Success; } /* end LC_GetSizedWPData */ @@ -1068,7 +1068,7 @@ int32 LC_ValidateWDT(void *TableData) "WDT verify results: good = %d, bad = %d, unused = %d", (int)GoodCount, (int)BadCount, (int)UnusedCount); - return (TableResult); + return TableResult; } /* end LC_ValidateWDT */ @@ -1103,7 +1103,7 @@ bool LC_Uint32IsNAN(uint32 Data) } } - return (Result); + return Result; } /* end LC_Uint32IsNAN */ @@ -1139,7 +1139,7 @@ bool LC_Uint32IsInfinite(uint32 Data) } } - return (Result); + return Result; } /* end LC_Uint32IsInfinite */ From 211183ce0c8b83f9bbd775d394e67ef2a04b8222 Mon Sep 17 00:00:00 2001 From: Avi Date: Wed, 28 Sep 2022 16:40:29 +1000 Subject: [PATCH 2/2] Fix #41, Remove 'return;' from last line of void functions. --- docs/dox_src/cfs_lc.dox | 6 +++--- fsw/src/lc_action.c | 6 ------ fsw/src/lc_cmds.c | 33 --------------------------------- fsw/src/lc_custom.c | 3 --- fsw/src/lc_watch.c | 9 --------- 5 files changed, 3 insertions(+), 54 deletions(-) diff --git a/docs/dox_src/cfs_lc.dox b/docs/dox_src/cfs_lc.dox index 296eddb..49afd40 100644 --- a/docs/dox_src/cfs_lc.dox +++ b/docs/dox_src/cfs_lc.dox @@ -230,7 +230,7 @@ #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter. When considering how many watchpoints and actionpoints are needed, keep in mind the the entire WDT is sequentially searched whenever a message that may contain watchpoints is received. Likewise the entire - ADT will be processed whenever a #LC_SAMPLE_AP_MID message is recieved. While it + ADT will be processed whenever a #LC_SAMPLE_AP_MID message is received. While it is desirable to leave unused entries in both tables for later updates, large tables will increase search time which may be undesirable depending on the telemetry and actionpoint sample rates required. LC defines the performance ID #LC_WDT_SEARCH_PERF_ID @@ -429,7 +429,7 @@ #LC_WATCH_STALE is an initialization value for the Watchpoint Results Table. If a watchpoint has this WatchResult then the watchpoint is unused (the DataType in the WDT is set to #LC_WATCH_NOT_USED) or a - message that contains the watchpoint has not yet been recieved by LC and + message that contains the watchpoint has not yet been received by LC and evaluated. @@ -526,7 +526,7 @@ #LC_ACTION_NOT_USED). 2) An actionpoint sample request (#LC_SAMPLE_AP_MID) targeting the AP has not - yet been recieved by LC so the AP has not yet been evaluated. + yet been received by LC so the AP has not yet been evaluated. 3) One or more of the watchpoints that this AP depends on (as defined by the RPN expression) has a current WatchResult of #LC_WATCH_STALE diff --git a/fsw/src/lc_action.c b/fsw/src/lc_action.c index 41db97a..4502925 100644 --- a/fsw/src/lc_action.c +++ b/fsw/src/lc_action.c @@ -78,9 +78,6 @@ void LC_SampleAPs(uint16 StartIndex, uint16 EndIndex) LC_SampleSingleAP(TableIndex); } } - - return; - } /* end LC_SampleAP */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -268,9 +265,6 @@ void LC_SampleSingleAP(uint16 APNumber) } } /* end CurrentAPState if */ - - return; - } /* end LC_SampleSingleAP */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fsw/src/lc_cmds.c b/fsw/src/lc_cmds.c index 4bed495..8ad5057 100644 --- a/fsw/src/lc_cmds.c +++ b/fsw/src/lc_cmds.c @@ -198,9 +198,6 @@ void LC_SampleAPReq(const CFE_SB_Buffer_t *BufPtr) } } } - - return; - } /* end LC_SampleAPReq */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -509,9 +506,6 @@ void LC_NoopCmd(const CFE_SB_Buffer_t *BufPtr) CFE_EVS_SendEvent(LC_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command: Version %d.%d.%d.%d", LC_MAJOR_VERSION, LC_MINOR_VERSION, LC_REVISION, LC_MISSION_REV); } - - return; - } /* end LC_NoopCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -532,9 +526,6 @@ void LC_ResetCmd(const CFE_SB_Buffer_t *BufPtr) CFE_EVS_SendEvent(LC_RESET_DBG_EID, CFE_EVS_EventType_DEBUG, "Reset counters command"); } - - return; - } /* end LC_ResetCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -551,9 +542,6 @@ void LC_ResetCounters(void) LC_AppData.MonitoredMsgCount = 0; LC_AppData.RTSExecCount = 0; LC_AppData.PassiveRTSExecCount = 0; - - return; - } /* end LC_ResetCounters */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -593,9 +581,6 @@ void LC_SetLCStateCmd(const CFE_SB_Buffer_t *BufPtr) break; } } - - return; - } /* end LC_SetLCStateCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -724,9 +709,6 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr) } /* end ValidState if */ } /* end LC_VerifyMsgLength if */ - - return; - } /* end LC_SetAPStateCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -792,9 +774,6 @@ void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr) } /* end CmdPtr -> APNumber else */ } /* end LC_VerifyMsgLength if */ - - return; - } /* end LC_SetAPPermOffCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -839,9 +818,6 @@ void LC_ResetAPStatsCmd(const CFE_SB_Buffer_t *BufPtr) CmdPtr->APNumber); } } - - return; - } /* end LC_ResetAPStatsCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -872,9 +848,6 @@ void LC_ResetResultsAP(uint32 StartIndex, uint32 EndIndex, bool ResetStatsCmd) LC_OperData.ARTPtr[TableIndex].CumulativeRTSExecCount = 0; LC_OperData.ARTPtr[TableIndex].CumulativeEventMsgsSent = 0; } - - return; - } /* end LC_ResetResultsAP */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -919,9 +892,6 @@ void LC_ResetWPStatsCmd(const CFE_SB_Buffer_t *BufPtr) CmdPtr->WPNumber); } } - - return; - } /* end LC_ResetWPStatsCmd */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -956,9 +926,6 @@ void LC_ResetResultsWP(uint32 StartIndex, uint32 EndIndex, bool ResetStatsCmd) LC_OperData.WRTPtr[TableIndex].LastTrueToFalse.Timestamp.Seconds = 0; LC_OperData.WRTPtr[TableIndex].LastTrueToFalse.Timestamp.Subseconds = 0; } - - return; - } /* end LC_ResetResultsWP */ /************************/ diff --git a/fsw/src/lc_custom.c b/fsw/src/lc_custom.c index 6a08905..f870a3f 100644 --- a/fsw/src/lc_custom.c +++ b/fsw/src/lc_custom.c @@ -52,9 +52,6 @@ void LC_ExecuteRTS(uint16 RTSId) RTSRequest.RTSId = RTSId; CFE_SB_TransmitMsg(&RTSRequest.CmdHeader.Msg, true); - - return; - } /* end LC_ExecuteRTS */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ diff --git a/fsw/src/lc_watch.c b/fsw/src/lc_watch.c index 3a8afaa..0f3a01b 100644 --- a/fsw/src/lc_watch.c +++ b/fsw/src/lc_watch.c @@ -131,9 +131,6 @@ void LC_CreateHashTable(void) LastMessageID = MessageID; } } - - return; - } /* End of LC_CreateHashTable() */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -323,9 +320,6 @@ void LC_CheckMsgForWPs(CFE_SB_MsgId_t MessageID, const CFE_SB_Buffer_t *BufPtr) (unsigned long)CFE_SB_MsgIdToValue(MessageID)); } } - - return; - } /* end LC_CheckMsgForWPs */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -430,9 +424,6 @@ void LC_ProcessWP(uint16 WatchIndex, const CFE_SB_Buffer_t *BufPtr, CFE_TIME_Sys } } /* end SizedDataValid if */ - - return; - } /* end LC_ProcessWP */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */