aboutsummaryrefslogtreecommitdiffstats
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
parente82c43fb38f13ee3efdda2b7a1395b8182fceb1c (diff)
Fix a few more GCC warnings
-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
-rw-r--r--common/alcomplex.cpp2
-rw-r--r--examples/almultireverb.c4
-rw-r--r--utils/openal-info.c2
7 files changed, 12 insertions, 9 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};
diff --git a/common/alcomplex.cpp b/common/alcomplex.cpp
index f77ec203..e5cbe8a0 100644
--- a/common/alcomplex.cpp
+++ b/common/alcomplex.cpp
@@ -35,7 +35,7 @@ void complex_fft(const al::span<std::complex<double>> buffer, const double sign)
for(size_t i{1u};i < fftsize;i<<=1, step<<=1)
{
const size_t step2{step >> 1};
- double arg{al::MathDefs<double>::Pi() / step2};
+ double arg{al::MathDefs<double>::Pi() / static_cast<double>(step2)};
std::complex<double> w{std::cos(arg), std::sin(arg)*sign};
std::complex<double> u{1.0, 0.0};
diff --git a/examples/almultireverb.c b/examples/almultireverb.c
index b967a050..4e3e188f 100644
--- a/examples/almultireverb.c
+++ b/examples/almultireverb.c
@@ -653,12 +653,12 @@ int main(int argc, char **argv)
* Convert the difference to seconds.
*/
curtime = altime_get();
- timediff = (ALfloat)(curtime - basetime) / 1000.0f;
+ timediff = (float)(curtime - basetime) / 1000.0f;
/* Avoid negative time deltas, in case of non-monotonic clocks. */
if(timediff < 0.0f)
timediff = 0.0f;
- else while(timediff >= 4.0f*((loops&1)+1))
+ else while(timediff >= 4.0f*(float)((loops&1)+1))
{
/* For this example, each transition occurs over 4 seconds, and
* there's 2 transitions per cycle.
diff --git a/utils/openal-info.c b/utils/openal-info.c
index cc628b6e..76cdf37d 100644
--- a/utils/openal-info.c
+++ b/utils/openal-info.c
@@ -53,7 +53,7 @@ static WCHAR *FromUTF8(const char *str)
if((len=MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0)) > 0)
{
- out = calloc(sizeof(WCHAR), len);
+ out = calloc(sizeof(WCHAR), (unsigned int)(len));
MultiByteToWideChar(CP_UTF8, 0, str, -1, out, len);
}
return out;