]> granicus.if.org Git - libevent/commitdiff
Fix mixed declarations and code (forbidden by ISO C90)
authorThomas Bernard <miniupnp@free.fr>
Mon, 16 Feb 2015 22:42:54 +0000 (23:42 +0100)
committerThomas Bernard <miniupnp@free.fr>
Mon, 16 Feb 2015 22:42:54 +0000 (23:42 +0100)
test/regress_bufferevent.c

index ea64202ad7d6c90551764bb12f569259c4ca0214..a87e02ed3d3fcad82cca31884567fb8c0cc17500 100644 (file)
@@ -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;
 }