From c9f5617f06503d951b3ed808cf07fb6362a7f8d1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 8 Dec 2018 14:22:20 -0800 Subject: Avoid several uses of memset --- Alc/effects/reverb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Alc/effects/reverb.cpp') diff --git a/Alc/effects/reverb.cpp b/Alc/effects/reverb.cpp index ce7a9946..b5e6dd94 100644 --- a/Alc/effects/reverb.cpp +++ b/Alc/effects/reverb.cpp @@ -821,14 +821,12 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection */ rot = GetTransformFromVector(ReflectionsPan); MATRIX_MULT(transform, rot, A2B); - memset(&State->mEarly.PanGain, 0, sizeof(State->mEarly.PanGain)); for(i = 0;i < MAX_EFFECT_CHANNELS;i++) ComputePanGains(&Device->FOAOut, transform.m[i], earlyGain, State->mEarly.PanGain[i]); rot = GetTransformFromVector(LateReverbPan); MATRIX_MULT(transform, rot, A2B); - memset(&State->mLate.PanGain, 0, sizeof(State->mLate.PanGain)); for(i = 0;i < MAX_EFFECT_CHANNELS;i++) ComputePanGains(&Device->FOAOut, transform.m[i], lateGain, State->mLate.PanGain[i]); @@ -1379,11 +1377,13 @@ void ReverbState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesI todo &= ~3; /* Convert B-Format to A-Format for processing. */ - memset(afmt, 0, sizeof(*afmt)*NUM_LINES); for(c = 0;c < NUM_LINES;c++) + { + std::fill(std::begin(afmt[c]), std::end(afmt[c]), 0.0f); MixRowSamples(afmt[c], B2A.m[c], SamplesIn, MAX_EFFECT_CHANNELS, base, todo ); + } /* Process the samples for reverb. */ for(c = 0;c < NUM_LINES;c++) -- cgit v1.2.3