aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixvoice.cpp
diff options
context:
space:
mode:
authorFilip Gawin <[email protected]>2019-01-08 19:42:44 +0100
committerFilip Gawin <[email protected]>2019-01-08 19:42:44 +0100
commit0d3a0635d946ab1f43fd98cec4882248bc990846 (patch)
treef9cade218fe90b815bf1b529607fadd7bfa0f656 /Alc/mixvoice.cpp
parent2a7f27ca58f9897be06fe815a46ea76a01734a0b (diff)
Avoid using old style casts
To think about: examples/alffplay.cpp:600 OpenAL32/Include/alMain.h:295
Diffstat (limited to 'Alc/mixvoice.cpp')
-rw-r--r--Alc/mixvoice.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index eb219bad..e52b330d 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -211,7 +211,7 @@ template<> inline ALfloat LoadSample<FmtShort>(FmtTypeTraits<FmtShort>::Type val
template<> inline ALfloat LoadSample<FmtFloat>(FmtTypeTraits<FmtFloat>::Type val)
{ return val; }
template<> inline ALfloat LoadSample<FmtDouble>(FmtTypeTraits<FmtDouble>::Type val)
-{ return (ALfloat)val; }
+{ return static_cast<ALfloat>(val); }
template<> inline ALfloat LoadSample<FmtMulaw>(FmtTypeTraits<FmtMulaw>::Type val)
{ return muLawDecompressionTable[val] * (1.0f/32768.0f); }
template<> inline ALfloat LoadSample<FmtAlaw>(FmtTypeTraits<FmtAlaw>::Type val)
@@ -295,7 +295,7 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
/* Get source info */
bool isplaying{true}; /* Will only be called while playing. */
bool isstatic{(voice->Flags&VOICE_IS_STATIC) != 0};
- ALsizei DataPosInt{(ALsizei)voice->position.load(std::memory_order_acquire)};
+ ALsizei DataPosInt{static_cast<ALsizei>(voice->position.load(std::memory_order_acquire))};
ALsizei DataPosFrac{voice->position_fraction.load(std::memory_order_relaxed)};
ALbufferlistitem *BufferListItem{voice->current_buffer.load(std::memory_order_relaxed)};
ALbufferlistitem *BufferLoopItem{voice->loop_buffer.load(std::memory_order_relaxed)};
@@ -603,13 +603,13 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
* this mix handles.
*/
ALfloat gain{lerp(parms.Hrtf.Old.Gain, parms.Hrtf.Target.Gain,
- minf(1.0f, (ALfloat)fademix/Counter))};
+ minf(1.0f, static_cast<ALfloat>(fademix))/Counter)};
MixHrtfParams hrtfparams;
hrtfparams.Coeffs = &parms.Hrtf.Target.Coeffs;
hrtfparams.Delay[0] = parms.Hrtf.Target.Delay[0];
hrtfparams.Delay[1] = parms.Hrtf.Target.Delay[1];
hrtfparams.Gain = 0.0f;
- hrtfparams.GainStep = gain / (ALfloat)fademix;
+ hrtfparams.GainStep = gain / static_cast<ALfloat>(fademix);
MixHrtfBlendSamples(
voice->Direct.Buffer[OutLIdx], voice->Direct.Buffer[OutRIdx],
@@ -631,14 +631,14 @@ ALboolean MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context,
*/
if(Counter > DstBufferSize)
gain = lerp(parms.Hrtf.Old.Gain, gain,
- (ALfloat)todo/(Counter-fademix));
+ static_cast<ALfloat>(todo)/(Counter-fademix));
MixHrtfParams hrtfparams;
hrtfparams.Coeffs = &parms.Hrtf.Target.Coeffs;
hrtfparams.Delay[0] = parms.Hrtf.Target.Delay[0];
hrtfparams.Delay[1] = parms.Hrtf.Target.Delay[1];
hrtfparams.Gain = parms.Hrtf.Old.Gain;
- hrtfparams.GainStep = (gain - parms.Hrtf.Old.Gain) / (ALfloat)todo;
+ hrtfparams.GainStep = (gain - parms.Hrtf.Old.Gain) / static_cast<ALfloat>(todo);
MixHrtfSamples(
voice->Direct.Buffer[OutLIdx], voice->Direct.Buffer[OutRIdx],
samples+fademix, voice->Offset+fademix, OutPos+fademix, IrSize,