Compare commits

..

No commits in common. "68af34c42869248860238a5edfed51879ffe7d21" and "41f817fd5b7d3f9adbb9ce47c511d95fd1f7b7b8" have entirely different histories.

3 changed files with 3 additions and 20 deletions

View file

@ -10,7 +10,6 @@ ifneq ($(DEBUG), 1)
CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident
CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic
CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer
CFLAGS += -fshort-enums
else else
CFLAGS += -g -O0 -std=c99 -march=native -mtune=native CFLAGS += -g -O0 -std=c99 -march=native -mtune=native
CFLAGS += -DDEBUG CFLAGS += -DDEBUG

View file

@ -107,7 +107,7 @@ rb_push_many(struct RingBuf *rb, const void *items, MEMCPY_T memcpy_fn,
// Advance the write head // Advance the write head
rb->write_head = (char *)rb->write_head + rb->struct_size * n; rb->write_head = (char *)rb->write_head + rb->struct_size * n;
rb->count += n; rb->count+=n;
return WriteOk; return WriteOk;
} }

View file

@ -25,24 +25,8 @@ struct RingBuf {
void *buffer_end; /** The end of the buffer */ void *buffer_end; /** The end of the buffer */
} __attribute__((packed)); } __attribute__((packed));
/* enum WriteResult { Full, WriteOk }; /** Result of a write */
* Considerations: One hot encoding for the enum values enum ReadResult { Empty, ReadOk }; /** Result of a read */
* (8 bit each with -fshort-enums)
*/
/** Result of a write */
enum WriteResult {
WriteOk, /** The write was successful */
Full, /** The buffer is full */
InsufficientSpace /** There is not enough space to write */
};
/** Result of a read */
enum ReadResult {
Empty, /** The buffer is empty */
ReadOk, /** The read was successful */
InsufficientData /** There is not enough data to read */
};
/** /**
* @brief Initialize the ring buffer * @brief Initialize the ring buffer