Skip to content

Commit

Permalink
Fix nasa#390, Update size variables to size_t and CF_ChunkSize_t
Browse files Browse the repository at this point in the history
…typedefs
  • Loading branch information
thnkslprpt committed Jun 13, 2023
1 parent 0f18ae4 commit 95ac14c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion fsw/src/cf_cfdp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ typedef struct CF_TxState_Data
typedef struct CF_RxS2_Data
{
uint32 eof_crc;
uint32 eof_size;
size_t eof_size;
uint32 rx_crc_calc_bytes;
CF_CFDP_FinDeliveryCode_t dc;
CF_CFDP_FinFileStatus_t fs;
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cf_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ void CF_CmdWriteQueue(CFE_SB_Buffer_t *msg)
* See description in cf_cmd.h for argument/return detail
*
*-----------------------------------------------------------------*/
CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num /* ignored */)
CFE_Status_t CF_CmdValidateChunkSize(CF_ChunkSize_t val, uint8 chan_num /* ignored */)
{
CFE_Status_t ret = CFE_SUCCESS;
if (val > sizeof(CF_CFDP_PduFileDataContent_t))
Expand Down Expand Up @@ -942,7 +942,7 @@ void CF_CmdGetSetParam(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value,
struct
{
void * ptr;
uint32 size;
size_t size;
int (*fn)(uint32, uint8 chan_num);
} item;

Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ void CF_CmdWriteQueue(CFE_SB_Buffer_t *msg);
* @retval CF_ERROR if failed (val is greater than max PDU)
*
*/
CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num);
CFE_Status_t CF_CmdValidateChunkSize(CF_ChunkSize_t val, uint8 chan_num);

/************************************************************************/
/** @brief Checks if the value is within allowable range as outgoing packets per wakeup
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ CFE_Status_t CF_WriteHistoryEntryToFile(osal_id_t fd, const CF_History_t *h)

int i;
CFE_Status_t ret;
int32 len;
size_t len;
char linebuf[(CF_FILENAME_MAX_LEN * 2) + 128]; /* buffer for line data */

for (i = 0; i < 3; ++i)
Expand Down
4 changes: 2 additions & 2 deletions unit-test/cf_cmd_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3391,7 +3391,7 @@ void Test_CF_CmdValidateChunkSize_val_GreaterThan_pdu_fd_data_t_FailAndReturn_1(
{
/* Arrange */
uint8 arg_chan_num = Any_uint8(); /* value labeled as 'ignored' in func def */
uint32 arg_val = sizeof(CF_CFDP_PduFileDataContent_t) + 1;
size_t arg_val = sizeof(CF_CFDP_PduFileDataContent_t) + 1;
CFE_Status_t local_result;

/* Act */
Expand Down Expand Up @@ -3421,7 +3421,7 @@ void Test_CF_CmdValidateChunkSize_val_SizeOf_pdu_fd_data_t_SuccessAndReturn_0(vo
{
/* Arrange */
uint8 arg_chan_num = Any_uint8(); /* value labeled as 'ignored' in func def */
uint32 arg_val = sizeof(CF_CFDP_PduFileDataContent_t);
size_t arg_val = sizeof(CF_CFDP_PduFileDataContent_t);
CFE_Status_t local_result;

/* Act */
Expand Down
4 changes: 2 additions & 2 deletions unit-test/stubs/cf_cmd_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ void CF_CmdTxFile(CFE_SB_Buffer_t *msg)
* Generated stub function for CF_CmdValidateChunkSize()
* ----------------------------------------------------
*/
CFE_Status_t CF_CmdValidateChunkSize(uint32 val, uint8 chan_num)
CFE_Status_t CF_CmdValidateChunkSize(CF_ChunkSize_t val, uint8 chan_num)
{
UT_GenStub_SetupReturnBuffer(CF_CmdValidateChunkSize, CFE_Status_t);

UT_GenStub_AddParam(CF_CmdValidateChunkSize, uint32, val);
UT_GenStub_AddParam(CF_CmdValidateChunkSize, CF_ChunkSize_t, val);
UT_GenStub_AddParam(CF_CmdValidateChunkSize, uint8, chan_num);

UT_GenStub_Execute(CF_CmdValidateChunkSize, Basic, NULL);
Expand Down

0 comments on commit 95ac14c

Please sign in to comment.