From 6581f9feb9e0b4cc0c33bca15492166b0c8e0702 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 15 Aug 2018 16:51:05 +0200 Subject: [PATCH] Make request_queue functions static These functions are local to file_handler.c. --- app/src/file_handler.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/file_handler.c b/app/src/file_handler.c index bf68b0f8..24741b28 100644 --- a/app/src/file_handler.c +++ b/app/src/file_handler.c @@ -31,21 +31,21 @@ static void request_free(struct request *req) { SDL_free((void *) req); } -SDL_bool request_queue_is_empty(const struct request_queue *queue) { +static SDL_bool request_queue_is_empty(const struct request_queue *queue) { return queue->head == queue->tail; } -SDL_bool request_queue_is_full(const struct request_queue *queue) { +static SDL_bool request_queue_is_full(const struct request_queue *queue) { return (queue->head + 1) % REQUEST_QUEUE_SIZE == queue->tail; } -SDL_bool request_queue_init(struct request_queue *queue) { +static SDL_bool request_queue_init(struct request_queue *queue) { queue->head = 0; queue->tail = 0; return SDL_TRUE; } -void request_queue_destroy(struct request_queue *queue) { +static void request_queue_destroy(struct request_queue *queue) { int i = queue->tail; while (i != queue->head) { request_free(queue->reqs[i]); @@ -53,7 +53,7 @@ void request_queue_destroy(struct request_queue *queue) { } } -SDL_bool request_queue_push(struct request_queue *queue, struct request *req) { +static SDL_bool request_queue_push(struct request_queue *queue, struct request *req) { if (request_queue_is_full(queue)) { return SDL_FALSE; } @@ -62,7 +62,7 @@ SDL_bool request_queue_push(struct request_queue *queue, struct request *req) { return SDL_TRUE; } -SDL_bool request_queue_take(struct request_queue *queue, struct request **req) { +static SDL_bool request_queue_take(struct request_queue *queue, struct request **req) { if (request_queue_is_empty(queue)) { return SDL_FALSE; }