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/backends | |
parent | 5ff5fd8eccbdc5888b350059cb1f341a33ddf05f (diff) |
Make PopCount and CountTrailingZeros more standard-like
Diffstat (limited to 'alc/backends')
-rw-r--r-- | alc/backends/base.cpp | 3 | ||||
-rw-r--r-- | alc/backends/wasapi.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/alc/backends/base.cpp b/alc/backends/base.cpp index 8642f40c..c4a4abeb 100644 --- a/alc/backends/base.cpp +++ b/alc/backends/base.cpp @@ -12,6 +12,7 @@ #include <mmreg.h> #endif +#include "albit.h" #include "alcmain.h" #include "alnumeric.h" #include "aloptional.h" @@ -180,7 +181,7 @@ void BackendBase::setChannelOrderFromWFXMask(uint chanmask) uint idx{0}; while(chanmask) { - const int bit{CountTrailingZeros(chanmask)}; + const int bit{al::countr_zero(chanmask)}; const uint mask{1u << bit}; chanmask &= ~mask; diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 1d1b93c4..0786a7d7 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -55,6 +55,7 @@ #include <thread> #include <vector> +#include "albit.h" #include "alcmain.h" #include "alu.h" #include "compat.h" @@ -1643,7 +1644,7 @@ HRESULT WasapiCapture::resetProxy() if((InputType.dwChannelMask&SPEAKER_LOW_FREQUENCY)) { constexpr auto lfemask = MaskFromTopBits(SPEAKER_LOW_FREQUENCY); - const int lfeidx{PopCount(uint32_t{InputType.dwChannelMask&lfemask}) - 1}; + const int lfeidx{al::popcount(InputType.dwChannelMask&lfemask) - 1}; chanmask &= ~(1u << lfeidx); } |