Skip to content

Commit

Permalink
remove pass by value parameter consts
Browse files Browse the repository at this point in the history
  • Loading branch information
Holden committed Jan 2, 2024
1 parent faad97f commit 5429bba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
24 changes: 12 additions & 12 deletions source/FreeRTOS_Stream_Buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
* minus 1.
*/
size_t uxStreamBufferSpace( const StreamBuffer_t * const pxBuffer,
const size_t uxLower,
const size_t uxUpper )
size_t uxLower,
size_t uxUpper )
{
const size_t uxLength = pxBuffer->LENGTH;
size_t uxCount = uxLength + uxUpper - uxLower - 1U;
Expand All @@ -74,8 +74,8 @@ size_t uxStreamBufferSpace( const StreamBuffer_t * const pxBuffer,
* @return The distance between uxLower and uxUpper.
*/
size_t uxStreamBufferDistance( const StreamBuffer_t * const pxBuffer,
const size_t uxLower,
const size_t uxUpper )
size_t uxLower,
size_t uxUpper )
{
const size_t uxLength = pxBuffer->LENGTH;
size_t uxCount = uxLength + uxUpper - uxLower;
Expand Down Expand Up @@ -160,7 +160,7 @@ void vStreamBufferClear( StreamBuffer_t * const pxBuffer )
* @param[in] uxCount The byte count by which the mid pointer is to be moved.
*/
void vStreamBufferMoveMid( StreamBuffer_t * const pxBuffer,
const size_t uxCount )
size_t uxCount )
{
/* Increment uxMid, but no further than uxHead */
const size_t uxLength = pxBuffer->LENGTH;
Expand Down Expand Up @@ -194,8 +194,8 @@ void vStreamBufferMoveMid( StreamBuffer_t * const pxBuffer,
* @return pdTRUE if uxLeft <= uxRight, else pdFALSE.
*/
BaseType_t xStreamBufferLessThenEqual( const StreamBuffer_t * const pxBuffer,
const size_t uxLeft,
const size_t uxRight )
size_t uxLeft,
size_t uxRight )
{
BaseType_t xReturn = pdFALSE;
const size_t uxTail = pxBuffer->uxTail;
Expand Down Expand Up @@ -245,9 +245,9 @@ size_t uxStreamBufferGetPtr( StreamBuffer_t * const pxBuffer,
* @return The number of bytes added to the buffer.
*/
size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer,
const size_t uxOffset,
size_t uxOffset,
const uint8_t * const pucData,
const size_t uxByteCount )
size_t uxByteCount )
{
size_t uxCount;
size_t uxSpace = uxStreamBufferGetSpace( pxBuffer );
Expand Down Expand Up @@ -345,10 +345,10 @@ size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer,
* @return The count of the bytes read.
*/
size_t uxStreamBufferGet( StreamBuffer_t * const pxBuffer,
const size_t uxOffset,
size_t uxOffset,
uint8_t * const pucData,
const size_t uxMaxCount,
const BaseType_t xPeek )
size_t uxMaxCount,
BaseType_t xPeek )
{
size_t uxCount;

Expand Down
22 changes: 11 additions & 11 deletions source/include/FreeRTOS_Stream_Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ typedef struct xSTREAM_BUFFER
} StreamBuffer_t;

size_t uxStreamBufferSpace( const StreamBuffer_t * const pxBuffer,
const size_t uxLower,
const size_t uxUpper );
size_t uxLower,
size_t uxUpper );

size_t uxStreamBufferDistance( const StreamBuffer_t * const pxBuffer,
const size_t uxLower,
const size_t uxUpper );
size_t uxLower,
size_t uxUpper );

size_t uxStreamBufferGetSpace( const StreamBuffer_t * const pxBuffer );

Expand All @@ -75,22 +75,22 @@ void vStreamBufferMoveMid( StreamBuffer_t * const pxBuffer,
const size_t uxCount );

BaseType_t xStreamBufferLessThenEqual( const StreamBuffer_t * const pxBuffer,
const size_t uxLeft,
const size_t uxRight );
size_t uxLeft,
size_t uxRight );

size_t uxStreamBufferGetPtr( StreamBuffer_t * const pxBuffer,
uint8_t ** const ppucData );

size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer,
const size_t uxOffset,
size_t uxOffset,
const uint8_t * const pucData,
const size_t uxByteCount );
size_t uxByteCount );

size_t uxStreamBufferGet( StreamBuffer_t * const pxBuffer,
const size_t uxOffset,
size_t uxOffset,
uint8_t * const pucData,
const size_t uxMaxCount,
const BaseType_t xPeek );
size_t uxMaxCount,
BaseType_t xPeek );

/* *INDENT-OFF* */
#ifdef __cplusplus
Expand Down

0 comments on commit 5429bba

Please sign in to comment.