From 9749d42161aa21c39d7f4cc26167f5939dae7677 Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Fri, 20 Mar 2020 17:02:46 -0500 Subject: [PATCH] Change ringbuffer return type to void pointer to fix cast align warnings (#61) Co-authored-by: Steve Karg --- src/bacnet/basic/sys/ringbuf.c | 6 +++--- src/bacnet/basic/sys/ringbuf.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bacnet/basic/sys/ringbuf.c b/src/bacnet/basic/sys/ringbuf.c index f96d1517..1e5fc8ca 100644 --- a/src/bacnet/basic/sys/ringbuf.c +++ b/src/bacnet/basic/sys/ringbuf.c @@ -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 */ diff --git a/src/bacnet/basic/sys/ringbuf.h b/src/bacnet/basic/sys/ringbuf.h index 93ef3b32..15a7e636 100644 --- a/src/bacnet/basic/sys/ringbuf.h +++ b/src/bacnet/basic/sys/ringbuf.h @@ -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);