From 746d2c502cc3552cca91f91846c6791f648c7205 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 16 Feb 2015 23:41:53 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20"function=20declaration=20isn?= =?UTF-8?q?=E2=80=99t=20a=20prototype"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add "void" to argument list --- evthread-internal.h | 4 ++-- test/regress_bufferevent.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/evthread-internal.h b/evthread-internal.h index 16adf167..efdecf81 100644 --- a/evthread-internal.h +++ b/evthread-internal.h @@ -377,9 +377,9 @@ int evutil_global_setup_locks_(const int enable_locks); int evutil_secure_rng_global_setup_locks_(const int enable_locks); /** Return current evthread_lock_callbacks */ -struct evthread_lock_callbacks *evthread_get_lock_callbacks(); +struct evthread_lock_callbacks *evthread_get_lock_callbacks(void); /** Return current evthread_condition_callbacks */ -struct evthread_condition_callbacks *evthread_get_condition_callbacks(); +struct evthread_condition_callbacks *evthread_get_condition_callbacks(void); /** Disable locking for internal usage (like global shutdown) */ void evthreadimpl_disable_lock_debugging_(void); diff --git a/test/regress_bufferevent.c b/test/regress_bufferevent.c index a1998ba6..ea64202a 100644 --- a/test/regress_bufferevent.c +++ b/test/regress_bufferevent.c @@ -273,7 +273,7 @@ static int trace_lock_unlock(unsigned mode, void *lock_) return lu_base.cbs.unlock(mode, lock_); } } -static void lock_unlock_free_thread_cbs() +static void lock_unlock_free_thread_cbs(void) { event_base_free(NULL); From 0c7f21781a99a2deda50f5d6a38742a6822fbe10 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 16 Feb 2015 23:42:54 +0100 Subject: [PATCH 2/2] Fix mixed declarations and code (forbidden by ISO C90) --- test/regress_bufferevent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/regress_bufferevent.c b/test/regress_bufferevent.c index ea64202a..a87e02ed 100644 --- a/test/regress_bufferevent.c +++ b/test/regress_bufferevent.c @@ -233,10 +233,11 @@ static lock_wrapper *lu_find(void *lock_) static void *trace_lock_alloc(unsigned locktype) { + void *lock; ++lu_base.nr_locks; lu_base.locks = realloc(lu_base.locks, sizeof(lock_wrapper) * lu_base.nr_locks); - void *lock = lu_base.cbs.alloc(locktype); + lock = lu_base.cbs.alloc(locktype); lu_base.locks[lu_base.nr_locks - 1] = (lock_wrapper){ lock, ALLOC, 0 }; return lock; }