Apply review feedback

This commit is contained in:
Miles Frain 2021-02-22 21:42:23 -08:00
parent 1e4aab6d40
commit 819046743a

View file

@ -760,7 +760,7 @@ static size_t prvWriteMessageToBuffer( StreamBuffer_t * const pxStreamBuffer,
if( xShouldWrite != pdFALSE ) if( xShouldWrite != pdFALSE )
{ {
/* Writes the data itself. */ /* Writes the data itself. */
xNextHead = prvWriteBytesToBuffer( pxStreamBuffer, ( const uint8_t * ) pvTxData, xDataLengthBytes, xNextHead ); /*lint !e9079 Storage buffer is implemented as uint8_t for ease of sizing, alighment and access. */ xNextHead = prvWriteBytesToBuffer( pxStreamBuffer, ( const uint8_t * ) pvTxData, xDataLengthBytes, xNextHead ); /*lint !e9079 Storage buffer is implemented as uint8_t for ease of sizing, alignment and access. */
pxStreamBuffer->xHead = xNextHead; pxStreamBuffer->xHead = xNextHead;
xReturn = xDataLengthBytes; xReturn = xDataLengthBytes;
} }
@ -1017,11 +1017,14 @@ static size_t prvReadMessageFromBuffer( StreamBuffer_t * pxStreamBuffer,
/* Use the minimum of the wanted bytes and the available bytes. */ /* Use the minimum of the wanted bytes and the available bytes. */
xCount = configMIN( xNextMessageLength, xBytesAvailable ); xCount = configMIN( xNextMessageLength, xBytesAvailable );
/* Read the actual data. */ if( xCount != ( size_t ) 0 )
xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xTail); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */ {
/* Read the actual data. */
xTail = prvReadBytesFromBuffer( pxStreamBuffer, ( uint8_t * ) pvRxData, xCount, xTail); /*lint !e9079 Data storage area is implemented as uint8_t array for ease of sizing, indexing and alignment. */
/* Update the tail to mark the data as officialy consumed. */ /* Update the tail to mark the data as officially consumed. */
pxStreamBuffer->xTail = xTail; pxStreamBuffer->xTail = xTail;
}
return xCount; return xCount;
} }
@ -1203,9 +1206,9 @@ static size_t prvReadBytesFromBuffer( StreamBuffer_t * pxStreamBuffer,
{ {
size_t xFirstLength, xNextTail; size_t xFirstLength, xNextTail;
xNextTail = xTail;
if( xCount > ( size_t ) 0 ) if( xCount > ( size_t ) 0 )
{ {
xNextTail = xTail;
/* Calculate the number of bytes that can be read - which may be /* Calculate the number of bytes that can be read - which may be
* less than the number wanted if the data wraps around to the start of * less than the number wanted if the data wraps around to the start of