summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-09-07 09:39:47 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-09-07 09:41:37 +0200
commit98f08e463d2ddb80441493a6d7529b015025eebb (patch)
treead250baa137b983c4196d085350520625ae27207 /sal
parent8318ecfa88ba52a44e1b9a437678302bfd0d0eab (diff)
Remove confusing casts between synonyms
oslMutex and oslMutexImpl* are synonyms (via two typedefs). Casting between them makes the reader believe some more nefarious trick is at hand. Change-Id: Ib0e609fd1facca4d47242392ed2f8ff08451346b
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/mutex.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sal/osl/unx/mutex.c b/sal/osl/unx/mutex.c
index 610dc7a87090..b894758c9795 100644
--- a/sal/osl/unx/mutex.c
+++ b/sal/osl/unx/mutex.c
@@ -42,7 +42,7 @@ typedef struct _oslMutexImpl
/*****************************************************************************/
oslMutex SAL_CALL osl_createMutex()
{
- oslMutexImpl* pMutex = (oslMutexImpl*) malloc(sizeof(oslMutexImpl));
+ oslMutexImpl* pMutex = malloc(sizeof(oslMutexImpl));
pthread_mutexattr_t aMutexAttr;
int nRet=0;
@@ -69,16 +69,14 @@ oslMutex SAL_CALL osl_createMutex()
pthread_mutexattr_destroy(&aMutexAttr);
- return (oslMutex) pMutex;
+ return pMutex;
}
/*****************************************************************************/
/* osl_destroyMutex */
/*****************************************************************************/
-void SAL_CALL osl_destroyMutex(oslMutex Mutex)
+void SAL_CALL osl_destroyMutex(oslMutexImpl *pMutex)
{
- oslMutexImpl* pMutex = (oslMutexImpl*) Mutex;
-
OSL_ASSERT(pMutex);
if ( pMutex != 0 )
@@ -101,10 +99,8 @@ void SAL_CALL osl_destroyMutex(oslMutex Mutex)
/*****************************************************************************/
/* osl_acquireMutex */
/*****************************************************************************/
-sal_Bool SAL_CALL osl_acquireMutex(oslMutex Mutex)
+sal_Bool SAL_CALL osl_acquireMutex(oslMutexImpl *pMutex)
{
- oslMutexImpl* pMutex = (oslMutexImpl*) Mutex;
-
OSL_ASSERT(pMutex);
if ( pMutex != 0 )
@@ -128,10 +124,8 @@ sal_Bool SAL_CALL osl_acquireMutex(oslMutex Mutex)
/*****************************************************************************/
/* osl_tryToAcquireMutex */
/*****************************************************************************/
-sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutex Mutex)
+sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutexImpl *pMutex)
{
- oslMutexImpl* pMutex = (oslMutexImpl*) Mutex;
-
OSL_ASSERT(pMutex);
if ( pMutex )
@@ -151,10 +145,8 @@ sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutex Mutex)
/*****************************************************************************/
/* osl_releaseMutex */
/*****************************************************************************/
-sal_Bool SAL_CALL osl_releaseMutex(oslMutex Mutex)
+sal_Bool SAL_CALL osl_releaseMutex(oslMutexImpl *pMutex)
{
- oslMutexImpl* pMutex = (oslMutexImpl*) Mutex;
-
OSL_ASSERT(pMutex);
if ( pMutex )