comparison queue.c @ 1478:3a933956437e coverity

update coverity
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 23:49:22 +0800
parents 06d52bcb8094
children
comparison
equal deleted inserted replaced
1439:8d24733026c5 1478:3a933956437e
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