These functions were intended for callers who want to allocate a Queue on the
heap. However, this is unnecessary and callers all locate their Queue objects on
the stack and use mkQueue and freeQueue instead. This removal cleans up the code
a little and squashes two -Wmissing-prototypes warnings.
qp->start = qp->end = 0;
}
-Queue *newQueue(int size)
-{
- Queue *qp = GNEW(Queue);
- mkQueue(qp, size);
- return qp;
-}
-
void freeQueue(Queue * qp)
{
free(qp->data);
}
-void delQueue(Queue * qp)
-{
- free(qp->data);
- free(qp);
-}
-
void initQueue(Queue * qp, int startVertex)
{
qp->data[0] = startVertex;