Skip to content

Commit

Permalink
Fix #210, Apply clang-format-10 whitespace formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Mar 24, 2022
1 parent dafc8ae commit 5443d4a
Show file tree
Hide file tree
Showing 32 changed files with 530 additions and 526 deletions.
2 changes: 1 addition & 1 deletion fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void CF_CheckTables(void)
*-----------------------------------------------------------------*/
int32 CF_ValidateConfigTable(void *tbl_ptr)
{
CF_ConfigTable_t *tbl = (CF_ConfigTable_t *)tbl_ptr;
CF_ConfigTable_t * tbl = (CF_ConfigTable_t *)tbl_ptr;
int32 ret; /* initialized below */
static const int32 no_ticks_per_second = -1;
static const int32 crc_alignment = -2;
Expand Down
18 changes: 9 additions & 9 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ CF_SendRet_t CF_CFDP_SendAck(CF_Transaction_t *t, CF_CFDP_AckTxnStatus_t ts, CF_
CF_CFDP_ConditionCode_t cc, CF_EntityId_t peer_eid, CF_TransactionSeq_t tsn)
{
CF_Logical_PduBuffer_t *ph;
CF_Logical_PduAck_t *ack;
CF_Logical_PduAck_t * ack;
CF_SendRet_t ret = CF_SendRet_SUCCESS;
CF_EntityId_t src_eid;
CF_EntityId_t dst_eid;
Expand Down Expand Up @@ -992,7 +992,7 @@ int32 CF_CFDP_InitEngine(void)
/* initialize all transaction nodes */
int i, j;
int chunk_mem_offset = 0;
CF_Transaction_t *t = CF_AppData.engine.transactions;
CF_Transaction_t * t = CF_AppData.engine.transactions;
CF_ChunkWrapper_t *c = CF_AppData.engine.chunks;
int32 ret = CFE_SUCCESS;

Expand Down Expand Up @@ -1078,7 +1078,7 @@ int32 CF_CFDP_InitEngine(void)
int CF_CFDP_CycleTxFirstActive(CF_CListNode_t *node, void *context)
{
CF_CFDP_CycleTx_args_t *args = (CF_CFDP_CycleTx_args_t *)context;
CF_Transaction_t *t = container_of(node, CF_Transaction_t, cl_node);
CF_Transaction_t * t = container_of(node, CF_Transaction_t, cl_node);
int ret = 1; /* default option is exit traversal */

if (t->flags.com.suspended)
Expand Down Expand Up @@ -1115,7 +1115,7 @@ int CF_CFDP_CycleTxFirstActive(CF_CListNode_t *node, void *context)
*-----------------------------------------------------------------*/
void CF_CFDP_CycleTx(CF_Channel_t *c)
{
CF_Transaction_t *t;
CF_Transaction_t * t;
CF_CFDP_CycleTx_args_t args;

if (CF_AppData.config_table->chan[(c - CF_AppData.engine.channels)].dequeue_enabled)
Expand Down Expand Up @@ -1162,7 +1162,7 @@ int CF_CFDP_DoTick(CF_CListNode_t *node, void *context)
{
int ret = CF_CLIST_CONT; /* CF_CLIST_CONT means don't tick one, keep looking for cur */
CF_CFDP_Tick_args_t *args = (CF_CFDP_Tick_args_t *)context;
CF_Transaction_t *t = container_of(node, CF_Transaction_t, cl_node);
CF_Transaction_t * t = container_of(node, CF_Transaction_t, cl_node);
if (!args->c->cur || (args->c->cur == t))
{
/* found where we left off, so clear that and move on */
Expand Down Expand Up @@ -1297,7 +1297,7 @@ int32 CF_CFDP_TxFile(const char *src_filename, const char *dst_filename, CF_CFDP
uint8 chan, uint8 priority, CF_EntityId_t dest_id)
{
CF_Transaction_t *t;
CF_Channel_t *c = &CF_AppData.engine.channels[chan];
CF_Channel_t * c = &CF_AppData.engine.channels[chan];
CF_Assert(chan < CF_NUM_CHANNELS);

int32 ret = CFE_SUCCESS;
Expand Down Expand Up @@ -1529,10 +1529,10 @@ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *c)

for (i = 0; i < CF_MAX_POLLING_DIR_PER_CHAN; ++i)
{
CF_Poll_t *p = &c->poll[i];
CF_Poll_t * p = &c->poll[i];
int chan_index = (c - CF_AppData.engine.channels);
CF_ChannelConfig_t *cc = &CF_AppData.config_table->chan[chan_index];
CF_PollDir_t *pd = &cc->polldir[i];
CF_PollDir_t * pd = &cc->polldir[i];
int count_check = 0;

if (pd->enabled && pd->interval_sec)
Expand Down Expand Up @@ -1759,7 +1759,7 @@ void CF_CFDP_DisableEngine(void)
{
int i, j;
static const CF_QueueIdx_t CLOSE_QUEUES[] = {CF_QueueIdx_RX, CF_QueueIdx_TXA, CF_QueueIdx_TXW};
CF_Channel_t *c;
CF_Channel_t * c;

CF_AppData.engine.enabled = 0;

Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_cfdp_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void CF_CFDP_S_DispatchRecv(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph,
CF_Assert(t->state_data.s.sub_state < CF_TxSubState_NUM_STATES);
const CF_CFDP_FileDirectiveDispatchTable_t *substate_tbl;
CF_CFDP_StateRecvFunc_t selected_handler;
CF_Logical_PduFileDirectiveHeader_t *fdh;
CF_Logical_PduFileDirectiveHeader_t * fdh;

/* send state, so we only care about file directive PDU */
selected_handler = NULL;
Expand Down
12 changes: 6 additions & 6 deletions fsw/src/cf_cfdp_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@ void CF_CFDP_R2_SubstateRecvFileData(CF_Transaction_t *t, CF_Logical_PduBuffer_t
*-----------------------------------------------------------------*/
void CF_CFDP_R2_GapCompute(const CF_ChunkList_t *chunks, const CF_Chunk_t *c, void *opaque)
{
CF_GapComputeArgs_t *args = (CF_GapComputeArgs_t *)opaque;
CF_GapComputeArgs_t * args = (CF_GapComputeArgs_t *)opaque;
CF_Logical_SegmentRequest_t *pseg;
CF_Logical_SegmentList_t *pseglist;
CF_Logical_PduNak_t *nak;
CF_Logical_SegmentList_t * pseglist;
CF_Logical_PduNak_t * nak;

/* This function is only invoked for NAK types */
nak = args->nak;
Expand Down Expand Up @@ -510,9 +510,9 @@ int CF_CFDP_R_SubstateSendNak(CF_Transaction_t *t)
nak->scope_start = 0;
cret = CF_ChunkList_ComputeGaps(&t->chunks->chunks,
(t->chunks->chunks.count < t->chunks->chunks.max_chunks)
? t->chunks->chunks.max_chunks
: (t->chunks->chunks.max_chunks - 1),
t->fsize, 0, CF_CFDP_R2_GapCompute, &args);
? t->chunks->chunks.max_chunks
: (t->chunks->chunks.max_chunks - 1),
t->fsize, 0, CF_CFDP_R2_GapCompute, &args);

if (!cret)
{
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_cfdp_r.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
typedef struct
{
CF_Transaction_t *t; /**< \brief Current transaction being processed */
CF_Transaction_t * t; /**< \brief Current transaction being processed */
CF_Logical_PduNak_t *nak; /**< \brief Current NAK PDU contents */
} CF_GapComputeArgs_t;

Expand Down
8 changes: 4 additions & 4 deletions fsw/src/cf_cfdp_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ void CF_CFDP_S2_SubstateSendEof(CF_Transaction_t *t)
int32 CF_CFDP_S_SendFileData(CF_Transaction_t *t, uint32 foffs, uint32 bytes_to_read, uint8 calc_crc)
{
int32 ret = -1;
CF_Logical_PduBuffer_t *ph = CF_CFDP_ConstructPduHeader(t, 0, CF_AppData.config_table->local_eid,
t->history->peer_eid, 0, t->history->seq_num, 1);
CF_Logical_PduBuffer_t * ph = CF_CFDP_ConstructPduHeader(t, 0, CF_AppData.config_table->local_eid,
t->history->peer_eid, 0, t->history->seq_num, 1);
CF_Logical_PduFileDataHeader_t *fd;
size_t actual_bytes;
void *data_ptr;
void * data_ptr;

if (!ph)
{
Expand Down Expand Up @@ -494,7 +494,7 @@ void CF_CFDP_S2_Fin(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
void CF_CFDP_S2_Nak(CF_Transaction_t *t, CF_Logical_PduBuffer_t *ph)
{
const CF_Logical_SegmentRequest_t *sr;
const CF_Logical_PduNak_t *nak;
const CF_Logical_PduNak_t * nak;
uint8 counter;
uint8 bad_sr;

Expand Down
6 changes: 3 additions & 3 deletions fsw/src/cf_cfdp_sbintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
CF_Logical_PduBuffer_t *CF_CFDP_MsgOutGet(const CF_Transaction_t *t, bool silent)
{
/* if channel is frozen, do not take message */
CF_Channel_t *c = CF_AppData.engine.channels + t->chan_num;
CF_Channel_t * c = CF_AppData.engine.channels + t->chan_num;
CF_Logical_PduBuffer_t *ret;

/* this function should not be called more than once before the message
Expand Down Expand Up @@ -162,11 +162,11 @@ void CF_CFDP_Send(uint8 chan_num, const CF_Logical_PduBuffer_t *ph)
*-----------------------------------------------------------------*/
void CF_CFDP_ReceiveMessage(CF_Channel_t *c)
{
CF_Transaction_t *t; /* initialized below */
CF_Transaction_t * t; /* initialized below */
uint32 count = 0;
int32 status;
const int chan_num = (c - CF_AppData.engine.channels);
CFE_SB_Buffer_t *bufptr;
CFE_SB_Buffer_t * bufptr;
CFE_MSG_Size_t msg_size;
CF_Logical_PduBuffer_t *ph;

Expand Down
6 changes: 3 additions & 3 deletions fsw/src/cf_cfdp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ typedef struct CF_Transaction
{
CF_TxnState_t state; /**< \brief each engine is commanded to do something, which is the overall state */

CF_History_t *history; /**< \brief weird, holds active filenames and possibly other info */
CF_History_t * history; /**< \brief weird, holds active filenames and possibly other info */
CF_ChunkWrapper_t *chunks; /**< \brief for gap tracking, only used on class 2 */
CF_Timer_t inactivity_timer; /**< \brief set to the overall inactivity timer of a remote */
CF_Timer_t ack_timer; /**< \brief called ack_timer, but is also nak_timer */
Expand Down Expand Up @@ -439,7 +439,7 @@ typedef struct CF_PduSendMsg
*/
typedef struct CF_Output
{
CFE_SB_Buffer_t *msg; /**< \brief Binary message to be sent to underlying transport */
CFE_SB_Buffer_t * msg; /**< \brief Binary message to be sent to underlying transport */
CF_EncoderState_t encode; /**< \brief Encoding state (while building message) */

/**
Expand All @@ -455,7 +455,7 @@ typedef struct CF_Output
*/
typedef struct CF_Input
{
CFE_SB_Buffer_t *msg; /**< \brief Binary message received from underlying transport */
CFE_SB_Buffer_t * msg; /**< \brief Binary message received from underlying transport */
CF_DecoderState_t decode; /**< \brief Decoding state (while interpreting message) */

/**
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cf_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ int CF_Chunks_CombinePrevious(CF_ChunkList_t *chunks, CF_ChunkIdx_t i, const CF_

if ((i && chunks->count))
{
CF_Chunk_t *prev = &chunks->chunks[i - 1];
CF_Chunk_t * prev = &chunks->chunks[i - 1];
CF_ChunkOffset_t prev_end = prev->offset + prev->size;
if (chunk->offset <= prev_end)
{
Expand Down Expand Up @@ -276,7 +276,7 @@ void CF_Chunks_Insert(CF_ChunkList_t *chunks, CF_ChunkIdx_t i, const CF_Chunk_t
else
{
CF_ChunkIdx_t smallest_i = CF_Chunks_FindSmallestSize(chunks);
CF_Chunk_t *smallest_c = &chunks->chunks[smallest_i];
CF_Chunk_t * smallest_c = &chunks->chunks[smallest_i];
if (smallest_c->size < chunk->size)
{
CF_Chunks_EraseChunk(chunks, smallest_i);
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_chunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct CF_ChunkList
{
CF_ChunkIdx_t count; /**< \brief number of chunks currently in the array */
CF_ChunkIdx_t max_chunks; /**< \brief maximum number of chunks allowed in the list (allocation size) */
CF_Chunk_t *chunks; /**< \brief chunk list array */
CF_Chunk_t * chunks; /**< \brief chunk list array */
} CF_ChunkList_t;

/**
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/cf_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void CF_DoSuspRes_Txn(CF_Transaction_t *t, CF_ChanAction_SuspResArg_t *context)
void CF_DoSuspRes(CF_TransactionCmd_t *cmd, uint8 action)
{
/* ok to not bounds check action, because the caller is using it in two places with constant values 0 or 1 */
static const char *msgstr[] = {"resume", "suspend"};
static const char * msgstr[] = {"resume", "suspend"};
CF_ChanAction_SuspResArg_t args = {0, action};
int ret = CF_TsnChanAction(cmd, msgstr[action], (CF_TsnChanAction_fn_t)CF_DoSuspRes_Txn, &args);

Expand Down Expand Up @@ -722,7 +722,7 @@ void CF_CmdWriteQueue(CFE_SB_Buffer_t *msg)
static const int q_history = 2;
static const int q_all = 3;
CF_WriteQueueCmd_t *wq = (CF_WriteQueueCmd_t *)msg;
CF_Channel_t *c = &CF_AppData.engine.channels[wq->chan];
CF_Channel_t * c = &CF_AppData.engine.channels[wq->chan];
osal_id_t fd;
int32 ret;

Expand Down Expand Up @@ -913,7 +913,7 @@ void CF_CmdGetSetParam(uint8 is_set, CF_GetSet_ValueID_t param_id, uint32 value,
bool valid_set;
struct
{
void *ptr;
void * ptr;
uint32 size;
int (*fn)(uint32, uint8 chan_num);
} item;
Expand Down
8 changes: 4 additions & 4 deletions fsw/src/cf_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void CF_CFDP_EncodeFileDirectiveHeader(CF_EncoderState_t *state, CF_Logical_PduF
void CF_CFDP_EncodeLV(CF_EncoderState_t *state, CF_Logical_Lv_t *pllv)
{
CF_CFDP_lv_t *lv; /* for encoding fixed sized fields */
void *data_ptr;
void * data_ptr;

lv = CF_ENCODE_FIXED_CHUNK(state, CF_CFDP_lv_t);
if (lv != NULL)
Expand Down Expand Up @@ -530,7 +530,7 @@ void CF_CFDP_EncodeLV(CF_EncoderState_t *state, CF_Logical_Lv_t *pllv)
void CF_CFDP_EncodeTLV(CF_EncoderState_t *state, CF_Logical_Tlv_t *pltlv)
{
CF_CFDP_tlv_t *tlv; /* for encoding fixed sized fields */
void *data_ptr;
void * data_ptr;

tlv = CF_ENCODE_FIXED_CHUNK(state, CF_CFDP_tlv_t);
if (tlv != NULL)
Expand Down Expand Up @@ -652,7 +652,7 @@ void CF_CFDP_EncodeMd(CF_EncoderState_t *state, CF_Logical_PduMd_t *plmd)
void CF_CFDP_EncodeFileDataHeader(CF_EncoderState_t *state, bool with_meta, CF_Logical_PduFileDataHeader_t *plfd)
{
CF_CFDP_PduFileDataHeader_t *fd;
CF_CFDP_uint8_t *optional_fields;
CF_CFDP_uint8_t * optional_fields;

/* in this packet, the optional fields actually come first */
if (with_meta)
Expand Down Expand Up @@ -996,7 +996,7 @@ void CF_CFDP_DecodeMd(CF_DecoderState_t *state, CF_Logical_PduMd_t *plmd)
void CF_CFDP_DecodeFileDataHeader(CF_DecoderState_t *state, bool with_meta, CF_Logical_PduFileDataHeader_t *plfd)
{
const CF_CFDP_PduFileDataHeader_t *fd;
const CF_CFDP_uint8_t *optional_fields;
const CF_CFDP_uint8_t * optional_fields;
uint8 field_count;

plfd->continuation_state = 0;
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cf_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct CF_CodecState
typedef struct CF_EncoderState
{
CF_CodecState_t codec_state; /**< \brief Common state */
uint8 *base; /**< \brief Pointer to start of encoded PDU data */
uint8 * base; /**< \brief Pointer to start of encoded PDU data */
} CF_EncoderState_t;

/**
Expand All @@ -61,7 +61,7 @@ typedef struct CF_EncoderState
typedef struct CF_DecoderState
{
CF_CodecState_t codec_state; /**< \brief Common state */
const uint8 *base; /**< \brief Pointer to start of encoded PDU data */
const uint8 * base; /**< \brief Pointer to start of encoded PDU data */
} CF_DecoderState_t;

/*********************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/cf_logical_pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ typedef struct CF_Logical_Lv
typedef union CF_Logical_TlvData
{
CF_EntityId_t eid; /**< \brief Valid when type=ENTITY_ID (6) */
const void *data_ptr; /**< \brief Source of actual data in original location (other string/binary types) */
const void * data_ptr; /**< \brief Source of actual data in original location (other string/binary types) */

} CF_Logical_TlvData_t;

Expand Down
12 changes: 6 additions & 6 deletions fsw/src/cf_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CF_Transaction_t *CF_FindUnusedTransaction(CF_Channel_t *c)
{
int q_index; /* initialized below in if */

CF_CListNode_t *n = c->qs[CF_QueueIdx_FREE];
CF_CListNode_t * n = c->qs[CF_QueueIdx_FREE];
CF_Transaction_t *t = container_of(n, CF_Transaction_t, cl_node);

CF_CList_Remove_Ex(c, CF_QueueIdx_FREE, &t->cl_node);
Expand Down Expand Up @@ -152,10 +152,10 @@ CF_Transaction_t *CF_FindTransactionBySequenceNumber(CF_Channel_t *c, CF_Transac
*
* Let's put CF_QueueIdx_RX up front, because most RX packets will be file data PDUs */
CF_Traverse_TransSeqArg_t ctx = {transaction_sequence_number, src_eid, NULL};
CF_CListNode_t *ptrs[] = {c->qs[CF_QueueIdx_RX], c->qs[CF_QueueIdx_PEND], c->qs[CF_QueueIdx_TXA],
CF_CListNode_t * ptrs[] = {c->qs[CF_QueueIdx_RX], c->qs[CF_QueueIdx_PEND], c->qs[CF_QueueIdx_TXA],
c->qs[CF_QueueIdx_TXW]};
int i;
CF_Transaction_t *ret = NULL;
CF_Transaction_t * ret = NULL;

for (i = 0; i < (sizeof(ptrs) / sizeof(ptrs[0])); ++i)
{
Expand Down Expand Up @@ -229,7 +229,7 @@ int CF_WriteHistoryEntryToFile(osal_id_t fd, const CF_History_t *h)
int CF_Traverse_WriteHistoryQueueEntryToFile(CF_CListNode_t *n, void *arg)
{
CF_Traverse_WriteHistoryFileArg_t *context = arg;
CF_History_t *h = container_of(n, CF_History_t, cl_node);
CF_History_t * h = container_of(n, CF_History_t, cl_node);

/* if filter_dir is CF_Direction_NUM, this means both directions (all match) */
if (context->filter_dir == CF_Direction_NUM || h->dir == context->filter_dir)
Expand Down Expand Up @@ -258,7 +258,7 @@ int CF_Traverse_WriteHistoryQueueEntryToFile(CF_CListNode_t *n, void *arg)
int CF_Traverse_WriteTxnQueueEntryToFile(CF_CListNode_t *n, void *arg)
{
CF_Traverse_WriteTxnFileArg_t *context = arg;
CF_Transaction_t *t = container_of(n, CF_Transaction_t, cl_node);
CF_Transaction_t * t = container_of(n, CF_Transaction_t, cl_node);

if (CF_WriteHistoryEntryToFile(context->fd, t->history) < 0)
{
Expand Down Expand Up @@ -322,7 +322,7 @@ int32 CF_WriteHistoryQueueDataToFile(osal_id_t fd, CF_Channel_t *c, CF_Direction
*-----------------------------------------------------------------*/
int CF_PrioSearch(CF_CListNode_t *node, void *context)
{
CF_Transaction_t *t = container_of(node, CF_Transaction_t, cl_node);
CF_Transaction_t * t = container_of(node, CF_Transaction_t, cl_node);
CF_Traverse_PriorityArg_t *p = (CF_Traverse_PriorityArg_t *)context;

if (t->priority <= p->priority)
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/cf_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ typedef struct CF_Traverse_TransSeqArg
{
CF_TransactionSeq_t transaction_sequence_number;
CF_EntityId_t src_eid;
CF_Transaction_t *t; /**< \brief output transaction pointer */
CF_Transaction_t * t; /**< \brief output transaction pointer */
} CF_Traverse_TransSeqArg_t;

/**
Expand Down Expand Up @@ -95,7 +95,7 @@ typedef void (*CF_TraverseAllTransactions_fn_t)(CF_Transaction_t *t, void *conte
typedef struct CF_TraverseAll_Arg
{
CF_TraverseAllTransactions_fn_t fn; /**< \brief internal callback to use for each CList_Traverse */
void *context; /**< \brief opaque object to pass to internal callback */
void * context; /**< \brief opaque object to pass to internal callback */
int counter; /**< \brief Running tally of all nodes traversed from all lists */
} CF_TraverseAll_Arg_t;

Expand All @@ -106,7 +106,7 @@ typedef struct CF_TraverseAll_Arg
*/
typedef struct CF_Traverse_PriorityArg
{
CF_Transaction_t *t; /**< \brief OUT: holds value of transaction with which to call CF_CList_InsertAfter on */
CF_Transaction_t *t; /**< \brief OUT: holds value of transaction with which to call CF_CList_InsertAfter on */
uint8 priority; /**< \brief seeking this priority */
} CF_Traverse_PriorityArg_t;

Expand Down
Loading

0 comments on commit 5443d4a

Please sign in to comment.