From f2ab24a7c1ddb03f8f87a5894ea780857e72f271 Mon Sep 17 00:00:00 2001 From: Mineplay Date: Tue, 22 Apr 2025 17:19:33 -0500 Subject: [PATCH] fix(queue): removed test code --- Include/Fledasty/Core/Stack.h | 0 Src/Core/Queue.c | 6 ++---- Src/Core/Stack.c | 0 3 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 Include/Fledasty/Core/Stack.h create mode 100644 Src/Core/Stack.c diff --git a/Include/Fledasty/Core/Stack.h b/Include/Fledasty/Core/Stack.h new file mode 100644 index 0000000..e69de29 diff --git a/Src/Core/Queue.c b/Src/Core/Queue.c index 1711c8d..e076b46 100644 --- a/Src/Core/Queue.c +++ b/Src/Core/Queue.c @@ -25,7 +25,6 @@ #include #include #include -#include FledastyError fledasty_queue_initialize(FledastyQueue *new_queue, const size_t element_byte_size) { if (new_queue == NULL) { @@ -60,7 +59,7 @@ FledastyError fledasty_queue_destroy(FledastyQueue *current_queue) { current_queue->buffer = NULL; return FLEDASTY_ERROR_NONE; } -#include + FledastyError fledasty_queue_push(FledastyQueue *current_queue, void *value) { if (current_queue == NULL || value == NULL) { return FLEDASTY_ERROR_INVALID_POINTER; @@ -73,7 +72,7 @@ FledastyError fledasty_queue_push(FledastyQueue *current_queue, void *value) { if (current_queue->buffer == NULL) { return FLEDASTY_ERROR_FAILED_ALLOCATION; } - printf("Allocated\n"); + size_t new_head = current_queue->capacity - current_queue->head; hallocy_move_memory(current_queue->buffer + (current_queue->head * current_queue->element_byte_size), current_queue->buffer + (new_head * current_queue->element_byte_size), current_queue->size - current_queue->tail); current_queue->head = new_head; @@ -84,7 +83,6 @@ FledastyError fledasty_queue_push(FledastyQueue *current_queue, void *value) { current_queue->size += 1; current_queue->tail += 1; if (current_queue->tail >= current_queue->capacity) { - printf("To 0\n"); current_queue->tail = 0; } diff --git a/Src/Core/Stack.c b/Src/Core/Stack.c new file mode 100644 index 0000000..e69de29