From 98ebfdc1fab08ce7103361cf837a91afe2d56651 Mon Sep 17 00:00:00 2001 From: hogliux Date: Fri, 4 Sep 2015 13:16:52 +0100 Subject: [PATCH] Fix some warnings in the VST/VST3 wrappers --- .../VST/juce_VST_Wrapper.cpp | 30 ++++++++--------- .../VST/juce_VST_Wrapper.mm | 32 +++++++++---------- .../VST3/juce_VST3_Wrapper.cpp | 16 +++++----- .../VST3/juce_VST3_Wrapper.mm | 18 +++++------ .../format_types/juce_VST3Common.h | 12 +++---- .../format_types/juce_VST3Headers.h | 1 + 6 files changed, 55 insertions(+), 54 deletions(-) diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index 3302e983b0..39b21667a8 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -122,14 +122,14 @@ static juce::uint32 lastMasterIdleCall = 0; namespace juce { #if JUCE_MAC - extern void initialiseMac(); - extern void* attachComponentToWindowRef (Component*, void* parent, bool isNSView); - extern void detachComponentFromWindowRef (Component*, void* window, bool isNSView); - extern void setNativeHostWindowSize (void* window, Component*, int newWidth, int newHeight, bool isNSView); - extern void checkWindowVisibility (void* window, Component*, bool isNSView); - extern bool forwardCurrentKeyEventToHost (Component*, bool isNSView); + extern void initialiseMacVST(); + extern void* attachComponentToWindowRefVST (Component*, void* parent, bool isNSView); + extern void detachComponentFromWindowRefVST (Component*, void* window, bool isNSView); + extern void setNativeHostWindowSizeVST (void* window, Component*, int newWidth, int newHeight, bool isNSView); + extern void checkWindowVisibilityVST (void* window, Component*, bool isNSView); + extern bool forwardCurrentKeyEventToHostVST (Component*, bool isNSView); #if ! JUCE_64BIT - extern void updateEditorCompBounds (Component*); + extern void updateEditorCompBoundsVST (Component*); #endif #endif @@ -1053,7 +1053,7 @@ public: #if JUCE_MAC if (hostWindow != 0) - checkWindowVisibility (hostWindow, editorComp, useNSView); + checkWindowVisibilityVST (hostWindow, editorComp, useNSView); #endif tryMasterIdle(); @@ -1147,7 +1147,7 @@ public: #if JUCE_MAC if (hostWindow != 0) { - detachComponentFromWindowRef (editorComp, hostWindow, useNSView); + detachComponentFromWindowRefVST (editorComp, hostWindow, useNSView); hostWindow = 0; } #endif @@ -1204,7 +1204,7 @@ public: Window editorWnd = (Window) editorComp->getWindowHandle(); XReparentWindow (display, editorWnd, hostWindow, 0, 0); #else - hostWindow = attachComponentToWindowRef (editorComp, ptr, useNSView); + hostWindow = attachComponentToWindowRefVST (editorComp, ptr, useNSView); #endif editorComp->setVisible (true); @@ -1259,7 +1259,7 @@ public: { // some hosts don't support the sizeWindow call, so do it manually.. #if JUCE_MAC - setNativeHostWindowSize (hostWindow, editorComp, newWidth, newHeight, useNSView); + setNativeHostWindowSizeVST (hostWindow, editorComp, newWidth, newHeight, useNSView); #elif JUCE_LINUX // (Currently, all linux hosts support sizeWindow, so this should never need to happen) @@ -1363,7 +1363,7 @@ public: { // If we have an unused keypress, move the key-focus to a host window // and re-inject the event.. - return forwardCurrentKeyEventToHost (this, wrapper.useNSView); + return forwardCurrentKeyEventToHostVST (this, wrapper.useNSView); } #endif @@ -1379,7 +1379,7 @@ public: #if JUCE_MAC && ! JUCE_64BIT if (! wrapper.useNSView) - updateEditorCompBounds (this); + updateEditorCompBoundsVST (this); #endif } @@ -1572,14 +1572,14 @@ namespace JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster); JUCE_EXPORTED_FUNCTION AEffect* VSTPluginMain (audioMasterCallback audioMaster) { - initialiseMac(); + initialiseMacVST(); return pluginEntryPoint (audioMaster); } JUCE_EXPORTED_FUNCTION AEffect* main_macho (audioMasterCallback audioMaster); JUCE_EXPORTED_FUNCTION AEffect* main_macho (audioMasterCallback audioMaster) { - initialiseMac(); + initialiseMacVST(); return pluginEntryPoint (audioMaster); } diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm index 065ff6d677..f1880804cf 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm @@ -42,8 +42,8 @@ namespace juce { #if ! JUCE_64BIT -void updateEditorCompBounds (Component*); -void updateEditorCompBounds (Component* comp) +void updateEditorCompBoundsVST (Component*); +void updateEditorCompBoundsVST (Component* comp) { HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) comp->getProperties() ["dummyViewRef"].toString().getHexValue64(); @@ -63,22 +63,22 @@ void updateEditorCompBounds (Component* comp) static pascal OSStatus viewBoundsChangedEvent (EventHandlerCallRef, EventRef, void* user) { - updateEditorCompBounds ((Component*) user); + updateEditorCompBoundsVST ((Component*) user); return noErr; } #endif //============================================================================== -void initialiseMac(); -void initialiseMac() +void initialiseMacVST(); +void initialiseMacVST() { #if ! JUCE_64BIT NSApplicationLoad(); #endif } -void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, bool isNSView); -void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, bool isNSView) +void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView); +void* attachComponentToWindowRefVST (Component* comp, void* parentWindowOrView, bool isNSView) { JUCE_AUTORELEASEPOOL { @@ -133,7 +133,7 @@ void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, boo InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEvent), 1, &kControlBoundsChangedEvent, (void*) comp, &ref); comp->getProperties().set ("boundsEventRef", String::toHexString ((pointer_sized_int) (void*) ref)); - updateEditorCompBounds (comp); + updateEditorCompBoundsVST (comp); #if ! JucePlugin_EditorRequiresKeyboardFocus comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses); @@ -181,8 +181,8 @@ void* attachComponentToWindowRef (Component* comp, void* parentWindowOrView, boo } } -void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView); -void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView) +void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView); +void detachComponentFromWindowRefVST (Component* comp, void* window, bool isNSView) { JUCE_AUTORELEASEPOOL { @@ -239,8 +239,8 @@ void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView) } } -void setNativeHostWindowSize (void* window, Component* component, int newWidth, int newHeight, bool isNSView); -void setNativeHostWindowSize (void* window, Component* component, int newWidth, int newHeight, bool isNSView) +void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView); +void setNativeHostWindowSizeVST (void* window, Component* component, int newWidth, int newHeight, bool isNSView) { JUCE_AUTORELEASEPOOL { @@ -277,8 +277,8 @@ void setNativeHostWindowSize (void* window, Component* component, int newWidth, } } -void checkWindowVisibility (void* window, Component* comp, bool isNSView); -void checkWindowVisibility (void* window, Component* comp, bool isNSView) +void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView); +void checkWindowVisibilityVST (void* window, Component* comp, bool isNSView) { (void) window; (void) comp; (void) isNSView; @@ -288,8 +288,8 @@ void checkWindowVisibility (void* window, Component* comp, bool isNSView) #endif } -bool forwardCurrentKeyEventToHost (Component* comp, bool isNSView); -bool forwardCurrentKeyEventToHost (Component* comp, bool isNSView) +bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView); +bool forwardCurrentKeyEventToHostVST (Component* comp, bool isNSView) { #if ! JUCE_64BIT if (! isNSView) diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index d7d76aa925..06bb283600 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -62,10 +62,10 @@ using namespace Steinberg; //============================================================================== #if JUCE_MAC - extern void initialiseMac(); - extern void* attachComponentToWindowRef (Component*, void* parent, bool isNSView); - extern void detachComponentFromWindowRef (Component*, void* window, bool isNSView); - extern void setNativeHostWindowSize (void* window, Component*, int newWidth, int newHeight, bool isNSView); + extern void initialiseMacVST3(); + extern void* attachComponentToWindowRefVST3 (Component*, void* parent, bool isNSView); + extern void detachComponentFromWindowRefVST3 (Component*, void* window, bool isNSView); + extern void setNativeHostWindowSizeVST3 (void* window, Component*, int newWidth, int newHeight, bool isNSView); #endif //============================================================================== @@ -552,7 +552,7 @@ private: component->setVisible (true); #else isNSView = (strcmp (type, kPlatformTypeNSView) == 0); - macHostWindow = juce::attachComponentToWindowRef (component, parent, isNSView); + macHostWindow = juce::attachComponentToWindowRefVST3 (component, parent, isNSView); #endif component->resizeHostWindow(); @@ -571,7 +571,7 @@ private: #else if (macHostWindow != nullptr) { - juce::detachComponentFromWindowRef (component, macHostWindow, isNSView); + juce::detachComponentFromWindowRefVST3 (component, macHostWindow, isNSView); macHostWindow = nullptr; } #endif @@ -683,7 +683,7 @@ private: setSize (w, h); #else if (owner.macHostWindow != nullptr && ! getHostType().isWavelab()) - juce::setNativeHostWindowSize (owner.macHostWindow, this, w, h, owner.isNSView); + juce::setNativeHostWindowSizeVST3 (owner.macHostWindow, this, w, h, owner.isNSView); #endif if (owner.plugFrame != nullptr) @@ -1769,7 +1769,7 @@ DEF_CLASS_IID (JuceAudioProcessor) bool initModule() { #if JUCE_MAC - initialiseMac(); + initialiseMacVST3(); #endif return true; diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.mm b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.mm index 75362a2d79..c0b661ddf5 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.mm +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.mm @@ -42,7 +42,7 @@ //============================================================================== namespace juce { - static void initialiseMac() + void initialiseMacVST3() { #if ! JUCE_64BIT NSApplicationLoad(); @@ -50,7 +50,7 @@ namespace juce } #if ! JUCE_64BIT - static void updateComponentPos (Component* const comp) + static void updateComponentPosVST3 (Component* const comp) { DBG ("updateComponentPos()"); @@ -70,14 +70,14 @@ namespace juce (int) (windowPos.top + r.origin.y)); } - static pascal OSStatus viewBoundsChangedEvent (EventHandlerCallRef, EventRef, void* user) + static pascal OSStatus viewBoundsChangedEventVST3 (EventHandlerCallRef, EventRef, void* user) { - updateComponentPos ((Component*) user); + updateComponentPosVST3 ((Component*) user); return noErr; } #endif - static void* attachComponentToWindowRef (Component* comp, void* windowRef, bool isHIView) + void* attachComponentToWindowRefVST3 (Component* comp, void* windowRef, bool isHIView) { DBG ("attachComponentToWindowRef()"); @@ -163,10 +163,10 @@ namespace juce EventHandlerRef ref; const EventTypeSpec kControlBoundsChangedEvent = { kEventClassControl, kEventControlBoundsChanged }; - InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEvent), 1, &kControlBoundsChangedEvent, (void*) comp, &ref); + InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEventVST3), 1, &kControlBoundsChangedEvent, (void*) comp, &ref); comp->getProperties().set ("boundsEventRef", String::toHexString ((pointer_sized_int) (void*) ref)); - updateComponentPos (comp); + updateComponentPosVST3 (comp); #if ! JucePlugin_EditorRequiresKeyboardFocus comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses); @@ -194,7 +194,7 @@ namespace juce } } - static void detachComponentFromWindowRef (Component* comp, void* nsWindow, bool isHIView) + void detachComponentFromWindowRefVST3 (Component* comp, void* nsWindow, bool isHIView) { JUCE_AUTORELEASEPOOL { @@ -242,7 +242,7 @@ namespace juce } } - static void setNativeHostWindowSize (void* nsWindow, Component* component, int newWidth, int newHeight, bool isHIView) + void setNativeHostWindowSizeVST3 (void* nsWindow, Component* component, int newWidth, int newHeight, bool isHIView) { JUCE_AUTORELEASEPOOL { diff --git a/modules/juce_audio_processors/format_types/juce_VST3Common.h b/modules/juce_audio_processors/format_types/juce_VST3Common.h index 8a5c6f2cb2..e4769807cc 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -60,12 +60,12 @@ static bool doUIDsMatch (const Steinberg::TUID a, const Steinberg::TUID b) noexc } //============================================================================== -static juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); } -static juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); } +inline juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); } +inline juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); } // NB: The casts are handled by a Steinberg::UString operator -static juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast (string)); } -static juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast (string)); } +inline juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast (string)); } +inline juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast (string)); } static void toString128 (Steinberg::Vst::String128 result, const char* source) { @@ -396,7 +396,7 @@ namespace VST3BufferExchange channelIndexOffset += numChansForBus; } - static void mapBufferToBusses (Array& result, BusMap& busMapToUse, + inline void mapBufferToBusses (Array& result, BusMap& busMapToUse, const Array& arrangements, AudioSampleBuffer& source) { @@ -407,7 +407,7 @@ namespace VST3BufferExchange arrangements.getUnchecked (i), source); } - static void mapBufferToBusses (Array& result, + inline void mapBufferToBusses (Array& result, Steinberg::Vst::IAudioProcessor& processor, BusMap& busMapToUse, bool isInput, int numBusses, AudioSampleBuffer& source) diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index 03e114a809..51a5649ed0 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -44,6 +44,7 @@ #pragma clang diagnostic ignored "-Woverloaded-virtual" #pragma clang diagnostic ignored "-Wshadow" #pragma clang diagnostic ignored "-Wdeprecated-register" + #pragma clang diagnostic ignored "-Wunused-function" #endif /* These files come with the Steinberg VST3 SDK - to get them, you'll need to