From ce76cc144142a065e2702bd57f4358929c38d1bc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 20 Aug 2019 07:57:37 -0700 Subject: Use unsigned for the sample and channel converters --- alc/backends/coreaudio.cpp | 9 ++++----- alc/backends/wasapi.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'alc/backends') diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index cfa7703a..c903ff07 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -654,15 +654,14 @@ ALCenum CoreAudioCapture::captureSamples(void *buffer, ALCuint samples) auto rec_vec = mRing->getReadVector(); const void *src0{rec_vec.first.buf}; - auto src0len = static_cast(rec_vec.first.len); - auto got = static_cast(mConverter->convert(&src0, &src0len, buffer, samples)); + auto src0len = static_cast(rec_vec.first.len); + ALuint got{mConverter->convert(&src0, &src0len, buffer, samples)}; size_t total_read{rec_vec.first.len - src0len}; if(got < samples && !src0len && rec_vec.second.len > 0) { const void *src1{rec_vec.second.buf}; - auto src1len = static_cast(rec_vec.second.len); - got += static_cast(mConverter->convert(&src1, &src1len, - static_cast(buffer)+got, samples-got)); + auto src1len = static_cast(rec_vec.second.len); + got += mConverter->convert(&src1, &src1len, static_cast(buffer)+got, samples-got); total_read += rec_vec.second.len - src1len; } diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index cc53be66..dbf1208d 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -1229,10 +1229,10 @@ FORCE_ALIGN int WasapiCapture::recordProc() if(mSampleConv) { const ALvoid *srcdata{rdata}; - auto srcframes = static_cast(numsamples); + ALuint srcframes{numsamples}; dstframes = mSampleConv->convert(&srcdata, &srcframes, data.first.buf, - static_cast(minz(data.first.len, INT_MAX))); + static_cast(minz(data.first.len, INT_MAX))); if(srcframes > 0 && dstframes == data.first.len && data.second.len > 0) { /* If some source samples remain, all of the first dest @@ -1240,14 +1240,14 @@ FORCE_ALIGN int WasapiCapture::recordProc() * dest block, do another run for the second block. */ dstframes += mSampleConv->convert(&srcdata, &srcframes, data.second.buf, - static_cast(minz(data.second.len, INT_MAX))); + static_cast(minz(data.second.len, INT_MAX))); } } else { const auto framesize = static_cast(mDevice->frameSizeFromFmt()); - size_t len1 = minz(data.first.len, numsamples); - size_t len2 = minz(data.second.len, numsamples-len1); + size_t len1{minz(data.first.len, numsamples)}; + size_t len2{minz(data.second.len, numsamples-len1)}; memcpy(data.first.buf, rdata, len1*framesize); if(len2 > 0) -- cgit v1.2.3