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:
@@ -168,7 +168,7 @@ unsigned Ringbuf_Size(RING_BUFFER const *b)
|
|||||||
* @param b - pointer to RING_BUFFER structure
|
* @param b - pointer to RING_BUFFER structure
|
||||||
* @return pointer to the data, or NULL if nothing in the list
|
* @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 */
|
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
|
* @param data_element - find the next element from this one
|
||||||
* @return pointer to the data, or NULL if nothing in the list
|
* @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 */
|
unsigned index; /* list index */
|
||||||
volatile uint8_t *this_element;
|
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
|
* @param b - pointer to RING_BUFFER structure
|
||||||
* @return pointer to the next data element, or NULL if the list is full
|
* @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 */
|
volatile uint8_t *ring_data = NULL; /* used to help point ring data */
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ extern "C" {
|
|||||||
bool Ringbuf_Empty(RING_BUFFER const *b);
|
bool Ringbuf_Empty(RING_BUFFER const *b);
|
||||||
/* tail */
|
/* tail */
|
||||||
BACNET_STACK_EXPORT
|
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,
|
bool Ringbuf_Pop(RING_BUFFER * b,
|
||||||
uint8_t * data_element);
|
uint8_t * data_element);
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
@@ -84,8 +84,8 @@ extern "C" {
|
|||||||
uint8_t * data_element);
|
uint8_t * data_element);
|
||||||
/* pair of functions to use head memory directly */
|
/* pair of functions to use head memory directly */
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
volatile uint8_t *Ringbuf_Data_Peek(RING_BUFFER * b);
|
volatile void *Ringbuf_Data_Peek(RING_BUFFER * b);
|
||||||
volatile uint8_t *Ringbuf_Peek_Next(RING_BUFFER const *b,
|
volatile void *Ringbuf_Peek_Next(RING_BUFFER const *b,
|
||||||
uint8_t * data_element);
|
uint8_t * data_element);
|
||||||
BACNET_STACK_EXPORT
|
BACNET_STACK_EXPORT
|
||||||
bool Ringbuf_Data_Put(RING_BUFFER * b, volatile uint8_t *data_element);
|
bool Ringbuf_Data_Put(RING_BUFFER * b, volatile uint8_t *data_element);
|
||||||
|
|||||||
Reference in New Issue
Block a user