diff options
author | Chris Robinson <[email protected]> | 2019-07-28 17:15:34 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-07-28 17:15:34 -0700 |
commit | b4d56d3fdff4243ae2a3fc64934ced2af3187690 (patch) | |
tree | 9a9809e2e991037aa5798a05ab7321d143b95e5f /Alc/effects | |
parent | c8bbd75bf9a6f0170ec95b130b3eb17cd8cdd5ad (diff) |
Remove the UNUSED macro
Diffstat (limited to 'Alc/effects')
-rw-r--r-- | Alc/effects/autowah.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/compressor.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/dedicated.cpp | 4 | ||||
-rw-r--r-- | Alc/effects/distortion.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/equalizer.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/fshifter.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/modulator.cpp | 4 | ||||
-rw-r--r-- | Alc/effects/null.cpp | 23 | ||||
-rw-r--r-- | Alc/effects/pshifter.cpp | 2 | ||||
-rw-r--r-- | Alc/effects/vmorpher.cpp | 11 |
10 files changed, 28 insertions, 26 deletions
diff --git a/Alc/effects/autowah.cpp b/Alc/effects/autowah.cpp index f1160804..8545de1f 100644 --- a/Alc/effects/autowah.cpp +++ b/Alc/effects/autowah.cpp @@ -77,7 +77,7 @@ struct ALautowahState final : public EffectState { DEF_NEWDEL(ALautowahState) }; -ALboolean ALautowahState::deviceUpdate(const ALCdevice *UNUSED(device)) +ALboolean ALautowahState::deviceUpdate(const ALCdevice*) { /* (Re-)initializing parameters and clear the buffers. */ diff --git a/Alc/effects/compressor.cpp b/Alc/effects/compressor.cpp index 542ef684..82f70317 100644 --- a/Alc/effects/compressor.cpp +++ b/Alc/effects/compressor.cpp @@ -74,7 +74,7 @@ ALboolean CompressorState::deviceUpdate(const ALCdevice *device) return AL_TRUE; } -void CompressorState::update(const ALCcontext* UNUSED(context), const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) +void CompressorState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { mEnabled = props->Compressor.OnOff; diff --git a/Alc/effects/dedicated.cpp b/Alc/effects/dedicated.cpp index b5fdb626..f31cc903 100644 --- a/Alc/effects/dedicated.cpp +++ b/Alc/effects/dedicated.cpp @@ -45,13 +45,13 @@ struct DedicatedState final : public EffectState { DEF_NEWDEL(DedicatedState) }; -ALboolean DedicatedState::deviceUpdate(const ALCdevice *UNUSED(device)) +ALboolean DedicatedState::deviceUpdate(const ALCdevice*) { std::fill(std::begin(mCurrentGains), std::end(mCurrentGains), 0.0f); return AL_TRUE; } -void DedicatedState::update(const ALCcontext* UNUSED(context), const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) +void DedicatedState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { std::fill(std::begin(mTargetGains), std::end(mTargetGains), 0.0f); diff --git a/Alc/effects/distortion.cpp b/Alc/effects/distortion.cpp index a58ac5a6..94af9e11 100644 --- a/Alc/effects/distortion.cpp +++ b/Alc/effects/distortion.cpp @@ -55,7 +55,7 @@ struct DistortionState final : public EffectState { DEF_NEWDEL(DistortionState) }; -ALboolean DistortionState::deviceUpdate(const ALCdevice *UNUSED(device)) +ALboolean DistortionState::deviceUpdate(const ALCdevice*) { mLowpass.clear(); mBandpass.clear(); diff --git a/Alc/effects/equalizer.cpp b/Alc/effects/equalizer.cpp index 995f03df..961ae8fc 100644 --- a/Alc/effects/equalizer.cpp +++ b/Alc/effects/equalizer.cpp @@ -99,7 +99,7 @@ struct EqualizerState final : public EffectState { DEF_NEWDEL(EqualizerState) }; -ALboolean EqualizerState::deviceUpdate(const ALCdevice *UNUSED(device)) +ALboolean EqualizerState::deviceUpdate(const ALCdevice*) { for(auto &e : mChans) { diff --git a/Alc/effects/fshifter.cpp b/Alc/effects/fshifter.cpp index 6378db89..68e10cba 100644 --- a/Alc/effects/fshifter.cpp +++ b/Alc/effects/fshifter.cpp @@ -88,7 +88,7 @@ struct FshifterState final : public EffectState { DEF_NEWDEL(FshifterState) }; -ALboolean FshifterState::deviceUpdate(const ALCdevice *UNUSED(device)) +ALboolean FshifterState::deviceUpdate(const ALCdevice*) { /* (Re-)initializing parameters and clear the buffers. */ mCount = FIFO_LATENCY; diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp index 46d17d1c..8377aefe 100644 --- a/Alc/effects/modulator.cpp +++ b/Alc/effects/modulator.cpp @@ -59,7 +59,7 @@ inline ALfloat Square(ALsizei index) return static_cast<ALfloat>(((index>>(WAVEFORM_FRACBITS-2))&2) - 1); } -inline ALfloat One(ALsizei UNUSED(index)) +inline ALfloat One(ALsizei) { return 1.0f; } @@ -98,7 +98,7 @@ struct ModulatorState final : public EffectState { DEF_NEWDEL(ModulatorState) }; -ALboolean ModulatorState::deviceUpdate(const ALCdevice *UNUSED(device)) +ALboolean ModulatorState::deviceUpdate(const ALCdevice*) { for(auto &e : mChans) { diff --git a/Alc/effects/null.cpp b/Alc/effects/null.cpp index 6076a2d9..3c27bae0 100644 --- a/Alc/effects/null.cpp +++ b/Alc/effects/null.cpp @@ -34,20 +34,21 @@ NullState::NullState() = default; */ NullState::~NullState() = default; -/* This updates the device-dependant effect state. This is called on +/* This updates the device-dependant effect state. This is called on state * initialization and any time the device parameters (e.g. playback frequency, * format) have been changed. Will always be followed by a call to the update * method, if successful. */ -ALboolean NullState::deviceUpdate(const ALCdevice* UNUSED(device)) +ALboolean NullState::deviceUpdate(const ALCdevice* /*device*/) { return AL_TRUE; } -/* This updates the effect state. This is called any time the effect is - * (re)loaded into a slot. +/* This updates the effect state with new properties. This is called any time + * the effect is (re)loaded into a slot. */ -void NullState::update(const ALCcontext* UNUSED(context), const ALeffectslot* UNUSED(slot), const EffectProps* UNUSED(props), const EffectTarget UNUSED(target)) +void NullState::update(const ALCcontext* /*context*/, const ALeffectslot* /*slot*/, + const EffectProps* /*props*/, const EffectTarget /*target*/) { } @@ -55,12 +56,14 @@ void NullState::update(const ALCcontext* UNUSED(context), const ALeffectslot* UN * input to the output buffer. The result should be added to the output buffer, * not replace it. */ -void NullState::process(const ALsizei /*samplesToDo*/, const FloatBufferLine *RESTRICT /*samplesIn*/, const ALsizei /*numInput*/, const al::span<FloatBufferLine> /*samplesOut*/) +void NullState::process(const ALsizei /*samplesToDo*/, + const FloatBufferLine *RESTRICT /*samplesIn*/, const ALsizei /*numInput*/, + const al::span<FloatBufferLine> /*samplesOut*/) { } -void NullEffect_setParami(EffectProps *UNUSED(props), ALCcontext *context, ALenum param, ALint UNUSED(val)) +void NullEffect_setParami(EffectProps* /*props*/, ALCcontext *context, ALenum param, ALint /*val*/) { switch(param) { @@ -76,7 +79,7 @@ void NullEffect_setParamiv(EffectProps *props, ALCcontext *context, ALenum param NullEffect_setParami(props, context, param, vals[0]); } } -void NullEffect_setParamf(EffectProps *UNUSED(props), ALCcontext *context, ALenum param, ALfloat UNUSED(val)) +void NullEffect_setParamf(EffectProps* /*props*/, ALCcontext *context, ALenum param, ALfloat /*val*/) { switch(param) { @@ -93,7 +96,7 @@ void NullEffect_setParamfv(EffectProps *props, ALCcontext *context, ALenum param } } -void NullEffect_getParami(const EffectProps *UNUSED(props), ALCcontext *context, ALenum param, ALint* UNUSED(val)) +void NullEffect_getParami(const EffectProps* /*props*/, ALCcontext *context, ALenum param, ALint* /*val*/) { switch(param) { @@ -109,7 +112,7 @@ void NullEffect_getParamiv(const EffectProps *props, ALCcontext *context, ALenum NullEffect_getParami(props, context, param, vals); } } -void NullEffect_getParamf(const EffectProps *UNUSED(props), ALCcontext *context, ALenum param, ALfloat* UNUSED(val)) +void NullEffect_getParamf(const EffectProps* /*props*/, ALCcontext *context, ALenum param, ALfloat* /*val*/) { switch(param) { diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp index 5a1e3817..bade81e6 100644 --- a/Alc/effects/pshifter.cpp +++ b/Alc/effects/pshifter.cpp @@ -181,7 +181,7 @@ ALboolean PshifterState::deviceUpdate(const ALCdevice *device) return AL_TRUE; } -void PshifterState::update(const ALCcontext* UNUSED(context), const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) +void PshifterState::update(const ALCcontext*, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) { const float pitch{std::pow(2.0f, static_cast<ALfloat>(props->Pshifter.CoarseTune*100 + props->Pshifter.FineTune) / 1200.0f diff --git a/Alc/effects/vmorpher.cpp b/Alc/effects/vmorpher.cpp index dc402aaf..6f7e22ae 100644 --- a/Alc/effects/vmorpher.cpp +++ b/Alc/effects/vmorpher.cpp @@ -47,22 +47,21 @@ namespace { inline ALfloat Sin(ALsizei index) { - return (std::sin(static_cast<ALfloat>(index) * - (al::MathDefs<float>::Tau() / ALfloat{WAVEFORM_FRACONE})))*0.5f+0.5f; + constexpr ALfloat scale{al::MathDefs<float>::Tau() / ALfloat{WAVEFORM_FRACONE}}; + return std::sin(static_cast<ALfloat>(index) * scale)*0.5f + 0.5f; } inline ALfloat Saw(ALsizei index) { - return (static_cast<ALfloat>(index)*(2.0f/WAVEFORM_FRACONE) - 1.0f)*0.5f+0.5f; + return static_cast<ALfloat>(index) / ALfloat{WAVEFORM_FRACONE}; } inline ALfloat Triangle(ALsizei index) { - return (std::fabs(static_cast<ALfloat>(index) * (al::MathDefs<float>::Tau() / WAVEFORM_FRACONE) - - al::MathDefs<float>::Pi()) / al::MathDefs<float>::Pi())*0.5f+0.5f; + return std::fabs(static_cast<ALfloat>(index)*(2.0f/WAVEFORM_FRACONE) - 1.0f); } -inline ALfloat Half(ALsizei UNUSED(index)) +inline ALfloat Half(ALsizei) { return 0.5f; } |