Skip to content

Commit

Permalink
Merge pull request #51 from thnkslprpt/fix-50-comment-cleanup
Browse files Browse the repository at this point in the history
Fix #50, Remove redundant/inconsistent comments (/* end of function */, /* end if */ etc.) and clean up empty lines.
  • Loading branch information
dzbaker authored Oct 11, 2022
2 parents b815b2a + 2f5d41f commit 8653ba6
Show file tree
Hide file tree
Showing 26 changed files with 465 additions and 991 deletions.
22 changes: 7 additions & 15 deletions fsw/src/cs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ void CS_AppMain(void)

/* Let cFE kill the task (and child task) */
CFE_ES_ExitApp(CS_AppData.RunStatus);

} /* End of CS_AppMain () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -250,7 +249,6 @@ int32 CS_AppInit(void)

if (Result == CFE_SUCCESS)
{

/* Set up default tables in memory */
CS_InitializeDefaultTables();

Expand Down Expand Up @@ -295,7 +293,7 @@ int32 CS_AppInit(void)
CS_MAJOR_VERSION, CS_MINOR_VERSION, CS_REVISION, CS_MISSION_REV);
}
return Result;
} /* End of CS_AppInit () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -337,7 +335,7 @@ int32 CS_AppPipe(const CFE_SB_Buffer_t *BufPtr)
}

return Result;
} /* End of CS_AppPipe () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -551,7 +549,6 @@ void CS_HousekeepingCmd(const CS_NoArgsCmd_t *CmdPtr)
/* Verify the command packet length */
if (ExpectedLength != ActualLength)
{

CFE_MSG_GetMsgId(&CmdPtr->CmdHeader.Msg, &MessageID);
CFE_MSG_GetFcnCode(&CmdPtr->CmdHeader.Msg, &CommandCode);

Expand All @@ -566,7 +563,7 @@ void CS_HousekeepingCmd(const CS_NoArgsCmd_t *CmdPtr)
CFE_SB_TimeStampMsg(&CS_AppData.HkPacket.TlmHeader.Msg);
CFE_SB_TransmitMsg(&CS_AppData.HkPacket.TlmHeader.Msg, true);
}
} /* End of CS_HousekeepingCmd () */
}

#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)

Expand Down Expand Up @@ -662,8 +659,7 @@ int32 CS_CreateRestoreStatesFromCDS(void)
}

return Result;

} /* End of CS_CreateCDS() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -708,9 +704,5 @@ void CS_UpdateCDS(void)
CS_AppData.DataStoreHandle = CFE_ES_CDS_BAD_HANDLE;
}
}
} /* End of CS_UpdateCDS() */
#endif /* #if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true ) */

/************************/
/* End of File Comment */
/************************/
}
#endif /* #if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true ) */
1 change: 0 additions & 1 deletion fsw/src/cs_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ typedef struct
#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)
CFE_ES_CDSHandle_t DataStoreHandle; /**< \brief Handle to critical data store created by CS */
#endif

} CS_AppData_t;

/**************************************************************************
Expand Down
21 changes: 6 additions & 15 deletions fsw/src/cs_app_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ void CS_DisableAppCmd(const CS_NoArgsCmd_t *CmdPtr)
/* Verify command packet length */
if (CS_VerifyCmdLength(&CmdPtr->CmdHeader.Msg, ExpectedLength))
{

if (CS_CheckRecomputeOneshot() == false)
{

CS_AppData.HkPacket.AppCSState = CS_STATE_DISABLED;
CS_ZeroAppTempValues();

Expand All @@ -67,7 +65,7 @@ void CS_DisableAppCmd(const CS_NoArgsCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdCounter++;
}
}
} /* End of CS_DisableAppCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -82,10 +80,8 @@ void CS_EnableAppCmd(const CS_NoArgsCmd_t *CmdPtr)
/* Verify command packet length */
if (CS_VerifyCmdLength(&CmdPtr->CmdHeader.Msg, ExpectedLength))
{

if (CS_CheckRecomputeOneshot() == false)
{

CS_AppData.HkPacket.AppCSState = CS_STATE_ENABLED;

#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)
Expand All @@ -96,7 +92,7 @@ void CS_EnableAppCmd(const CS_NoArgsCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdCounter++;
}
}
} /* End of CS_EnableAppCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -140,7 +136,7 @@ void CS_ReportBaselineAppCmd(const CS_AppNameCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdErrCounter++;
}
}
} /* End of CS_ReportBaselineAppCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -209,7 +205,7 @@ void CS_RecomputeBaselineAppCmd(const CS_AppNameCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdErrCounter++;
}
}
} /* end CS_RecomputeBaselineAppCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -235,7 +231,6 @@ void CS_DisableNameAppCmd(const CS_AppNameCmd_t *CmdPtr)

if (CS_GetAppResTblEntryByName(&ResultsEntry, Name))
{

ResultsEntry->State = CS_STATE_DISABLED;
ResultsEntry->TempChecksumValue = 0;
ResultsEntry->ByteOffset = 0;
Expand Down Expand Up @@ -266,7 +261,7 @@ void CS_DisableNameAppCmd(const CS_AppNameCmd_t *CmdPtr)
}
} /* end InProgress if */
}
} /* End of CS_DisableNameAppCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -319,8 +314,4 @@ void CS_EnableNameAppCmd(const CS_AppNameCmd_t *CmdPtr)
}
} /* end InProgress if */
}
} /* End of CS_EnableNameAppCmd () */

/************************/
/* End of File Comment */
/************************/
}
36 changes: 15 additions & 21 deletions fsw/src/cs_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void CS_NoopCmd(const CS_NoArgsCmd_t *CmdPtr)
CFE_EVS_SendEvent(CS_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command. Version %d.%d.%d.%d",
CS_MAJOR_VERSION, CS_MINOR_VERSION, CS_REVISION, CS_MISSION_REV);
}
} /* End of CS_NoopCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -87,7 +87,7 @@ void CS_ResetCmd(const CS_NoArgsCmd_t *CmdPtr)

CFE_EVS_SendEvent(CS_RESET_DBG_EID, CFE_EVS_EventType_DEBUG, "Reset Counters command recieved");
}
} /* End of CS_ResetCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -121,7 +121,6 @@ void CS_BackgroundCheckCycle(const CS_NoArgsCmd_t *CmdPtr)
{
if (CS_AppData.HkPacket.ChecksumState == CS_STATE_ENABLED)
{

DoneWithCycle = false;
EndOfList = false;

Expand Down Expand Up @@ -196,7 +195,7 @@ void CS_BackgroundCheckCycle(const CS_NoArgsCmd_t *CmdPtr)
/* CS is disabled, Application-wide */
}
}
} /* End of CS_BackgroundCheckCycle () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -227,7 +226,7 @@ void CS_DisableAllCSCmd(const CS_NoArgsCmd_t *CmdPtr)

CFE_EVS_SendEvent(CS_DISABLE_ALL_INF_EID, CFE_EVS_EventType_INFORMATION, "Background Checksumming Disabled");
}
} /* End of CS_DisableAllCSCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -248,7 +247,7 @@ void CS_EnableAllCSCmd(const CS_NoArgsCmd_t *CmdPtr)

CFE_EVS_SendEvent(CS_ENABLE_ALL_INF_EID, CFE_EVS_EventType_INFORMATION, "Background Checksumming Enabled");
}
} /* End of CS_EnableAllCSCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -275,7 +274,7 @@ void CS_DisableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr)

CS_AppData.HkPacket.CmdCounter++;
}
} /* End of CS_DisableCfeCoreCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -301,7 +300,7 @@ void CS_EnableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr)

CS_AppData.HkPacket.CmdCounter++;
}
} /* End of CS_EnableCfeCoreCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -328,7 +327,7 @@ void CS_DisableOSCmd(const CS_NoArgsCmd_t *CmdPtr)

CS_AppData.HkPacket.CmdCounter++;
}
} /* End of CS_DisableOSCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -354,7 +353,7 @@ void CS_EnableOSCmd(const CS_NoArgsCmd_t *CmdPtr)

CS_AppData.HkPacket.CmdCounter++;
}
} /* End of CS_OSEnableCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -382,7 +381,7 @@ void CS_ReportBaselineCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr)
}
CS_AppData.HkPacket.CmdCounter++;
}
} /* End of CS_ReportBaselineCfeCoreCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -410,7 +409,7 @@ void CS_ReportBaselineOSCmd(const CS_NoArgsCmd_t *CmdPtr)
}
CS_AppData.HkPacket.CmdCounter++;
}
} /* End of CS_ReportBaselineOSCmd () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -464,7 +463,7 @@ void CS_RecomputeBaselineCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdErrCounter++;
}
}
} /* end CS_RecomputeBaselineCfeCoreCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -516,7 +515,7 @@ void CS_RecomputeBaselineOSCmd(const CS_NoArgsCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdErrCounter++;
}
}
} /* end CS_RecomputeBaselineOSCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -533,7 +532,6 @@ void CS_OneShotCmd(const CS_OneShotCmd_t *CmdPtr)
/* Verify command packet length... */
if (CS_VerifyCmdLength(&CmdPtr->CmdHeader.Msg, ExpectedLength))
{

/* validate size and address */
Status = CFE_PSP_MemValidateRange(CmdPtr->Address, CmdPtr->Size, CFE_PSP_MEM_ANY);

Expand Down Expand Up @@ -598,7 +596,7 @@ void CS_OneShotCmd(const CS_OneShotCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdErrCounter++;
}
}
} /* end CS_OneShotCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -643,8 +641,4 @@ void CS_CancelOneShotCmd(const CS_NoArgsCmd_t *CmdPtr)
CS_AppData.HkPacket.CmdErrCounter++;
}
}
} /* end CS_CancelOneShotCmd */

/************************/
/* End of File Comment */
/************************/
}
22 changes: 7 additions & 15 deletions fsw/src/cs_compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ int32 CS_ComputeEepromMemory(CS_Res_EepromMemory_Table_Entry_t *ResultsEntry, ui
}

return Status;

} /* End of CS_ComputeEepromMemory () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -289,7 +288,6 @@ int32 CS_ComputeTables(CS_Res_Tables_Table_Entry_t *ResultsEntry, uint32 *Comput
} /* end if tabled was success or updated */
else
{

CFE_EVS_SendEvent(CS_COMPUTE_TABLES_ERR_EID, CFE_EVS_EventType_ERROR,
"CS Tables: Problem Getting table %s info Share: 0x%08X, GetInfo: 0x%08X, GetAddress: 0x%08X",
ResultsEntry->Name, (unsigned int)ResultShare, (unsigned int)ResultGetInfo,
Expand All @@ -299,8 +297,7 @@ int32 CS_ComputeTables(CS_Res_Tables_Table_Entry_t *ResultsEntry, uint32 *Comput
}

return Status;

} /* End of CS_ComputeTables () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -433,8 +430,7 @@ int32 CS_ComputeApp(CS_Res_App_Table_Entry_t *ResultsEntry, uint32 *ComputedCSVa
}

return Status;

} /* End of CS_ComputeApp () */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -564,7 +560,7 @@ void CS_RecomputeEepromMemoryChildTask(void)

CS_AppData.HkPacket.RecomputeInProgress = false;
CFE_ES_ExitChildTask();
} /* end CS_RecomputeEepromMemoryChildTask */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -670,7 +666,7 @@ void CS_RecomputeAppChildTask(void)

CS_AppData.HkPacket.RecomputeInProgress = false;
CFE_ES_ExitChildTask();
} /* end CS_RecomputeAppChildTask */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -776,7 +772,7 @@ void CS_RecomputeTablesChildTask(void)

CS_AppData.HkPacket.RecomputeInProgress = false;
CFE_ES_ExitChildTask();
} /* end CS_RecomputeTablesChildTask */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -826,8 +822,4 @@ void CS_OneShotChildTask(void)
CS_AppData.ChildTaskID = CFE_ES_TASKID_UNDEFINED;

CFE_ES_ExitChildTask();
} /* end CS_OneShotChildTask */

/************************/
/* End of File Comment */
/************************/
}
Loading

0 comments on commit 8653ba6

Please sign in to comment.