aboutsummaryrefslogtreecommitdiffstats
path: root/al/filter.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-01-22 04:58:42 -0800
committerChris Robinson <[email protected]>2021-01-22 04:58:42 -0800
commitda59ad51057ce7343e3db4632e8679e1e537779d (patch)
tree6b4c1f5bd5d6b4bd4b83b9bc290e63ca837f8bc0 /al/filter.cpp
parent5ff5fd8eccbdc5888b350059cb1f341a33ddf05f (diff)
Make PopCount and CountTrailingZeros more standard-like
Diffstat (limited to 'al/filter.cpp')
-rw-r--r--al/filter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/al/filter.cpp b/al/filter.cpp
index e549b1c9..0bcfe408 100644
--- a/al/filter.cpp
+++ b/al/filter.cpp
@@ -36,6 +36,7 @@
#include "AL/alc.h"
#include "AL/efx.h"
+#include "albit.h"
#include "alcmain.h"
#include "alcontext.h"
#include "almalloc.h"
@@ -324,7 +325,7 @@ bool EnsureFilters(ALCdevice *device, size_t needed)
{
size_t count{std::accumulate(device->FilterList.cbegin(), device->FilterList.cend(), size_t{0},
[](size_t cur, const FilterSubList &sublist) noexcept -> size_t
- { return cur + static_cast<ALuint>(PopCount(sublist.FreeMask)); })};
+ { return cur + static_cast<ALuint>(al::popcount(sublist.FreeMask)); })};
while(needed > count)
{
@@ -353,7 +354,7 @@ ALfilter *AllocFilter(ALCdevice *device)
{ return entry.FreeMask != 0; }
);
auto lidx = static_cast<ALuint>(std::distance(device->FilterList.begin(), sublist));
- auto slidx = static_cast<ALuint>(CountTrailingZeros(sublist->FreeMask));
+ auto slidx = static_cast<ALuint>(al::countr_zero(sublist->FreeMask));
ALfilter *filter{::new(sublist->Filters + slidx) ALfilter{}};
InitFilterParams(filter, AL_FILTER_NULL);
@@ -704,7 +705,7 @@ FilterSubList::~FilterSubList()
uint64_t usemask{~FreeMask};
while(usemask)
{
- const ALsizei idx{CountTrailingZeros(usemask)};
+ const int idx{al::countr_zero(usemask)};
al::destroy_at(Filters+idx);
usemask &= ~(1_u64 << idx);
}