Fix a few more GCC warnings
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user