From: dmitrykos Date: Sat, 25 Dec 2010 13:26:17 +0000 (+0000) Subject: coreaudio: fixed incorrect value type used with OSAtomicOr32 API (xrunFlags were... X-Git-Tag: pa_stable_v19_20110326_r1647~73 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=ba1def612671360dc14ad65ed7ff2b7a15457677;p=portaudio coreaudio: fixed incorrect value type used with OSAtomicOr32 API (xrunFlags were casted from long to unsigned int) which results in value truncation on systems where 'long' is 64 bits --- diff --git a/src/hostapi/coreaudio/pa_mac_core_internal.h b/src/hostapi/coreaudio/pa_mac_core_internal.h index 9277321..3ebbf1b 100644 --- a/src/hostapi/coreaudio/pa_mac_core_internal.h +++ b/src/hostapi/coreaudio/pa_mac_core_internal.h @@ -141,7 +141,7 @@ typedef struct PaMacCoreStream AudioBufferList inputAudioBufferList; AudioTimeStamp startTime; /* FIXME: instead of volatile, these should be properly memory barriered */ - volatile PaStreamCallbackFlags xrunFlags; + volatile uint32_t xrunFlags; /*PaStreamCallbackFlags*/ volatile enum { STOPPED = 0, /* playback is completely stopped, and the user has called StopStream(). */ diff --git a/src/hostapi/coreaudio/pa_mac_core_utilities.c b/src/hostapi/coreaudio/pa_mac_core_utilities.c index 251bbe8..bbd169f 100644 --- a/src/hostapi/coreaudio/pa_mac_core_utilities.c +++ b/src/hostapi/coreaudio/pa_mac_core_utilities.c @@ -652,10 +652,10 @@ OSStatus xrunCallback( if( isInput ) { if( stream->inputDevice == inDevice ) - OSAtomicOr32( paInputOverflow, (uint32_t *)&(stream->xrunFlags) ); + OSAtomicOr32( paInputOverflow, &stream->xrunFlags ); } else { if( stream->outputDevice == inDevice ) - OSAtomicOr32( paOutputUnderflow, (uint32_t *)&(stream->xrunFlags) ); + OSAtomicOr32( paOutputUnderflow, &stream->xrunFlags ); } }