diff -Nurd -x'*~' pwlib-1.10.10.orig/src/ptlib/unix/maccoreaudio.cxx pwlib-1.10.10/src/ptlib/unix/maccoreaudio.cxx --- pwlib-1.10.10.orig/src/ptlib/unix/maccoreaudio.cxx 2005-08-04 16:10:24.000000000 -0400 +++ pwlib-1.10.10/src/ptlib/unix/maccoreaudio.cxx 2012-01-26 16:52:24.000000000 -0500 @@ -23,6 +23,7 @@ #include #include // used for Volume Listener +#include PCREATE_SOUND_PLUGIN(CoreAudio, PSoundChannelCoreAudio); @@ -1337,7 +1338,7 @@ //calculate size of ABL given the last field, assum non-interleaved UInt32 mChannelsPerFrame = hwASBD.mChannelsPerFrame; - UInt32 propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]); + UInt32 propsize = sizeof(AudioBuffer) * mChannelsPerFrame + sizeof(AudioBufferList); //malloc buffer lists mInputBufferList = (AudioBufferList *)malloc(propsize); @@ -1372,7 +1373,7 @@ //calculate number of buffers from channels mChannelsPerFrame = pwlibASBD.mChannelsPerFrame; - propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]); + propsize = sizeof(AudioBuffer) * mChannelsPerFrame + sizeof(AudioBufferList); //malloc buffer lists mOutputBufferList = (AudioBufferList *)malloc(propsize); --- a/src/ptlib/unix/svcproc.cxx 2012-03-16 10:44:21.000000000 -0400 +++ b/src/ptlib/unix/svcproc.cxx 2007-10-19 02:22:32.000000000 -0400 @@ -388,7 +388,7 @@ #elif defined(BE_THREADS) thread_id tid = ::find_thread(NULL); #else - unsigned tid = (unsigned) pthread_self(); + unsigned tid = (unsigned long) pthread_self(); #endif *out << "ThreadID=0x" << setfill('0') << ::hex @@ -938,7 +938,7 @@ #elif defined(BE_THREADS) thread_id tid = ::find_thread(NULL); #else - unsigned tid = (unsigned) pthread_self(); + unsigned tid = (unsigned long) pthread_self(); #endif PThread * thread_ptr = activeThreads.GetAt(tid); --- a/src/ptlib/unix/tlibthrd.cxx 2012-03-16 10:44:21.000000000 -0400 +++ b/src/ptlib/unix/tlibthrd.cxx 2007-10-19 02:22:32.000000000 -0400 @@ -754,7 +754,7 @@ { PWaitAndSignal m(threadMutex); - if (!activeThreads.Contains((unsigned)id)) + if (!activeThreads.Contains((unsigned long)id)) return FALSE; return pthread_kill(id, sig) == 0; @@ -792,7 +792,7 @@ #endif ((PProcess *)this)->activeThreads.DisallowDeleteObjects(); - ((PProcess *)this)->activeThreads.SetAt((unsigned)PX_threadId, this); + ((PProcess *)this)->activeThreads.SetAt((unsigned long)PX_threadId, this); PX_firstTimeStart = FALSE; @@ -906,7 +906,7 @@ PAssertPTHREAD(pthread_create, (&PX_threadId, &threadAttr, PX_ThreadStart, this)); // put the thread into the thread list - process.activeThreads.SetAt((unsigned)PX_threadId, this); + process.activeThreads.SetAt((unsigned long)PX_threadId, this); if (process.activeThreads.GetSize() > highWaterMark) newHighWaterMark = highWaterMark = process.activeThreads.GetSize(); @@ -1229,7 +1229,7 @@ { PProcess & process = PProcess::Current(); process.threadMutex.Wait(); - PThread * thread = process.activeThreads.GetAt((unsigned)pthread_self()); + PThread * thread = process.activeThreads.GetAt((unsigned long)pthread_self()); process.threadMutex.Signal(); return thread; } @@ -1362,7 +1362,7 @@ } // remove this thread from the active thread list - process.activeThreads.SetAt((unsigned)id, NULL); + process.activeThreads.SetAt((unsigned long)id, NULL); // delete the thread if required, note this is done this way to avoid // a race condition, the thread ID cannot be zeroed before the if! @@ -1562,7 +1562,7 @@ PAssertPTHREAD(pthread_mutex_unlock, (&semCreationMutex)); - PAssert(((int)sem != SEM_FAILED), "Couldn't create named semaphore"); + PAssert((sem != (sem_t *)SEM_FAILED), "Couldn't create named semaphore"); return sem; } #endif --- a/src/ptlib/common/osutils.cxx 2005-12-04 17:43:30.000000000 -0500 +++ b/src/ptlib/common/osutils.cxx 2012-03-16 11:11:48.000000000 -0400 @@ -2145,9 +2145,9 @@ void PThread::SetThreadName(const PString & name) { if (name.IsEmpty()) - threadName = psprintf("%s:%08x", GetClass(), (INT)this); + threadName = psprintf("%s:%08x", GetClass(), (long INT)this); else - threadName = psprintf(name, (INT)this); + threadName = psprintf(name, (long INT)this); #if defined(_DEBUG) && defined(_MSC_VER) if (threadId) { // make thread name known to debugger @@ -2356,21 +2356,21 @@ PReadWriteMutex::Nest * PReadWriteMutex::GetNest() const { PWaitAndSignal mutex(nestingMutex); - return nestedThreads.GetAt(POrdinalKey((PINDEX)PThread::GetCurrentThreadId())); + return nestedThreads.GetAt(POrdinalKey((long PINDEX)PThread::GetCurrentThreadId())); } void PReadWriteMutex::EndNest() { nestingMutex.Wait(); - nestedThreads.RemoveAt(POrdinalKey((PINDEX)PThread::GetCurrentThreadId())); + nestedThreads.RemoveAt(POrdinalKey((long PINDEX)PThread::GetCurrentThreadId())); nestingMutex.Signal(); } PReadWriteMutex::Nest & PReadWriteMutex::StartNest() { - POrdinalKey threadId = (PINDEX)PThread::GetCurrentThreadId(); + POrdinalKey threadId = (long PINDEX)PThread::GetCurrentThreadId(); nestingMutex.Wait();