Merge pull request #220 from miniupnp/fix_warnings

Fix warnings
This commit is contained in:
Nick Mathewson 2015-02-17 12:37:30 -05:00
commit 31c6d45f8d
2 changed files with 5 additions and 4 deletions

View File

@ -377,9 +377,9 @@ int evutil_global_setup_locks_(const int enable_locks);
int evutil_secure_rng_global_setup_locks_(const int enable_locks); int evutil_secure_rng_global_setup_locks_(const int enable_locks);
/** Return current evthread_lock_callbacks */ /** 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 */ /** 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) */ /** Disable locking for internal usage (like global shutdown) */
void evthreadimpl_disable_lock_debugging_(void); void evthreadimpl_disable_lock_debugging_(void);

View File

@ -233,10 +233,11 @@ static lock_wrapper *lu_find(void *lock_)
static void *trace_lock_alloc(unsigned locktype) static void *trace_lock_alloc(unsigned locktype)
{ {
void *lock;
++lu_base.nr_locks; ++lu_base.nr_locks;
lu_base.locks = realloc(lu_base.locks, lu_base.locks = realloc(lu_base.locks,
sizeof(lock_wrapper) * lu_base.nr_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 }; lu_base.locks[lu_base.nr_locks - 1] = (lock_wrapper){ lock, ALLOC, 0 };
return lock; return lock;
} }
@ -273,7 +274,7 @@ static int trace_lock_unlock(unsigned mode, void *lock_)
return lu_base.cbs.unlock(mode, 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); event_base_free(NULL);