aboutsummaryrefslogtreecommitdiffstats
path: root/core/voice.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-17 22:36:44 -0800
committerChris Robinson <[email protected]>2023-12-17 22:36:44 -0800
commit708a90ef8ef7ee00991556298073c50dfa6e72a1 (patch)
tree5d72e46977dc241febfcf6ad4ab2ffbe2fadf2c3 /core/voice.cpp
parentbc83c874ff15b29fdab9b6c0bf40b268345b3026 (diff)
Fix some implicit conversions
Diffstat (limited to 'core/voice.cpp')
-rw-r--r--core/voice.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/voice.cpp b/core/voice.cpp
index d2645b7f..1272b202 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -954,7 +954,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
fracPos += dstBufferSize*increment;
const uint srcOffset{fracPos >> MixerFracBits};
fracPos &= MixerFracMask;
- intPos += srcOffset;
+ intPos += static_cast<int>(srcOffset);
/* If more samples need to be loaded, copy the back of the
* resampleBuffer to the front to reuse it. prevSamples isn't
@@ -1018,7 +1018,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
if(mFlags.test(VoiceHasHrtf))
{
- const float TargetGain{parms.Hrtf.Target.Gain * (vstate == Playing)};
+ const float TargetGain{parms.Hrtf.Target.Gain * float(vstate == Playing)};
DoHrtfMix(samples, samplesToMix, parms, TargetGain, Counter, OutPos,
(vstate == Playing), Device);
}
@@ -1064,8 +1064,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
/* Update voice positions and buffers as needed. */
DataPosFrac += increment*samplesToMix;
- const uint SrcSamplesDone{DataPosFrac>>MixerFracBits};
- DataPosInt += SrcSamplesDone;
+ DataPosInt += static_cast<int>(DataPosFrac>>MixerFracBits);
DataPosFrac &= MixerFracMask;
uint buffers_done{0u};
@@ -1121,7 +1120,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi
if(BufferListItem->mSampleLen > static_cast<uint>(DataPosInt))
break;
- DataPosInt -= BufferListItem->mSampleLen;
+ DataPosInt -= static_cast<int>(BufferListItem->mSampleLen);
++buffers_done;
BufferListItem = BufferListItem->mNext.load(std::memory_order_relaxed);