diff options
author | alfred gedeon <28123637+alfred2g@users.noreply.github.com> | 2021-07-29 03:53:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-29 03:53:10 +0300 |
commit | ce81bcb33fe4d46d3a0ada6fb470f0a1e3e3687c (patch) | |
tree | 8fbb38ee98d4c656dba6a7944f52354c7b6d05df /stream_buffer.c | |
parent | 85a23127cca2fab7b4fd5ed43e2bd89c1e87614f (diff) |
Run uncrustify with github workflows (#369)
* uncrustify with github workflows
* Fix find expression
* Add uncrustify configuration file
* Uncrustify some files
* uncrustify some more files
* uncrustify more files
* Fix whitespace at end of lines
Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
Diffstat (limited to 'stream_buffer.c')
-rw-r--r-- | stream_buffer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stream_buffer.c b/stream_buffer.c index ab9e1cfd7..8a7a2e0d0 100644 --- a/stream_buffer.c +++ b/stream_buffer.c @@ -503,14 +503,15 @@ size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) configASSERT( pxStreamBuffer ); /* The code below reads xTail and then xHead. This is safe if the stream - buffer is updated once between the two reads - but not if the stream buffer - is updated more than once between the two reads - hence the loop. */ + * buffer is updated once between the two reads - but not if the stream buffer + * is updated more than once between the two reads - hence the loop. */ do { xOriginalTail = pxStreamBuffer->xTail; xSpace = pxStreamBuffer->xLength + pxStreamBuffer->xTail; xSpace -= pxStreamBuffer->xHead; } while( xOriginalTail != pxStreamBuffer->xTail ); + xSpace -= ( size_t ) 1; if( xSpace >= pxStreamBuffer->xLength ) @@ -885,8 +886,8 @@ size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) /* The number of bytes available is greater than the number of bytes * required to hold the length of the next message, so another message * is available. */ - ( void ) prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) &xTempReturn, sbBYTES_TO_STORE_MESSAGE_LENGTH, pxStreamBuffer->xTail ); - xReturn = ( size_t ) xTempReturn; + ( void ) prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) &xTempReturn, sbBYTES_TO_STORE_MESSAGE_LENGTH, pxStreamBuffer->xTail ); + xReturn = ( size_t ) xTempReturn; } else { @@ -1009,7 +1010,7 @@ static size_t prvReadMessageFromBuffer( StreamBuffer_t * pxStreamBuffer, if( xCount != ( size_t ) 0 ) { /* Read the actual data and update the tail to mark the data as officially consumed. */ - pxStreamBuffer->xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xNextTail); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */ + pxStreamBuffer->xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xNextTail ); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */ } return xCount; |