DEBUG_PRINT
This commit is contained in:
parent
d6a3c95951
commit
6a4dc46b60
1 changed files with 10 additions and 11 deletions
17
ringbuf.c
17
ringbuf.c
|
@ -6,7 +6,6 @@
|
|||
#include "ringbuf.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#define DEBUG_PRINT(fmt, ...) printf(fmt, __VA_ARGS__)
|
||||
|
@ -121,16 +120,16 @@ rb_pop_front(struct RingBuf *rb, void *item, MEMCPY_T memcpy_fn)
|
|||
void
|
||||
rb_debug_print(struct RingBuf *rb)
|
||||
{
|
||||
printf("============\n");
|
||||
printf("Count %lu\n", rb->count);
|
||||
printf("Capacity: %ld\n", rb->capacity);
|
||||
printf("Left: %ld\n", rb->capacity - rb->count);
|
||||
printf("Base addr:\t%p\n", rb->buffer);
|
||||
DEBUG_PRINT("============%s\n", "");
|
||||
DEBUG_PRINT("Count %lu\n", rb->count);
|
||||
DEBUG_PRINT("Capacity: %ld\n", rb->capacity);
|
||||
DEBUG_PRINT("Left: %ld\n", rb->capacity - rb->count);
|
||||
DEBUG_PRINT("Base addr:\t%p\n", rb->buffer);
|
||||
|
||||
printf("Read Head:\t%p (%ld:th position)\n", rb->read_head,
|
||||
DEBUG_PRINT("Read Head:\t%p (%ld:th position)\n", rb->read_head,
|
||||
((rb->read_head) - (rb->buffer)) / rb->struct_size);
|
||||
printf("Write Head:\t%p (%ld:th position)\n", rb->write_head,
|
||||
DEBUG_PRINT("Write Head:\t%p (%ld:th position)\n", rb->write_head,
|
||||
((rb->write_head) - (rb->buffer)) / rb->struct_size);
|
||||
|
||||
printf("============\n");
|
||||
DEBUG_PRINT("============%s\n", "");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue