comparison queue.c @ 773:a9f2a6ae4eb5

merge
author Matt Johnston <matt@ucc.asn.au>
date Sun, 14 Apr 2013 22:49:19 +0800
parents 9a5438271556
children 06d52bcb8094
comparison
equal deleted inserted replaced
772:7fc0aeada79c 773:a9f2a6ae4eb5
68 68
69 void enqueue(struct Queue* queue, void* item) { 69 void enqueue(struct Queue* queue, void* item) {
70 70
71 struct Link* newlink; 71 struct Link* newlink;
72 72
73 TRACE(("enter enqueue"))
74 newlink = (struct Link*)m_malloc(sizeof(struct Link)); 73 newlink = (struct Link*)m_malloc(sizeof(struct Link));
75 74
76 newlink->item = item; 75 newlink->item = item;
77 newlink->link = NULL; 76 newlink->link = NULL;
78 77
83 82
84 if (queue->head == NULL) { 83 if (queue->head == NULL) {
85 queue->head = newlink; 84 queue->head = newlink;
86 } 85 }
87 queue->count++; 86 queue->count++;
88 TRACE(("leave enqueue"))
89 } 87 }