From db73a0e2885a38375c7c68a72d30eb2cb47ebb8f Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Fri, 27 Dec 2024 20:36:09 -0800 Subject: [PATCH] Cleaner fix for cppcheck warnings with anonymous namespace instead of bad names --- .../GuitarPedal/Effect-Modules/multi_delay_module.cpp | 6 ++++-- Software/GuitarPedal/Effect-Modules/reverb_delay_module.h | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Software/GuitarPedal/Effect-Modules/multi_delay_module.cpp b/Software/GuitarPedal/Effect-Modules/multi_delay_module.cpp index 6bd254d..2712b08 100644 --- a/Software/GuitarPedal/Effect-Modules/multi_delay_module.cpp +++ b/Software/GuitarPedal/Effect-Modules/multi_delay_module.cpp @@ -13,7 +13,8 @@ DelayLine DSY_SDRAM_BSS delayLineLeft0; DelayLine DSY_SDRAM_BSS delayLineRight0; float tap_delays[4] = {0.0f, 0.0f, 0.0f, 0.0f}; -struct delay_multi { +namespace { +struct delay { DelayLine *del; float currentDelay; float delayTarget; @@ -29,7 +30,8 @@ struct delay_multi { return read; } }; -delay_multi delays[2]; +} // namespace +delay delays[2]; static const char *s_typeBinNames[] = {"Follower", "Time"}; static const int s_paramCount = 13; diff --git a/Software/GuitarPedal/Effect-Modules/reverb_delay_module.h b/Software/GuitarPedal/Effect-Modules/reverb_delay_module.h index 229d0f1..59d1028 100644 --- a/Software/GuitarPedal/Effect-Modules/reverb_delay_module.h +++ b/Software/GuitarPedal/Effect-Modules/reverb_delay_module.h @@ -22,6 +22,7 @@ constexpr size_t MAX_DELAY_REV = // opposite directions in the buffer) constexpr size_t MAX_DELAY_SPREAD = static_cast(4800.0f); // 50 ms for Spread effect +namespace { // This is the core delay struct, which actually includes two delays, // one for forwared/octave, and one for reverse. This is required // because the reverse delayline needs to be double the size of the @@ -32,7 +33,7 @@ constexpr size_t MAX_DELAY_SPREAD = static_cast(4800.0f); // 50 ms for // octave delay, or create a "fading into the distance" effect for the // forward and reverse delays. A "level" param is included for modulation // of the output volume, for stereo panning. -struct delay_reverb { +struct delay { DelayLineRevOct *del; DelayLineReverse *delreverse; float currentDelay; @@ -110,6 +111,7 @@ struct delay_spread { return read; } }; +} // namespace namespace bkshepherd { @@ -149,8 +151,8 @@ class ReverbDelayModule : public BaseEffectModule { float m_modOscFreqMax; // Delays - delay_reverb delayLeft; - delay_reverb delayRight; + delay delayLeft; + delay delayRight; delay_spread delaySpread; // Mix params