[master] 94ed598 Resurrect the test-code
Poul-Henning Kamp
phk at FreeBSD.org
Mon Nov 13 20:53:08 UTC 2017
commit 94ed59827d3feaa78b2de6c675d8b10a8502e501
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Nov 13 20:51:53 2017 +0000
Resurrect the test-code
diff --git a/lib/libvarnish/binary_heap.c b/lib/libvarnish/binary_heap.c
index beb9a64..94de6f8 100644
--- a/lib/libvarnish/binary_heap.c
+++ b/lib/libvarnish/binary_heap.c
@@ -456,21 +456,22 @@ binheap_reorder(const struct binheap *bh, unsigned idx)
#ifdef TEST_DRIVER
#include <stdio.h>
+#include <strings.h>
#include "miniobj.h"
/* Test driver -------------------------------------------------------*/
-static void
-vasfail(const char *func, const char *file, int line,
- const char *cond, int err, int xxx)
+void __attribute__((__noreturn__))
+VAS_Fail(const char *func, const char *file, int line,
+ const char *cond, enum vas_e what)
{
- fprintf(stderr, "PANIC: %s %s %d %s %d %d\n",
- func, file, line, cond, err, xxx);
+ fprintf(stderr, "PANIC: %s %s %d %s %d\n",
+ func, file, line, cond, what);
abort();
}
-vas_f *VAS_Fail_Func = vasfail;
+vas_f *VAS_Fail_Func = VAS_Fail;
struct foo {
unsigned magic;
@@ -492,9 +493,9 @@ struct foo {
struct foo *ff[N];
static int
-cmp(void *priv, void *a, void *b)
+cmp(void *priv, const void *a, const void *b)
{
- struct foo *fa, *fb;
+ const struct foo *fa, *fb;
CAST_OBJ_NOTNULL(fa, a, FOO_MAGIC);
CAST_OBJ_NOTNULL(fb, b, FOO_MAGIC);
More information about the varnish-commit
mailing list