the recent AudioBlock refactoring broke the clear() method, if the SampleType is a SIMD type.
The following code won’t work:
No matching function for call to 'clear' <- FloatVectorOperations.
clearInternal() method, which is used to clear the data, is no longer reinterpret_casting the SampleType to float in order to use the FloatVectorOperations.
Am I supposed to use clear differently? Or did it just slip through testing?
Maybe something for @tpoole?
Seems like adding
reinterpret_cast<NumericType*> to the
clearInternal() method should do the trick:
In juce_AudioBlock.h line 578:
void JUCE_VECTOR_CALLTYPE clearInternal() const noexcept
auto n = static_cast<int> (numSamples * sizeFactor);
for (size_t ch = 0; ch < numChannels; ++ch)
FloatVectorOperations::clear (reinterpret_cast<NumericType*> (getChannelPointer (ch)), n);
All the other methods using
FloatVectorOperations are also affected (see
fillInternal()), so the
reinterpret_cast has to be added to those as well. Unless it will put directly to
getChannelPointer as it was before, however that would break the interface, as it wouldn’t return
That was an oversight. Fixed here:
Thank you for reporting!
Thanks for fixing! Would you mind cherry-picking it to master?
I’d like it to have a few days on
develop first, but have no objections to moving it over if no other problems are reported.
I really dislike the concept that master can change after release, how are we supposed to know what’s a master and what’s an updated master without monitoring the forum?
There are also release-tags, so if you want to stick with the release-versions you can always pull the tags, if you want to get the latest master-worthy changes you can pull from master, and if you want to use the most recent develop changes -> develop