FloatVectorOperations / Error / const cast


#1

Hi, JuceDemo fails to build with last tip.

/Users/nicolas/Work/JUCE/examples/Demo/Builds/MacOSX/../../../../modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:749: error: invalid conversion from 'const float*' to 'float*' /Users/nicolas/Work/JUCE/examples/Demo/Builds/MacOSX/../../../../modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:749: error: initializing argument 1 of 'void vDSP_vmin(float*, vDSP_Stride, float*, vDSP_Stride, float*, vDSP_Stride, vDSP_Length)' /Users/nicolas/Work/JUCE/examples/Demo/Builds/MacOSX/../../../../modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:749: error: invalid conversion from 'const float*' to 'float*' /Users/nicolas/Work/JUCE/examples/Demo/Builds/MacOSX/../../../../modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:749: error: initializing argument 3 of 'void vDSP_vmin(float*, vDSP_Stride, float*, vDSP_Stride, float*, vDSP_Stride, vDSP_Length)' ...

It seems you forgot to const cast in the JUCE_USE_VDSP_FRAMEWORK case, for instance:

https://github.com/julianstorer/JUCE/blob/master/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp#L749

Also / 749, 758, 781, 790, 801, 814

 


#2

Oh, I guess you must be using some old version of vdsp.. Thanks, I'll add some casts.


#3

Yes, i use an old version. At first i was thinking if it worths the cost to report the error, then i saw that workarounds already existed for other vdsp functions… So i guess for consistency it is a good thing.

It compiles fine now, thanks.