From ba1def612671360dc14ad65ed7ff2b7a15457677 Mon Sep 17 00:00:00 2001 From: dmitrykos Date: Sat, 25 Dec 2010 13:26:17 +0000 Subject: [PATCH] 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 --- src/hostapi/coreaudio/pa_mac_core_internal.h | 2 +- src/hostapi/coreaudio/pa_mac_core_utilities.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 ); } } -- 2.43.0