diff options
author | kcat <[email protected]> | 2019-01-08 17:19:15 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2019-01-08 17:19:15 -0800 |
commit | 009d738c1e7e84e662d629c7e96b3fcc08adc17d (patch) | |
tree | f9cade218fe90b815bf1b529607fadd7bfa0f656 /Alc/hrtf.cpp | |
parent | 2a7f27ca58f9897be06fe815a46ea76a01734a0b (diff) | |
parent | 0d3a0635d946ab1f43fd98cec4882248bc990846 (diff) |
Merge pull request #261 from ShFil119/avoid_old_style_casts
Avoid using old style casts
Diffstat (limited to 'Alc/hrtf.cpp')
-rw-r--r-- | Alc/hrtf.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp index 070de55f..4d1c27ee 100644 --- a/Alc/hrtf.cpp +++ b/Alc/hrtf.cpp @@ -329,7 +329,7 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz { for(ALsizei i{0};i < NumChannels;++i) { - const ALdouble mult{(ALdouble)AmbiOrderHFGain[OrderFromChan[i]] * AmbiMatrix[c][i]}; + const ALdouble mult{static_cast<ALdouble>(AmbiOrderHFGain[OrderFromChan[i]]) * AmbiMatrix[c][i]}; const ALsizei numirs{mini(Hrtf->irSize, HRIR_LENGTH-maxi(ldelay, rdelay))}; ALsizei lidx{ldelay}, ridx{rdelay}; for(ALsizei j{0};j < numirs;++j) @@ -384,8 +384,8 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz { for(ALsizei idx{0};idx < HRIR_LENGTH;idx++) { - state->Chan[i].Coeffs[idx][0] = (ALfloat)tmpres[i][idx][0]; - state->Chan[i].Coeffs[idx][1] = (ALfloat)tmpres[i][idx][1]; + state->Chan[i].Coeffs[idx][0] = static_cast<ALfloat>(tmpres[i][idx][0]); + state->Chan[i].Coeffs[idx][1] = static_cast<ALfloat>(tmpres[i][idx][1]); } } tmpres.clear(); @@ -435,7 +435,7 @@ HrtfEntry *CreateHrtfStore(ALuint rate, ALsizei irSize, ALfloat distance, ALsize else { uintptr_t offset = sizeof(HrtfEntry); - char *base = (char*)Hrtf; + char *base = reinterpret_cast<char*>(Hrtf); ALushort *_evOffset; ALubyte *_azCount; ALubyte (*_delays)[2]; @@ -941,7 +941,7 @@ HrtfEntry *LoadHrtf02(std::istream &data, const char *filename) } return CreateHrtfStore(rate, irSize, - (ALfloat)distance / 1000.0f, evCount, irCount, azCount.data(), evOffset.data(), + static_cast<ALfloat>(distance) / 1000.0f, evCount, irCount, azCount.data(), evOffset.data(), &reinterpret_cast<ALfloat(&)[2]>(coeffs[0]), &reinterpret_cast<ALubyte(&)[2]>(delays[0]), filename ); |