From 9db6ee734df8477a2529f56e4a6f4b1784bf941b Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 22 Jun 2017 16:05:05 -0400 Subject: many changes, simplification of some functions, removal of unneeded ones --- lib/queue.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'lib/queue.c') diff --git a/lib/queue.c b/lib/queue.c index 9a01741..aebbb2a 100644 --- a/lib/queue.c +++ b/lib/queue.c @@ -1,23 +1,23 @@ -#include "wolff.h" +#include "queue.h" void stack_push(ll_t **q, uint32_t x) { - ll_t *nq = malloc(sizeof(ll_t)); - nq->x = x; - nq->next = *q; + ll_t *nq = malloc(sizeof(ll_t)); + nq->x = x; + nq->next = *q; - *q = nq; + *q = nq; } uint32_t stack_pop(ll_t **q) { - ll_t *old_q = *q; + ll_t *old_q = *q; - *q = old_q->next; - uint32_t x = old_q->x; + *q = old_q->next; + uint32_t x = old_q->x; - free(old_q); + free(old_q); - return x; + return x; } bool stack_contains(const ll_t *q, uint32_t x) { @@ -29,4 +29,3 @@ bool stack_contains(const ll_t *q, uint32_t x) { return stack_contains(q->next, x); } } - -- cgit v1.2.3-70-g09d2