diff options
author | Chris Robinson <[email protected]> | 2020-10-13 01:21:44 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-10-13 01:21:44 -0700 |
commit | 303ca3af72aa7aecc25d94690f3886085c5c6e5b (patch) | |
tree | 05c0a6626b7884a76d181c8972d04f69800c2ece /al/auxeffectslot.cpp | |
parent | 45ff10fb4d847662ec7d1048f7e740c0ca55cf27 (diff) |
Use inline functions for popcnt and ctz instead of macros
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r-- | al/auxeffectslot.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 00dce6c4..74005aaa 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -177,7 +177,7 @@ bool EnsureEffectSlots(ALCcontext *context, size_t needed) size_t count{std::accumulate(context->mEffectSlotList.cbegin(), context->mEffectSlotList.cend(), size_t{0}, [](size_t cur, const EffectSlotSubList &sublist) noexcept -> size_t - { return cur + static_cast<ALuint>(POPCNT64(sublist.FreeMask)); } + { return cur + static_cast<ALuint>(PopCount(sublist.FreeMask)); } )}; while(needed > count) @@ -207,7 +207,7 @@ ALeffectslot *AllocEffectSlot(ALCcontext *context) { return entry.FreeMask != 0; } ); auto lidx = static_cast<ALuint>(std::distance(context->mEffectSlotList.begin(), sublist)); - auto slidx = static_cast<ALuint>(CTZ64(sublist->FreeMask)); + auto slidx = static_cast<ALuint>(CountTrailingZeros(sublist->FreeMask)); ALeffectslot *slot{::new (sublist->EffectSlots + slidx) ALeffectslot{}}; if(ALenum err{slot->init()}) @@ -942,7 +942,7 @@ EffectSlotSubList::~EffectSlotSubList() uint64_t usemask{~FreeMask}; while(usemask) { - ALsizei idx{CTZ64(usemask)}; + const ALsizei idx{CountTrailingZeros(usemask)}; al::destroy_at(EffectSlots+idx); usemask &= ~(1_u64 << idx); } |