mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Made const casts added to avoid problems in the old 10.8 SDK more conspicuous.
This commit is contained in:
parent
51f284bf0f
commit
9e317babd6
1 changed files with 13 additions and 2 deletions
|
|
@ -481,6 +481,17 @@ namespace FloatVectorHelpers
|
|||
#endif
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
namespace
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
// This casts away constness to account for slightly different vDSP function signatures
|
||||
// in OSX 10.8 SDK and below. Can be safely removed once those SDKs are obsolete.
|
||||
template <typename ValueType>
|
||||
ValueType* osx108sdkCompatibilityCast (const ValueType* arg) noexcept { return const_cast<ValueType*> (arg); }
|
||||
#endif
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void JUCE_CALLTYPE FloatVectorOperations::clear (float* dest, int num) noexcept
|
||||
{
|
||||
|
|
@ -571,7 +582,7 @@ void JUCE_CALLTYPE FloatVectorOperations::add (double* dest, double amount, int
|
|||
void JUCE_CALLTYPE FloatVectorOperations::add (float* dest, const float* src, float amount, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsadd ((float*) src, 1, &amount, dest, 1, (vDSP_Length) num);
|
||||
vDSP_vsadd (osx108sdkCompatibilityCast (src), 1, &amount, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] + amount, Mode::add (am, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
|
|
@ -582,7 +593,7 @@ void JUCE_CALLTYPE FloatVectorOperations::add (float* dest, const float* src, fl
|
|||
void JUCE_CALLTYPE FloatVectorOperations::add (double* dest, const double* src, double amount, int num) noexcept
|
||||
{
|
||||
#if JUCE_USE_VDSP_FRAMEWORK
|
||||
vDSP_vsaddD ((double*) src, 1, &amount, dest, 1, (vDSP_Length) num);
|
||||
vDSP_vsaddD (osx108sdkCompatibilityCast (src), 1, &amount, dest, 1, (vDSP_Length) num);
|
||||
#else
|
||||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] + amount, Mode::add (am, s),
|
||||
JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue