* XXX: the array is not scaled back when items are deleted.
*/
-#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
#include "binary_heap.h"
+#include "libvarnish.h"
/* Private definitions -----------------------------------------------*/
/* Implementation ----------------------------------------------------*/
static void
-binheap_update(struct binheap *bh, unsigned u)
+binheap_update(const struct binheap *bh, unsigned u)
{
assert(bh->magic == BINHEAP_MAGIC);
assert(u < bh->next);
}
static void
-binhead_swap(struct binheap *bh, unsigned u, unsigned v)
+binhead_swap(const struct binheap *bh, unsigned u, unsigned v)
{
void *p;
}
static unsigned
-binheap_trickleup(struct binheap *bh, unsigned u)
+binheap_trickleup(const struct binheap *bh, unsigned u)
{
unsigned v;
}
static void
-binheap_trickledown(struct binheap *bh, unsigned u)
+binheap_trickledown(const struct binheap *bh, unsigned u)
{
unsigned v1, v2;
u = bh->next++;
bh->array[u] = p;
binheap_update(bh, u);
- binheap_trickleup(bh, u);
+ (void)binheap_trickleup(bh, u);
}
void *
-binheap_root(struct binheap *bh)
+binheap_root(const struct binheap *bh)
{
assert(bh != NULL);