From 44ed272a73b179e115b9d568f853a221335f2505 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 30 Jan 2008 10:02:19 +0000 Subject: [PATCH] Make sure we get the right assert() macro. Constification. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2404 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/include/binary_heap.h | 2 +- varnish-cache/lib/libvarnish/binary_heap.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/varnish-cache/include/binary_heap.h b/varnish-cache/include/binary_heap.h index f4beb09c..e31b77f1 100644 --- a/varnish-cache/include/binary_heap.h +++ b/varnish-cache/include/binary_heap.h @@ -69,7 +69,7 @@ void binheap_delete(struct binheap *, unsigned idx); * The root item has 'idx' zero */ -void *binheap_root(struct binheap *); +void *binheap_root(const struct binheap *); /* * Return the root item */ diff --git a/varnish-cache/lib/libvarnish/binary_heap.c b/varnish-cache/lib/libvarnish/binary_heap.c index 0cf5dbb0..5589d836 100644 --- a/varnish-cache/lib/libvarnish/binary_heap.c +++ b/varnish-cache/lib/libvarnish/binary_heap.c @@ -36,11 +36,11 @@ * XXX: the array is not scaled back when items are deleted. */ -#include #include #include #include "binary_heap.h" +#include "libvarnish.h" /* Private definitions -----------------------------------------------*/ @@ -66,7 +66,7 @@ struct binheap { /* 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); @@ -97,7 +97,7 @@ binheap_new(void *priv, binheap_cmp_t *cmp_f, binheap_update_t *update_f) } static void -binhead_swap(struct binheap *bh, unsigned u, unsigned v) +binhead_swap(const struct binheap *bh, unsigned u, unsigned v) { void *p; @@ -112,7 +112,7 @@ binhead_swap(struct binheap *bh, unsigned u, unsigned v) } static unsigned -binheap_trickleup(struct binheap *bh, unsigned u) +binheap_trickleup(const struct binheap *bh, unsigned u) { unsigned v; @@ -129,7 +129,7 @@ binheap_trickleup(struct binheap *bh, unsigned u) } static void -binheap_trickledown(struct binheap *bh, unsigned u) +binheap_trickledown(const struct binheap *bh, unsigned u) { unsigned v1, v2; @@ -182,11 +182,11 @@ binheap_insert(struct binheap *bh, void *p) 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); -- 2.39.5