Skip to content

Commit

Permalink
Merge pull request #58 from thnkslprpt/fix-57-comment-and-empty-line-…
Browse files Browse the repository at this point in the history
…cleanup

Fix #57, Remove redundant/inconsistent comments (/* end of function */, /* end if */ etc.) and clean up empty lines.
  • Loading branch information
dzbaker authored Oct 14, 2022
2 parents 7e5bcb8 + 77db631 commit 49d6a09
Show file tree
Hide file tree
Showing 16 changed files with 487 additions and 906 deletions.
33 changes: 13 additions & 20 deletions fsw/src/ds_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppData -- application global data structure */
/* Application global data structure */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

DS_AppData_t DS_AppData;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppMain() -- application entry point and main process loop */
/* Application entry point and main process loop */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -166,12 +166,11 @@ void DS_AppMain(void)
** Let cFE kill the application (and any child tasks)...
*/
CFE_ES_ExitApp(RunStatus);

} /* End of DS_AppMain() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppInitialize() -- application initialization */
/* Application initialization */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -274,12 +273,11 @@ int32 DS_AppInitialize(void)
}

return Result;

} /* End of DS_AppInitialize() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppProcessMsg() -- process Software Bus messages */
/* Process Software Bus messages */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -334,11 +332,11 @@ void DS_AppProcessMsg(const CFE_SB_Buffer_t *BufPtr)
DS_AppStorePacket(MessageID, BufPtr);
break;
}
} /* End of DS_AppProcessMsg() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppProcessCmd() -- process application commands */
/* Process application commands */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -486,11 +484,11 @@ void DS_AppProcessCmd(const CFE_SB_Buffer_t *BufPtr)
DS_AppData.CmdRejectedCounter++;
break;
}
} /* End of DS_AppProcessCmd() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppProcessHK() -- process hk request command */
/* Process hk request command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -600,17 +598,16 @@ void DS_AppProcessHK(void)
*/
CFE_SB_TimeStampMsg(&HkPacket.TlmHeader.Msg);
CFE_SB_TransmitMsg(&HkPacket.TlmHeader.Msg, true);
} /* End of DS_AppProcessHK() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_AppStorePacket() -- packet storage pre-processor */
/* Packet storage pre-processor */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

void DS_AppStorePacket(CFE_SB_MsgId_t MessageID, const CFE_SB_Buffer_t *BufPtr)
{

if (DS_AppData.AppEnableState == DS_DISABLED)
{
/*
Expand All @@ -633,8 +630,4 @@ void DS_AppStorePacket(CFE_SB_MsgId_t MessageID, const CFE_SB_Buffer_t *BufPtr)
*/
DS_FileStorePacket(MessageID, BufPtr);
}
} /* End of DS_AppStorePacket() */

/************************/
/* End of File Comment */
/************************/
}
2 changes: 0 additions & 2 deletions fsw/src/ds_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ typedef struct
uint16 FileState; /**< \brief Current file enable/disable state */
uint16 Unused; /**< \brief Unused - structure padding */
char FileName[DS_TOTAL_FNAME_BUFSIZE]; /**< \brief Current filename (path+base+seq+ext) */

} DS_AppFileStatus_t;

/**
Expand Down Expand Up @@ -103,7 +102,6 @@ typedef struct

DS_HashLink_t HashLinks[DS_PACKETS_IN_FILTER_TABLE]; /**< \brief Hash table linked list elements */
DS_HashLink_t *HashTable[DS_HASH_TABLE_ENTRIES]; /**< \brief Each hash table entry is a linked list */

} DS_AppData_t;

/** \brief DS global data structure reference */
Expand Down
76 changes: 36 additions & 40 deletions fsw/src/ds_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdNoop() - NOOP command */
/* NOOP command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -74,11 +74,11 @@ void DS_CmdNoop(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(DS_NOOP_CMD_EID, CFE_EVS_EventType_INFORMATION, "NOOP command, Version %d.%d.%d.%d",
DS_MAJOR_VERSION, DS_MINOR_VERSION, DS_REVISION, DS_MISSION_REV);
}
} /* End of DS_CmdNoop() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdReset() - reset hk telemetry counters command */
/* Reset hk telemetry counters command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -134,11 +134,11 @@ void DS_CmdReset(const CFE_SB_Buffer_t *BufPtr)

CFE_EVS_SendEvent(DS_RESET_CMD_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
}
} /* End of DS_CmdReset() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetAppState() - set application ena/dis state */
/* Set application ena/dis state */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -188,11 +188,11 @@ void DS_CmdSetAppState(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(DS_ENADIS_CMD_EID, CFE_EVS_EventType_DEBUG, "APP STATE command: state = %d",
DS_AppStateCmd->EnableState);
}
} /* End of DS_CmdSetAppState() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetFilterFile() - set packet filter file index */
/* Set packet filter file index */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -301,11 +301,11 @@ void DS_CmdSetFilterFile(const CFE_SB_Buffer_t *BufPtr)
DS_FilterFileCmd->FilterParmsIndex, DS_FilterFileCmd->FileTableIndex);
}
}
} /* End of DS_CmdSetFilterFile() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetFilterType() - set pkt filter filename type */
/* Set pkt filter filename type */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -414,11 +414,11 @@ void DS_CmdSetFilterType(const CFE_SB_Buffer_t *BufPtr)
DS_FilterTypeCmd->FilterParmsIndex, DS_FilterTypeCmd->FilterType);
}
}
} /* End of DS_CmdSetFilterType() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetFilterParms() - set packet filter parameters */
/* Set packet filter parameters */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -532,11 +532,11 @@ void DS_CmdSetFilterParms(const CFE_SB_Buffer_t *BufPtr)
pFilterParms->Algorithm_O);
}
}
} /* End of DS_CmdSetFilterParms() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestType() - set destination filename type */
/* Set destination filename type */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -609,11 +609,11 @@ void DS_CmdSetDestType(const CFE_SB_Buffer_t *BufPtr)
"DEST TYPE command: file table index = %d, filename type = %d",
DS_DestTypeCmd->FileTableIndex, DS_DestTypeCmd->FileNameType);
}
} /* End of DS_CmdSetDestType() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestState() - set dest file ena/dis state */
/* Set dest file ena/dis state */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -685,11 +685,11 @@ void DS_CmdSetDestState(const CFE_SB_Buffer_t *BufPtr)
"DEST STATE command: file table index = %d, file state = %d", DS_DestStateCmd->FileTableIndex,
DS_DestStateCmd->EnableState);
}
} /* End of DS_CmdSetDestState() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestPath() - set path portion of filename */
/* Set path portion of filename */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -752,11 +752,11 @@ void DS_CmdSetDestPath(const CFE_SB_Buffer_t *BufPtr)
"DEST PATH command: file table index = %d, pathname = '%s'",
(int)DS_DestPathCmd->FileTableIndex, DS_DestPathCmd->Pathname);
}
} /* End of DS_CmdSetDestPath() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestBase() - set base portion of filename */
/* Set base portion of filename */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -819,11 +819,11 @@ void DS_CmdSetDestBase(const CFE_SB_Buffer_t *BufPtr)
"DEST BASE command: file table index = %d, base filename = '%s'",
(int)DS_DestBaseCmd->FileTableIndex, DS_DestBaseCmd->Basename);
}
} /* End of DS_CmdSetDestBase() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestExt() - set extension portion of filename */
/* Set extension portion of filename */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -886,11 +886,11 @@ void DS_CmdSetDestExt(const CFE_SB_Buffer_t *BufPtr)
"DEST EXT command: file table index = %d, extension = '%s'",
(int)DS_DestExtCmd->FileTableIndex, DS_DestExtCmd->Extension);
}
} /* End of DS_CmdSetDestExt() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestSize() - set maximum file size limit */
/* Set maximum file size limit */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -963,11 +963,11 @@ void DS_CmdSetDestSize(const CFE_SB_Buffer_t *BufPtr)
"DEST SIZE command: file table index = %d, size limit = %d",
(int)DS_DestSizeCmd->FileTableIndex, (int)DS_DestSizeCmd->MaxFileSize);
}
} /* End of DS_CmdSetDestSize() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestAge() - set maximum file age limit */
/* Set maximum file age limit */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -1040,11 +1040,11 @@ void DS_CmdSetDestAge(const CFE_SB_Buffer_t *BufPtr)
"DEST AGE command: file table index = %d, age limit = %d", (int)DS_DestAgeCmd->FileTableIndex,
(int)DS_DestAgeCmd->MaxFileAge);
}
} /* End of DS_CmdSetDestAge() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdSetDestCount() - set seq cnt portion of filename */
/* Set seq cnt portion of filename */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -1130,11 +1130,11 @@ void DS_CmdSetDestCount(const CFE_SB_Buffer_t *BufPtr)
"DEST COUNT command: file table index = %d, sequence count = %d",
(int)DS_DestCountCmd->FileTableIndex, (int)DS_DestCountCmd->SequenceCount);
}
} /* End of DS_CmdSetDestCount() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdCloseFile() - close destination file */
/* Close destination file */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -1184,11 +1184,11 @@ void DS_CmdCloseFile(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(DS_CLOSE_CMD_EID, CFE_EVS_EventType_DEBUG, "DEST CLOSE command: file table index = %d",
(int)DS_CloseFileCmd->FileTableIndex);
}
} /* End of DS_CmdCloseFile() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdCloseAll() - close all open destination files */
/* Close all open destination files */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -1229,11 +1229,11 @@ void DS_CmdCloseAll(const CFE_SB_Buffer_t *BufPtr)

CFE_EVS_SendEvent(DS_CLOSE_ALL_CMD_EID, CFE_EVS_EventType_DEBUG, "DEST CLOSE ALL command");
}
} /* End of DS_CmdCloseAll() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdGetFileInfo() - get file info packet */
/* Get file info packet */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -1329,11 +1329,11 @@ void DS_CmdGetFileInfo(const CFE_SB_Buffer_t *BufPtr)
CFE_SB_TimeStampMsg(&DS_FileInfoPkt.TlmHeader.Msg);
CFE_SB_TransmitMsg(&DS_FileInfoPkt.TlmHeader.Msg, true);
}
} /* End of DS_CmdGetFileInfo() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* DS_CmdAddMID() - add message ID to packet filter table */
/* Add message ID to packet filter table */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -1440,8 +1440,4 @@ void DS_CmdAddMID(const CFE_SB_Buffer_t *BufPtr)
(unsigned long)CFE_SB_MsgIdToValue(DS_AddMidCmd->MessageID), (int)FilterTableIndex,
(int)HashTableIndex);
}
} /* End of DS_CmdAddMID() */

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

0 comments on commit 49d6a09

Please sign in to comment.