diff options
author | Chris Robinson <[email protected]> | 2018-11-26 14:48:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-26 14:48:26 -0800 |
commit | 053599b2435844eddcc084414ab9dd1c5ad7ec23 (patch) | |
tree | dd041ee64b6d056708ad500f5e6d5b0d144cecc7 | |
parent | a6923790fac739f0b98db6c06bc93543b9707556 (diff) |
Avoid using the ATOMIC() macro
-rw-r--r-- | Alc/alcontext.h | 22 | ||||
-rw-r--r-- | Alc/backends/jack.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/null.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/opensl.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/qsa.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/sndio.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/solaris.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/wave.cpp | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alListener.h | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 8 | ||||
-rw-r--r-- | OpenAL32/Include/alSource.h | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 18 | ||||
-rw-r--r-- | common/atomic.h | 2 |
14 files changed, 37 insertions, 39 deletions
diff --git a/Alc/alcontext.h b/Alc/alcontext.h index c6824d78..056d9003 100644 --- a/Alc/alcontext.h +++ b/Alc/alcontext.h @@ -71,7 +71,7 @@ struct ALCcontext_struct { al::vector<ALeffectslotPtr> EffectSlotList; almtx_t EffectSlotLock; - ATOMIC(ALenum) LastError{AL_NO_ERROR}; + std::atomic<ALenum> LastError{AL_NO_ERROR}; DistanceModel mDistanceModel{DistanceModel::Default}; ALboolean SourceDistanceModel{AL_FALSE}; @@ -90,30 +90,30 @@ struct ALCcontext_struct { * indicates if updates are currently happening). */ RefCount UpdateCount{0u}; - ATOMIC(ALenum) HoldUpdates{AL_FALSE}; + std::atomic<ALenum> HoldUpdates{AL_FALSE}; ALfloat GainBoost{1.0f}; - ATOMIC(ALcontextProps*) Update{nullptr}; + std::atomic<ALcontextProps*> Update{nullptr}; /* Linked lists of unused property containers, free to use for future * updates. */ - ATOMIC(ALcontextProps*) FreeContextProps{nullptr}; - ATOMIC(ALlistenerProps*) FreeListenerProps{nullptr}; - ATOMIC(ALvoiceProps*) FreeVoiceProps{nullptr}; - ATOMIC(ALeffectslotProps*) FreeEffectslotProps{nullptr}; + std::atomic<ALcontextProps*> FreeContextProps{nullptr}; + std::atomic<ALlistenerProps*> FreeListenerProps{nullptr}; + std::atomic<ALvoiceProps*> FreeVoiceProps{nullptr}; + std::atomic<ALeffectslotProps*> FreeEffectslotProps{nullptr}; ALvoice **Voices{nullptr}; std::atomic<ALsizei> VoiceCount{0}; ALsizei MaxVoices{0}; - ATOMIC(ALeffectslotArray*) ActiveAuxSlots{nullptr}; + std::atomic<ALeffectslotArray*> ActiveAuxSlots{nullptr}; std::thread EventThread; alsem_t EventSem; ll_ringbuffer *AsyncEvents{nullptr}; - ATOMIC(ALbitfieldSOFT) EnabledEvts{0u}; + std::atomic<ALbitfieldSOFT> EnabledEvts{0u}; std::mutex EventCbLock; ALEVENTPROCSOFT EventCb{}; void *EventParam{nullptr}; @@ -124,7 +124,7 @@ struct ALCcontext_struct { ALCdevice *const Device; const ALCchar *ExtensionList{nullptr}; - ATOMIC(ALCcontext*) next{nullptr}; + std::atomic<ALCcontext*> next{nullptr}; ALlistener Listener{}; @@ -199,7 +199,7 @@ struct ALcontextProps { DistanceModel mDistanceModel; ALfloat MetersPerUnit; - ATOMIC(struct ALcontextProps*) next; + std::atomic<ALcontextProps*> next; }; #endif /* ALCONTEXT_H */ diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp index d0687939..72a27c44 100644 --- a/Alc/backends/jack.cpp +++ b/Alc/backends/jack.cpp @@ -151,7 +151,7 @@ struct ALCjackPlayback final : public ALCbackend { ll_ringbuffer_t *Ring{nullptr}; alsem_t Sem; - ATOMIC(ALenum) killNow{AL_TRUE}; + std::atomic<ALenum> killNow{AL_TRUE}; althrd_t thread; }; diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp index 7c7f5e5e..440da5e8 100644 --- a/Alc/backends/null.cpp +++ b/Alc/backends/null.cpp @@ -45,7 +45,7 @@ constexpr ALCchar nullDevice[] = "No Output"; struct ALCnullBackend final : public ALCbackend { - ATOMIC(int) killNow{AL_TRUE}; + std::atomic<ALenum> killNow{AL_TRUE}; std::thread thread; }; diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp index 5b80ea65..2a87e19b 100644 --- a/Alc/backends/opensl.cpp +++ b/Alc/backends/opensl.cpp @@ -148,7 +148,7 @@ struct ALCopenslPlayback final : public ALCbackend { ALsizei mFrameSize{0}; - ATOMIC(ALenum) mKillNow{AL_TRUE}; + std::atomic<ALenum> mKillNow{AL_TRUE}; althrd_t mThread; }; diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp index a6d1e0ea..66f3e601 100644 --- a/Alc/backends/qsa.cpp +++ b/Alc/backends/qsa.cpp @@ -51,7 +51,7 @@ struct qsa_data { ALvoid* buffer; ALsizei size; - ATOMIC(ALenum) killNow; + std::atomic<ALenum> killNow; althrd_t thread; }; diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index de5f74e4..5e7b48af 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -43,7 +43,7 @@ struct SndioPlayback final : public ALCbackend { ALvoid *mix_data{nullptr}; ALsizei data_size{0}; - ATOMIC(int) killNow{AL_TRUE}; + std::atomic<ALenum> killNow{AL_TRUE}; althrd_t thread; }; @@ -280,7 +280,7 @@ struct SndioCapture final : public ALCbackend { ll_ringbuffer_t *ring{nullptr}; - ATOMIC(int) killNow{AL_TRUE}; + std::atomic<ALenum> killNow{AL_TRUE}; althrd_t thread; }; diff --git a/Alc/backends/solaris.cpp b/Alc/backends/solaris.cpp index 93de4384..2d26fb6a 100644 --- a/Alc/backends/solaris.cpp +++ b/Alc/backends/solaris.cpp @@ -49,7 +49,7 @@ struct ALCsolarisBackend final : public ALCbackend { ALubyte *mix_data{nullptr}; int data_size{0}; - ATOMIC(ALenum) killNow{AL_TRUE}; + std::atomic<ALenum> killNow{AL_TRUE}; althrd_t thread; }; diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp index bb37d979..ec5e787b 100644 --- a/Alc/backends/wave.cpp +++ b/Alc/backends/wave.cpp @@ -84,7 +84,7 @@ struct ALCwaveBackend final : public ALCbackend { al::vector<ALbyte> mBuffer; - ATOMIC(ALenum) killNow{AL_TRUE}; + std::atomic<ALenum> killNow{AL_TRUE}; std::thread thread; }; diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index dfb57140..586fc507 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -54,7 +54,7 @@ struct ALeffectslotProps { EffectState *State; - ATOMIC(struct ALeffectslotProps*) next; + std::atomic<ALeffectslotProps*> next; }; @@ -73,7 +73,7 @@ struct ALeffectslot { RefCount ref{0u}; - ATOMIC(struct ALeffectslotProps*) Update{nullptr}; + std::atomic<ALeffectslotProps*> Update{nullptr}; struct { ALfloat Gain{1.0f}; diff --git a/OpenAL32/Include/alListener.h b/OpenAL32/Include/alListener.h index 6b1dcda9..f3a39dfa 100644 --- a/OpenAL32/Include/alListener.h +++ b/OpenAL32/Include/alListener.h @@ -18,7 +18,7 @@ struct ALlistenerProps { ALfloat Up[3]; ALfloat Gain; - ATOMIC(ALlistenerProps*) next; + std::atomic<ALlistenerProps*> next; }; struct ALlistener { @@ -32,7 +32,7 @@ struct ALlistener { /* Pointer to the most recent property values that are awaiting an update. */ - ATOMIC(ALlistenerProps*) Update{nullptr}; + std::atomic<ALlistenerProps*> Update{nullptr}; struct { aluMatrixf Matrix; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index c08f9a09..297ff06f 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -667,7 +667,7 @@ typedef void (*POSTPROCESS)(ALCdevice *device, ALsizei SamplesToDo); struct ALCdevice_struct { RefCount ref{1u}; - ATOMIC(ALenum) Connected{AL_TRUE}; + std::atomic<ALenum> Connected{AL_TRUE}; DeviceType Type{}; ALuint Frequency{}; @@ -687,7 +687,7 @@ struct ALCdevice_struct { std::string DeviceName; - ATOMIC(ALCenum) LastError{ALC_NO_ERROR}; + std::atomic<ALCenum> LastError{ALC_NO_ERROR}; // Maximum number of sources that can be created ALuint SourcesMax{}; @@ -783,12 +783,12 @@ struct ALCdevice_struct { RefCount MixCount{0u}; // Contexts created on this device - ATOMIC(ALCcontext*) ContextList{nullptr}; + std::atomic<ALCcontext*> ContextList{nullptr}; almtx_t BackendLock; ALCbackend *Backend{nullptr}; - ATOMIC(ALCdevice*) next{nullptr}; + std::atomic<ALCdevice*> next{nullptr}; ALCdevice_struct(DeviceType type); diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 05ccdadf..2cbc5ddc 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -19,7 +19,7 @@ struct ALsource; typedef struct ALbufferlistitem { - ATOMIC(struct ALbufferlistitem*) next; + std::atomic<ALbufferlistitem*> next; ALsizei max_samples; ALsizei num_buffers; struct ALbuffer *buffers[]; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index eb71290a..d51000c8 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -144,7 +144,7 @@ typedef struct SendParams { struct ALvoiceProps { - ATOMIC(struct ALvoiceProps*) next; + std::atomic<ALvoiceProps*> next; ALfloat Pitch; ALfloat Gain; @@ -203,28 +203,28 @@ struct ALvoiceProps { #define VOICE_HAS_NFC (1<<3) typedef struct ALvoice { - struct ALvoiceProps *Props; + ALvoiceProps *Props; - ATOMIC(struct ALvoiceProps*) Update; + std::atomic<ALvoiceProps*> Update; - ATOMIC(struct ALsource*) Source; - ATOMIC(bool) Playing; + std::atomic<ALsource*> Source; + std::atomic<bool> Playing; /** * Source offset in samples, relative to the currently playing buffer, NOT * the whole queue, and the fractional (fixed-point) offset to the next * sample. */ - ATOMIC(ALuint) position; - ATOMIC(ALsizei) position_fraction; + std::atomic<ALuint> position; + std::atomic<ALsizei> position_fraction; /* Current buffer queue item being played. */ - ATOMIC(struct ALbufferlistitem*) current_buffer; + std::atomic<ALbufferlistitem*> current_buffer; /* Buffer queue item to loop to at end of queue (will be NULL for non- * looping voices). */ - ATOMIC(struct ALbufferlistitem*) loop_buffer; + std::atomic<ALbufferlistitem*> loop_buffer; /** * Number of channels and bytes-per-sample for the attached source's diff --git a/common/atomic.h b/common/atomic.h index eaae8fb8..15c34953 100644 --- a/common/atomic.h +++ b/common/atomic.h @@ -12,8 +12,6 @@ #define almemory_order_acq_rel std::memory_order_acq_rel #define almemory_order_seq_cst std::memory_order_seq_cst -#define ATOMIC(T) std::atomic<T> - #define ATOMIC_LOAD std::atomic_load_explicit #define ATOMIC_STORE std::atomic_store_explicit |