diff options
author | Chris Robinson <[email protected]> | 2020-12-27 01:05:16 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-27 01:05:16 -0800 |
commit | cd2ebb9c3a4716544963dece75857efe1b30bbec (patch) | |
tree | 0ace8fc983fd91c81391e5ce73ad017a41c817d5 | |
parent | e20143fcc42e4a39b365b3f1395dfde94a30ac31 (diff) |
Use a uint for a bitfield
-rw-r--r-- | al/event.cpp | 8 | ||||
-rw-r--r-- | alc/alcontext.h | 2 | ||||
-rw-r--r-- | alc/alu.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/al/event.cpp b/al/event.cpp index 7267625d..a5d7be38 100644 --- a/al/event.cpp +++ b/al/event.cpp @@ -63,7 +63,7 @@ static int EventThread(ALCcontext *context) continue; } - ALbitfieldSOFT enabledevts{context->mEnabledEvts.load(std::memory_order_acquire)}; + uint enabledevts{context->mEnabledEvts.load(std::memory_order_acquire)}; if(!context->mEventCb) continue; if(evt.EnumType == EventType_SourceStateChange) @@ -164,7 +164,7 @@ START_API_FUNC if(count <= 0) return; if(!types) SETERR_RETURN(context, AL_INVALID_VALUE,, "NULL pointer"); - ALbitfieldSOFT flags{0}; + uint flags{0}; const ALenum *types_end = types+count; auto bad_type = std::find_if_not(types, types_end, [&flags](ALenum type) noexcept -> bool @@ -185,7 +185,7 @@ START_API_FUNC if(enable) { - ALbitfieldSOFT enabledevts{context->mEnabledEvts.load(std::memory_order_relaxed)}; + uint enabledevts{context->mEnabledEvts.load(std::memory_order_relaxed)}; while(context->mEnabledEvts.compare_exchange_weak(enabledevts, enabledevts|flags, std::memory_order_acq_rel, std::memory_order_acquire) == 0) { @@ -196,7 +196,7 @@ START_API_FUNC } else { - ALbitfieldSOFT enabledevts{context->mEnabledEvts.load(std::memory_order_relaxed)}; + uint enabledevts{context->mEnabledEvts.load(std::memory_order_relaxed)}; while(context->mEnabledEvts.compare_exchange_weak(enabledevts, enabledevts&~flags, std::memory_order_acq_rel, std::memory_order_acquire) == 0) { diff --git a/alc/alcontext.h b/alc/alcontext.h index 21102538..dca24e4b 100644 --- a/alc/alcontext.h +++ b/alc/alcontext.h @@ -216,7 +216,7 @@ struct ALCcontext : public al::intrusive_ref<ALCcontext> { std::thread mEventThread; al::semaphore mEventSem; std::unique_ptr<RingBuffer> mAsyncEvents; - std::atomic<ALbitfieldSOFT> mEnabledEvts{0u}; + std::atomic<uint> mEnabledEvts{0u}; std::mutex mEventCbLock; ALEVENTPROCSOFT mEventCb{}; void *mEventParam{nullptr}; diff --git a/alc/alu.cpp b/alc/alu.cpp index ae181af2..bdc5b78f 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1583,7 +1583,7 @@ void ProcessVoiceChanges(ALCcontext *ctx) VoiceChange *next{cur->mNext.load(std::memory_order_acquire)}; if(!next) return; - const ALbitfieldSOFT enabledevt{ctx->mEnabledEvts.load(std::memory_order_acquire)}; + const uint enabledevt{ctx->mEnabledEvts.load(std::memory_order_acquire)}; do { cur = next; @@ -1990,7 +1990,7 @@ void ALCdevice::handleDisconnect(const char *msg, ...) IncrementRef(MixCount); for(ALCcontext *ctx : *mContexts.load()) { - const ALbitfieldSOFT enabledevt{ctx->mEnabledEvts.load(std::memory_order_acquire)}; + const uint enabledevt{ctx->mEnabledEvts.load(std::memory_order_acquire)}; if((enabledevt&EventType_Disconnected)) { RingBuffer *ring{ctx->mAsyncEvents.get()}; |