diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-05-27 04:05:57 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-05-27 04:05:57 -0400 |
commit | a89e4d56a242073982ca3620a00c6e04bf5e82d8 (patch) | |
tree | 5d80eac29213fc0528a046820a14936313112c65 | |
parent | df2e0f59747d55ffd6fd47468d098aab1e9abfbe (diff) |
Fix trivial compiler errors.
-rw-r--r-- | collections/double_ended_queue.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/collections/double_ended_queue.c b/collections/double_ended_queue.c index 31ede5f..fab92c7 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -87,13 +87,13 @@ void* deq_index(root, index) deq *root; int index; { - void *tmp; + void **tmp; if (!root) { return NULL; } - tmp = root->base + (root->beg + index - root->base) % root->limit); + tmp = root->base + ((root->beg + index - root->base) % root->limit); if (tmp > root->end) { return NULL; } @@ -105,6 +105,8 @@ void deq_push_back(root, item) deq *root; void *item; { + void **tmp; + if (!root) { return; } @@ -122,7 +124,7 @@ void deq_push_front(root, item) deq *root; void *item; { - void *tmp; + void **tmp; if (!root) { return; @@ -241,7 +243,7 @@ void* deq_front(root) deq *root; { if (!root) { - return; + return NULL; } return *root->beg; @@ -251,7 +253,7 @@ void* deq_back(root) deq *root; { if (!root) { - return; + return NULL; } return *root->end; |