diff options
author | Chris Robinson <[email protected]> | 2022-09-20 15:10:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-09-20 15:10:26 -0700 |
commit | 76a60725bbe44ce61a545b48ababb7324ca72394 (patch) | |
tree | 4d4b673bc6d53878a374af91286a7796d48d995a /core/voice.cpp | |
parent | c52df6d78ab7131a543326cd2257f267036754e1 (diff) |
Remove an unused variable
Diffstat (limited to 'core/voice.cpp')
-rw-r--r-- | core/voice.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/core/voice.cpp b/core/voice.cpp index b77a5eca..74363fc1 100644 --- a/core/voice.cpp +++ b/core/voice.cpp @@ -249,9 +249,8 @@ void LoadBufferStatic(VoiceBufferItem *buffer, VoiceBufferItem *&bufferLoopItem, const size_t dataPosInt, const FmtType sampleType, const FmtChannels sampleChannels, const size_t srcStep, const size_t samplesToLoad, const al::span<float*> voiceSamples) { - const uint loopStart{buffer->mLoopStart}; - const uint loopEnd{buffer->mLoopEnd}; - ASSUME(loopEnd > loopStart); + const size_t loopStart{buffer->mLoopStart}; + const size_t loopEnd{buffer->mLoopEnd}; /* If current pos is beyond the loop range, do not loop */ if(!bufferLoopItem || dataPosInt >= loopEnd) @@ -274,13 +273,15 @@ void LoadBufferStatic(VoiceBufferItem *buffer, VoiceBufferItem *&bufferLoopItem, } else { + ASSUME(loopEnd > loopStart); + /* Load what's left of this loop iteration */ const size_t remaining{minz(samplesToLoad, loopEnd-dataPosInt)}; LoadSamples(voiceSamples, 0, buffer->mSamples, dataPosInt, sampleType, sampleChannels, srcStep, remaining); /* Load repeats of the loop to fill the buffer. */ - const auto loopSize = static_cast<size_t>(loopEnd - loopStart); + const size_t loopSize{loopEnd - loopStart}; size_t samplesLoaded{remaining}; while(const size_t toFill{minz(samplesToLoad - samplesLoaded, loopSize)}) { @@ -304,8 +305,8 @@ void LoadBufferCallback(VoiceBufferItem *buffer, const size_t numCallbackSamples { for(auto *chanbuffer : voiceSamples) { - auto srcsamples = chanbuffer + remaining - 1; - std::fill_n(srcsamples + 1, toFill, *srcsamples); + auto srcsamples = chanbuffer + remaining; + std::fill_n(srcsamples, toFill, *(srcsamples-1)); } } } @@ -340,12 +341,10 @@ void LoadBufferQueue(VoiceBufferItem *buffer, VoiceBufferItem *bufferLoopItem, } if(const size_t toFill{samplesToLoad - samplesLoaded}) { - size_t chanidx{0}; for(auto *chanbuffer : voiceSamples) { - auto srcsamples = chanbuffer + samplesLoaded - 1; - std::fill_n(srcsamples + 1, toFill, *srcsamples); - ++chanidx; + auto srcsamples = chanbuffer + samplesLoaded; + std::fill_n(srcsamples, toFill, *(srcsamples-1)); } } } |