From 8b4f35532c8fd7c7f0939756923fdaf14ee39531 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 10 Jul 2014 15:38:09 +0200 Subject: Removed unsafe pointer typedefs - If a variable doesn't look like a pointer... Maybe it might be a pointer after all. Please, give me back my '*' sign. - See CERT DCL05-C. Signed-off-by: Haru --- src/common/mutex.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/common/mutex.h') diff --git a/src/common/mutex.h b/src/common/mutex.h index ce13a28b7..ced91ab8e 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -6,29 +6,29 @@ #include "../common/cbasetypes.h" -typedef struct ramutex *ramutex; // Mutex -typedef struct racond *racond; // Condition Var +typedef struct ramutex ramutex; // Mutex +typedef struct racond racond; // Condition Var /** * Creates a Mutex * * @return not NULL */ -ramutex ramutex_create(); +ramutex *ramutex_create(); /** * Destroys a Mutex * * @param m - the mutex to destroy */ -void ramutex_destroy( ramutex m ); +void ramutex_destroy(ramutex *m); /** * Gets a lock * * @param m - the mutex to lock */ -void ramutex_lock( ramutex m); +void ramutex_lock(ramutex *m); /** * Trys to get the Lock @@ -37,14 +37,14 @@ void ramutex_lock( ramutex m); * * @return boolean (true = got the lock) */ -bool ramutex_trylock( ramutex m ); +bool ramutex_trylock(ramutex *m); /** * Unlocks a mutex * * @param m - the mutex to unlock */ -void ramutex_unlock( ramutex m); +void ramutex_unlock(ramutex *m); /** @@ -52,14 +52,14 @@ void ramutex_unlock( ramutex m); * * @return not NULL */ -racond racond_create(); +racond *racond_create(); /** * Destroy a Condition variable * * @param c - the condition variable to destroy */ -void racond_destroy( racond c ); +void racond_destroy(racond *c); /** * Waits Until state is signaled @@ -68,7 +68,7 @@ void racond_destroy( racond c ); * @param m - the mutex used for synchronization * @param timeout_ticks - timeout in ticks ( -1 = INFINITE ) */ -void racond_wait( racond c, ramutex m, sysint timeout_ticks); +void racond_wait(racond *c, ramutex *m, sysint timeout_ticks); /** * Sets the given condition var to signaled state @@ -78,7 +78,7 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks); * @note: * Only one waiter gets notified. */ -void racond_signal( racond c ); +void racond_signal(racond *c); /** * Sets notifies all waiting threads thats signaled. @@ -87,7 +87,7 @@ void racond_signal( racond c ); * @note: * All Waiters getting notified. */ -void racond_broadcast( racond c ); +void racond_broadcast(racond *c); #endif /* _COMMON_MUTEX_H_ */ -- cgit v1.2.3-60-g2f50