diff options
author | Chris Robinson <[email protected]> | 2018-11-18 03:59:39 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-18 03:59:39 -0800 |
commit | f48be9d73b4472570d28bf381d84e40cf65694c8 (patch) | |
tree | 59a4b4a9c869beab928cf06a35d3592dc4c334d0 /Alc/alu.cpp | |
parent | 7433cb5f4cb0515dd6e314978f579ae91e2c63c4 (diff) |
Remove the pointer-specific atomic exchange macros
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r-- | Alc/alu.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 92aa2bc4..9a02d4b6 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -75,7 +75,7 @@ static HrtfDirectMixerFunc MixDirectHrtf = MixDirectHrtf_C; void DeinitVoice(ALvoice *voice) { - al_free(ATOMIC_EXCHANGE_PTR_SEQ(&voice->Update, static_cast<ALvoiceProps*>(nullptr))); + al_free(ATOMIC_EXCHANGE_SEQ(&voice->Update, static_cast<ALvoiceProps*>(nullptr))); } @@ -315,8 +315,8 @@ static bool CalcContextParams(ALCcontext *Context) ALlistener &Listener = Context->Listener; struct ALcontextProps *props; - props = static_cast<ALcontextProps*>(ATOMIC_EXCHANGE_PTR(&Context->Update, - static_cast<ALcontextProps*>(nullptr), almemory_order_acq_rel)); + props = ATOMIC_EXCHANGE(&Context->Update, static_cast<ALcontextProps*>(nullptr), + almemory_order_acq_rel); if(!props) return false; Listener.Params.MetersPerUnit = props->MetersPerUnit; @@ -341,8 +341,8 @@ static bool CalcListenerParams(ALCcontext *Context) struct ALlistenerProps *props; aluVector vel; - props = static_cast<ALlistenerProps*>(ATOMIC_EXCHANGE_PTR(&Listener.Update, - static_cast<ALlistenerProps*>(nullptr), almemory_order_acq_rel)); + props = ATOMIC_EXCHANGE(&Listener.Update, static_cast<ALlistenerProps*>(nullptr), + almemory_order_acq_rel); if(!props) return false; /* AT then UP */ @@ -385,8 +385,8 @@ static bool CalcEffectSlotParams(ALeffectslot *slot, ALCcontext *context, bool f struct ALeffectslotProps *props; ALeffectState *state; - props = static_cast<ALeffectslotProps*>(ATOMIC_EXCHANGE_PTR(&slot->Update, - static_cast<ALeffectslotProps*>(nullptr), almemory_order_acq_rel)); + props = ATOMIC_EXCHANGE(&slot->Update, static_cast<ALeffectslotProps*>(nullptr), + almemory_order_acq_rel); if(!props && !force) return false; if(props) @@ -1455,8 +1455,8 @@ static void CalcSourceParams(ALvoice *voice, ALCcontext *context, bool force) ALbufferlistitem *BufferListItem; struct ALvoiceProps *props; - props = static_cast<ALvoiceProps*>(ATOMIC_EXCHANGE_PTR(&voice->Update, - static_cast<ALvoiceProps*>(nullptr), almemory_order_acq_rel)); + props = ATOMIC_EXCHANGE(&voice->Update, static_cast<ALvoiceProps*>(nullptr), + almemory_order_acq_rel); if(!props && !force) return; if(props) @@ -1857,10 +1857,8 @@ void aluHandleDisconnect(ALCdevice *device, const char *msg, ...) for(i = 0;i < ctx->VoiceCount;i++) { ALvoice *voice = ctx->Voices[i]; - ALsource *source; - - source = static_cast<ALsource*>(ATOMIC_EXCHANGE_PTR(&voice->Source, - static_cast<ALsource*>(nullptr), almemory_order_relaxed)); + ALsource *source = ATOMIC_EXCHANGE(&voice->Source, static_cast<ALsource*>(nullptr), + almemory_order_relaxed); if(source && ATOMIC_LOAD(&voice->Playing, almemory_order_relaxed)) { /* If the source's voice was playing, it's now effectively |