Mercurial > dropbear
comparison queue.c @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 06d52bcb8094 |
children |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
31 queue->head = NULL; | 31 queue->head = NULL; |
32 queue->tail = NULL; | 32 queue->tail = NULL; |
33 queue->count = 0; | 33 queue->count = 0; |
34 } | 34 } |
35 | 35 |
36 int isempty(struct Queue* queue) { | 36 int isempty(const struct Queue* queue) { |
37 | 37 |
38 return (queue->head == NULL); | 38 return (queue->head == NULL); |
39 } | 39 } |
40 | 40 |
41 void* dequeue(struct Queue* queue) { | 41 void* dequeue(struct Queue* queue) { |
58 m_free(oldhead); | 58 m_free(oldhead); |
59 queue->count--; | 59 queue->count--; |
60 return ret; | 60 return ret; |
61 } | 61 } |
62 | 62 |
63 void *examine(struct Queue* queue) { | 63 void *examine(const struct Queue* queue) { |
64 | 64 |
65 dropbear_assert(!isempty(queue)); | 65 dropbear_assert(!isempty(queue)); |
66 return queue->head->item; | 66 return queue->head->item; |
67 } | 67 } |
68 | 68 |