| @@ -69,22 +69,22 @@ public: | |||
| class BigEndian | |||
| { | |||
| public: | |||
| template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatBE(); } | |||
| template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatBE (newValue); } | |||
| template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32BE(); } | |||
| template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32BE (newValue); } | |||
| template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromBE (source); } | |||
| template <class SampleFormatType> static float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatBE(); } | |||
| template <class SampleFormatType> static void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatBE (newValue); } | |||
| template <class SampleFormatType> static int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32BE(); } | |||
| template <class SampleFormatType> static void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32BE (newValue); } | |||
| template <class SourceType, class DestType> static void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromBE (source); } | |||
| enum { isBigEndian = 1 }; | |||
| }; | |||
| class LittleEndian | |||
| { | |||
| public: | |||
| template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatLE(); } | |||
| template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatLE (newValue); } | |||
| template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32LE(); } | |||
| template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32LE (newValue); } | |||
| template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromLE (source); } | |||
| template <class SampleFormatType> static float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatLE(); } | |||
| template <class SampleFormatType> static void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatLE (newValue); } | |||
| template <class SampleFormatType> static int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32LE(); } | |||
| template <class SampleFormatType> static void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32LE (newValue); } | |||
| template <class SourceType, class DestType> static void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromLE (source); } | |||
| enum { isBigEndian = 0 }; | |||
| }; | |||
| @@ -284,7 +284,7 @@ public: | |||
| template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.advance(); } | |||
| template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numSamples); } | |||
| template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { s.clearMultiple (numSamples); } | |||
| template <class SampleFormatType> inline static int getNumBytesBetweenSamples (const SampleFormatType&) noexcept { return SampleFormatType::bytesPerSample; } | |||
| template <class SampleFormatType> static int getNumBytesBetweenSamples (const SampleFormatType&) noexcept { return SampleFormatType::bytesPerSample; } | |||
| enum { isInterleavedType = 0, numInterleavedChannels = 1 }; | |||
| }; | |||
| @@ -309,7 +309,7 @@ public: | |||
| { | |||
| public: | |||
| using VoidType = void; | |||
| static inline void* toVoidPtr (VoidType* v) noexcept { return v; } | |||
| static void* toVoidPtr (VoidType* v) noexcept { return v; } | |||
| enum { isConst = 0 }; | |||
| }; | |||
| @@ -317,7 +317,7 @@ public: | |||
| { | |||
| public: | |||
| using VoidType = const void; | |||
| static inline void* toVoidPtr (VoidType* v) noexcept { return const_cast<void*> (v); } | |||
| static void* toVoidPtr (VoidType* v) noexcept { return const_cast<void*> (v); } | |||
| enum { isConst = 1 }; | |||
| }; | |||
| #endif | |||
| @@ -30,7 +30,7 @@ namespace FloatVectorHelpers | |||
| #define JUCE_INCREMENT_DEST dest += (16 / sizeof (*dest)); | |||
| #if JUCE_USE_SSE_INTRINSICS | |||
| inline static bool isAligned (const void* p) noexcept | |||
| static bool isAligned (const void* p) noexcept | |||
| { | |||
| return (((pointer_sized_int) p) & 15) == 0; | |||
| } | |||
| @@ -518,7 +518,7 @@ private: | |||
| bool firstPlayTime; | |||
| int64 lastPlayTime, ticksPerBuffer; | |||
| static inline int convertInputValues (const float l, const float r) noexcept | |||
| static int convertInputValues (const float l, const float r) noexcept | |||
| { | |||
| return jlimit (-32768, 32767, roundToInt (32767.0f * r)) << 16 | |||
| | (0xffff & jlimit (-32768, 32767, roundToInt (32767.0f * l))); | |||
| @@ -274,7 +274,7 @@ namespace AAXClasses | |||
| return AAX_eStemFormat_INT32_MAX; | |||
| } | |||
| static inline AudioChannelSet channelSetFromStemFormat (AAX_EStemFormat format, bool ignoreLayout) noexcept | |||
| static AudioChannelSet channelSetFromStemFormat (AAX_EStemFormat format, bool ignoreLayout) noexcept | |||
| { | |||
| if (! ignoreLayout) | |||
| { | |||
| @@ -2199,7 +2199,7 @@ namespace AAXClasses | |||
| check (desc.AddProcessProc_Native (algorithmProcessCallback, properties)); | |||
| } | |||
| static inline bool hostSupportsStemFormat (AAX_EStemFormat stemFormat, const AAX_IFeatureInfo* featureInfo) | |||
| static bool hostSupportsStemFormat (AAX_EStemFormat stemFormat, const AAX_IFeatureInfo* featureInfo) | |||
| { | |||
| if (featureInfo != nullptr) | |||
| { | |||
| @@ -1389,7 +1389,7 @@ private: | |||
| && (int32) hostCallback (&vstEffect, Vst2::audioMasterGetCurrentProcessLevel, 0, 0, nullptr, 0) == 4; | |||
| } | |||
| static inline int32 convertHexVersionToDecimal (const unsigned int hexVersion) | |||
| static int32 convertHexVersionToDecimal (const unsigned int hexVersion) | |||
| { | |||
| #if JUCE_VST_RETURN_HEX_VERSION_NUMBER_DIRECTLY | |||
| return (int32) hexVersion; | |||
| @@ -1565,12 +1565,12 @@ private: | |||
| namespace | |||
| { | |||
| template <typename FloatType> struct AudioBusPointerHelper {}; | |||
| template <> struct AudioBusPointerHelper<float> { static inline float** impl (Vst::AudioBusBuffers& data) noexcept { return data.channelBuffers32; } }; | |||
| template <> struct AudioBusPointerHelper<double> { static inline double** impl (Vst::AudioBusBuffers& data) noexcept { return data.channelBuffers64; } }; | |||
| template <> struct AudioBusPointerHelper<float> { static float** impl (Vst::AudioBusBuffers& data) noexcept { return data.channelBuffers32; } }; | |||
| template <> struct AudioBusPointerHelper<double> { static double** impl (Vst::AudioBusBuffers& data) noexcept { return data.channelBuffers64; } }; | |||
| template <typename FloatType> struct ChooseBufferHelper {}; | |||
| template <> struct ChooseBufferHelper<float> { static inline AudioBuffer<float>& impl (AudioBuffer<float>& f, AudioBuffer<double>& ) noexcept { return f; } }; | |||
| template <> struct ChooseBufferHelper<double> { static inline AudioBuffer<double>& impl (AudioBuffer<float>& , AudioBuffer<double>& d) noexcept { return d; } }; | |||
| template <> struct ChooseBufferHelper<float> { static AudioBuffer<float>& impl (AudioBuffer<float>& f, AudioBuffer<double>& ) noexcept { return f; } }; | |||
| template <> struct ChooseBufferHelper<double> { static AudioBuffer<double>& impl (AudioBuffer<float>& , AudioBuffer<double>& d) noexcept { return d; } }; | |||
| } | |||
| @@ -2016,7 +2016,7 @@ private: | |||
| } | |||
| //============================================================================== | |||
| static inline UInt64 GetCurrentHostTime (int numSamples, double sampleRate, bool isAUv3) noexcept | |||
| static UInt64 GetCurrentHostTime (int numSamples, double sampleRate, bool isAUv3) noexcept | |||
| { | |||
| #if ! JUCE_IOS | |||
| if (! isAUv3) | |||
| @@ -105,45 +105,7 @@ static inline Steinberg::Vst::SpeakerArrangement getArrangementForBus (Steinberg | |||
| return arrangement; | |||
| } | |||
| /** For the sake of simplicity, there can only be 1 arrangement type per channel count. | |||
| i.e.: 4 channels == k31Cine OR k40Cine | |||
| */ | |||
| static inline Steinberg::Vst::SpeakerArrangement getArrangementForNumChannels (int numChannels) noexcept | |||
| { | |||
| using namespace Steinberg::Vst::SpeakerArr; | |||
| switch (numChannels) | |||
| { | |||
| case 0: return kEmpty; | |||
| case 1: return kMono; | |||
| case 2: return kStereo; | |||
| case 3: return k30Cine; | |||
| case 4: return k31Cine; | |||
| case 5: return k50; | |||
| case 6: return k51; | |||
| case 7: return k61Cine; | |||
| case 8: return k71CineFullFront; | |||
| case 9: return k90; | |||
| case 10: return k91; | |||
| case 11: return k101; | |||
| case 12: return k111; | |||
| case 13: return k130; | |||
| case 14: return k131; | |||
| #if VST_VERSION >= 0x030608 | |||
| case 16: return kAmbi3rdOrderACN; | |||
| #endif | |||
| case 24: return (Steinberg::Vst::SpeakerArrangement) 1929904127; // k222 | |||
| default: break; | |||
| } | |||
| jassert (numChannels >= 0); | |||
| juce::BigInteger bi; | |||
| bi.setRange (0, jmin (numChannels, (int) (sizeof (Steinberg::Vst::SpeakerArrangement) * 8)), true); | |||
| return (Steinberg::Vst::SpeakerArrangement) bi.toInt64(); | |||
| } | |||
| static inline Steinberg::Vst::Speaker getSpeakerType (const AudioChannelSet& set, AudioChannelSet::ChannelType type) noexcept | |||
| static Steinberg::Vst::Speaker getSpeakerType (const AudioChannelSet& set, AudioChannelSet::ChannelType type) noexcept | |||
| { | |||
| switch (type) | |||
| { | |||
| @@ -231,7 +193,7 @@ static inline Steinberg::Vst::Speaker getSpeakerType (const AudioChannelSet& set | |||
| return (1ull << (channelIndex + 33ull /* last speaker in vst layout + 1 */)); | |||
| } | |||
| static inline AudioChannelSet::ChannelType getChannelType (Steinberg::Vst::SpeakerArrangement arr, Steinberg::Vst::Speaker type) noexcept | |||
| static AudioChannelSet::ChannelType getChannelType (Steinberg::Vst::SpeakerArrangement arr, Steinberg::Vst::Speaker type) noexcept | |||
| { | |||
| switch (type) | |||
| { | |||
| @@ -296,7 +258,7 @@ static inline AudioChannelSet::ChannelType getChannelType (Steinberg::Vst::Speak | |||
| return static_cast<AudioChannelSet::ChannelType> (static_cast<int> (AudioChannelSet::discreteChannel0) + 6 + (channelType - 33)); | |||
| } | |||
| static inline Steinberg::Vst::SpeakerArrangement getVst3SpeakerArrangement (const AudioChannelSet& channels) noexcept | |||
| static Steinberg::Vst::SpeakerArrangement getVst3SpeakerArrangement (const AudioChannelSet& channels) noexcept | |||
| { | |||
| using namespace Steinberg::Vst::SpeakerArr; | |||
| @@ -337,7 +299,7 @@ static inline Steinberg::Vst::SpeakerArrangement getVst3SpeakerArrangement (cons | |||
| return result; | |||
| } | |||
| static inline AudioChannelSet getChannelSetForSpeakerArrangement (Steinberg::Vst::SpeakerArrangement arr) noexcept | |||
| static AudioChannelSet getChannelSetForSpeakerArrangement (Steinberg::Vst::SpeakerArrangement arr) noexcept | |||
| { | |||
| using namespace Steinberg::Vst::SpeakerArr; | |||
| @@ -788,8 +750,8 @@ struct VST3BufferExchange | |||
| using Bus = Array<FloatType*>; | |||
| using BusMap = Array<Bus>; | |||
| static inline void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, float** raw) { vstBuffers.channelBuffers32 = raw; } | |||
| static inline void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, double** raw) { vstBuffers.channelBuffers64 = raw; } | |||
| static void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, float** raw) { vstBuffers.channelBuffers32 = raw; } | |||
| static void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, double** raw) { vstBuffers.channelBuffers64 = raw; } | |||
| /** Assigns a series of AudioBuffer's channels to an AudioBusBuffers' | |||
| @warning For speed, does not check the channel count and offsets according to the AudioBuffer | |||
| @@ -833,9 +795,9 @@ struct VST3BufferExchange | |||
| channelIndexOffset += numChansForBus; | |||
| } | |||
| static inline void mapBufferToBuses (Array<Steinberg::Vst::AudioBusBuffers>& result, BusMap& busMapToUse, | |||
| const Array<AudioChannelSet>& arrangements, | |||
| AudioBuffer<FloatType>& source) | |||
| static void mapBufferToBuses (Array<Steinberg::Vst::AudioBusBuffers>& result, BusMap& busMapToUse, | |||
| const Array<AudioChannelSet>& arrangements, | |||
| AudioBuffer<FloatType>& source) | |||
| { | |||
| int channelIndexOffset = 0; | |||
| @@ -844,10 +806,10 @@ struct VST3BufferExchange | |||
| arrangements.getUnchecked (i), source); | |||
| } | |||
| static inline void mapBufferToBuses (Array<Steinberg::Vst::AudioBusBuffers>& result, | |||
| Steinberg::Vst::IAudioProcessor& processor, | |||
| BusMap& busMapToUse, bool isInput, int numBuses, | |||
| AudioBuffer<FloatType>& source) | |||
| static void mapBufferToBuses (Array<Steinberg::Vst::AudioBusBuffers>& result, | |||
| Steinberg::Vst::IAudioProcessor& processor, | |||
| BusMap& busMapToUse, bool isInput, int numBuses, | |||
| AudioBuffer<FloatType>& source) | |||
| { | |||
| int channelIndexOffset = 0; | |||
| @@ -874,12 +836,12 @@ struct VST3FloatAndDoubleBusMapComposite | |||
| template <> struct VST3FloatAndDoubleBusMapCompositeHelper<float> | |||
| { | |||
| static inline VST3BufferExchange<float>::BusMap& get (VST3FloatAndDoubleBusMapComposite& impl) { return impl.floatVersion; } | |||
| static VST3BufferExchange<float>::BusMap& get (VST3FloatAndDoubleBusMapComposite& impl) { return impl.floatVersion; } | |||
| }; | |||
| template <> struct VST3FloatAndDoubleBusMapCompositeHelper<double> | |||
| { | |||
| static inline VST3BufferExchange<double>::BusMap& get (VST3FloatAndDoubleBusMapComposite& impl) { return impl.doubleVersion; } | |||
| static VST3BufferExchange<double>::BusMap& get (VST3FloatAndDoubleBusMapComposite& impl) { return impl.doubleVersion; } | |||
| }; | |||
| } // namespace juce | |||
| @@ -271,7 +271,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e | |||
| return mappings; | |||
| } | |||
| static inline int32 getSpeakerType (AudioChannelSet::ChannelType type) noexcept | |||
| static int32 getSpeakerType (AudioChannelSet::ChannelType type) noexcept | |||
| { | |||
| static const std::map<AudioChannelSet::ChannelType, int32> speakerTypeMap = | |||
| { | |||
| @@ -302,7 +302,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e | |||
| return speakerTypeMap.at (type); | |||
| } | |||
| static inline AudioChannelSet::ChannelType getChannelType (int32 type) noexcept | |||
| static AudioChannelSet::ChannelType getChannelType (int32 type) noexcept | |||
| { | |||
| switch (type) | |||
| { | |||
| @@ -147,7 +147,7 @@ void AudioThumbnailCache::removeThumb (const int64 hashCode) | |||
| thumbs.remove (i); | |||
| } | |||
| static inline int getThumbnailCacheFileMagicHeader() noexcept | |||
| static int getThumbnailCacheFileMagicHeader() noexcept | |||
| { | |||
| return (int) ByteOrder::littleEndianInt ("ThmC"); | |||
| } | |||
| @@ -67,7 +67,7 @@ namespace | |||
| static PortIOStats inputStats { "Input" }, outputStats { "Output" }; | |||
| static uint32 startTime = 0; | |||
| static inline void resetOnSecondBoundary() | |||
| static void resetOnSecondBoundary() | |||
| { | |||
| auto now = Time::getMillisecondCounter(); | |||
| double elapsedSec = (now - startTime) / 1000.0; | |||
| @@ -80,13 +80,13 @@ namespace | |||
| } | |||
| } | |||
| static inline void registerBytesOut (int numBytes) | |||
| static void registerBytesOut (int numBytes) | |||
| { | |||
| outputStats.registerMessage (numBytes); | |||
| resetOnSecondBoundary(); | |||
| } | |||
| static inline void registerBytesIn (int numBytes) | |||
| static void registerBytesIn (int numBytes) | |||
| { | |||
| inputStats.registerMessage (numBytes); | |||
| resetOnSecondBoundary(); | |||
| @@ -489,7 +489,7 @@ private: | |||
| return hash; | |||
| } | |||
| static inline HashEntry* getEntry (HashEntry* firstEntry, KeyType keyToLookFor) noexcept | |||
| static HashEntry* getEntry (HashEntry* firstEntry, KeyType keyToLookFor) noexcept | |||
| { | |||
| for (auto* entry = firstEntry; entry != nullptr; entry = entry->nextEntry) | |||
| if (entry->key == keyToLookFor) | |||
| @@ -257,8 +257,8 @@ public: | |||
| } | |||
| private: | |||
| static inline const String* getString (const ValueUnion& data) noexcept { return reinterpret_cast<const String*> (data.stringValue); } | |||
| static inline String* getString (ValueUnion& data) noexcept { return reinterpret_cast<String*> (data.stringValue); } | |||
| static const String* getString (const ValueUnion& data) noexcept { return reinterpret_cast<const String*> (data.stringValue); } | |||
| static String* getString (ValueUnion& data) noexcept { return reinterpret_cast<String*> (data.stringValue); } | |||
| }; | |||
| //============================================================================== | |||
| @@ -681,7 +681,7 @@ struct Expression::Helpers | |||
| } | |||
| //============================================================================== | |||
| static inline bool isDecimalDigit (const juce_wchar c) noexcept | |||
| static bool isDecimalDigit (const juce_wchar c) noexcept | |||
| { | |||
| return c >= '0' && c <= '9'; | |||
| } | |||
| @@ -201,7 +201,7 @@ public: | |||
| private: | |||
| SharedRef holder; | |||
| static inline SharedRef getRef (ObjectType* o) | |||
| static SharedRef getRef (ObjectType* o) | |||
| { | |||
| if (o != nullptr) | |||
| return o->masterReference.getSharedPointer (o); | |||
| @@ -23,12 +23,12 @@ | |||
| namespace juce | |||
| { | |||
| static inline File resolveFilename (const String& name) | |||
| static File resolveFilename (const String& name) | |||
| { | |||
| return File::getCurrentWorkingDirectory().getChildFile (name.unquoted()); | |||
| } | |||
| static inline File checkFileExists (const File& f) | |||
| static File checkFileExists (const File& f) | |||
| { | |||
| if (! f.exists()) | |||
| ConsoleApplication::fail ("Could not find file: " + f.getFullPathName()); | |||
| @@ -36,7 +36,7 @@ static inline File checkFileExists (const File& f) | |||
| return f; | |||
| } | |||
| static inline File checkFolderExists (const File& f) | |||
| static File checkFolderExists (const File& f) | |||
| { | |||
| if (! f.isDirectory()) | |||
| ConsoleApplication::fail ("Could not find folder: " + f.getFullPathName()); | |||
| @@ -44,7 +44,7 @@ static inline File checkFolderExists (const File& f) | |||
| return f; | |||
| } | |||
| static inline File resolveFilenameForOption (const ArgumentList& args, StringRef option, const String& filename) | |||
| static File resolveFilenameForOption (const ArgumentList& args, StringRef option, const String& filename) | |||
| { | |||
| if (filename.isEmpty()) | |||
| { | |||
| @@ -75,9 +75,9 @@ File ArgumentList::Argument::resolveAsExistingFolder() const | |||
| return f; | |||
| } | |||
| static inline bool isShortOptionFormat (StringRef s) { return s[0] == '-' && s[1] != '-'; } | |||
| static inline bool isLongOptionFormat (StringRef s) { return s[0] == '-' && s[1] == '-' && s[2] != '-'; } | |||
| static inline bool isOptionFormat (StringRef s) { return s[0] == '-'; } | |||
| static bool isShortOptionFormat (StringRef s) { return s[0] == '-' && s[1] != '-'; } | |||
| static bool isLongOptionFormat (StringRef s) { return s[0] == '-' && s[1] == '-' && s[2] != '-'; } | |||
| static bool isOptionFormat (StringRef s) { return s[0] == '-'; } | |||
| bool ArgumentList::Argument::isLongOption() const { return isLongOptionFormat (text); } | |||
| bool ArgumentList::Argument::isShortOption() const { return isShortOptionFormat (text); } | |||
| @@ -149,7 +149,7 @@ private: | |||
| //============================================================================== | |||
| jobject obj = nullptr; | |||
| static inline jobject retain (jobject obj, JNIEnv* env) | |||
| static jobject retain (jobject obj, JNIEnv* env) | |||
| { | |||
| return obj == nullptr ? nullptr : env->NewGlobalRef (obj); | |||
| } | |||
| @@ -40,14 +40,14 @@ namespace AndroidStatsHelpers | |||
| DECLARE_JNI_CLASS (JavaLocale, "java/util/Locale") | |||
| #undef JNI_CLASS_MEMBERS | |||
| static inline String getSystemProperty (const String& name) | |||
| static String getSystemProperty (const String& name) | |||
| { | |||
| return juceString (LocalRef<jstring> ((jstring) getEnv()->CallStaticObjectMethod (SystemClass, | |||
| SystemClass.getProperty, | |||
| javaString (name).get()))); | |||
| } | |||
| static inline String getLocaleValue (bool isRegion) | |||
| static String getLocaleValue (bool isRegion) | |||
| { | |||
| auto* env = getEnv(); | |||
| LocalRef<jobject> locale (env->CallStaticObjectMethod (JavaLocale, JavaLocale.getDefault)); | |||
| @@ -58,7 +58,7 @@ namespace AndroidStatsHelpers | |||
| return juceString (LocalRef<jstring> ((jstring) stringResult)); | |||
| } | |||
| static inline String getAndroidOsBuildValue (const char* fieldName) | |||
| static String getAndroidOsBuildValue (const char* fieldName) | |||
| { | |||
| return juceString (LocalRef<jstring> ((jstring) getEnv()->GetStaticObjectField ( | |||
| AndroidBuild, getEnv()->GetStaticFieldID (AndroidBuild, fieldName, "Ljava/lang/String;")))); | |||
| @@ -54,7 +54,7 @@ bool SystemStats::isOperatingSystem64Bit() | |||
| } | |||
| //============================================================================== | |||
| static inline String getCpuInfo (const char* key) | |||
| static String getCpuInfo (const char* key) | |||
| { | |||
| return readPosixConfigFileValue ("/proc/cpuinfo", key); | |||
| } | |||
| @@ -27,37 +27,37 @@ namespace juce | |||
| { | |||
| //============================================================================== | |||
| static inline String nsStringToJuce (NSString* s) | |||
| inline String nsStringToJuce (NSString* s) | |||
| { | |||
| return CharPointer_UTF8 ([s UTF8String]); | |||
| } | |||
| static inline NSString* juceStringToNS (const String& s) | |||
| inline NSString* juceStringToNS (const String& s) | |||
| { | |||
| return [NSString stringWithUTF8String: s.toUTF8()]; | |||
| } | |||
| static inline NSString* nsStringLiteral (const char* const s) noexcept | |||
| inline NSString* nsStringLiteral (const char* const s) noexcept | |||
| { | |||
| return [NSString stringWithUTF8String: s]; | |||
| } | |||
| static inline NSString* nsEmptyString() noexcept | |||
| inline NSString* nsEmptyString() noexcept | |||
| { | |||
| return [NSString string]; | |||
| } | |||
| static inline NSURL* createNSURLFromFile (const String& f) | |||
| inline NSURL* createNSURLFromFile (const String& f) | |||
| { | |||
| return [NSURL fileURLWithPath: juceStringToNS (f)]; | |||
| } | |||
| static inline NSURL* createNSURLFromFile (const File& f) | |||
| inline NSURL* createNSURLFromFile (const File& f) | |||
| { | |||
| return createNSURLFromFile (f.getFullPathName()); | |||
| } | |||
| static inline NSArray* createNSArrayFromStringArray (const StringArray& strings) | |||
| inline NSArray* createNSArrayFromStringArray (const StringArray& strings) | |||
| { | |||
| auto array = [[NSMutableArray alloc] init]; | |||
| @@ -67,9 +67,9 @@ static inline NSArray* createNSArrayFromStringArray (const StringArray& strings) | |||
| return [array autorelease]; | |||
| } | |||
| static NSArray* varArrayToNSArray (const var& varToParse); | |||
| inline NSArray* varArrayToNSArray (const var& varToParse); | |||
| static NSDictionary* varObjectToNSDictionary (const var& varToParse) | |||
| inline NSDictionary* varObjectToNSDictionary (const var& varToParse) | |||
| { | |||
| auto dictionary = [NSMutableDictionary dictionary]; | |||
| @@ -109,7 +109,7 @@ static NSDictionary* varObjectToNSDictionary (const var& varToParse) | |||
| return dictionary; | |||
| } | |||
| static NSArray* varArrayToNSArray (const var& varToParse) | |||
| inline NSArray* varArrayToNSArray (const var& varToParse) | |||
| { | |||
| jassert (varToParse.isArray()); | |||
| @@ -145,9 +145,9 @@ static NSArray* varArrayToNSArray (const var& varToParse) | |||
| return array; | |||
| } | |||
| static var nsObjectToVar (NSObject* array); | |||
| var nsObjectToVar (NSObject* array); | |||
| static var nsDictionaryToVar (NSDictionary* dictionary) | |||
| inline var nsDictionaryToVar (NSDictionary* dictionary) | |||
| { | |||
| DynamicObject::Ptr dynamicObject (new DynamicObject()); | |||
| @@ -157,7 +157,7 @@ static var nsDictionaryToVar (NSDictionary* dictionary) | |||
| return var (dynamicObject.get()); | |||
| } | |||
| static var nsArrayToVar (NSArray* array) | |||
| inline var nsArrayToVar (NSArray* array) | |||
| { | |||
| Array<var> resultArray; | |||
| @@ -167,7 +167,7 @@ static var nsArrayToVar (NSArray* array) | |||
| return var (resultArray); | |||
| } | |||
| static var nsObjectToVar (NSObject* obj) | |||
| inline var nsObjectToVar (NSObject* obj) | |||
| { | |||
| if ([obj isKindOfClass: [NSString class]]) return nsStringToJuce ((NSString*) obj); | |||
| else if ([obj isKindOfClass: [NSNumber class]]) return nsStringToJuce ([(NSNumber*) obj stringValue]); | |||
| @@ -184,7 +184,7 @@ static var nsObjectToVar (NSObject* obj) | |||
| #if JUCE_MAC | |||
| template <typename RectangleType> | |||
| static NSRect makeNSRect (const RectangleType& r) noexcept | |||
| NSRect makeNSRect (const RectangleType& r) noexcept | |||
| { | |||
| return NSMakeRect (static_cast<CGFloat> (r.getX()), | |||
| static_cast<CGFloat> (r.getY()), | |||
| @@ -198,7 +198,7 @@ static NSRect makeNSRect (const RectangleType& r) noexcept | |||
| // depending on the argument type. The re-cast objc_msgSendSuper to a function | |||
| // take the same arguments as the target method. | |||
| template <typename ReturnValue, typename... Params> | |||
| static inline ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Params... params) | |||
| ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Params... params) | |||
| { | |||
| using SuperFn = ReturnValue (*)(struct objc_super*, SEL, Params...); | |||
| SuperFn fn = reinterpret_cast<SuperFn> (objc_msgSendSuper); | |||
| @@ -207,11 +207,11 @@ static inline ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Param | |||
| // These hacks are a workaround for newer Xcode builds which by default prevent calls to these objc functions.. | |||
| typedef id (*MsgSendSuperFn) (struct objc_super*, SEL, ...); | |||
| static inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; } | |||
| inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; } | |||
| #if ! JUCE_IOS | |||
| typedef double (*MsgSendFPRetFn) (id, SEL op, ...); | |||
| static inline MsgSendFPRetFn getMsgSendFPRetFn() noexcept { return (MsgSendFPRetFn) (void*) objc_msgSend_fpret; } | |||
| inline MsgSendFPRetFn getMsgSendFPRetFn() noexcept { return (MsgSendFPRetFn) (void*) objc_msgSend_fpret; } | |||
| #endif | |||
| #endif | |||
| @@ -1033,7 +1033,8 @@ void* DynamicLibrary::getFunction (const String& functionName) noexcept | |||
| //============================================================================== | |||
| static inline String readPosixConfigFileValue (const char* file, const char* key) | |||
| #if JUCE_LINUX || JUCE_ANDROID | |||
| static String readPosixConfigFileValue (const char* file, const char* key) | |||
| { | |||
| StringArray lines; | |||
| File (file).readLines (lines); | |||
| @@ -1044,6 +1045,7 @@ static inline String readPosixConfigFileValue (const char* file, const char* key | |||
| return {}; | |||
| } | |||
| #endif | |||
| //============================================================================== | |||
| @@ -23,7 +23,7 @@ | |||
| namespace juce | |||
| { | |||
| static inline int calcBufferStreamBufferSize (int requestedSize, InputStream* source) noexcept | |||
| static int calcBufferStreamBufferSize (int requestedSize, InputStream* source) noexcept | |||
| { | |||
| // You need to supply a real stream when creating a BufferedInputStream | |||
| jassert (source != nullptr); | |||
| @@ -182,7 +182,7 @@ public: | |||
| /** Returns the number of bytes that would be needed to represent the given | |||
| unicode character in this encoding format. | |||
| */ | |||
| static inline size_t getBytesRequiredFor (const juce_wchar) noexcept | |||
| static size_t getBytesRequiredFor (const juce_wchar) noexcept | |||
| { | |||
| return 1; | |||
| } | |||
| @@ -186,7 +186,7 @@ public: | |||
| /** Returns the number of bytes that would be needed to represent the given | |||
| unicode character in this encoding format. | |||
| */ | |||
| static inline size_t getBytesRequiredFor (juce_wchar) noexcept | |||
| static size_t getBytesRequiredFor (juce_wchar) noexcept | |||
| { | |||
| return sizeof (CharType); | |||
| } | |||
| @@ -551,7 +551,7 @@ public: | |||
| } | |||
| /** Compares two characters. */ | |||
| static inline int compare (juce_wchar char1, juce_wchar char2) noexcept | |||
| static int compare (juce_wchar char1, juce_wchar char2) noexcept | |||
| { | |||
| if (auto diff = static_cast<int> (char1) - static_cast<int> (char2)) | |||
| return diff < 0 ? -1 : 1; | |||
| @@ -596,7 +596,7 @@ public: | |||
| } | |||
| /** Compares two characters, using a case-independant match. */ | |||
| static inline int compareIgnoreCase (juce_wchar char1, juce_wchar char2) noexcept | |||
| static int compareIgnoreCase (juce_wchar char1, juce_wchar char2) noexcept | |||
| { | |||
| return char1 != char2 ? compare (toUpperCase (char1), toUpperCase (char2)) : 0; | |||
| } | |||
| @@ -39,7 +39,7 @@ NewLine newLine; | |||
| using CharPointer_wchar_t = CharPointer_UTF32; | |||
| #endif | |||
| static inline CharPointer_wchar_t castToCharPointer_wchar_t (const void* t) noexcept | |||
| static CharPointer_wchar_t castToCharPointer_wchar_t (const void* t) noexcept | |||
| { | |||
| return CharPointer_wchar_t (static_cast<const CharPointer_wchar_t::CharType*> (t)); | |||
| } | |||
| @@ -157,7 +157,7 @@ public: | |||
| ++(b->refCount); | |||
| } | |||
| static inline void release (StringHolder* const b) noexcept | |||
| static void release (StringHolder* const b) noexcept | |||
| { | |||
| if (! isEmptyString (b)) | |||
| if (--(b->refCount) == -1) | |||
| @@ -169,7 +169,7 @@ public: | |||
| release (bufferFromText (text)); | |||
| } | |||
| static inline int getReferenceCount (const CharPointerType text) noexcept | |||
| static int getReferenceCount (const CharPointerType text) noexcept | |||
| { | |||
| return bufferFromText (text)->refCount.get() + 1; | |||
| } | |||
| @@ -207,14 +207,14 @@ public: | |||
| CharType text[1]; | |||
| private: | |||
| static inline StringHolder* bufferFromText (const CharPointerType text) noexcept | |||
| static StringHolder* bufferFromText (const CharPointerType text) noexcept | |||
| { | |||
| // (Can't use offsetof() here because of warnings about this not being a POD) | |||
| return reinterpret_cast<StringHolder*> (reinterpret_cast<char*> (text.getAddress()) | |||
| - (reinterpret_cast<size_t> (reinterpret_cast<StringHolder*> (128)->text) - 128)); | |||
| } | |||
| static inline bool isEmptyString (StringHolder* other) | |||
| static bool isEmptyString (StringHolder* other) | |||
| { | |||
| return (other->refCount.get() & 0x30000000) != 0; | |||
| } | |||
| @@ -91,7 +91,7 @@ namespace TimeHelpers | |||
| : (value - ((value / modulo) + 1) * modulo)); | |||
| } | |||
| static inline String formatString (const String& format, const std::tm* const tm) | |||
| static String formatString (const String& format, const std::tm* const tm) | |||
| { | |||
| #if JUCE_ANDROID | |||
| using StringType = CharPointer_UTF8; | |||
| @@ -126,12 +126,12 @@ namespace TimeHelpers | |||
| } | |||
| //============================================================================== | |||
| static inline bool isLeapYear (int year) noexcept | |||
| static bool isLeapYear (int year) noexcept | |||
| { | |||
| return (year % 400 == 0) || ((year % 100 != 0) && (year % 4 == 0)); | |||
| } | |||
| static inline int daysFromJan1 (int year, int month) noexcept | |||
| static int daysFromJan1 (int year, int month) noexcept | |||
| { | |||
| const short dayOfYear[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, | |||
| 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }; | |||
| @@ -139,18 +139,18 @@ namespace TimeHelpers | |||
| return dayOfYear [(isLeapYear (year) ? 12 : 0) + month]; | |||
| } | |||
| static inline int64 daysFromYear0 (int year) noexcept | |||
| static int64 daysFromYear0 (int year) noexcept | |||
| { | |||
| --year; | |||
| return 365 * year + (year / 400) - (year / 100) + (year / 4); | |||
| } | |||
| static inline int64 daysFrom1970 (int year) noexcept | |||
| static int64 daysFrom1970 (int year) noexcept | |||
| { | |||
| return daysFromYear0 (year) - daysFromYear0 (1970); | |||
| } | |||
| static inline int64 daysFrom1970 (int year, int month) noexcept | |||
| static int64 daysFrom1970 (int year, int month) noexcept | |||
| { | |||
| if (month > 11) | |||
| { | |||
| @@ -169,7 +169,7 @@ namespace TimeHelpers | |||
| // There's no posix function that does a UTC version of mktime, | |||
| // so annoyingly we need to implement this manually.. | |||
| static inline int64 mktime_utc (const std::tm& t) noexcept | |||
| static int64 mktime_utc (const std::tm& t) noexcept | |||
| { | |||
| return 24 * 3600 * (daysFrom1970 (t.tm_year + 1900, t.tm_mon) + (t.tm_mday - 1)) | |||
| + 3600 * t.tm_hour | |||
| @@ -23,7 +23,7 @@ | |||
| namespace juce | |||
| { | |||
| inline static bool isValidXmlNameStartCharacter (juce_wchar character) noexcept | |||
| static bool isValidXmlNameStartCharacter (juce_wchar character) noexcept | |||
| { | |||
| return character == ':' | |||
| || character == '_' | |||
| @@ -43,7 +43,7 @@ inline static bool isValidXmlNameStartCharacter (juce_wchar character) noexcept | |||
| || (character >= 0x10000 && character <= 0xeffff); | |||
| } | |||
| inline static bool isValidXmlNameBodyCharacter (juce_wchar character) noexcept | |||
| static bool isValidXmlNameBodyCharacter (juce_wchar character) noexcept | |||
| { | |||
| return isValidXmlNameStartCharacter (character) | |||
| || character == '-' | |||
| @@ -147,12 +147,12 @@ private: | |||
| #endif | |||
| } | |||
| static inline uint32_t rotateLeft (uint32_t x, uint32_t n) noexcept { return (x << n) | (x >> (32 - n)); } | |||
| static uint32_t rotateLeft (uint32_t x, uint32_t n) noexcept { return (x << n) | (x >> (32 - n)); } | |||
| static inline uint32_t F (uint32_t x, uint32_t y, uint32_t z) noexcept { return (x & y) | (~x & z); } | |||
| static inline uint32_t G (uint32_t x, uint32_t y, uint32_t z) noexcept { return (x & z) | (y & ~z); } | |||
| static inline uint32_t H (uint32_t x, uint32_t y, uint32_t z) noexcept { return x ^ y ^ z; } | |||
| static inline uint32_t I (uint32_t x, uint32_t y, uint32_t z) noexcept { return y ^ (x | ~z); } | |||
| static uint32_t F (uint32_t x, uint32_t y, uint32_t z) noexcept { return (x & y) | (~x & z); } | |||
| static uint32_t G (uint32_t x, uint32_t y, uint32_t z) noexcept { return (x & z) | (y & ~z); } | |||
| static uint32_t H (uint32_t x, uint32_t y, uint32_t z) noexcept { return x ^ y ^ z; } | |||
| static uint32_t I (uint32_t x, uint32_t y, uint32_t z) noexcept { return y ^ (x | ~z); } | |||
| static void FF (uint32_t& a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint32_t s, uint32_t ac) noexcept | |||
| { | |||
| @@ -131,14 +131,14 @@ private: | |||
| 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; | |||
| uint64_t length = 0; | |||
| static inline uint32_t rotate (uint32_t x, uint32_t y) noexcept { return (x >> y) | (x << (32 - y)); } | |||
| static inline uint32_t ch (uint32_t x, uint32_t y, uint32_t z) noexcept { return z ^ ((y ^ z) & x); } | |||
| static inline uint32_t maj (uint32_t x, uint32_t y, uint32_t z) noexcept { return y ^ ((y ^ z) & (x ^ y)); } | |||
| static inline uint32_t s0 (uint32_t x) noexcept { return rotate (x, 7) ^ rotate (x, 18) ^ (x >> 3); } | |||
| static inline uint32_t s1 (uint32_t x) noexcept { return rotate (x, 17) ^ rotate (x, 19) ^ (x >> 10); } | |||
| static inline uint32_t S0 (uint32_t x) noexcept { return rotate (x, 2) ^ rotate (x, 13) ^ rotate (x, 22); } | |||
| static inline uint32_t S1 (uint32_t x) noexcept { return rotate (x, 6) ^ rotate (x, 11) ^ rotate (x, 25); } | |||
| static uint32_t rotate (uint32_t x, uint32_t y) noexcept { return (x >> y) | (x << (32 - y)); } | |||
| static uint32_t ch (uint32_t x, uint32_t y, uint32_t z) noexcept { return z ^ ((y ^ z) & x); } | |||
| static uint32_t maj (uint32_t x, uint32_t y, uint32_t z) noexcept { return y ^ ((y ^ z) & (x ^ y)); } | |||
| static uint32_t s0 (uint32_t x) noexcept { return rotate (x, 7) ^ rotate (x, 18) ^ (x >> 3); } | |||
| static uint32_t s1 (uint32_t x) noexcept { return rotate (x, 17) ^ rotate (x, 19) ^ (x >> 10); } | |||
| static uint32_t S0 (uint32_t x) noexcept { return rotate (x, 2) ^ rotate (x, 13) ^ rotate (x, 22); } | |||
| static uint32_t S1 (uint32_t x) noexcept { return rotate (x, 6) ^ rotate (x, 11) ^ rotate (x, 25); } | |||
| }; | |||
| //============================================================================== | |||
| @@ -119,14 +119,14 @@ struct SIMDRegister | |||
| //============================================================================== | |||
| /** Creates a new SIMDRegister from the corresponding scalar primitive. | |||
| The scalar is extended to all elements of the vector. */ | |||
| inline static SIMDRegister JUCE_VECTOR_CALLTYPE expand (ElementType s) noexcept { return {CmplxOps::expand (s)}; } | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE expand (ElementType s) noexcept { return {CmplxOps::expand (s)}; } | |||
| /** Creates a new SIMDRegister from the internal SIMD type (for example | |||
| __mm128 for single-precision floating point on SSE architectures). */ | |||
| inline static SIMDRegister JUCE_VECTOR_CALLTYPE fromNative (vSIMDType a) noexcept { return {a}; } | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE fromNative (vSIMDType a) noexcept { return {a}; } | |||
| /** Creates a new SIMDRegister from the first SIMDNumElements of a scalar array. */ | |||
| inline static SIMDRegister JUCE_VECTOR_CALLTYPE fromRawArray (const ElementType* a) noexcept | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE fromRawArray (const ElementType* a) noexcept | |||
| { | |||
| jassert (isSIMDAligned (a)); | |||
| return {CmplxOps::load (a)}; | |||
| @@ -275,43 +275,43 @@ struct SIMDRegister | |||
| /** Returns a SIMDRegister of the corresponding integral type where each element has each bit set | |||
| if the corresponding element of a is equal to the corresponding element of b, or zero otherwise. | |||
| The result can then be used in bit operations defined above to avoid branches in vector SIMD code. */ | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE equal (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::equal (a.value, b.value)); } | |||
| static vMaskType JUCE_VECTOR_CALLTYPE equal (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::equal (a.value, b.value)); } | |||
| /** Returns a SIMDRegister of the corresponding integral type where each element has each bit set | |||
| if the corresponding element of a is not equal to the corresponding element of b, or zero otherwise. | |||
| The result can then be used in bit operations defined above to avoid branches in vector SIMD code. */ | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE notEqual (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::notEqual (a.value, b.value)); } | |||
| static vMaskType JUCE_VECTOR_CALLTYPE notEqual (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::notEqual (a.value, b.value)); } | |||
| /** Returns a SIMDRegister of the corresponding integral type where each element has each bit set | |||
| if the corresponding element of a is less than to the corresponding element of b, or zero otherwise. | |||
| The result can then be used in bit operations defined above to avoid branches in vector SIMD code. */ | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE lessThan (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThan (b.value, a.value)); } | |||
| static vMaskType JUCE_VECTOR_CALLTYPE lessThan (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThan (b.value, a.value)); } | |||
| /** Returns a SIMDRegister of the corresponding integral type where each element has each bit set | |||
| if the corresponding element of a is than or equal to the corresponding element of b, or zero otherwise. | |||
| The result can then be used in bit operations defined above to avoid branches in vector SIMD code. */ | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE lessThanOrEqual (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThanOrEqual (b.value, a.value)); } | |||
| static vMaskType JUCE_VECTOR_CALLTYPE lessThanOrEqual (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThanOrEqual (b.value, a.value)); } | |||
| /** Returns a SIMDRegister of the corresponding integral type where each element has each bit set | |||
| if the corresponding element of a is greater than to the corresponding element of b, or zero otherwise. | |||
| The result can then be used in bit operations defined above to avoid branches in vector SIMD code. */ | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE greaterThan (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThan (a.value, b.value)); } | |||
| static vMaskType JUCE_VECTOR_CALLTYPE greaterThan (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThan (a.value, b.value)); } | |||
| /** Returns a SIMDRegister of the corresponding integral type where each element has each bit set | |||
| if the corresponding element of a is greater than or equal to the corresponding element of b, or zero otherwise. | |||
| The result can then be used in bit operations defined above to avoid branches in vector SIMD code. */ | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE greaterThanOrEqual (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThanOrEqual (a.value, b.value)); } | |||
| static vMaskType JUCE_VECTOR_CALLTYPE greaterThanOrEqual (SIMDRegister a, SIMDRegister b) noexcept { return toMaskType (NativeOps::greaterThanOrEqual (a.value, b.value)); } | |||
| //============================================================================== | |||
| /** Returns a new vector where each element is the minimum of the corresponding element of a and b. */ | |||
| static inline SIMDRegister JUCE_VECTOR_CALLTYPE min (SIMDRegister a, SIMDRegister b) noexcept { return { NativeOps::min (a.value, b.value) }; } | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE min (SIMDRegister a, SIMDRegister b) noexcept { return { NativeOps::min (a.value, b.value) }; } | |||
| /** Returns a new vector where each element is the maximum of the corresponding element of a and b. */ | |||
| static inline SIMDRegister JUCE_VECTOR_CALLTYPE max (SIMDRegister a, SIMDRegister b) noexcept { return { NativeOps::max (a.value, b.value) }; } | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE max (SIMDRegister a, SIMDRegister b) noexcept { return { NativeOps::max (a.value, b.value) }; } | |||
| //============================================================================== | |||
| /** Multiplies b and c and adds the result to a. */ | |||
| static inline SIMDRegister JUCE_VECTOR_CALLTYPE multiplyAdd (SIMDRegister a, const SIMDRegister b, SIMDRegister c) noexcept | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE multiplyAdd (SIMDRegister a, const SIMDRegister b, SIMDRegister c) noexcept | |||
| { | |||
| return { CmplxOps::muladd (a.value, b.value, c.value) }; | |||
| } | |||
| @@ -323,18 +323,18 @@ struct SIMDRegister | |||
| //============================================================================== | |||
| /** Truncates each element to its integer part. | |||
| Effectively discards the fractional part of each element. A.k.a. round to zero. */ | |||
| static inline SIMDRegister JUCE_VECTOR_CALLTYPE truncate (SIMDRegister a) noexcept { return { NativeOps::truncate (a.value) }; } | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE truncate (SIMDRegister a) noexcept { return { NativeOps::truncate (a.value) }; } | |||
| //============================================================================== | |||
| /** Returns the absolute value of each element. */ | |||
| static inline SIMDRegister JUCE_VECTOR_CALLTYPE abs (SIMDRegister a) noexcept | |||
| static SIMDRegister JUCE_VECTOR_CALLTYPE abs (SIMDRegister a) noexcept | |||
| { | |||
| return a - (a * (expand (ElementType (2)) & lessThan (a, expand (ElementType (0))))); | |||
| } | |||
| //============================================================================== | |||
| /** Checks if the given pointer is sufficiently aligned for using SIMD operations. */ | |||
| static inline bool isSIMDAligned (const ElementType* ptr) noexcept | |||
| static bool isSIMDAligned (const ElementType* ptr) noexcept | |||
| { | |||
| uintptr_t bitmask = SIMDRegisterSize - 1; | |||
| return (reinterpret_cast<uintptr_t> (ptr) & bitmask) == 0; | |||
| @@ -345,13 +345,13 @@ struct SIMDRegister | |||
| If the current position in memory is already aligned then this method | |||
| will simply return the pointer. | |||
| */ | |||
| static inline ElementType* getNextSIMDAlignedPtr (ElementType* ptr) noexcept | |||
| static ElementType* getNextSIMDAlignedPtr (ElementType* ptr) noexcept | |||
| { | |||
| return snapPointerToAlignment (ptr, SIMDRegisterSize); | |||
| } | |||
| private: | |||
| static inline vMaskType JUCE_VECTOR_CALLTYPE toMaskType (vSIMDType a) noexcept | |||
| static vMaskType JUCE_VECTOR_CALLTYPE toMaskType (vSIMDType a) noexcept | |||
| { | |||
| union | |||
| { | |||
| @@ -363,7 +363,7 @@ private: | |||
| return vMaskType::fromNative (u.out); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE toVecType (vMaskSIMDType a) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE toVecType (vMaskSIMDType a) noexcept | |||
| { | |||
| union | |||
| { | |||
| @@ -375,7 +375,7 @@ private: | |||
| return u.out; | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE toVecType (MaskType a) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE toVecType (MaskType a) noexcept | |||
| { | |||
| union | |||
| { | |||
| @@ -48,42 +48,42 @@ struct CmplxSIMDOps | |||
| { | |||
| using vSIMDType = typename SIMDNativeOps<Scalar>::vSIMDType; | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE load (const Scalar* a) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE load (const Scalar* a) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::load (a); | |||
| } | |||
| static inline void JUCE_VECTOR_CALLTYPE store (vSIMDType value, Scalar* dest) noexcept | |||
| static void JUCE_VECTOR_CALLTYPE store (vSIMDType value, Scalar* dest) noexcept | |||
| { | |||
| SIMDNativeOps<Scalar>::store (value, dest); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE expand (Scalar s) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE expand (Scalar s) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::expand (s); | |||
| } | |||
| static inline Scalar JUCE_VECTOR_CALLTYPE get (vSIMDType v, std::size_t i) noexcept | |||
| static Scalar JUCE_VECTOR_CALLTYPE get (vSIMDType v, std::size_t i) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::get (v, i); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE set (vSIMDType v, std::size_t i, Scalar s) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE set (vSIMDType v, std::size_t i, Scalar s) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::set (v, i, s); | |||
| } | |||
| static inline Scalar JUCE_VECTOR_CALLTYPE sum (vSIMDType a) noexcept | |||
| static Scalar JUCE_VECTOR_CALLTYPE sum (vSIMDType a) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::sum (a); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE mul (vSIMDType a, vSIMDType b) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE mul (vSIMDType a, vSIMDType b) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::mul (a, b); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE muladd (vSIMDType a, vSIMDType b, vSIMDType c) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE muladd (vSIMDType a, vSIMDType b, vSIMDType c) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::multiplyAdd (a, b, c); | |||
| } | |||
| @@ -95,17 +95,17 @@ struct CmplxSIMDOps<std::complex<Scalar>> | |||
| { | |||
| using vSIMDType = typename SIMDNativeOps<Scalar>::vSIMDType; | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE load (const std::complex<Scalar>* a) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE load (const std::complex<Scalar>* a) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::load (reinterpret_cast<const Scalar*> (a)); | |||
| } | |||
| static inline void JUCE_VECTOR_CALLTYPE store (vSIMDType value, std::complex<Scalar>* dest) noexcept | |||
| static void JUCE_VECTOR_CALLTYPE store (vSIMDType value, std::complex<Scalar>* dest) noexcept | |||
| { | |||
| SIMDNativeOps<Scalar>::store (value, reinterpret_cast<Scalar*> (dest)); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE expand (std::complex<Scalar> s) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE expand (std::complex<Scalar> s) noexcept | |||
| { | |||
| const int n = sizeof (vSIMDType) / sizeof (Scalar); | |||
| @@ -121,31 +121,31 @@ struct CmplxSIMDOps<std::complex<Scalar>> | |||
| return u.v; | |||
| } | |||
| static inline std::complex<Scalar> JUCE_VECTOR_CALLTYPE get (vSIMDType v, std::size_t i) noexcept | |||
| static std::complex<Scalar> JUCE_VECTOR_CALLTYPE get (vSIMDType v, std::size_t i) noexcept | |||
| { | |||
| auto j = i << 1; | |||
| return std::complex<Scalar> (SIMDNativeOps<Scalar>::get (v, j), SIMDNativeOps<Scalar>::get (v, j + 1)); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE set (vSIMDType v, std::size_t i, std::complex<Scalar> s) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE set (vSIMDType v, std::size_t i, std::complex<Scalar> s) noexcept | |||
| { | |||
| auto j = i << 1; | |||
| return SIMDNativeOps<Scalar>::set (SIMDNativeOps<Scalar>::set (v, j, s.real()), j + 1, s.imag()); | |||
| } | |||
| static inline std::complex<Scalar> JUCE_VECTOR_CALLTYPE sum (vSIMDType a) noexcept | |||
| static std::complex<Scalar> JUCE_VECTOR_CALLTYPE sum (vSIMDType a) noexcept | |||
| { | |||
| vSIMDType result = SIMDNativeOps<Scalar>::oddevensum (a); | |||
| auto* ptr = reinterpret_cast<const Scalar*> (&result); | |||
| return std::complex<Scalar> (ptr[0], ptr[1]); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE mul (vSIMDType a, vSIMDType b) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE mul (vSIMDType a, vSIMDType b) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::cmplxmul (a, b); | |||
| } | |||
| static inline vSIMDType JUCE_VECTOR_CALLTYPE muladd (vSIMDType a, vSIMDType b, vSIMDType c) noexcept | |||
| static vSIMDType JUCE_VECTOR_CALLTYPE muladd (vSIMDType a, vSIMDType b, vSIMDType c) noexcept | |||
| { | |||
| return SIMDNativeOps<Scalar>::add (a, SIMDNativeOps<Scalar>::cmplxmul (b, c)); | |||
| } | |||
| @@ -22,7 +22,7 @@ namespace dsp | |||
| { | |||
| template <typename FloatType> | |||
| static inline FloatType ncos (size_t order, size_t i, size_t size) noexcept | |||
| static FloatType ncos (size_t order, size_t i, size_t size) noexcept | |||
| { | |||
| return std::cos (static_cast<FloatType> (order * i) | |||
| * MathConstants<FloatType>::pi / static_cast<FloatType> (size - 1)); | |||
| @@ -157,7 +157,7 @@ public: | |||
| inline Matrix& hadarmard (const Matrix& other) noexcept { return apply (other, [] (ElementType a, ElementType b) { return a * b; } ); } | |||
| /** Does a hadarmard product with a and b returns the result. */ | |||
| static inline Matrix hadarmard (const Matrix& a, const Matrix& b) { Matrix result (a); result.hadarmard (b); return result; } | |||
| static Matrix hadarmard (const Matrix& a, const Matrix& b) { Matrix result (a); result.hadarmard (b); return result; } | |||
| //============================================================================== | |||
| /** Compare to matrices with a given tolerance */ | |||
| @@ -30,7 +30,7 @@ static const char* killMessage = "__ipc_k_"; | |||
| static const char* pingMessage = "__ipc_p_"; | |||
| enum { specialMessageSize = 8, defaultTimeoutMs = 8000 }; | |||
| static inline bool isMessageType (const MemoryBlock& mb, const char* messageType) noexcept | |||
| static bool isMessageType (const MemoryBlock& mb, const char* messageType) noexcept | |||
| { | |||
| return mb.matches (messageType, (size_t) specialMessageSize); | |||
| } | |||
| @@ -136,7 +136,7 @@ public: | |||
| callTimers(); | |||
| } | |||
| static inline void add (Timer* tim) noexcept | |||
| static void add (Timer* tim) noexcept | |||
| { | |||
| if (instance == nullptr) | |||
| instance = new TimerThread(); | |||
| @@ -144,13 +144,13 @@ public: | |||
| instance->addTimer (tim); | |||
| } | |||
| static inline void remove (Timer* tim) noexcept | |||
| static void remove (Timer* tim) noexcept | |||
| { | |||
| if (instance != nullptr) | |||
| instance->removeTimer (tim); | |||
| } | |||
| static inline void resetCounter (Timer* tim) noexcept | |||
| static void resetCounter (Timer* tim) noexcept | |||
| { | |||
| if (instance != nullptr) | |||
| instance->resetTimerCounter (tim); | |||
| @@ -19,7 +19,7 @@ | |||
| namespace juce | |||
| { | |||
| static inline void blurDataTriplets (uint8* d, int num, const int delta) noexcept | |||
| static void blurDataTriplets (uint8* d, int num, const int delta) noexcept | |||
| { | |||
| uint32 last = d[0]; | |||
| d[0] = (uint8) ((d[0] + d[delta] + 1) / 3); | |||
| @@ -33,7 +33,7 @@ PositionedGlyph::PositionedGlyph (const Font& font_, juce_wchar character_, int | |||
| PositionedGlyph::~PositionedGlyph() {} | |||
| static inline void drawGlyphWithFont (Graphics& g, int glyph, const Font& font, AffineTransform t) | |||
| static void drawGlyphWithFont (Graphics& g, int glyph, const Font& font, AffineTransform t) | |||
| { | |||
| auto& context = g.getInternalContext(); | |||
| context.setFont (font); | |||
| @@ -536,7 +536,7 @@ void GlyphArrangement::spreadOutLine (int start, int num, float targetWidth) | |||
| } | |||
| } | |||
| static inline bool isBreakableGlyph (const PositionedGlyph& g) noexcept | |||
| static bool isBreakableGlyph (const PositionedGlyph& g) noexcept | |||
| { | |||
| return g.isWhitespace() || g.getCharacter() == '-'; | |||
| } | |||
| @@ -60,7 +60,7 @@ const float Path::closeSubPathMarker = 100005.0f; | |||
| const float Path::defaultToleranceForTesting = 1.0f; | |||
| const float Path::defaultToleranceForMeasurement = 0.6f; | |||
| static inline bool isMarker (float value, float marker) noexcept | |||
| static bool isMarker (float value, float marker) noexcept | |||
| { | |||
| return value == marker; | |||
| } | |||
| @@ -278,7 +278,7 @@ struct Component::ComponentHelpers | |||
| } | |||
| //============================================================================== | |||
| static inline bool hitTest (Component& comp, Point<int> localPoint) | |||
| static bool hitTest (Component& comp, Point<int> localPoint) | |||
| { | |||
| return isPositiveAndBelow (localPoint.x, comp.getWidth()) | |||
| && isPositiveAndBelow (localPoint.y, comp.getHeight()) | |||
| @@ -396,7 +396,7 @@ static void setDPIAwareness() | |||
| setProcessDPIAware(); | |||
| } | |||
| static inline bool isPerMonitorDPIAwareProcess() | |||
| static bool isPerMonitorDPIAwareProcess() | |||
| { | |||
| #if JUCE_WIN_PER_MONITOR_DPI_AWARE | |||
| static bool dpiAware = []() -> bool | |||
| @@ -418,7 +418,7 @@ static inline bool isPerMonitorDPIAwareProcess() | |||
| #endif | |||
| } | |||
| static inline bool isPerMonitorDPIAwareWindow (HWND h) | |||
| static bool isPerMonitorDPIAwareWindow (HWND h) | |||
| { | |||
| #if JUCE_WIN_PER_MONITOR_DPI_AWARE | |||
| jassert (h != nullptr); | |||
| @@ -435,7 +435,7 @@ static inline bool isPerMonitorDPIAwareWindow (HWND h) | |||
| #endif | |||
| } | |||
| static inline bool isPerMonitorDPIAwareThread() | |||
| static bool isPerMonitorDPIAwareThread() | |||
| { | |||
| #if JUCE_WIN_PER_MONITOR_DPI_AWARE | |||
| setDPIAwareness(); | |||
| @@ -743,7 +743,7 @@ bool CodeDocument::hasChangedSinceSavePoint() const noexcept | |||
| } | |||
| //============================================================================== | |||
| static inline int getCharacterType (juce_wchar character) noexcept | |||
| static int getCharacterType (juce_wchar character) noexcept | |||
| { | |||
| return (CharacterFunctions::isLetterOrDigit (character) || character == '_') | |||
| ? 2 : (CharacterFunctions::isWhitespace (character) ? 0 : 1); | |||
| @@ -175,7 +175,7 @@ namespace ActiveXHelpers | |||
| //============================================================================== | |||
| static Array<ActiveXControlComponent*> activeXComps; | |||
| static inline HWND getHWND (const ActiveXControlComponent* const component) | |||
| static HWND getHWND (const ActiveXControlComponent* const component) | |||
| { | |||
| HWND hwnd = {}; | |||
| const IID iid = __uuidof (IOleWindow); | |||
| @@ -189,7 +189,7 @@ namespace ActiveXHelpers | |||
| return hwnd; | |||
| } | |||
| static inline void offerActiveXMouseEventToPeer (ComponentPeer* peer, HWND hwnd, UINT message, LPARAM lParam) | |||
| static void offerActiveXMouseEventToPeer (ComponentPeer* peer, HWND hwnd, UINT message, LPARAM lParam) | |||
| { | |||
| switch (message) | |||
| { | |||
| @@ -129,19 +129,19 @@ struct OpenGLExtensionFunctions | |||
| //============================================================================== | |||
| #else | |||
| #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) inline static returnType name params noexcept { return ::name callparams; } | |||
| #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept { return ::name callparams; } | |||
| JUCE_GL_BASE_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION) | |||
| #ifndef GL3_PROTOTYPES | |||
| #undef JUCE_DECLARE_GL_FUNCTION | |||
| #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) inline static returnType name params noexcept { return ::name ## EXT callparams; } | |||
| #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept { return ::name ## EXT callparams; } | |||
| #endif | |||
| JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION) | |||
| #if JUCE_OPENGL3 | |||
| #ifndef GL3_PROTOTYPES | |||
| #undef JUCE_DECLARE_GL_FUNCTION | |||
| #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) inline static returnType name params noexcept { return ::name ## APPLE callparams; } | |||
| #define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) static returnType name params noexcept { return ::name ## APPLE callparams; } | |||
| #endif | |||
| JUCE_GL_VERTEXBUFFER_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION) | |||
| #endif | |||
| @@ -75,7 +75,7 @@ public: | |||
| unlocker MyGreatApp Joe_Bloggs joebloggs@foobar.com 1234abcd,95432ff 22d9aec92d986dd1,923ad49e9e7ff294c | |||
| */ | |||
| static inline int keyGenerationAppMain (int argc, char* argv[]) | |||
| static int keyGenerationAppMain (int argc, char* argv[]) | |||
| { | |||
| StringArray args; | |||
| for (int i = 1; i < argc; ++i) | |||