diff options
author | Chris Robinson <[email protected]> | 2019-09-14 16:55:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-14 18:35:23 -0700 |
commit | 2c348cecb68bd3a71d388547d6b3330f9cebbfad (patch) | |
tree | 445e6387a7356da79c93db166ca8da057a0a0cfc /alc/mixer/mixer_c.cpp | |
parent | 1c45b1791b784fb9b70e8c6ce8a1ea158e9004ff (diff) |
Fix some more implicit conversions noted by GCC
Diffstat (limited to 'alc/mixer/mixer_c.cpp')
-rw-r--r-- | alc/mixer/mixer_c.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp index 720b264b..74315dd5 100644 --- a/alc/mixer/mixer_c.cpp +++ b/alc/mixer/mixer_c.cpp @@ -16,9 +16,9 @@ namespace { inline ALfloat do_point(const InterpState&, const ALfloat *RESTRICT vals, const ALuint) { return vals[0]; } inline ALfloat do_lerp(const InterpState&, const ALfloat *RESTRICT vals, const ALuint frac) -{ return lerp(vals[0], vals[1], frac * (1.0f/FRACTIONONE)); } +{ return lerp(vals[0], vals[1], static_cast<float>(frac)*(1.0f/FRACTIONONE)); } inline ALfloat do_cubic(const InterpState&, const ALfloat *RESTRICT vals, const ALuint frac) -{ return cubic(vals[0], vals[1], vals[2], vals[3], frac * (1.0f/FRACTIONONE)); } +{ return cubic(vals[0], vals[1], vals[2], vals[3], static_cast<float>(frac)*(1.0f/FRACTIONONE)); } inline ALfloat do_bsinc(const InterpState &istate, const ALfloat *RESTRICT vals, const ALuint frac) { ASSUME(istate.bsinc.m > 0); @@ -26,10 +26,11 @@ inline ALfloat do_bsinc(const InterpState &istate, const ALfloat *RESTRICT vals, // Calculate the phase index and factor. #define FRAC_PHASE_BITDIFF (FRACTIONBITS-BSINC_PHASE_BITS) const ALuint pi{frac >> FRAC_PHASE_BITDIFF}; - const ALfloat pf{(frac & ((1<<FRAC_PHASE_BITDIFF)-1)) * (1.0f/(1<<FRAC_PHASE_BITDIFF))}; + const ALfloat pf{static_cast<float>(frac & ((1<<FRAC_PHASE_BITDIFF)-1)) * + (1.0f/(1<<FRAC_PHASE_BITDIFF))}; #undef FRAC_PHASE_BITDIFF - const ALfloat *fil{istate.bsinc.filter + ptrdiff_t{istate.bsinc.m}*pi*4}; + const ALfloat *fil{istate.bsinc.filter + static_cast<ptrdiff_t>(istate.bsinc.m)*pi*4}; const ALfloat *scd{fil + istate.bsinc.m}; const ALfloat *phd{scd + istate.bsinc.m}; const ALfloat *spd{phd + istate.bsinc.m}; |