summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--bench-heap.c2
-rw-r--r--bench-wheel.c6
-rw-r--r--bench.c2
-rw-r--r--bench.h2
5 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 5d8911f..f9a8f7a 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ WHEEL_BIT = 6
WHEEL_NUM = 4
CPPFLAGS = -DTIMEOUT_DEBUG
-CFLAGS = -O2 -g -Wall -Wextra
+CFLAGS = -O2 -g -Wall -Wextra -Wno-unused-parameter
timeout: CPPFLAGS+=-DWHEEL_BIT=$(WHEEL_BIT) -DWHEEL_NUM=$(WHEEL_NUM)
diff --git a/bench-heap.c b/bench-heap.c
index e132380..46a522b 100644
--- a/bench-heap.c
+++ b/bench-heap.c
@@ -158,7 +158,7 @@ void min_heap_shift_down_(min_heap_t* s, unsigned hole_index, struct timeout* e)
static timeout_t curtime;
static min_heap_t timeouts;
-static void init(struct timeout *timeout, size_t count) {
+static void init(struct timeout *timeout, size_t count, int verbose) {
size_t i;
min_heap_ctor(&timeouts);
diff --git a/bench-wheel.c b/bench-wheel.c
index 51177a3..62d658a 100644
--- a/bench-wheel.c
+++ b/bench-wheel.c
@@ -5,7 +5,7 @@
static struct timeouts timeouts;
-static void init(struct timeout *timeout, size_t count) {
+static void init(struct timeout *timeout, size_t count, int verbose) {
size_t i;
timeouts_init(&timeouts, TIMEOUT_mHZ);
@@ -13,6 +13,10 @@ static void init(struct timeout *timeout, size_t count) {
for (i = 0; i < count; i++) {
timeout_init(&timeout[i], 0);
}
+
+#if TIMEOUT_DEBUG - 0
+ timeout_debug = verbose;
+#endif
} /* init() */
diff --git a/bench.c b/bench.c
index e844309..2006f40 100644
--- a/bench.c
+++ b/bench.c
@@ -203,7 +203,7 @@ int main(int argc, char **argv) {
errx(1, "%s: %s", MAIN.path, dlerror());
MAIN.vops = *vops;
- MAIN.vops.init(MAIN.timeout, MAIN.count);
+ MAIN.vops.init(MAIN.timeout, MAIN.count, MAIN.verbose);
while (fgets(cmd, sizeof cmd, stdin) && parseop(&op, cmd)) {
struct timeout *to;
diff --git a/bench.h b/bench.h
index a2a1b72..2418990 100644
--- a/bench.h
+++ b/bench.h
@@ -43,7 +43,7 @@ struct op *parseop(struct op *, char *ln);
struct vops {
- void (*init)(struct timeout *, size_t);
+ void (*init)(struct timeout *, size_t, int);
void (*add)(struct timeout *, timeout_t);
void (*del)(struct timeout *);
struct timeout *(*get)(void);