Change ringbuffer return type to void pointer to fix cast align warnings (#61)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-03-20 17:02:46 -05:00
committed by GitHub
parent d557522c1f
commit 9749d42161
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -168,7 +168,7 @@ unsigned Ringbuf_Size(RING_BUFFER const *b)
* @param b - pointer to RING_BUFFER structure
* @return pointer to the data, or NULL if nothing in the list
*/
volatile uint8_t *Ringbuf_Peek(RING_BUFFER const *b)
volatile void *Ringbuf_Peek(RING_BUFFER const *b)
{
volatile uint8_t *data_element = NULL; /* return value */
@@ -187,7 +187,7 @@ volatile uint8_t *Ringbuf_Peek(RING_BUFFER const *b)
* @param data_element - find the next element from this one
* @return pointer to the data, or NULL if nothing in the list
*/
volatile uint8_t *Ringbuf_Peek_Next(RING_BUFFER const *b, uint8_t *data_element)
volatile void *Ringbuf_Peek_Next(RING_BUFFER const *b, uint8_t *data_element)
{
unsigned index; /* list index */
volatile uint8_t *this_element;
@@ -364,7 +364,7 @@ bool Ringbuf_Put_Front(RING_BUFFER *b, uint8_t *data_element)
* @param b - pointer to RING_BUFFER structure
* @return pointer to the next data element, or NULL if the list is full
*/
volatile uint8_t *Ringbuf_Data_Peek(RING_BUFFER *b)
volatile void *Ringbuf_Data_Peek(RING_BUFFER *b)
{
volatile uint8_t *ring_data = NULL; /* used to help point ring data */
+3 -3
View File
@@ -68,7 +68,7 @@ extern "C" {
bool Ringbuf_Empty(RING_BUFFER const *b);
/* tail */
BACNET_STACK_EXPORT
volatile uint8_t *Ringbuf_Peek(RING_BUFFER const *b);
volatile void *Ringbuf_Peek(RING_BUFFER const *b);
bool Ringbuf_Pop(RING_BUFFER * b,
uint8_t * data_element);
BACNET_STACK_EXPORT
@@ -84,8 +84,8 @@ extern "C" {
uint8_t * data_element);
/* pair of functions to use head memory directly */
BACNET_STACK_EXPORT
volatile uint8_t *Ringbuf_Data_Peek(RING_BUFFER * b);
volatile uint8_t *Ringbuf_Peek_Next(RING_BUFFER const *b,
volatile void *Ringbuf_Data_Peek(RING_BUFFER * b);
volatile void *Ringbuf_Peek_Next(RING_BUFFER const *b,
uint8_t * data_element);
BACNET_STACK_EXPORT
bool Ringbuf_Data_Put(RING_BUFFER * b, volatile uint8_t *data_element);