Use bool consistently now that we're on C23

This commit is contained in:
Allen Hill
2026-05-16 01:26:43 +00:00
parent 9fbaa7a55f
commit c0bb9c4018
5 changed files with 45 additions and 46 deletions
+5 -5
View File
@@ -4,11 +4,11 @@
#include "queue.h"
void constructQueue(Queue_t *q, void **slots, void *items, uint8_t itemSize,
uint8_t len, uint8_t constructFull) {
uint8_t len, bool constructFull) {
q->read = 0;
q->size = len;
q->buf = slots;
if (!!constructFull) {
if (constructFull) {
q->write = len;
for (uint8_t i = 0; i < len; ++i) {
@@ -21,12 +21,12 @@ void constructQueue(Queue_t *q, void **slots, void *items, uint8_t itemSize,
}
void constructEmptyQueue(Queue_t *q, void **slots, uint8_t len) {
constructQueue(q, slots, nullptr, 0, len, 0);
constructQueue(q, slots, nullptr, 0, len, false);
}
uint8_t isEmpty(const Queue_t *q) { return (q->write == q->read); }
bool isEmpty(const Queue_t *q) { return (q->write == q->read); }
static inline uint8_t isFull(const Queue_t *q) {
static inline bool isFull(const Queue_t *q) {
return ((q->write - q->read) == q->size);
}