Skip to content

Commit

Permalink
Fix nasa#711, Remove unreachable code and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Aug 7, 2020
1 parent 84c1fc7 commit 3c97b9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/inc/cfe_msg_typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef enum
{
CFE_MSG_Endian_Invalid, /**< \brief Invalid endian setting */
CFE_MSG_Endian_Big, /**< \brief Big endian */
CFE_MSG_Endian_Little /**< \brief Littne endian */
CFE_MSG_Endian_Little /**< \brief Little endian */
} CFE_MSG_Endian_t;

/** \brief Playback flag */
Expand Down
2 changes: 1 addition & 1 deletion modules/msg/private_inc/cfe_msg_defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* Defines
*/

/* Backwards compatibility - TODO could just force users to define */
/* Backwards compatibility */
#ifndef CFE_PLATFORM_DEFAULT_APID
#define CFE_PLATFORM_DEFAULT_APID 0 /**< \brief Default APID, for bits not in MsgId */
#endif
Expand Down
12 changes: 6 additions & 6 deletions modules/msg/src/cfe_msg_sechdr_checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ CFE_MSG_Checksum_t CFE_MSG_ComputeCheckSum(const CFE_MSG_Message_t *MsgPtr)

uint32 PktLen = 0;
const uint8 * BytePtr = MsgPtr->Byte;
CFE_MSG_Checksum_t chksum = 0;
CFE_MSG_Checksum_t chksum = 0xFF;

if (CFE_MSG_GetSize(MsgPtr, &PktLen) == CFE_SUCCESS)
{
chksum = 0xFF;
/* Message already checked, no error case reachable */
CFE_MSG_GetSize(MsgPtr, &PktLen);

while (PktLen--)
chksum ^= *(BytePtr++);
while (PktLen--)
{
chksum ^= *(BytePtr++);
}

return chksum;
Expand Down

0 comments on commit 3c97b9c

Please sign in to comment.