Skip to content

Commit

Permalink
Cleaner fix for cppcheck warnings with anonymous namespace instead of…
Browse files Browse the repository at this point in the history
… bad names
  • Loading branch information
xconverge committed Dec 28, 2024
1 parent 2190876 commit db73a0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Software/GuitarPedal/Effect-Modules/multi_delay_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ DelayLine<float, MAX_DELAY_TAP> DSY_SDRAM_BSS delayLineLeft0;
DelayLine<float, MAX_DELAY_TAP> DSY_SDRAM_BSS delayLineRight0;

float tap_delays[4] = {0.0f, 0.0f, 0.0f, 0.0f};
struct delay_multi {
namespace {
struct delay {
DelayLine<float, MAX_DELAY_TAP> *del;
float currentDelay;
float delayTarget;
Expand All @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions Software/GuitarPedal/Effect-Modules/reverb_delay_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ constexpr size_t MAX_DELAY_REV =
// opposite directions in the buffer)
constexpr size_t MAX_DELAY_SPREAD = static_cast<size_t>(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
Expand All @@ -32,7 +33,7 @@ constexpr size_t MAX_DELAY_SPREAD = static_cast<size_t>(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<float, MAX_DELAY> *del;
DelayLineReverse<float, MAX_DELAY_REV> *delreverse;
float currentDelay;
Expand Down Expand Up @@ -110,6 +111,7 @@ struct delay_spread {
return read;
}
};
} // namespace

namespace bkshepherd {

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit db73a0e

Please sign in to comment.