From e3a315fed12971f1e8309f6730c64712e125a105 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 26 Aug 2008 00:35:04 +0000 Subject: [PATCH] Remove some hacks from regression test since bpf_filter.c builds fine now. --- tools/regression/bpf/bpf_filter/Makefile | 8 ++++---- tools/regression/bpf/bpf_filter/bpf_test.c | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/regression/bpf/bpf_filter/Makefile b/tools/regression/bpf/bpf_filter/Makefile index 5be486d1e27c..a777e703cf88 100644 --- a/tools/regression/bpf/bpf_filter/Makefile +++ b/tools/regression/bpf/bpf_filter/Makefile @@ -20,11 +20,13 @@ TEST_CASES= test0001 test0002 test0003 test0004 \ test0069 test0070 test0071 test0072 \ test0073 test0074 +WARNS?= 6 + SYSDIR?= ${.CURDIR}/../../../../sys SRCS= ${.CURDIR}/bpf_test.c -CFLAGS+= -g -fno-builtin-abort -I${.CURDIR}/tests +CFLAGS+= -g -I${SYSDIR} -I${.CURDIR}/tests .if defined(BPF_BENCHMARK) CFLAGS+= -DBPF_BENCHMARK -DLOG_LEVEL=0 @@ -39,11 +41,9 @@ CFLAGS+= -DBPF_VALIDATE .if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386") && defined(BPF_JIT) SRCS+= ${SYSDIR}/net/bpf_jitter.c \ ${SYSDIR}/${MACHINE_ARCH}/${MACHINE_ARCH}/bpf_jit_machdep.c -CFLAGS+= -I${SYSDIR} -DBPF_JIT_COMPILER -WARNS?= 6 +CFLAGS+= -DBPF_JIT_COMPILER .else SRCS+= ${SYSDIR}/net/bpf_filter.c -WARNS?= 1 .endif .for TEST in ${TEST_CASES} diff --git a/tools/regression/bpf/bpf_filter/bpf_test.c b/tools/regression/bpf/bpf_filter/bpf_test.c index 31a20435890c..d8b46efd94fc 100644 --- a/tools/regression/bpf/bpf_filter/bpf_test.c +++ b/tools/regression/bpf/bpf_filter/bpf_test.c @@ -52,7 +52,10 @@ __FBSDID("$FreeBSD$"); static void sig_handler(int); +#if defined(BPF_JIT_COMPILER) || defined(BPF_VALIDATE) static int nins = sizeof(pc) / sizeof(pc[0]); +#endif + static int verbose = LOG_LEVEL; #ifdef BPF_JIT_COMPILER @@ -86,10 +89,6 @@ bpf_compile_and_filter(void) return (ret); } -#else - -u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); - #endif #ifdef BPF_VALIDATE @@ -155,7 +154,7 @@ bpf_validate(const struct bpf_insn *f, int len) int main(void) { -#if !defined(BPF_JIT_COMPILER) +#ifndef BPF_JIT_COMPILER u_int i; #endif u_int ret;