diff options
author | Chris Robinson <[email protected]> | 2021-01-22 04:58:42 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-01-22 04:58:42 -0800 |
commit | da59ad51057ce7343e3db4632e8679e1e537779d (patch) | |
tree | 6b4c1f5bd5d6b4bd4b83b9bc290e63ca837f8bc0 /alc/alc.cpp | |
parent | 5ff5fd8eccbdc5888b350059cb1f341a33ddf05f (diff) |
Make PopCount and CountTrailingZeros more standard-like
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r-- | alc/alc.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index e7c85525..02aaaa18 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -64,6 +64,7 @@ #include "al/filter.h" #include "al/listener.h" #include "al/source.h" +#include "albit.h" #include "alcmain.h" #include "albyte.h" #include "alconfig.h" @@ -2128,7 +2129,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) uint64_t usemask{~sublist.FreeMask}; while(usemask) { - const int idx{CountTrailingZeros(usemask)}; + const int idx{al::countr_zero(usemask)}; ALeffectslot *slot{sublist.EffectSlots + idx}; usemask &= ~(1_u64 << idx); @@ -2149,7 +2150,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) uint64_t usemask{~sublist.FreeMask}; while(usemask) { - const int idx{CountTrailingZeros(usemask)}; + const int idx{al::countr_zero(usemask)}; ALsource *source{sublist.Sources + idx}; usemask &= ~(1_u64 << idx); @@ -2292,19 +2293,19 @@ ALCdevice::~ALCdevice() size_t count{std::accumulate(BufferList.cbegin(), BufferList.cend(), size_t{0u}, [](size_t cur, const BufferSubList &sublist) noexcept -> size_t - { return cur + static_cast<uint>(PopCount(~sublist.FreeMask)); })}; + { return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); })}; if(count > 0) WARN("%zu Buffer%s not deleted\n", count, (count==1)?"":"s"); count = std::accumulate(EffectList.cbegin(), EffectList.cend(), size_t{0u}, [](size_t cur, const EffectSubList &sublist) noexcept -> size_t - { return cur + static_cast<uint>(PopCount(~sublist.FreeMask)); }); + { return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); }); if(count > 0) WARN("%zu Effect%s not deleted\n", count, (count==1)?"":"s"); count = std::accumulate(FilterList.cbegin(), FilterList.cend(), size_t{0u}, [](size_t cur, const FilterSubList &sublist) noexcept -> size_t - { return cur + static_cast<uint>(PopCount(~sublist.FreeMask)); }); + { return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); }); if(count > 0) WARN("%zu Filter%s not deleted\n", count, (count==1)?"":"s"); @@ -2356,7 +2357,7 @@ ALCcontext::~ALCcontext() count = std::accumulate(mSourceList.cbegin(), mSourceList.cend(), size_t{0u}, [](size_t cur, const SourceSubList &sublist) noexcept -> size_t - { return cur + static_cast<uint>(PopCount(~sublist.FreeMask)); }); + { return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); }); if(count > 0) WARN("%zu Source%s not deleted\n", count, (count==1)?"":"s"); mSourceList.clear(); @@ -2381,7 +2382,7 @@ ALCcontext::~ALCcontext() count = std::accumulate(mEffectSlotList.cbegin(), mEffectSlotList.cend(), size_t{0u}, [](size_t cur, const EffectSlotSubList &sublist) noexcept -> size_t - { return cur + static_cast<uint>(PopCount(~sublist.FreeMask)); }); + { return cur + static_cast<uint>(al::popcount(~sublist.FreeMask)); }); if(count > 0) WARN("%zu AuxiliaryEffectSlot%s not deleted\n", count, (count==1)?"":"s"); mEffectSlotList.clear(); |