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.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/common/mutex.c') diff --git a/src/common/mutex.c b/src/common/mutex.c index 626dfa2e1..6707df7e6 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -50,7 +50,7 @@ struct racond{ // -ramutex ramutex_create(){ +ramutex *ramutex_create() { struct ramutex *m; m = (struct ramutex*)aMalloc( sizeof(struct ramutex) ); @@ -69,7 +69,7 @@ ramutex ramutex_create(){ }//end: ramutex_create() -void ramutex_destroy( ramutex m ){ +void ramutex_destroy(ramutex *m) { #ifdef WIN32 DeleteCriticalSection(&m->hMutex); @@ -82,7 +82,7 @@ void ramutex_destroy( ramutex m ){ }//end: ramutex_destroy() -void ramutex_lock( ramutex m ){ +void ramutex_lock(ramutex *m) { #ifdef WIN32 EnterCriticalSection(&m->hMutex); @@ -92,7 +92,7 @@ void ramutex_lock( ramutex m ){ }//end: ramutex_lock -bool ramutex_trylock( ramutex m ){ +bool ramutex_trylock(ramutex *m) { #ifdef WIN32 if(TryEnterCriticalSection(&m->hMutex) == TRUE) return true; @@ -107,7 +107,7 @@ bool ramutex_trylock( ramutex m ){ }//end: ramutex_trylock() -void ramutex_unlock( ramutex m ){ +void ramutex_unlock(ramutex *m) { #ifdef WIN32 LeaveCriticalSection(&m->hMutex); #else @@ -124,7 +124,7 @@ void ramutex_unlock( ramutex m ){ // Implementation: // -racond racond_create(){ +racond *racond_create() { struct racond *c; c = (struct racond*)aMalloc( sizeof(struct racond) ); @@ -146,7 +146,7 @@ racond racond_create(){ }//end: racond_create() -void racond_destroy( racond c ){ +void racond_destroy(racond *c) { #ifdef WIN32 CloseHandle( c->events[ EVENT_COND_SIGNAL ] ); CloseHandle( c->events[ EVENT_COND_BROADCAST ] ); @@ -159,7 +159,7 @@ void racond_destroy( racond c ){ }//end: racond_destroy() -void racond_wait( racond c, ramutex m, sysint timeout_ticks){ +void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) { #ifdef WIN32 register DWORD ms; int result; @@ -217,7 +217,7 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks){ }//end: racond_wait() -void racond_signal( racond c ){ +void racond_signal(racond *c) { #ifdef WIN32 // bool has_waiters = false; // EnterCriticalSection(&c->waiters_lock); @@ -233,7 +233,7 @@ void racond_signal( racond c ){ }//end: racond_signal() -void racond_broadcast( racond c ){ +void racond_broadcast(racond *c) { #ifdef WIN32 // bool has_waiters = false; // EnterCriticalSection(&c->waiters_lock); -- cgit v1.2.3-60-g2f50