From 2646f509ee686f21458c32a990346be6e2a806d1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 13 Sep 2019 20:04:22 -0700 Subject: Store the ambisonic order as unsigned --- alc/alc.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'alc/alc.cpp') diff --git a/alc/alc.cpp b/alc/alc.cpp index 9bb604a4..408b3ca3 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1286,7 +1286,7 @@ ALuint BytesFromDevFmt(DevFmtType type) noexcept } return 0; } -ALuint ChannelsFromDevFmt(DevFmtChannels chans, ALsizei ambiorder) noexcept +ALuint ChannelsFromDevFmt(DevFmtChannels chans, ALuint ambiorder) noexcept { switch(chans) { @@ -1297,7 +1297,7 @@ ALuint ChannelsFromDevFmt(DevFmtChannels chans, ALsizei ambiorder) noexcept case DevFmtX51Rear: return 6; case DevFmtX61: return 7; case DevFmtX71: return 8; - case DevFmtAmbi3D: return static_cast((ambiorder+1) * (ambiorder+1)); + case DevFmtAmbi3D: return (ambiorder+1) * (ambiorder+1); } return 0; } @@ -1639,7 +1639,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) ALCenum schans{AL_NONE}; ALCenum stype{AL_NONE}; ALCsizei attrIdx{0}; - ALCsizei aorder{0}; + ALCuint aorder{0}; ALCuint freq{0u}; ALuint numMono{device->NumMonoSources}; @@ -1677,7 +1677,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) break; case ALC_AMBISONIC_ORDER_SOFT: - aorder = attrList[attrIdx + 1]; + aorder = static_cast(attrList[attrIdx + 1]); TRACE_ATTR(ALC_AMBISONIC_ORDER_SOFT, aorder); break; @@ -2855,7 +2855,7 @@ static size_t GetIntegerv(ALCdevice *device, ALCenum param, const al::span(device->mAmbiScale); values[i++] = ALC_AMBISONIC_ORDER_SOFT; - values[i++] = device->mAmbiOrder; + values[i++] = static_cast(device->mAmbiOrder); } values[i++] = ALC_FORMAT_CHANNELS_SOFT; @@ -2973,7 +2973,7 @@ static size_t GetIntegerv(ALCdevice *device, ALCenum param, const al::spanmAmbiOrder; + values[0] = static_cast(device->mAmbiOrder); return 1; case ALC_MONO_SOURCES: @@ -3558,7 +3558,7 @@ START_API_FUNC static constexpr struct ChannelMap { const char name[16]; DevFmtChannels chans; - ALsizei order; + ALuint order; } chanlist[] = { { "mono", DevFmtMono, 0 }, { "stereo", DevFmtStereo, 0 }, -- cgit v1.2.3