Skip to content

Commit

Permalink
Fixing size_t conversions for GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Nov 2, 2023
1 parent d42ffb8 commit 128790f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/dsp/chowdsp_filters/Other/chowdsp_CrossoverFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ class CrossoverFilter

if constexpr (Order == 1)
{
auto lowerBandBuffers = buffersOut.template first<NumBands - 1>();
auto lowerBandBuffers = buffersOut.template first<(size_t) NumBands - 1>();
lowerBandsCrossover.processBlock (bufferIn, lowerBandBuffers);
BufferMath::copyBufferData (lowerBandBuffers.back(), tempBuffer); // Order-1 LR filter does not allow pointer aliasing, so we copy to a temp buffer here.
highCutFilter.processBlock (tempBuffer, lowerBandBuffers.back(), buffersOut.back());
}
else
{
auto lowerBandBuffers = buffersOut.template first<NumBands - 1>();
auto lowerBandBuffers = buffersOut.template first<(size_t) NumBands - 1>();
lowerBandsCrossover.processBlock (bufferIn, lowerBandBuffers);
highCutFilter.processBlock (lowerBandBuffers.back(), lowerBandBuffers.back(), buffersOut.back());

// an allpass LR-filter with the same crossover as the high-cut frequency
// this puts the low band back in-phase with the high- and mid-bands.
for (auto [buffer, filter] : chowdsp::zip (buffersOut.template first<NumBands - 2>(), apHighCutFilter))
for (auto [buffer, filter] : chowdsp::zip (buffersOut.template first<(size_t) NumBands - 2>(), apHighCutFilter))
{
filter.processBlock (buffer, buffer, tempBuffer);
BufferMath::addBufferData (tempBuffer, buffer);
Expand All @@ -102,7 +102,7 @@ class CrossoverFilter
private:
CrossoverFilter<T, Order, NumBands - 1> lowerBandsCrossover {};
LinkwitzRileyFilter<T, Order> highCutFilter {};
std::array<LinkwitzRileyFilter<T, Order>, NumBands - 2> apHighCutFilter {};
std::array<LinkwitzRileyFilter<T, Order>, (size_t) NumBands - 2> apHighCutFilter {};

Buffer<T> tempBuffer {};

Expand Down

0 comments on commit 128790f

Please sign in to comment.