From a79f1381f349d099e5018d38007bdc5a8a31171a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 22 Jun 2005 20:58:41 +0000 Subject: [PATCH] fix casting problem? --- stepmania/src/arch/Threads/Threads_Pthreads.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/stepmania/src/arch/Threads/Threads_Pthreads.cpp b/stepmania/src/arch/Threads/Threads_Pthreads.cpp index b05b121607..5ce81e82ad 100644 --- a/stepmania/src/arch/Threads/Threads_Pthreads.cpp +++ b/stepmania/src/arch/Threads/Threads_Pthreads.cpp @@ -41,12 +41,14 @@ uint64_t ThreadImpl_Pthreads::GetThreadId() const int ThreadImpl_Pthreads::Wait() { - void *val; - int ret = pthread_join( thread, &val ); + int *val; + int ret = pthread_join( thread, (void **) &val ); if( ret ) RageException::Throw( "pthread_join: %s", strerror(errno) ); - return (int) val; + int iRet = *val; + delete val; + return iRet; } ThreadImpl *MakeThisThread() @@ -69,7 +71,9 @@ static void *StartThread( void *pData ) /* Tell MakeThread that we've set m_piThreadID, so it's safe to return. */ pThis->m_StartFinishedSem->Post(); - return (void *) pThis->m_pFunc( pThis->m_pData ); + int iRet = pThis->m_pFunc( pThis->m_pData ); + + return new int(iRet); } ThreadImpl *MakeThread( int (*pFunc)(void *pData), void *pData, uint64_t *piThreadID )