diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index f5b0b9a60b..2029bc827c 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -37,7 +37,7 @@ const char* const AiffAudioFormat::appleKey = "apple key"; //============================================================================== namespace AiffFileHelpers { - inline int chunkName (const char* const name) { return (int) ByteOrder::littleEndianInt (name); } + inline int chunkName (const char* name) noexcept { return (int) ByteOrder::littleEndianInt (name); } #if JUCE_MSVC #pragma pack (push, 1) diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index fb19e8b6e5..798a662344 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -62,7 +62,7 @@ namespace AudioUnitFormatHelpers static ThreadLocalValue insideCallback; #endif - String osTypeToString (OSType type) + String osTypeToString (OSType type) noexcept { const juce_wchar s[4] = { (juce_wchar) ((type >> 24) & 0xff), (juce_wchar) ((type >> 16) & 0xff), @@ -88,9 +88,6 @@ namespace AudioUnitFormatHelpers String createPluginIdentifier (const AudioComponentDescription& desc) { - jassert (osTypeToString ('abcd') == "abcd"); // agh, must have got the endianness wrong.. - jassert (stringToOSType ("abcd") == (OSType) 'abcd'); // ditto - String s (auIdentifierPrefix); if (desc.componentType == kAudioUnitType_MusicDevice) @@ -215,9 +212,11 @@ namespace AudioUnitFormatHelpers const short resFileId = CFBundleOpenBundleResourceMap (bundleRef); UseResFile (resFileId); - for (ResourceIndex i = 1; i <= Count1Resources ('thng'); ++i) + const OSType thngType = stringToOSType ("thng"); + + for (ResourceIndex i = 1; i <= Count1Resources (thngType); ++i) { - if (Handle h = Get1IndResource ('thng', i)) + if (Handle h = Get1IndResource (thngType, i)) { HLock (h); const uint32* const types = (const uint32*) *h; diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 787a32a114..c09d26fdf3 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -29,13 +29,6 @@ #include "../../juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h" #endif -#if JUCE_MAC - static bool makeFSRefFromPath (FSRef* destFSRef, const String& path) - { - return FSPathMakeRef (reinterpret_cast (path.toRawUTF8()), destFSRef, 0) == noErr; - } -#endif - //============================================================================== #undef PRAGMA_ALIGN_SUPPORTED #define VST_FORCE_DEPRECATED 0 @@ -84,74 +77,68 @@ #endif //============================================================================== -const int fxbVersionNum = 1; - -struct fxProgram -{ - VstInt32 chunkMagic; // 'CcnK' - VstInt32 byteSize; // of this chunk, excl. magic + byteSize - VstInt32 fxMagic; // 'FxCk' - VstInt32 version; - VstInt32 fxID; // fx unique id - VstInt32 fxVersion; - VstInt32 numParams; - char prgName[28]; - float params[1]; // variable no. of parameters -}; - -struct fxSet -{ - VstInt32 chunkMagic; // 'CcnK' - VstInt32 byteSize; // of this chunk, excl. magic + byteSize - VstInt32 fxMagic; // 'FxBk' - VstInt32 version; - VstInt32 fxID; // fx unique id - VstInt32 fxVersion; - VstInt32 numPrograms; - char future[128]; - fxProgram programs[1]; // variable no. of programs -}; - -struct fxChunkSet -{ - VstInt32 chunkMagic; // 'CcnK' - VstInt32 byteSize; // of this chunk, excl. magic + byteSize - VstInt32 fxMagic; // 'FxCh', 'FPCh', or 'FBCh' - VstInt32 version; - VstInt32 fxID; // fx unique id - VstInt32 fxVersion; - VstInt32 numPrograms; - char future[128]; - VstInt32 chunkSize; - char chunk[8]; // variable -}; - -struct fxProgramSet -{ - VstInt32 chunkMagic; // 'CcnK' - VstInt32 byteSize; // of this chunk, excl. magic + byteSize - VstInt32 fxMagic; // 'FxCh', 'FPCh', or 'FBCh' - VstInt32 version; - VstInt32 fxID; // fx unique id - VstInt32 fxVersion; - VstInt32 numPrograms; - char name[28]; - VstInt32 chunkSize; - char chunk[8]; // variable -}; - namespace { - VstInt32 vst_swap (const VstInt32 x) noexcept - { - #ifdef JUCE_LITTLE_ENDIAN - return (VstInt32) ByteOrder::swap ((uint32) x); - #else - return x; - #endif - } + const int fxbVersionNum = 1; - float vst_swapFloat (const float x) noexcept + struct fxProgram + { + VstInt32 chunkMagic; // 'CcnK' + VstInt32 byteSize; // of this chunk, excl. magic + byteSize + VstInt32 fxMagic; // 'FxCk' + VstInt32 version; + VstInt32 fxID; // fx unique id + VstInt32 fxVersion; + VstInt32 numParams; + char prgName[28]; + float params[1]; // variable no. of parameters + }; + + struct fxSet + { + VstInt32 chunkMagic; // 'CcnK' + VstInt32 byteSize; // of this chunk, excl. magic + byteSize + VstInt32 fxMagic; // 'FxBk' + VstInt32 version; + VstInt32 fxID; // fx unique id + VstInt32 fxVersion; + VstInt32 numPrograms; + char future[128]; + fxProgram programs[1]; // variable no. of programs + }; + + struct fxChunkSet + { + VstInt32 chunkMagic; // 'CcnK' + VstInt32 byteSize; // of this chunk, excl. magic + byteSize + VstInt32 fxMagic; // 'FxCh', 'FPCh', or 'FBCh' + VstInt32 version; + VstInt32 fxID; // fx unique id + VstInt32 fxVersion; + VstInt32 numPrograms; + char future[128]; + VstInt32 chunkSize; + char chunk[8]; // variable + }; + + struct fxProgramSet + { + VstInt32 chunkMagic; // 'CcnK' + VstInt32 byteSize; // of this chunk, excl. magic + byteSize + VstInt32 fxMagic; // 'FxCh', 'FPCh', or 'FBCh' + VstInt32 version; + VstInt32 fxID; // fx unique id + VstInt32 fxVersion; + VstInt32 numPrograms; + char name[28]; + VstInt32 chunkSize; + char chunk[8]; // variable + }; + + static VstInt32 fxbName (const char* name) noexcept { return (VstInt32) ByteOrder::bigEndianInt (name); } + static VstInt32 fxbSwap (const VstInt32 x) noexcept { return (VstInt32) ByteOrder::swapIfLittleEndian ((uint32) x); } + + static float fxbSwapFloat (const float x) noexcept { #ifdef JUCE_LITTLE_ENDIAN union { uint32 asInt; float asFloat; } n; @@ -162,8 +149,12 @@ namespace return x; #endif } +} - double getVSTHostTimeNanoseconds() +//============================================================================== +namespace +{ + static double getVSTHostTimeNanoseconds() noexcept { #if JUCE_WINDOWS return timeGetTime() * 1000000.0; @@ -177,40 +168,52 @@ namespace return micro.lo * 1000.0; #endif } + + static int shellUIDToCreate = 0; + static int insideVSTCallback = 0; + + struct IdleCallRecursionPreventer + { + IdleCallRecursionPreventer() : isMessageThread (MessageManager::getInstance()->isThisTheMessageThread()) + { + if (isMessageThread) + ++insideVSTCallback; + } + + ~IdleCallRecursionPreventer() + { + if (isMessageThread) + --insideVSTCallback; + } + + const bool isMessageThread; + JUCE_DECLARE_NON_COPYABLE (IdleCallRecursionPreventer) + }; + + #if JUCE_MAC + static bool makeFSRefFromPath (FSRef* destFSRef, const String& path) + { + return FSPathMakeRef (reinterpret_cast (path.toRawUTF8()), destFSRef, 0) == noErr; + } + #endif + + #if JUCE_MAC && JUCE_PPC + static void* newCFMFromMachO (void* const machofp) noexcept + { + void* result = (void*) new char[8]; + + ((void**) result)[0] = machofp; + ((void**) result)[1] = result; + + return result; + } + #endif } //============================================================================== typedef AEffect* (VSTCALLBACK *MainCall) (audioMasterCallback); - static VstIntPtr VSTCALLBACK audioMaster (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); -static int shellUIDToCreate = 0; -static int insideVSTCallback = 0; - -class IdleCallRecursionPreventer -{ -public: - IdleCallRecursionPreventer() - : isMessageThread (MessageManager::getInstance()->isThisTheMessageThread()) - { - if (isMessageThread) - ++insideVSTCallback; - } - - ~IdleCallRecursionPreventer() - { - if (isMessageThread) - --insideVSTCallback; - } - -private: - const bool isMessageThread; - - JUCE_DECLARE_NON_COPYABLE (IdleCallRecursionPreventer) -}; - -class VSTPluginWindow; - //============================================================================== // Change this to disable logging of various VST activities #ifndef VST_LOGGING @@ -223,27 +226,12 @@ class VSTPluginWindow; #define JUCE_VST_LOG(a) #endif -//============================================================================== -#if JUCE_MAC && JUCE_PPC -static void* NewCFMFromMachO (void* const machofp) noexcept -{ - void* result = (void*) new char[8]; - - ((void**) result)[0] = machofp; - ((void**) result)[1] = result; - - return result; -} -#endif - //============================================================================== #if JUCE_LINUX extern Display* display; extern XContext windowHandleXContext; -typedef void (*EventProcPtr) (XEvent* ev); - namespace { static bool xErrorTriggered = false; @@ -254,6 +242,8 @@ namespace return 0; } + typedef void (*EventProcPtr) (XEvent* ev); + static EventProcPtr getPropertyFromXWindow (Window handle, Atom atom) { XErrorHandler oldErrorHandler = XSetErrorHandler (temporaryErrorHandler); @@ -269,8 +259,7 @@ namespace XSetErrorHandler (oldErrorHandler); - return (userCount == 1 && ! xErrorTriggered) ? *reinterpret_cast (data) - : 0; + return (userCount == 1 && ! xErrorTriggered) ? *reinterpret_cast (data) : nullptr; } Window getChildWindow (Window windowToCheck) @@ -279,12 +268,7 @@ namespace Window* childWindows; unsigned int numChildren = 0; - XQueryTree (display, - windowToCheck, - &rootWindow, - &parentWindow, - &childWindows, - &numChildren); + XQueryTree (display, windowToCheck, &rootWindow, &parentWindow, &childWindows, &numChildren); if (numChildren > 0) return childWindows [0]; @@ -354,9 +338,9 @@ public: typedef ReferenceCountedObjectPtr Ptr; - static Array & getActiveModules() + static Array& getActiveModules() { - static Array activeModules; + static Array activeModules; return activeModules; } @@ -470,7 +454,7 @@ public: { if (HGLOBAL hGlob = LoadResource (dllModule, res)) { - const char* data = static_cast (LockResource (hGlob)); + const char* data = static_cast (LockResource (hGlob)); return String::fromUTF8 (data, SizeofResource (dllModule, res)); } } @@ -552,7 +536,7 @@ public: } } } -#if JUCE_PPC + #if JUCE_PPC else { FSRef fn; @@ -605,7 +589,7 @@ public: } } } -#endif + #endif return ok; } @@ -683,7 +667,7 @@ public: static void disposeMachOFromCFM (void* ptr) { - delete[] static_cast (ptr); + delete[] static_cast (ptr); } void coerceAEffectFunctionCalls (AEffect* eff) @@ -715,11 +699,11 @@ class VSTPluginInstance : public AudioPluginInstance, private AsyncUpdater { public: - VSTPluginInstance (const ModuleHandle::Ptr& module_) + VSTPluginInstance (const ModuleHandle::Ptr& mh) : effect (nullptr), - module (module_), + module (mh), usesCocoaNSView (false), - name (module_->pluginName), + name (mh->pluginName), wantsMidiMessages (false), initialised (false), isPowerOn (false), @@ -741,7 +725,7 @@ public: { static void* audioMasterCoerced = nullptr; if (audioMasterCoerced == nullptr) - audioMasterCoerced = NewCFMFromMachO ((void*) &audioMaster); + audioMasterCoerced = newCFMFromMachO ((void*) &audioMaster); effect = module->moduleMain ((audioMasterCallback) audioMasterCoerced); } @@ -1146,8 +1130,7 @@ public: bool isValidChannel (int index, bool isInput) const { - return isInput ? (index < getNumInputChannels()) - : (index < getNumOutputChannels()); + return isPositiveAndBelow (index, isInput ? getNumInputChannels() : getNumOutputChannels()); } //============================================================================== @@ -1449,20 +1432,20 @@ public: const fxSet* const set = (const fxSet*) data; - if ((vst_swap (set->chunkMagic) != 'CcnK' && vst_swap (set->chunkMagic) != 'KncC') - || vst_swap (set->version) > fxbVersionNum) + if ((set->chunkMagic != fxbName ("CcnK") && set->chunkMagic != fxbName ("KncC")) + || fxbSwap (set->version) > fxbVersionNum) return false; - if (vst_swap (set->fxMagic) == 'FxBk') + if (set->fxMagic == fxbName ("FxBk")) { // bank of programs - if (vst_swap (set->numPrograms) >= 0) + if (fxbSwap (set->numPrograms) >= 0) { const int oldProg = getCurrentProgram(); - const int numParams = vst_swap (((const fxProgram*) (set->programs))->numParams); + const int numParams = fxbSwap (((const fxProgram*) (set->programs))->numParams); const int progLen = sizeof (fxProgram) + (numParams - 1) * sizeof (float); - for (int i = 0; i < vst_swap (set->numPrograms); ++i) + for (int i = 0; i < fxbSwap (set->numPrograms); ++i) { if (i != oldProg) { @@ -1470,7 +1453,7 @@ public: if (((const char*) prog) - ((const char*) set) >= (ssize_t) dataSize) return false; - if (vst_swap (set->numPrograms) > 0) + if (fxbSwap (set->numPrograms) > 0) setCurrentProgram (i); if (! restoreProgramSettings (prog)) @@ -1478,7 +1461,7 @@ public: } } - if (vst_swap (set->numPrograms) > 0) + if (fxbSwap (set->numPrograms) > 0) setCurrentProgram (oldProg); const fxProgram* const prog = (const fxProgram*) (((const char*) (set->programs)) + oldProg * progLen); @@ -1489,38 +1472,38 @@ public: return false; } } - else if (vst_swap (set->fxMagic) == 'FxCk') + else if (set->fxMagic == fxbName ("FxCk")) { // single program const fxProgram* const prog = (const fxProgram*) data; - if (vst_swap (prog->chunkMagic) != 'CcnK') + if (prog->chunkMagic != fxbName ("CcnK")) return false; changeProgramName (getCurrentProgram(), prog->prgName); - for (int i = 0; i < vst_swap (prog->numParams); ++i) - setParameter (i, vst_swapFloat (prog->params[i])); + for (int i = 0; i < fxbSwap (prog->numParams); ++i) + setParameter (i, fxbSwapFloat (prog->params[i])); } - else if (vst_swap (set->fxMagic) == 'FBCh' || vst_swap (set->fxMagic) == 'hCBF') + else if (set->fxMagic == fxbName ("FBCh") || set->fxMagic == fxbName ("hCBF")) { // non-preset chunk const fxChunkSet* const cset = (const fxChunkSet*) data; - if (vst_swap (cset->chunkSize) + sizeof (fxChunkSet) - 8 > (unsigned int) dataSize) + if (fxbSwap (cset->chunkSize) + sizeof (fxChunkSet) - 8 > (unsigned int) dataSize) return false; - setChunkData (cset->chunk, vst_swap (cset->chunkSize), false); + setChunkData (cset->chunk, fxbSwap (cset->chunkSize), false); } - else if (vst_swap (set->fxMagic) == 'FPCh' || vst_swap (set->fxMagic) == 'hCPF') + else if (set->fxMagic == fxbName ("FPCh") || set->fxMagic == fxbName ("hCPF")) { // preset chunk const fxProgramSet* const cset = (const fxProgramSet*) data; - if (vst_swap (cset->chunkSize) + sizeof (fxProgramSet) - 8 > (unsigned int) dataSize) + if (fxbSwap (cset->chunkSize) + sizeof (fxProgramSet) - 8 > (unsigned int) dataSize) return false; - setChunkData (cset->chunk, vst_swap (cset->chunkSize), true); + setChunkData (cset->chunk, fxbSwap (cset->chunkSize), true); changeProgramName (getCurrentProgram(), cset->name); } @@ -1548,14 +1531,14 @@ public: dest.setSize (totalLen, true); fxChunkSet* const set = (fxChunkSet*) dest.getData(); - set->chunkMagic = vst_swap ('CcnK'); + set->chunkMagic = fxbName ("CcnK"); set->byteSize = 0; - set->fxMagic = vst_swap ('FBCh'); - set->version = vst_swap (fxbVersionNum); - set->fxID = vst_swap (getUID()); - set->fxVersion = vst_swap (getVersionNumber()); - set->numPrograms = vst_swap (numPrograms); - set->chunkSize = vst_swap ((VstInt32) chunk.getSize()); + set->fxMagic = fxbName ("FBCh"); + set->version = fxbSwap (fxbVersionNum); + set->fxID = fxbSwap (getUID()); + set->fxVersion = fxbSwap (getVersionNumber()); + set->numPrograms = fxbSwap (numPrograms); + set->chunkSize = fxbSwap ((VstInt32) chunk.getSize()); chunk.copyTo (set->chunk, 0, chunk.getSize()); } @@ -1565,14 +1548,14 @@ public: dest.setSize (totalLen, true); fxProgramSet* const set = (fxProgramSet*) dest.getData(); - set->chunkMagic = vst_swap ('CcnK'); + set->chunkMagic = fxbName ("CcnK"); set->byteSize = 0; - set->fxMagic = vst_swap ('FPCh'); - set->version = vst_swap (fxbVersionNum); - set->fxID = vst_swap (getUID()); - set->fxVersion = vst_swap (getVersionNumber()); - set->numPrograms = vst_swap (numPrograms); - set->chunkSize = vst_swap ((VstInt32) chunk.getSize()); + set->fxMagic = fxbName ("FPCh"); + set->version = fxbSwap (fxbVersionNum); + set->fxID = fxbSwap (getUID()); + set->fxVersion = fxbSwap (getVersionNumber()); + set->numPrograms = fxbSwap (numPrograms); + set->chunkSize = fxbSwap ((VstInt32) chunk.getSize()); getCurrentProgramName().copyToUTF8 (set->name, sizeof (set->name) - 1); chunk.copyTo (set->chunk, 0, chunk.getSize()); @@ -1587,13 +1570,13 @@ public: dest.setSize (len, true); fxSet* const set = (fxSet*) dest.getData(); - set->chunkMagic = vst_swap ('CcnK'); + set->chunkMagic = fxbName ("CcnK"); set->byteSize = 0; - set->fxMagic = vst_swap ('FxBk'); - set->version = vst_swap (fxbVersionNum); - set->fxID = vst_swap (getUID()); - set->fxVersion = vst_swap (getVersionNumber()); - set->numPrograms = vst_swap (numPrograms); + set->fxMagic = fxbName ("FxBk"); + set->version = fxbSwap (fxbVersionNum); + set->fxID = fxbSwap (getUID()); + set->fxVersion = fxbSwap (getVersionNumber()); + set->numPrograms = fxbSwap (numPrograms); const int oldProgram = getCurrentProgram(); MemoryBlock oldSettings; @@ -1688,12 +1671,12 @@ private: bool restoreProgramSettings (const fxProgram* const prog) { - if (vst_swap (prog->chunkMagic) == 'CcnK' && vst_swap (prog->fxMagic) == 'FxCk') + if (prog->chunkMagic == fxbName ("CcnK") && prog->fxMagic == fxbName ("FxCk")) { changeProgramName (getCurrentProgram(), prog->prgName); - for (int i = 0; i < vst_swap (prog->numParams); ++i) - setParameter (i, vst_swapFloat (prog->params[i])); + for (int i = 0; i < fxbSwap (prog->numParams); ++i) + setParameter (i, fxbSwapFloat (prog->params[i])); return true; } @@ -1742,18 +1725,18 @@ private: { const int numParams = getNumParameters(); - prog->chunkMagic = vst_swap ('CcnK'); + prog->chunkMagic = fxbName ("CcnK"); prog->byteSize = 0; - prog->fxMagic = vst_swap ('FxCk'); - prog->version = vst_swap (fxbVersionNum); - prog->fxID = vst_swap (getUID()); - prog->fxVersion = vst_swap (getVersionNumber()); - prog->numParams = vst_swap (numParams); + prog->fxMagic = fxbName ("FxCk"); + prog->version = fxbSwap (fxbVersionNum); + prog->fxID = fxbSwap (getUID()); + prog->fxVersion = fxbSwap (getVersionNumber()); + prog->numParams = fxbSwap (numParams); getCurrentProgramName().copyToUTF8 (prog->prgName, sizeof (prog->prgName) - 1); for (int i = 0; i < numParams; ++i) - prog->params[i] = vst_swapFloat (getParameter (i)); + prog->params[i] = fxbSwapFloat (getParameter (i)); } void updateStoredProgramNames() @@ -1895,7 +1878,8 @@ private: }; //============================================================================== -static Array activeVSTWindows; +class VSTPluginWindow; +static Array activeVSTWindows; //============================================================================== class VSTPluginWindow : public AudioProcessorEditor, @@ -2845,7 +2829,7 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch() const XmlElement* VSTPluginFormat::getVSTXML (AudioPluginInstance* plugin) { - if (VSTPluginInstance* const vst = dynamic_cast (plugin)) + if (VSTPluginInstance* const vst = dynamic_cast (plugin)) if (vst->module != nullptr) return vst->module->vstXml.get(); @@ -2854,7 +2838,7 @@ const XmlElement* VSTPluginFormat::getVSTXML (AudioPluginInstance* plugin) bool VSTPluginFormat::loadFromFXBFile (AudioPluginInstance* plugin, const void* data, size_t dataSize) { - if (VSTPluginInstance* vst = dynamic_cast (plugin)) + if (VSTPluginInstance* vst = dynamic_cast (plugin)) return vst->loadFromFXBFile (data, dataSize); return false; @@ -2862,7 +2846,7 @@ bool VSTPluginFormat::loadFromFXBFile (AudioPluginInstance* plugin, const void* bool VSTPluginFormat::saveToFXBFile (AudioPluginInstance* plugin, MemoryBlock& dest, bool asFXB) { - if (VSTPluginInstance* vst = dynamic_cast (plugin)) + if (VSTPluginInstance* vst = dynamic_cast (plugin)) return vst->saveToFXBFile (dest, asFXB); return false; @@ -2870,7 +2854,7 @@ bool VSTPluginFormat::saveToFXBFile (AudioPluginInstance* plugin, MemoryBlock& d bool VSTPluginFormat::getChunkData (AudioPluginInstance* plugin, MemoryBlock& result, bool isPreset) { - if (VSTPluginInstance* vst = dynamic_cast (plugin)) + if (VSTPluginInstance* vst = dynamic_cast (plugin)) return vst->getChunkData (result, isPreset, 128); return false; @@ -2878,7 +2862,7 @@ bool VSTPluginFormat::getChunkData (AudioPluginInstance* plugin, MemoryBlock& re bool VSTPluginFormat::setChunkData (AudioPluginInstance* plugin, const void* data, int size, bool isPreset) { - if (VSTPluginInstance* vst = dynamic_cast (plugin)) + if (VSTPluginInstance* vst = dynamic_cast (plugin)) return vst->setChunkData (data, size, isPreset); return false; @@ -2888,13 +2872,13 @@ void VSTPluginFormat::setExtraFunctions (AudioPluginInstance* plugin, ExtraFunct { ScopedPointer f (functions); - if (VSTPluginInstance* vst = dynamic_cast (plugin)) + if (VSTPluginInstance* vst = dynamic_cast (plugin)) vst->extraFunctions = f; } VSTPluginFormat::VstIntPtr JUCE_CALLTYPE VSTPluginFormat::dispatcher (AudioPluginInstance* plugin, int32 opcode, int32 index, VstIntPtr value, void* ptr, float opt) { - if (VSTPluginInstance* vst = dynamic_cast (plugin)) + if (VSTPluginInstance* vst = dynamic_cast (plugin)) return vst->dispatch (opcode, index, value, ptr, opt); return 0; diff --git a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp index 74f797d810..f008cd133c 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp +++ b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp @@ -31,7 +31,7 @@ struct InterprocessConnection::ConnectionThread : public Thread private: InterprocessConnection& owner; - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ConnectionThread); + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ConnectionThread) }; //==============================================================================