aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-14 19:42:54 -0700
committerChris Robinson <[email protected]>2019-09-14 19:42:54 -0700
commit4b8f78a8d633e3f39e2b708184c051465fcfef7d (patch)
tree0f90c50f3630c5dbb6e188116cd58c8ca4181186 /alc
parente82c43fb38f13ee3efdda2b7a1395b8182fceb1c (diff)
Fix a few more GCC warnings
Diffstat (limited to 'alc')
-rw-r--r--alc/backends/coreaudio.cpp3
-rw-r--r--alc/backends/opensl.cpp6
-rw-r--r--alc/backends/wasapi.cpp2
-rw-r--r--alc/mixer/mixer_c.cpp2
4 files changed, 8 insertions, 5 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp
index 99b06b7a..3ae9800c 100644
--- a/alc/backends/coreaudio.cpp
+++ b/alc/backends/coreaudio.cpp
@@ -374,7 +374,8 @@ OSStatus CoreAudioCapture::RecordProc(AudioUnitRenderActionFlags*,
audiobuf.list.mNumberBuffers = 2;
audiobuf.list.mBuffers[0].mNumberChannels = mFormat.mChannelsPerFrame;
audiobuf.list.mBuffers[0].mData = rec_vec.first.buf;
- audiobuf.list.mBuffers[0].mDataByteSize = rec_vec.first.len * mFormat.mBytesPerFrame;
+ audiobuf.list.mBuffers[0].mDataByteSize = static_cast<UInt32>(rec_vec.first.len) *
+ mFormat.mBytesPerFrame;
audiobuf.list.mBuffers[1].mNumberChannels = mFormat.mChannelsPerFrame;
audiobuf.list.mBuffers[1].mData = rec_vec.second.buf;
audiobuf.list.mBuffers[1].mDataByteSize = remaining * mFormat.mBytesPerFrame;
diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp
index 06d5cd40..3a2f455e 100644
--- a/alc/backends/opensl.cpp
+++ b/alc/backends/opensl.cpp
@@ -681,11 +681,11 @@ ALCenum OpenSLCapture::open(const ALCchar* name)
{
mFrameSize = mDevice->frameSizeFromFmt();
/* Ensure the total length is at least 100ms */
- ALsizei length{maxi(mDevice->BufferSize, mDevice->Frequency/10)};
+ ALuint length{maxu(mDevice->BufferSize, mDevice->Frequency/10)};
/* Ensure the per-chunk length is at least 10ms, and no more than 50ms. */
- ALsizei update_len{clampi(mDevice->BufferSize/3, mDevice->Frequency/100,
+ ALuint update_len{clampu(mDevice->BufferSize/3, mDevice->Frequency/100,
mDevice->Frequency/100*5)};
- ALsizei num_updates{(length+update_len-1) / update_len};
+ ALuint num_updates{(length+update_len-1) / update_len};
try {
mRing = CreateRingBuffer(num_updates, update_len*mFrameSize, false);
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index b762da76..0d04d5a7 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -429,6 +429,8 @@ constexpr char MessageStr[static_cast<unsigned int>(MsgType::Count)][20]{
/* Proxy interface used by the message handler. */
struct WasapiProxy {
+ virtual ~WasapiProxy() = default;
+
virtual HRESULT openProxy() = 0;
virtual void closeProxy() = 0;
diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp
index 74315dd5..7beab1a9 100644
--- a/alc/mixer/mixer_c.cpp
+++ b/alc/mixer/mixer_c.cpp
@@ -30,7 +30,7 @@ inline ALfloat do_bsinc(const InterpState &istate, const ALfloat *RESTRICT vals,
(1.0f/(1<<FRAC_PHASE_BITDIFF))};
#undef FRAC_PHASE_BITDIFF
- const ALfloat *fil{istate.bsinc.filter + static_cast<ptrdiff_t>(istate.bsinc.m)*pi*4};
+ const ALfloat *fil{istate.bsinc.filter + istate.bsinc.m*static_cast<ptrdiff_t>(pi*4)};
const ALfloat *scd{fil + istate.bsinc.m};
const ALfloat *phd{scd + istate.bsinc.m};
const ALfloat *spd{phd + istate.bsinc.m};