Skip to content

Commit f4009b9

Browse files
committed
Merge branch 'bugfix/ringbuf_warnings' into 'master'
ringbuf: Fix warnings seen when CONFIG_FREERTOS_ASSERT_DISABLE=y See merge request !1824
2 parents 1c3dd23 + b66d80e commit f4009b9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

components/freertos/ringbuf.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,8 @@ static void returnItemToRingbufDefault(ringbuf_t *rb, void *item) {
404404
//can be increase.
405405
//This function by itself is not threadsafe, always call from within a muxed section.
406406
static void returnItemToRingbufBytebuf(ringbuf_t *rb, void *item) {
407-
uint8_t *data=(uint8_t*)item;
408-
configASSERT(data >= rb->data);
409-
configASSERT(data < rb->data+rb->size);
407+
configASSERT((uint8_t *)item >= rb->data);
408+
configASSERT((uint8_t *)item < rb->data+rb->size);
410409
//Free the read memory.
411410
rb->free_ptr=rb->read_ptr;
412411
}
@@ -692,10 +691,9 @@ void *xRingbufferReceiveFromISR(RingbufHandle_t ringbuf, size_t *item_size)
692691
}
693692

694693
void *xRingbufferReceiveUpTo(RingbufHandle_t ringbuf, size_t *item_size, TickType_t ticks_to_wait, size_t wanted_size) {
695-
ringbuf_t *rb=(ringbuf_t *)ringbuf;
696694
if (wanted_size == 0) return NULL;
697-
configASSERT(rb);
698-
configASSERT(rb->flags & flag_bytebuf);
695+
configASSERT(ringbuf);
696+
configASSERT(((ringbuf_t *)ringbuf)->flags & flag_bytebuf);
699697
return xRingbufferReceiveGeneric(ringbuf, item_size, ticks_to_wait, wanted_size);
700698
}
701699

0 commit comments

Comments
 (0)