aboutsummaryrefslogtreecommitdiffstats
path: root/core/voice.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-23 03:07:57 -0800
committerChris Robinson <[email protected]>2023-12-23 03:07:57 -0800
commit4720b2c64d91facea24e8411c104770bd3763afa (patch)
tree7ab1cc05e307be0b18ef6cc3cc8a84ece8dae624 /core/voice.cpp
parentd7304c49a1d2cea2dae0ae38fdd9706dbcdb561f (diff)
Fix implicit widening after multiplication
Diffstat (limited to 'core/voice.cpp')
-rw-r--r--core/voice.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/voice.cpp b/core/voice.cpp
index 1272b202..4a30ee83 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -904,8 +904,8 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
const size_t needBlocks{(needSamples + mSamplesPerBlock-1) / mSamplesPerBlock};
if(!mFlags.test(VoiceCallbackStopped) && needBlocks > mNumCallbackBlocks)
{
- const size_t byteOffset{mNumCallbackBlocks*mBytesPerBlock};
- const size_t needBytes{(needBlocks-mNumCallbackBlocks)*mBytesPerBlock};
+ const size_t byteOffset{mNumCallbackBlocks*size_t{mBytesPerBlock}};
+ const size_t needBytes{(needBlocks-mNumCallbackBlocks)*size_t{mBytesPerBlock}};
const int gotBytes{BufferListItem->mCallback(BufferListItem->mUserData,
&BufferListItem->mSamples[byteOffset], static_cast<int>(needBytes))};
@@ -919,7 +919,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
else
mNumCallbackBlocks = static_cast<uint>(needBlocks);
}
- const size_t numSamples{uint{mNumCallbackBlocks} * mSamplesPerBlock};
+ const size_t numSamples{size_t{mNumCallbackBlocks} * mSamplesPerBlock};
LoadBufferCallback(BufferListItem, bufferOffset, numSamples, mFmtType, chan,
mFrameStep, srcSampleDelay, srcBufferSize, al::to_address(resampleBuffer));
}
@@ -1099,8 +1099,8 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
const uint blocksDone{currentBlock - mCallbackBlockBase};
if(blocksDone < mNumCallbackBlocks)
{
- const size_t byteOffset{blocksDone*mBytesPerBlock};
- const size_t byteEnd{mNumCallbackBlocks*mBytesPerBlock};
+ const size_t byteOffset{blocksDone*size_t{mBytesPerBlock}};
+ const size_t byteEnd{mNumCallbackBlocks*size_t{mBytesPerBlock}};
std::byte *data{BufferListItem->mSamples};
std::copy(data+byteOffset, data+byteEnd, data);
mNumCallbackBlocks -= blocksDone;