aboutsummaryrefslogtreecommitdiffstats
path: root/core/hrtf.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-01 01:01:29 -0700
committerChris Robinson <[email protected]>2023-05-01 01:01:29 -0700
commit343b2ce1b3395a672608552d5fe2b1a312c100b1 (patch)
treef9a89631fc09f52629888262ed62ec7bf5f72d3d /core/hrtf.cpp
parent3953cb5dbef7add70e72f41bbf36d5fdf1b02917 (diff)
Mask a value to the proper size when setting a bitfield
Silences a GCC warning about assigning a uint value to a uint:24 bitfield.
Diffstat (limited to 'core/hrtf.cpp')
-rw-r--r--core/hrtf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/hrtf.cpp b/core/hrtf.cpp
index d5c7573a..cdafe93c 100644
--- a/core/hrtf.cpp
+++ b/core/hrtf.cpp
@@ -393,7 +393,7 @@ std::unique_ptr<HrtfStore> CreateHrtfStore(uint rate, uint8_t irSize,
{
Hrtf.reset(al::construct_at(static_cast<HrtfStore*>(ptr)));
InitRef(Hrtf->mRef, 1u);
- Hrtf->mSampleRate = rate;
+ Hrtf->mSampleRate = rate & 0xff'ff'ff;
Hrtf->mIrSize = irSize;
/* Set up pointers to storage following the main HRTF struct. */
@@ -1430,7 +1430,7 @@ HrtfStorePtr GetLoadedHrtf(const std::string &name, const uint devrate)
*/
const float newIrSize{std::round(static_cast<float>(hrtf->mIrSize) * rate_scale)};
hrtf->mIrSize = static_cast<uint8_t>(minf(HrirLength, newIrSize));
- hrtf->mSampleRate = devrate;
+ hrtf->mSampleRate = devrate & 0xff'ff'ff;
}
TRACE("Loaded HRTF %s for sample rate %uhz, %u-sample filter\n", name.c_str(),