diff --git a/Include/Fledasty/Core/Queue.h b/Include/Fledasty/Core/Queue.h index 8b168fc..a874f91 100644 --- a/Include/Fledasty/Core/Queue.h +++ b/Include/Fledasty/Core/Queue.h @@ -42,6 +42,6 @@ FledastyError fledasty_queue_push(FledastyQueue *current_queue, void *value); void *fledasty_queue_peek(FledastyQueue *current_queue); void *fledasty_queue_pop(FledastyQueue *current_queue); -static inline size_t fledasty_queue_is_empty(FledastyQueue *current_queue) { return current_queue->size == 0; } +static inline size_t fledasty_queue_is_empty(const FledastyQueue *current_queue) { return current_queue->size == 0; } #endif \ No newline at end of file diff --git a/Include/Fledasty/Core/Stack.h b/Include/Fledasty/Core/Stack.h index 78805bf..c3977a6 100644 --- a/Include/Fledasty/Core/Stack.h +++ b/Include/Fledasty/Core/Stack.h @@ -37,4 +37,6 @@ typedef struct { FledastyError fledasty_stack_initialize(FledastyStack *new_stack, const size_t element_byte_size); FledastyError fledasty_stack_destroy(FledastyStack *current_stack); +static inline size_t fledasty_stack_is_empty(const FledastyStack *current_stack) { return current_stack->size == 0; } + #endif \ No newline at end of file diff --git a/Tests/Main.c b/Tests/Main.c index 33ab88a..7a53313 100644 --- a/Tests/Main.c +++ b/Tests/Main.c @@ -48,6 +48,10 @@ int main() { FledastyStack test_stack; fledasty_stack_initialize(&test_stack, sizeof(int)); + if (fledasty_stack_is_empty(&test_stack)) { + printf("Stack is empty\n"); + } + fledasty_stack_destroy(&test_stack); printf("Done\n");