From 35ae7af4c8f541785699ad7ca1ad64d2413a88ec Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 2 Jan 2015 15:06:58 +0100 Subject: [SERVER] Dead code removal, minor performance tweaks, refactoring, etc. --- src/server/locks.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/server/locks.c') diff --git a/src/server/locks.c b/src/server/locks.c index 48f67a9..d779e6f 100644 --- a/src/server/locks.c +++ b/src/server/locks.c @@ -66,7 +66,7 @@ int debug_spin_init(const char *name, const char *file, int line, pthread_spinlo pthread_spin_lock( &initdestory ); for (int i = 0; i < MAXLOCKS; ++i) { if ( locks[i].lock == lock ) { - printf( "[ERROR] Lock %p (%s) already initialized (%s:%d)\n", lock, name, file, line ); + printf( "[ERROR] Lock %p (%s) already initialized (%s:%d)\n", (void*)lock, name, file, line ); exit( 4 ); } if ( first == -1 && locks[i].lock == NULL ) first = i; @@ -97,7 +97,7 @@ int debug_spin_lock(const char *name, const char *file, int line, pthread_spinlo } pthread_spin_unlock( &initdestory ); if ( l == NULL ) { - printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", (void*)lock, name, file, line ); debug_dump_lock_stats(); exit( 4 ); } @@ -119,7 +119,7 @@ int debug_spin_lock(const char *name, const char *file, int line, pthread_spinlo t->time = 0; pthread_spin_unlock( &initdestory ); if ( l->locked ) { - printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", (void*)lock, name, file, line ); exit( 4 ); } l->locked = 1; @@ -144,7 +144,7 @@ int debug_spin_trylock(const char *name, const char *file, int line, pthread_spi } pthread_spin_unlock( &initdestory ); if ( l == NULL ) { - printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Tried to lock uninitialized lock %p (%s) at %s:%d\n", (void*)lock, name, file, line ); debug_dump_lock_stats(); exit( 4 ); } @@ -167,7 +167,7 @@ int debug_spin_trylock(const char *name, const char *file, int line, pthread_spi pthread_spin_unlock( &initdestory ); if ( retval == 0 ) { if ( l->locked ) { - printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Lock sanity check: lock %p (%s) already locked at %s:%d\n", (void*)lock, name, file, line ); exit( 4 ); } l->locked = 1; @@ -193,11 +193,11 @@ int debug_spin_unlock(const char *name, const char *file, int line, pthread_spin } pthread_spin_unlock( &initdestory ); if ( l == NULL ) { - printf( "[ERROR] Tried to unlock uninitialized lock %p (%s) at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Tried to unlock uninitialized lock %p (%s) at %s:%d\n", (void*)lock, name, file, line ); exit( 4 ); } if ( !l->locked ) { - printf( "[ERROR] Unlock sanity check: lock %p (%s) not locked at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Unlock sanity check: lock %p (%s) not locked at %s:%d\n", (void*)lock, name, file, line ); exit( 4 ); } l->locked = 0; @@ -214,7 +214,7 @@ int debug_spin_destroy(const char *name, const char *file, int line, pthread_spi for (int i = 0; i < MAXLOCKS; ++i) { if ( locks[i].lock == lock ) { if ( locks[i].locked ) { - printf( "[ERROR] Tried to destroy lock %p (%s) at %s:%d when it is still locked\n", lock, name, file, line ); + printf( "[ERROR] Tried to destroy lock %p (%s) at %s:%d when it is still locked\n", (void*)lock, name, file, line ); exit( 4 ); } locks[i].lock = NULL; @@ -223,7 +223,7 @@ int debug_spin_destroy(const char *name, const char *file, int line, pthread_spi return pthread_spin_destroy( lock ); } } - printf( "[ERROR] Tried to destroy non-existent lock %p (%s) at %s:%d\n", lock, name, file, line ); + printf( "[ERROR] Tried to destroy non-existent lock %p (%s) at %s:%d\n", (void*)lock, name, file, line ); exit( 4 ); } -- cgit v1.2.3-55-g7522