summaryrefslogtreecommitdiff
path: root/src/common/mutex.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 15:38:09 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:42:50 +0200
commit8b4f35532c8fd7c7f0939756923fdaf14ee39531 (patch)
tree2a5a69e909538ecc81cdcd37b0dd74e0a046e021 /src/common/mutex.c
parent3f3f2e7ec09087b57148a0fb229de26293c5a462 (diff)
downloadhercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.gz
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.bz2
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.xz
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.zip
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 <haru@dotalux.com>
Diffstat (limited to 'src/common/mutex.c')
-rw-r--r--src/common/mutex.c20
1 files changed, 10 insertions, 10 deletions
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);