From a4bd6cbc66d8ccf58d91ed7abba243458e398d9b Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Wed, 5 Jun 2019 17:45:33 +0100 Subject: [PATCH] Fixed some more Linux compiler warnings --- examples/Assets/DSPDemos_Common.h | 6 +-- examples/Audio/AudioAppDemo.h | 2 +- examples/Audio/AudioLatencyDemo.h | 2 +- examples/Audio/AudioPlaybackDemo.h | 4 +- examples/Audio/AudioRecordingDemo.h | 6 +-- examples/Audio/AudioSettingsDemo.h | 2 +- examples/Audio/AudioSynthesiserDemo.h | 2 +- examples/Audio/MPEDemo.h | 3 +- examples/Audio/MidiDemo.h | 2 +- examples/Audio/PluckedStringsDemo.h | 2 +- examples/Audio/SimpleFFTDemo.h | 2 +- examples/BLOCKS/BlocksDrawingDemo.h | 2 +- examples/BLOCKS/BlocksMonitorDemo.h | 4 +- examples/BLOCKS/BlocksSynthDemo.h | 4 +- examples/DemoRunner/Source/Main.cpp | 2 +- .../Source/UI/DemoContentComponent.h | 2 +- examples/DemoRunner/Source/UI/MainComponent.h | 2 +- examples/GUI/BouncingBallWavetableDemo.h | 2 +- examples/GUI/CameraDemo.h | 2 +- examples/GUI/CodeEditorDemo.h | 2 +- examples/GUI/ImagesDemo.h | 2 +- examples/GUI/MDIDemo.h | 2 +- examples/GUI/MenusDemo.h | 4 +- examples/GUI/OpenGLAppDemo.h | 2 +- examples/GUI/OpenGLDemo.h | 2 +- examples/GUI/OpenGLDemo2D.h | 2 +- examples/GUI/VideoDemo.h | 2 +- examples/GUI/WindowsDemo.h | 2 +- examples/Plugins/AudioPluginDemo.h | 4 +- examples/Utilities/Box2DDemo.h | 2 +- examples/Utilities/ChildProcessDemo.h | 2 +- examples/Utilities/MultithreadingDemo.h | 4 +- examples/Utilities/OSCDemo.h | 2 +- examples/Utilities/TimersAndEventsDemo.h | 2 +- examples/Utilities/UnitTestsDemo.h | 2 +- examples/Utilities/ValueTreesDemo.h | 2 +- examples/Utilities/XMLandJSONDemo.h | 2 +- .../juce_ThreadedAnalyticsDestination.cpp | 2 +- .../native/juce_linux_ALSA.cpp | 4 +- .../codecs/juce_MP3AudioFormat.h | 2 +- .../Standalone/juce_StandaloneFilterWindow.h | 6 +-- .../VST/juce_VST_Wrapper.cpp | 11 ++-- .../format_types/juce_LADSPAPluginFormat.cpp | 2 +- .../format_types/juce_LADSPAPluginFormat.h | 2 +- .../format_types/juce_VSTMidiEventList.h | 20 ++++--- .../format_types/juce_VSTPluginFormat.cpp | 15 ++++-- .../internal/juce_BlockImplementation.cpp | 6 +-- .../internal/juce_ConnectedDeviceGroup.cpp | 2 +- .../juce_DepreciatedVersionReader.cpp | 2 +- .../topology/internal/juce_Detector.cpp | 2 +- .../internal/juce_MidiDeviceConnection.cpp | 2 +- .../topology/juce_RuleBasedTopologySource.cpp | 2 +- modules/juce_box2d/juce_box2d.cpp | 1 + modules/juce_core/memory/juce_Memory.h | 2 +- .../juce_dsp/frequency/juce_Convolution.cpp | 2 +- .../juce_dsp/native/juce_avx_SIMDNativeOps.h | 36 ++++++------- .../juce_dsp/native/juce_sse_SIMDNativeOps.h | 34 ++++++------ .../juce_InterprocessConnection.cpp | 2 +- .../image_formats/juce_GIFLoader.cpp | 2 +- .../native/juce_linux_FileChooser.cpp | 2 +- .../native/juce_linux_X11_Windowing.cpp | 52 ++++++++++++++----- .../embedding/juce_XEmbedComponent.h | 2 +- modules/juce_gui_extra/juce_gui_extra.cpp | 13 +++++ .../juce_linux_X11_WebBrowserComponent.cpp | 7 ++- .../native/juce_linux_XEmbedComponent.cpp | 12 +++-- modules/juce_osc/osc/juce_OSCReceiver.cpp | 2 +- .../marketplace/juce_OnlineUnlockForm.cpp | 2 +- 67 files changed, 205 insertions(+), 141 deletions(-) diff --git a/examples/Assets/DSPDemos_Common.h b/examples/Assets/DSPDemos_Common.h index dc9dfcb59e..33a54ea671 100644 --- a/examples/Assets/DSPDemos_Common.h +++ b/examples/Assets/DSPDemos_Common.h @@ -104,7 +104,7 @@ public: thumbnail.addChangeListener (this); } - ~AudioThumbnailComponent() + ~AudioThumbnailComponent() override { thumbnail.removeChangeListener (this); } @@ -367,7 +367,7 @@ public: setSize (800, 250); } - ~AudioFileReaderComponent() + ~AudioFileReaderComponent() override { signalThreadShouldExit(); stop(); @@ -551,7 +551,7 @@ private: loopButton.getToggleStateValue().referTo (audioFileReader.loopState); } - ~AudioPlayerHeader() + ~AudioPlayerHeader() override { audioFileReader.playState.removeListener (this); } diff --git a/examples/Audio/AudioAppDemo.h b/examples/Audio/AudioAppDemo.h index 81f65778fe..fa3eb2033a 100644 --- a/examples/Audio/AudioAppDemo.h +++ b/examples/Audio/AudioAppDemo.h @@ -64,7 +64,7 @@ public: setSize (800, 600); } - ~AudioAppDemo() + ~AudioAppDemo() override { shutdownAudio(); } diff --git a/examples/Audio/AudioLatencyDemo.h b/examples/Audio/AudioLatencyDemo.h index a02aa1ea1a..b7e16ea650 100644 --- a/examples/Audio/AudioLatencyDemo.h +++ b/examples/Audio/AudioLatencyDemo.h @@ -345,7 +345,7 @@ public: setSize (500, 500); } - ~AudioLatencyDemo() + ~AudioLatencyDemo() override { audioDeviceManager.removeAudioCallback (liveAudioScroller.get()); audioDeviceManager.removeAudioCallback (latencyTester .get()); diff --git a/examples/Audio/AudioPlaybackDemo.h b/examples/Audio/AudioPlaybackDemo.h index 94ecbebcc6..33d48f36aa 100644 --- a/examples/Audio/AudioPlaybackDemo.h +++ b/examples/Audio/AudioPlaybackDemo.h @@ -75,7 +75,7 @@ public: addAndMakeVisible (currentPositionMarker); } - ~DemoThumbnailComp() + ~DemoThumbnailComp() override { scrollbar.removeListener (this); thumbnail.removeChangeListener (this); @@ -342,7 +342,7 @@ public: setSize (500, 500); } - ~AudioPlaybackDemo() + ~AudioPlaybackDemo() override { transportSource .setSource (nullptr); audioSourcePlayer.setSource (nullptr); diff --git a/examples/Audio/AudioRecordingDemo.h b/examples/Audio/AudioRecordingDemo.h index f1c1d9bbc0..ceaecba3d6 100644 --- a/examples/Audio/AudioRecordingDemo.h +++ b/examples/Audio/AudioRecordingDemo.h @@ -64,7 +64,7 @@ public: backgroundThread.startThread(); } - ~AudioRecorder() + ~AudioRecorder() override { stop(); } @@ -178,7 +178,7 @@ public: thumbnail.addChangeListener (this); } - ~RecordingThumbnail() + ~RecordingThumbnail() override { thumbnail.removeChangeListener (this); } @@ -272,7 +272,7 @@ public: setSize (500, 500); } - ~AudioRecordingDemo() + ~AudioRecordingDemo() override { audioDeviceManager.removeAudioCallback (&recorder); audioDeviceManager.removeAudioCallback (&liveAudioScroller); diff --git a/examples/Audio/AudioSettingsDemo.h b/examples/Audio/AudioSettingsDemo.h index af73cc4aa7..9bd5f3303e 100644 --- a/examples/Audio/AudioSettingsDemo.h +++ b/examples/Audio/AudioSettingsDemo.h @@ -88,7 +88,7 @@ public: setSize (500, 600); } - ~AudioSettingsDemo() + ~AudioSettingsDemo() override { audioDeviceManager.removeChangeListener (this); } diff --git a/examples/Audio/AudioSynthesiserDemo.h b/examples/Audio/AudioSynthesiserDemo.h index 057d5428b2..644f061f83 100644 --- a/examples/Audio/AudioSynthesiserDemo.h +++ b/examples/Audio/AudioSynthesiserDemo.h @@ -278,7 +278,7 @@ public: setSize (640, 480); } - ~AudioSynthesiserDemo() + ~AudioSynthesiserDemo() override { audioSourcePlayer.setSource (nullptr); audioDeviceManager.removeMidiInputDeviceCallback ({}, &(synthAudioSource.midiCollector)); diff --git a/examples/Audio/MPEDemo.h b/examples/Audio/MPEDemo.h index 38aade35a1..37bec790dc 100644 --- a/examples/Audio/MPEDemo.h +++ b/examples/Audio/MPEDemo.h @@ -48,7 +48,6 @@ #pragma once - //============================================================================== class ZoneColourPicker { @@ -904,7 +903,7 @@ public: setSize (880, 720); } - ~MPEDemo() + ~MPEDemo() override { audioDeviceManager.removeMidiInputDeviceCallback ({}, this); audioDeviceManager.removeAudioCallback (this); diff --git a/examples/Audio/MidiDemo.h b/examples/Audio/MidiDemo.h index 978e15e46b..b871fd5586 100644 --- a/examples/Audio/MidiDemo.h +++ b/examples/Audio/MidiDemo.h @@ -116,7 +116,7 @@ public: startTimer (500); } - ~MidiDemo() + ~MidiDemo() override { stopTimer(); midiInputs .clear(); diff --git a/examples/Audio/PluckedStringsDemo.h b/examples/Audio/PluckedStringsDemo.h index 1d6566cec3..003491095c 100644 --- a/examples/Audio/PluckedStringsDemo.h +++ b/examples/Audio/PluckedStringsDemo.h @@ -268,7 +268,7 @@ public: setAudioChannels (numInputChannels, numOutputChannels); } - ~PluckedStringsDemo() + ~PluckedStringsDemo() override { shutdownAudio(); } diff --git a/examples/Audio/SimpleFFTDemo.h b/examples/Audio/SimpleFFTDemo.h index 0dbf3287c3..a087a21efa 100644 --- a/examples/Audio/SimpleFFTDemo.h +++ b/examples/Audio/SimpleFFTDemo.h @@ -78,7 +78,7 @@ public: setSize (700, 500); } - ~SimpleFFTDemo() + ~SimpleFFTDemo() override { shutdownAudio(); } diff --git a/examples/BLOCKS/BlocksDrawingDemo.h b/examples/BLOCKS/BlocksDrawingDemo.h index 9cbbb9148e..ed454ebf91 100644 --- a/examples/BLOCKS/BlocksDrawingDemo.h +++ b/examples/BLOCKS/BlocksDrawingDemo.h @@ -317,7 +317,7 @@ public: topologyChanged(); } - ~BlocksDrawingDemo() + ~BlocksDrawingDemo() override { if (activeBlock != nullptr) detachActiveBlock(); diff --git a/examples/BLOCKS/BlocksMonitorDemo.h b/examples/BLOCKS/BlocksMonitorDemo.h index e911df0904..3656ccccb1 100644 --- a/examples/BLOCKS/BlocksMonitorDemo.h +++ b/examples/BLOCKS/BlocksMonitorDemo.h @@ -85,7 +85,7 @@ public: constrainer.setMinimumOnscreenAmounts (50, 50, 50, 50); } - ~BlockComponent() + ~BlockComponent() override { // Remove any listeners if (auto touchSurface = block->getTouchSurface()) @@ -609,7 +609,7 @@ public: topologyChanged(); } - ~BlocksMonitorDemo() + ~BlocksMonitorDemo() override { topologySource.removeListener (this); } diff --git a/examples/BLOCKS/BlocksSynthDemo.h b/examples/BLOCKS/BlocksSynthDemo.h index 814d994274..aa34dc1270 100644 --- a/examples/BLOCKS/BlocksSynthDemo.h +++ b/examples/BLOCKS/BlocksSynthDemo.h @@ -302,7 +302,7 @@ public: synthesiser.addSound (new TriangleSound()); } - ~Audio() + ~Audio() override { audioDeviceManager.removeAudioCallback (this); } @@ -613,7 +613,7 @@ public: topologyChanged(); } - ~BlocksSynthDemo() + ~BlocksSynthDemo() override { if (activeBlock != nullptr) detachActiveBlock(); diff --git a/examples/DemoRunner/Source/Main.cpp b/examples/DemoRunner/Source/Main.cpp index 60d71990a1..3f58c792b9 100644 --- a/examples/DemoRunner/Source/Main.cpp +++ b/examples/DemoRunner/Source/Main.cpp @@ -83,7 +83,7 @@ public: //============================================================================== DemoRunnerApplication() {} - ~DemoRunnerApplication() + ~DemoRunnerApplication() override { sharedAudioDeviceManager.reset(); } diff --git a/examples/DemoRunner/Source/UI/DemoContentComponent.h b/examples/DemoRunner/Source/UI/DemoContentComponent.h index 680996c1d8..b4daee1140 100644 --- a/examples/DemoRunner/Source/UI/DemoContentComponent.h +++ b/examples/DemoRunner/Source/UI/DemoContentComponent.h @@ -37,7 +37,7 @@ class DemoContentComponent : public TabbedComponent { public: DemoContentComponent (Component& mainComponent, std::function demoChangedCallback); - ~DemoContentComponent(); + ~DemoContentComponent() override; void resized() override; diff --git a/examples/DemoRunner/Source/UI/MainComponent.h b/examples/DemoRunner/Source/UI/MainComponent.h index 30a8980521..5833cb9171 100644 --- a/examples/DemoRunner/Source/UI/MainComponent.h +++ b/examples/DemoRunner/Source/UI/MainComponent.h @@ -35,7 +35,7 @@ class MainComponent : public Component public: //============================================================================== MainComponent(); - ~MainComponent(); + ~MainComponent() override; //============================================================================== void paint (Graphics&) override; diff --git a/examples/GUI/BouncingBallWavetableDemo.h b/examples/GUI/BouncingBallWavetableDemo.h index 638b424d8c..f3c50f900a 100644 --- a/examples/GUI/BouncingBallWavetableDemo.h +++ b/examples/GUI/BouncingBallWavetableDemo.h @@ -70,7 +70,7 @@ public: startTimerHz (60); } - ~BouncingBallWavetableDemo() + ~BouncingBallWavetableDemo() override { shutdownAudio(); } diff --git a/examples/GUI/CameraDemo.h b/examples/GUI/CameraDemo.h index adc86d9ed1..34a8e03a00 100644 --- a/examples/GUI/CameraDemo.h +++ b/examples/GUI/CameraDemo.h @@ -86,7 +86,7 @@ public: #endif } - ~CameraDemo() + ~CameraDemo() override { #if JUCE_IOS || JUCE_ANDROID setPortraitOrientationEnabled (false); diff --git a/examples/GUI/CodeEditorDemo.h b/examples/GUI/CodeEditorDemo.h index 89cf843fcc..c2be5ffbbe 100644 --- a/examples/GUI/CodeEditorDemo.h +++ b/examples/GUI/CodeEditorDemo.h @@ -83,7 +83,7 @@ public: setSize (500, 500); } - ~CodeEditorDemo() + ~CodeEditorDemo() override { fileChooser.removeListener (this); } diff --git a/examples/GUI/ImagesDemo.h b/examples/GUI/ImagesDemo.h index 66dea900b4..61a0e4fe99 100644 --- a/examples/GUI/ImagesDemo.h +++ b/examples/GUI/ImagesDemo.h @@ -82,7 +82,7 @@ public: setSize (500, 500); } - ~ImagesDemo() + ~ImagesDemo() override { fileTree.removeListener (this); } diff --git a/examples/GUI/MDIDemo.h b/examples/GUI/MDIDemo.h index ad2891244e..040cebb75a 100644 --- a/examples/GUI/MDIDemo.h +++ b/examples/GUI/MDIDemo.h @@ -140,7 +140,7 @@ class DemoMultiDocumentPanel : public MultiDocumentPanel public: DemoMultiDocumentPanel() {} - ~DemoMultiDocumentPanel() + ~DemoMultiDocumentPanel() override { closeAllDocuments (true); } diff --git a/examples/GUI/MenusDemo.h b/examples/GUI/MenusDemo.h index fe0614127c..2304b7c516 100644 --- a/examples/GUI/MenusDemo.h +++ b/examples/GUI/MenusDemo.h @@ -81,7 +81,7 @@ struct BurgerMenuHeader : public Component addAndMakeVisible (burgerButton); } - ~BurgerMenuHeader() + ~BurgerMenuHeader() override { sidePanel.showOrHide (false); } @@ -167,7 +167,7 @@ public: setSize (500, 500); } - ~MenusDemo() + ~MenusDemo() override { #if JUCE_MAC MenuBarModel::setMacMainMenu (nullptr); diff --git a/examples/GUI/OpenGLAppDemo.h b/examples/GUI/OpenGLAppDemo.h index f161f41d5c..5caff53249 100644 --- a/examples/GUI/OpenGLAppDemo.h +++ b/examples/GUI/OpenGLAppDemo.h @@ -63,7 +63,7 @@ public: setSize (800, 600); } - ~OpenGLAppDemo() + ~OpenGLAppDemo() override { shutdownOpenGL(); } diff --git a/examples/GUI/OpenGLDemo.h b/examples/GUI/OpenGLDemo.h index 1216506627..065d40fa6d 100644 --- a/examples/GUI/OpenGLDemo.h +++ b/examples/GUI/OpenGLDemo.h @@ -760,7 +760,7 @@ public: setSize (500, 500); } - ~OpenGLDemo() + ~OpenGLDemo() override { openGLContext.detach(); } diff --git a/examples/GUI/OpenGLDemo2D.h b/examples/GUI/OpenGLDemo2D.h index 40ce70d194..24ae12b5e9 100644 --- a/examples/GUI/OpenGLDemo2D.h +++ b/examples/GUI/OpenGLDemo2D.h @@ -87,7 +87,7 @@ public: setSize (500, 500); } - ~OpenGLDemo2D() + ~OpenGLDemo2D() override { openGLContext.detach(); shader.reset(); diff --git a/examples/GUI/VideoDemo.h b/examples/GUI/VideoDemo.h index 62a721990f..2336156bc4 100644 --- a/examples/GUI/VideoDemo.h +++ b/examples/GUI/VideoDemo.h @@ -186,7 +186,7 @@ public: setSize (500, 500); } - ~VideoDemo() + ~VideoDemo() override { fileTree.removeListener (this); } diff --git a/examples/GUI/WindowsDemo.h b/examples/GUI/WindowsDemo.h index 22362391fa..3e7deb0c5d 100644 --- a/examples/GUI/WindowsDemo.h +++ b/examples/GUI/WindowsDemo.h @@ -231,7 +231,7 @@ public: setSize (250, 250); } - ~WindowsDemo() + ~WindowsDemo() override { if (dialogWindow != nullptr) { diff --git a/examples/Plugins/AudioPluginDemo.h b/examples/Plugins/AudioPluginDemo.h index 30625d8b1c..4937219b46 100644 --- a/examples/Plugins/AudioPluginDemo.h +++ b/examples/Plugins/AudioPluginDemo.h @@ -189,7 +189,7 @@ public: initialiseSynth(); } - ~JuceDemoPluginAudioProcessor() {} + ~JuceDemoPluginAudioProcessor() override = default; //============================================================================== bool isBusesLayoutSupported (const BusesLayout& layouts) const override @@ -380,7 +380,7 @@ private: startTimerHz (30); } - ~JuceDemoPluginAudioProcessorEditor() {} + ~JuceDemoPluginAudioProcessorEditor() override {} //============================================================================== void paint (Graphics& g) override diff --git a/examples/Utilities/Box2DDemo.h b/examples/Utilities/Box2DDemo.h index a51f6e6796..c5086f23f7 100644 --- a/examples/Utilities/Box2DDemo.h +++ b/examples/Utilities/Box2DDemo.h @@ -192,7 +192,7 @@ public: setSize (500, 500); } - ~Box2DDemo() + ~Box2DDemo() override { testsListModel.removeChangeListener (this); } diff --git a/examples/Utilities/ChildProcessDemo.h b/examples/Utilities/ChildProcessDemo.h index bab208e201..d2651bcc39 100644 --- a/examples/Utilities/ChildProcessDemo.h +++ b/examples/Utilities/ChildProcessDemo.h @@ -103,7 +103,7 @@ public: setSize (500, 500); } - ~ChildProcessDemo() + ~ChildProcessDemo() override { masterProcess.reset(); } diff --git a/examples/Utilities/MultithreadingDemo.h b/examples/Utilities/MultithreadingDemo.h index 31f768ddff..443755e4a3 100644 --- a/examples/Utilities/MultithreadingDemo.h +++ b/examples/Utilities/MultithreadingDemo.h @@ -141,7 +141,7 @@ public: startThread (Random::getSystemRandom().nextInt (3) + 3); } - ~DemoThread() + ~DemoThread() override { // allow the thread 2 seconds to stop cleanly - should be plenty of time. stopThread (2000); @@ -234,7 +234,7 @@ public: setSize (500, 500); } - ~MultithreadingDemo() + ~MultithreadingDemo() override { pool.removeAllJobs (true, 2000); } diff --git a/examples/Utilities/OSCDemo.h b/examples/Utilities/OSCDemo.h index 126fe01677..56548a4a6a 100644 --- a/examples/Utilities/OSCDemo.h +++ b/examples/Utilities/OSCDemo.h @@ -58,7 +58,7 @@ public: setModel (this); } - ~OSCLogListBox() {} + ~OSCLogListBox() override = default; //============================================================================== int getNumRows() override diff --git a/examples/Utilities/TimersAndEventsDemo.h b/examples/Utilities/TimersAndEventsDemo.h index eee181defb..01b29a89fc 100644 --- a/examples/Utilities/TimersAndEventsDemo.h +++ b/examples/Utilities/TimersAndEventsDemo.h @@ -196,7 +196,7 @@ public: setSize (600, 600); } - ~TimersAndEventsDemo() + ~TimersAndEventsDemo() override { for (auto* fc : flashingComponents) fc->removeChangeListener (this); diff --git a/examples/Utilities/UnitTestsDemo.h b/examples/Utilities/UnitTestsDemo.h index 9a54912a26..783296f212 100644 --- a/examples/Utilities/UnitTestsDemo.h +++ b/examples/Utilities/UnitTestsDemo.h @@ -82,7 +82,7 @@ public: setSize (500, 500); } - ~UnitTestsDemo() + ~UnitTestsDemo() override { stopTest(); } diff --git a/examples/Utilities/ValueTreesDemo.h b/examples/Utilities/ValueTreesDemo.h index 55cf291df3..1d42397a1b 100644 --- a/examples/Utilities/ValueTreesDemo.h +++ b/examples/Utilities/ValueTreesDemo.h @@ -203,7 +203,7 @@ public: setSize (500, 500); } - ~ValueTreesDemo() + ~ValueTreesDemo() override { tree.setRootItem (nullptr); } diff --git a/examples/Utilities/XMLandJSONDemo.h b/examples/Utilities/XMLandJSONDemo.h index 42a9cec877..79d18661a2 100644 --- a/examples/Utilities/XMLandJSONDemo.h +++ b/examples/Utilities/XMLandJSONDemo.h @@ -278,7 +278,7 @@ public: setSize (500, 500); } - ~XMLandJSONDemo() + ~XMLandJSONDemo() override { resultsTree.setRootItem (nullptr); } diff --git a/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp b/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp index 93cb156f64..7c92bbba92 100644 --- a/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp +++ b/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp @@ -160,7 +160,7 @@ namespace DestinationTestHelpers startAnalyticsThread (20); } - ~BasicDestination() + ~BasicDestination() override { stopAnalyticsThread (1000); } diff --git a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp index cecfef3445..9fff0b1efe 100644 --- a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp +++ b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp @@ -494,7 +494,7 @@ public: initialiseRatesAndChannels(); } - ~ALSAThread() + ~ALSAThread() override { close(); } @@ -853,7 +853,7 @@ public: { } - ~ALSAAudioIODevice() + ~ALSAAudioIODevice() override { close(); } diff --git a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h index c151647873..fee084039f 100644 --- a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h @@ -50,7 +50,7 @@ class MP3AudioFormat : public AudioFormat public: //============================================================================== MP3AudioFormat(); - ~MP3AudioFormat(); + ~MP3AudioFormat() override; //============================================================================== Array getPossibleSampleRates() override; diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index a0c22651c7..1c3522dddd 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -109,7 +109,7 @@ public: startTimer (500); } - virtual ~StandalonePluginHolder() + virtual ~StandalonePluginHolder() override { stopTimer(); @@ -636,7 +636,7 @@ public: #endif } - ~StandaloneFilterWindow() + ~StandaloneFilterWindow() override { #if (! JUCE_IOS) && (! JUCE_ANDROID) if (auto* props = pluginHolder->settings.get()) @@ -753,7 +753,7 @@ private: inputMutedChanged (shouldShowNotification); } - ~MainContentComponent() + ~MainContentComponent() override { if (editor != nullptr) { 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 e181006c18..69ffe933c3 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -75,6 +75,9 @@ #pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wdeprecated-writable-strings" #pragma clang diagnostic ignored "-Wnon-virtual-dtor" + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif #endif #if JUCE_GCC @@ -223,7 +226,7 @@ struct SharedMessageThread : public Thread sleep (1); } - ~SharedMessageThread() + ~SharedMessageThread() override { signalThreadShouldExit(); JUCEApplicationBase::quit(); @@ -383,7 +386,7 @@ public: activePlugins.add (this); } - ~JuceVSTWrapper() + ~JuceVSTWrapper() override { JUCE_AUTORELEASEPOOL { @@ -1275,7 +1278,7 @@ public: ignoreUnused (fakeMouseGenerator); } - ~EditorCompWrapper() + ~EditorCompWrapper() override { deleteAllChildren(); // note that we can't use a std::unique_ptr because the editor may // have been transferred to another parent which takes over ownership. @@ -2285,11 +2288,13 @@ private: bool isProcessing = false, isBypassed = false, hasShutdown = false; bool firstProcessCallback = true, shouldDeleteEditor = false; + #if JUCE_MAC #if JUCE_64BIT bool useNSView = true; #else bool useNSView = false; #endif + #endif VstTempBuffers floatTempBuffers; VstTempBuffers doubleTempBuffers; diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index 7f1a95c8c0..1a8deebfdf 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -152,7 +152,7 @@ public: --insideLADSPACallback; } - ~LADSPAPluginInstance() + ~LADSPAPluginInstance() override { const ScopedLock sl (lock); diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h index 6234e70cc8..960c1fa2f3 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h @@ -39,7 +39,7 @@ class JUCE_API LADSPAPluginFormat : public AudioPluginFormat { public: LADSPAPluginFormat(); - ~LADSPAPluginFormat(); + ~LADSPAPluginFormat() override; //============================================================================== String getName() const override { return "LADSPA"; } diff --git a/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h b/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h index f0f4a1cff2..3b6d31646f 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h +++ b/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h @@ -65,14 +65,15 @@ public: { ensureSize (numEventsUsed + 1); - Vst2::VstMidiEvent* const e = (Vst2::VstMidiEvent*) (events->events [numEventsUsed]); + void* const ptr = (Vst2::VstMidiEvent*) (events->events [numEventsUsed]); + auto* const e = (Vst2::VstMidiEvent*) ptr; events->numEvents = ++numEventsUsed; if (numBytes <= 4) { if (e->type == Vst2::kVstSysExType) { - delete[] (((Vst2::VstMidiSysexEvent*) e)->sysexDump); + delete[] (((Vst2::VstMidiSysexEvent*) ptr)->sysexDump); e->type = Vst2::kVstMidiType; e->byteSize = sizeof (Vst2::VstMidiEvent); e->noteLength = 0; @@ -86,7 +87,7 @@ public: } else { - Vst2::VstMidiSysexEvent* const se = (Vst2::VstMidiSysexEvent*) e; + auto* const se = (Vst2::VstMidiSysexEvent*) ptr; if (se->type == Vst2::kVstSysExType) delete[] se->sysexDump; @@ -115,15 +116,18 @@ public: if (e != nullptr) { + const void* const ptr = events->events[i]; + if (e->type == Vst2::kVstMidiType) { - dest.addEvent ((const juce::uint8*) ((const Vst2::VstMidiEvent*) e)->midiData, + dest.addEvent ((const juce::uint8*) ((const Vst2::VstMidiEvent*) ptr)->midiData, 4, e->deltaFrames); } else if (e->type == Vst2::kVstSysExType) { - dest.addEvent ((const juce::uint8*) ((const Vst2::VstMidiSysexEvent*) e)->sysexDump, - (int) ((const Vst2::VstMidiSysexEvent*) e)->dumpBytes, + const auto* se = (const Vst2::VstMidiSysexEvent*) ptr; + dest.addEvent ((const juce::uint8*) se->sysexDump, + (int) se->dumpBytes, e->deltaFrames); } } @@ -182,7 +186,9 @@ private: static void freeVSTEvent (Vst2::VstEvent* e) { if (e->type == Vst2::kVstSysExType) - delete[] (((Vst2::VstMidiSysexEvent*) e)->sysexDump); + { + delete[] (reinterpret_cast (e)->sysexDump); + } std::free (e); } diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 9727f9e4bc..3b77c92fd7 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -36,9 +36,11 @@ #define __cdecl #endif -#if JUCE_CLANG && __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" +#if JUCE_CLANG + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif #endif #if JUCE_GCC @@ -67,8 +69,10 @@ namespace Vst2 #pragma warning (disable: 4355) // ("this" used in initialiser list warning) #endif -#if JUCE_CLANG && __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic pop +#if JUCE_CLANG + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic pop + #endif #endif #if JUCE_GCC @@ -2769,6 +2773,7 @@ public: #if JUCE_LINUX pluginWindow = None; display = XWindowSystem::getInstance()->displayRef(); + ignoreUnused (pluginRefusesToResize, alreadyInside); #elif JUCE_MAC ignoreUnused (recursiveResize, pluginRefusesToResize, alreadyInside); diff --git a/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp b/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp index c442d065c4..f373f51dd0 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp @@ -61,7 +61,7 @@ public: updateMidiConnectionListener(); } - ~BlockImplementation() + ~BlockImplementation() override { markDisconnected(); } @@ -757,7 +757,7 @@ public: activateTouchSurface(); } - ~TouchSurfaceImplementation() + ~TouchSurfaceImplementation() override { disableTouchSurface(); } @@ -875,7 +875,7 @@ public: { } - ~ControlButtonImplementation() + ~ControlButtonImplementation() override { } diff --git a/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp b/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp index 4f7d1b614a..cab84e8850 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_ConnectedDeviceGroup.cpp @@ -53,7 +53,7 @@ struct ConnectedDeviceGroup : private AsyncUpdater, sendTopologyRequest(); } - ~ConnectedDeviceGroup() + ~ConnectedDeviceGroup() override { for (const auto& device : currentDeviceInfo) detector.handleDeviceRemoved (device); diff --git a/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp b/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp index 35939f7bb1..c871d0924b 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_DepreciatedVersionReader.cpp @@ -40,7 +40,7 @@ public: } //============================================================================== - ~DepreciatedVersionReader() + ~DepreciatedVersionReader() override { deviceConnection.removeListener (this); } diff --git a/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp b/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp index e91f6a5457..1fb6c6924d 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_Detector.cpp @@ -41,7 +41,7 @@ struct Detector : public ReferenceCountedObject, startTimer (10); } - ~Detector() + ~Detector() override { jassert (activeTopologySources.isEmpty()); } diff --git a/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp b/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp index 2ef5169ddb..56fb9e34c1 100644 --- a/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp +++ b/modules/juce_blocks_basics/topology/internal/juce_MidiDeviceConnection.cpp @@ -28,7 +28,7 @@ struct MIDIDeviceConnection : public PhysicalTopologySource::DeviceConnection, { MIDIDeviceConnection() {} - ~MIDIDeviceConnection() + ~MIDIDeviceConnection() override { JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED diff --git a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp index 25c8dff0a5..c573c950a5 100644 --- a/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp +++ b/modules/juce_blocks_basics/topology/juce_RuleBasedTopologySource.cpp @@ -31,7 +31,7 @@ struct RuleBasedTopologySource::Internal : public TopologySource::Listener, detector.addListener (this); } - ~Internal() + ~Internal() override { detector.removeListener (this); } diff --git a/modules/juce_box2d/juce_box2d.cpp b/modules/juce_box2d/juce_box2d.cpp index 41e68f3626..5673b384d9 100644 --- a/modules/juce_box2d/juce_box2d.cpp +++ b/modules/juce_box2d/juce_box2d.cpp @@ -39,6 +39,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wfloat-conversion" + #pragma clang diagnostic ignored "-Wcast-align" #if __has_warning("-Wzero-as-null-pointer-constant") #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #endif diff --git a/modules/juce_core/memory/juce_Memory.h b/modules/juce_core/memory/juce_Memory.h index 75d30976c3..6587d368bb 100644 --- a/modules/juce_core/memory/juce_Memory.h +++ b/modules/juce_core/memory/juce_Memory.h @@ -44,7 +44,7 @@ inline void deleteAndZero (Type& pointer) { delete poi a specific number of bytes, */ template -inline Type* addBytesToPointer (Type* basePointer, IntegerType bytes) noexcept { return (Type*) (const_cast (reinterpret_cast (basePointer)) + bytes); } +inline Type* addBytesToPointer (Type* basePointer, IntegerType bytes) noexcept { return reinterpret_cast (const_cast (reinterpret_cast (basePointer)) + bytes); } /** A handy function to round up a pointer to the nearest multiple of a given number of bytes. alignmentBytes must be a power of two. */ diff --git a/modules/juce_dsp/frequency/juce_Convolution.cpp b/modules/juce_dsp/frequency/juce_Convolution.cpp index 3d30eba5ca..f0b5ab2f76 100644 --- a/modules/juce_dsp/frequency/juce_Convolution.cpp +++ b/modules/juce_dsp/frequency/juce_Convolution.cpp @@ -373,7 +373,7 @@ struct Convolution::Pimpl : private Thread impulseResponse.setSize (2, static_cast (maximumTimeInSamples), false, false, true); } - ~Pimpl() + ~Pimpl() override { stopThread (10000); } diff --git a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h index 942f6ede3b..7ecf95b5cc 100644 --- a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h @@ -72,7 +72,7 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m256 JUCE_VECTOR_CALLTYPE vconst (const float* a) noexcept { return load (a); } - static forcedinline __m256 JUCE_VECTOR_CALLTYPE vconst (const int32_t* a) noexcept { return _mm256_castsi256_ps (_mm256_load_si256 ((const __m256i*) a)); } + static forcedinline __m256 JUCE_VECTOR_CALLTYPE vconst (const int32_t* a) noexcept { return _mm256_castsi256_ps (_mm256_load_si256 (reinterpret_cast (a))); } static forcedinline __m256 JUCE_VECTOR_CALLTYPE expand (float s) noexcept { return _mm256_broadcast_ss (&s); } static forcedinline __m256 JUCE_VECTOR_CALLTYPE load (const float* a) noexcept { return _mm256_load_ps (a); } static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256 value, float* dest) noexcept { _mm256_store_ps (dest, value); } @@ -144,7 +144,7 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m256d JUCE_VECTOR_CALLTYPE vconst (const double* a) noexcept { return load (a); } - static forcedinline __m256d JUCE_VECTOR_CALLTYPE vconst (const int64_t* a) noexcept { return _mm256_castsi256_pd (_mm256_load_si256 ((const __m256i*) a)); } + static forcedinline __m256d JUCE_VECTOR_CALLTYPE vconst (const int64_t* a) noexcept { return _mm256_castsi256_pd (_mm256_load_si256 (reinterpret_cast (a))); } static forcedinline __m256d JUCE_VECTOR_CALLTYPE expand (double s) noexcept { return _mm256_broadcast_sd (&s); } static forcedinline __m256d JUCE_VECTOR_CALLTYPE load (const double* a) noexcept { return _mm256_load_pd (a); } static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256d value, double* dest) noexcept { _mm256_store_pd (dest, value); } @@ -208,8 +208,8 @@ struct SIMDNativeOps DECLARE_AVX_SIMD_CONST (int8_t, kAllBitsSet); static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (int8_t s) noexcept { return _mm256_set1_epi8 (s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int8_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int8_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int8_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int8_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi8 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi8 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE bit_and (__m256i a, __m256i b) noexcept { return _mm256_and_si256 (a, b); } @@ -284,8 +284,8 @@ struct SIMDNativeOps static forcedinline __m256i JUCE_VECTOR_CALLTYPE ssign (__m256i a) noexcept { return _mm256_xor_si256 (a, load (kHighBit)); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (uint8_t s) noexcept { return _mm256_set1_epi8 ((int8_t) s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint8_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint8_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint8_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint8_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi8 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi8 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE bit_and (__m256i a, __m256i b) noexcept { return _mm256_and_si256 (a, b); } @@ -359,8 +359,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (int16_t s) noexcept { return _mm256_set1_epi16 (s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int16_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int16_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int16_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int16_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi16 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi16 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE mul (__m256i a, __m256i b) noexcept { return _mm256_mullo_epi16 (a, b); } @@ -417,8 +417,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m256i JUCE_VECTOR_CALLTYPE ssign (__m256i a) noexcept { return _mm256_xor_si256 (a, load (kHighBit)); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (uint16_t s) noexcept { return _mm256_set1_epi16 ((int16_t) s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint16_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint16_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint16_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint16_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi16 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi16 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE mul (__m256i a, __m256i b) noexcept { return _mm256_mullo_epi16 (a, b); } @@ -474,8 +474,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (int32_t s) noexcept { return _mm256_set1_epi32 (s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int32_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int32_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int32_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int32_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi32 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi32 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE mul (__m256i a, __m256i b) noexcept { return _mm256_mullo_epi32 (a, b); } @@ -530,8 +530,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m256i JUCE_VECTOR_CALLTYPE ssign (__m256i a) noexcept { return _mm256_xor_si256 (a, load (kHighBit)); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (uint32_t s) noexcept { return _mm256_set1_epi32 ((int32_t) s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint32_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint32_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint32_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint32_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi32 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi32 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE mul (__m256i a, __m256i b) noexcept { return _mm256_mullo_epi32 (a, b); } @@ -584,8 +584,8 @@ struct SIMDNativeOps DECLARE_AVX_SIMD_CONST (int64_t, kAllBitsSet); static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (int64_t s) noexcept { return _mm256_set1_epi64x ((int64_t) s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int64_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int64_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const int64_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, int64_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi64 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi64 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE bit_and (__m256i a, __m256i b) noexcept { return _mm256_and_si256 (a, b); } @@ -624,8 +624,8 @@ struct SIMDNativeOps DECLARE_AVX_SIMD_CONST (uint64_t, kHighBit); static forcedinline __m256i JUCE_VECTOR_CALLTYPE expand (uint64_t s) noexcept { return _mm256_set1_epi64x ((int64_t) s); } - static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint64_t* p) noexcept { return _mm256_load_si256 ((const __m256i*) p); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint64_t* dest) noexcept { _mm256_store_si256 ((__m256i*) dest, value); } + static forcedinline __m256i JUCE_VECTOR_CALLTYPE load (const uint64_t* p) noexcept { return _mm256_load_si256 (reinterpret_cast (p)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m256i value, uint64_t* dest) noexcept { _mm256_store_si256 (reinterpret_cast<__m256i*> (dest), value); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE ssign (__m256i a) noexcept { return _mm256_xor_si256 (a, load (kHighBit)); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE add (__m256i a, __m256i b) noexcept { return _mm256_add_epi64 (a, b); } static forcedinline __m256i JUCE_VECTOR_CALLTYPE sub (__m256i a, __m256i b) noexcept { return _mm256_sub_epi64 (a, b); } diff --git a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h index a9a7c7ae3d..d082910cc2 100644 --- a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h @@ -139,7 +139,7 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m128d JUCE_VECTOR_CALLTYPE vconst (const double* a) noexcept { return load (a); } - static forcedinline __m128d JUCE_VECTOR_CALLTYPE vconst (const int64_t* a) noexcept { return _mm_castsi128_pd (_mm_load_si128 ((const __m128i*) a)); } + static forcedinline __m128d JUCE_VECTOR_CALLTYPE vconst (const int64_t* a) noexcept { return _mm_castsi128_pd (_mm_load_si128 (reinterpret_cast (a))); } static forcedinline __m128d JUCE_VECTOR_CALLTYPE expand (double s) noexcept { return _mm_load1_pd (&s); } static forcedinline __m128d JUCE_VECTOR_CALLTYPE load (const double* a) noexcept { return _mm_load_pd (a); } static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128d value, double* dest) noexcept { _mm_store_pd (dest, value); } @@ -203,8 +203,8 @@ struct SIMDNativeOps DECLARE_SSE_SIMD_CONST (int8_t, kAllBitsSet); static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const int8_t* a) noexcept { return load (a); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int8_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int8_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int8_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int8_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (int8_t s) noexcept { return _mm_set1_epi8 (s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi8 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi8 (a, b); } @@ -277,8 +277,8 @@ struct SIMDNativeOps static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const uint8_t* a) noexcept { return load (a); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE ssign (__m128i a) noexcept { return _mm_xor_si128 (a, vconst (kHighBit)); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint8_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint8_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint8_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint8_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (uint8_t s) noexcept { return _mm_set1_epi8 ((int8_t) s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi8 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi8 (a, b); } @@ -346,8 +346,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const int16_t* a) noexcept { return load (a); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int16_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int16_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int16_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int16_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (int16_t s) noexcept { return _mm_set1_epi16 (s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi16 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi16 (a, b); } @@ -402,8 +402,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const uint16_t* a) noexcept { return load (a); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE ssign (__m128i a) noexcept { return _mm_xor_si128 (a, vconst (kHighBit)); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint16_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint16_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint16_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint16_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (uint16_t s) noexcept { return _mm_set1_epi16 ((int16_t) s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi16 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi16 (a, b); } @@ -461,8 +461,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const int32_t* a) noexcept { return load (a); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int32_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int32_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int32_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int32_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (int32_t s) noexcept { return _mm_set1_epi32 (s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi32 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi32 (a, b); } @@ -543,8 +543,8 @@ struct SIMDNativeOps //============================================================================== static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const uint32_t* a) noexcept { return load (a); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE ssign (__m128i a) noexcept { return _mm_xor_si128 (a, vconst (kHighBit)); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint32_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint32_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint32_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint32_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (uint32_t s) noexcept { return _mm_set1_epi32 ((int32_t) s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi32 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi32 (a, b); } @@ -623,8 +623,8 @@ struct SIMDNativeOps static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const int64_t* a) noexcept { return load (a); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (int64_t s) noexcept { return _mm_set1_epi64x (s); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int64_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int64_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const int64_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, int64_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi64 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi64 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE bit_and (__m128i a, __m128i b) noexcept { return _mm_and_si128 (a, b); } @@ -683,8 +683,8 @@ struct SIMDNativeOps static forcedinline __m128i JUCE_VECTOR_CALLTYPE vconst (const uint64_t* a) noexcept { return load (a); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE expand (uint64_t s) noexcept { return _mm_set1_epi64x ((int64_t) s); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE ssign (__m128i a) noexcept { return _mm_xor_si128 (a, vconst (kHighBit)); } - static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint64_t* a) noexcept { return _mm_load_si128 ((const __m128i*) a); } - static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint64_t* p) noexcept { _mm_store_si128 ((__m128i*) p, v); } + static forcedinline __m128i JUCE_VECTOR_CALLTYPE load (const uint64_t* a) noexcept { return _mm_load_si128 (reinterpret_cast (a)); } + static forcedinline void JUCE_VECTOR_CALLTYPE store (__m128i v, uint64_t* p) noexcept { _mm_store_si128 (reinterpret_cast<__m128i*> (p), v); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE add (__m128i a, __m128i b) noexcept { return _mm_add_epi64 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE sub (__m128i a, __m128i b) noexcept { return _mm_sub_epi64 (a, b); } static forcedinline __m128i JUCE_VECTOR_CALLTYPE bit_and (__m128i a, __m128i b) noexcept { return _mm_and_si128 (a, b); } diff --git a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp index a74979a5f1..57c5291517 100644 --- a/modules/juce_events/interprocess/juce_InterprocessConnection.cpp +++ b/modules/juce_events/interprocess/juce_InterprocessConnection.cpp @@ -290,7 +290,7 @@ bool InterprocessConnection::readNextMessage() uint32 messageHeader[2]; auto bytes = readData (messageHeader, sizeof (messageHeader)); - if (bytes == sizeof (messageHeader) + if (bytes == (int) sizeof (messageHeader) && ByteOrder::swapIfBigEndian (messageHeader[0]) == magicMessageHeader) { auto bytesInMessage = (int) ByteOrder::swapIfBigEndian (messageHeader[1]); diff --git a/modules/juce_graphics/image_formats/juce_GIFLoader.cpp b/modules/juce_graphics/image_formats/juce_GIFLoader.cpp index 61b38dce78..adec9cdc7c 100644 --- a/modules/juce_graphics/image_formats/juce_GIFLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_GIFLoader.cpp @@ -426,7 +426,7 @@ bool GIFImageFormat::canUnderstand (InputStream& in) { char header [4]; - return (in.read (header, sizeof (header)) == sizeof (header)) + return (in.read (header, sizeof (header)) == (int) sizeof (header)) && header[0] == 'G' && header[1] == 'I' && header[2] == 'F'; diff --git a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp index dad2df9a5f..cc87e2e126 100644 --- a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp @@ -58,7 +58,7 @@ public: addZenityArgs(); } - ~Native() + ~Native() override { finish (true); } diff --git a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp index a897ecaaaa..1c386c74b7 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp @@ -594,7 +594,7 @@ public: } } - ~XBitmapImage() + ~XBitmapImage() override { ScopedXLock xlock (display); @@ -1070,16 +1070,16 @@ public: { ScopedXDisplay xDisplay; - if (auto display = xDisplay.display) + if (auto d = xDisplay.display) { Window root, child; int x, y, winx, winy; unsigned int mask; int mouseMods = 0; - ScopedXLock xlock (display); + ScopedXLock xlock (d); - if (XQueryPointer (display, RootWindow (display, DefaultScreen (display)), + if (XQueryPointer (d, RootWindow (d, DefaultScreen (d)), &root, &child, &x, &y, &winx, &winy, &mask) != False) { if ((mask & Button1Mask) != 0) mouseMods |= ModifierKeys::leftButtonModifier; @@ -1094,7 +1094,7 @@ public: }; } - ~LinuxComponentPeer() + ~LinuxComponentPeer() override { // it's dangerous to delete a window on a thread other than the message thread.. JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED @@ -1299,11 +1299,14 @@ public: ScopedXLock xlock (display); GetXProperty prop (display, windowH, atoms->state, 0, 64, false, atoms->state); + unsigned long state; + memcpy (&state, prop.data, sizeof (unsigned long)); + return prop.success && prop.actualType == atoms->state && prop.actualFormat == 32 && prop.numItems > 0 - && ((unsigned long*) prop.data)[0] == IconicState; + && state == IconicState; } void setFullScreen (bool shouldBeFullScreen) override @@ -2754,7 +2757,10 @@ private: long getUserTime() const { GetXProperty prop (display, windowH, atoms->userTime, 0, 65536, false, XA_CARDINAL); - return prop.success ? *(long*) prop.data : 0; + long result; + memcpy (&result, prop.data, sizeof (long)); + + return prop.success ? result : 0; } void updateBorderSize() @@ -2774,7 +2780,14 @@ private: if (prop.success && prop.actualFormat == 32) { - auto* sizes = (const unsigned long*) prop.data; + auto data = prop.data; + std::array sizes; + + for (auto& size : sizes) + { + memcpy (&size, data, sizeof (unsigned long)); + data += sizeof (unsigned long); + } windowBorder = BorderSize ((int) sizes[2], (int) sizes[0], (int) sizes[3], (int) sizes[1]); @@ -3141,11 +3154,18 @@ private: && prop.actualFormat == 32 && prop.numItems != 0) { - auto* types = (const unsigned long*) prop.data; + auto* types = prop.data; for (unsigned long i = 0; i < prop.numItems; ++i) - if (types[i] != None) - srcMimeTypeAtomList.add (types[i]); + { + unsigned long type; + memcpy (&type, types, sizeof (unsigned long)); + + if (type != None) + srcMimeTypeAtomList.add (type); + + types += sizeof (unsigned long); + } } } @@ -3566,8 +3586,16 @@ void Displays::findDisplays (float masterScale) for (int i = 0; i < numMonitors; ++i) { - if (auto* position = (const long*) getWorkAreaPropertyData (i)) + if (auto* positionData = getWorkAreaPropertyData (i)) { + std::array position; + + for (auto& p : position) + { + memcpy (&p, positionData, sizeof (long)); + positionData += sizeof (long); + } + Display d; d.totalArea = Rectangle ((int) position[0], (int) position[1], (int) position[2], (int) position[3]); diff --git a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h index 97aebcdb4f..9d431c6554 100644 --- a/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h +++ b/modules/juce_gui_extra/embedding/juce_XEmbedComponent.h @@ -87,7 +87,7 @@ public: /** Destructor. */ - ~XEmbedComponent(); + ~XEmbedComponent() override; /** Use this method to retrieve the host's window id when using the host initiated version of the XEmbedProtocol diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp index 6d6435a6a6..3be2cad491 100644 --- a/modules/juce_gui_extra/juce_gui_extra.cpp +++ b/modules/juce_gui_extra/juce_gui_extra.cpp @@ -109,12 +109,25 @@ #endif #endif + #if JUCE_CLANG + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif + #endif + #include #if JUCE_GCC #pragma GCC diagnostic pop #endif + #if JUCE_CLANG + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic pop + #endif + #endif + #include #include #include diff --git a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp index 720ae024d9..484f271a62 100644 --- a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp @@ -427,7 +427,7 @@ public: : Thread ("Webview"), owner (parent) {} - ~Pimpl() + ~Pimpl() override { quit(); } @@ -450,7 +450,7 @@ public: unsigned long windowHandle; ssize_t actual = read (inChannel, &windowHandle, sizeof (windowHandle)); - if (actual != sizeof (windowHandle)) + if (actual != (ssize_t) sizeof (windowHandle)) { killChild(); return; @@ -709,6 +709,9 @@ WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidd : browser (new Pimpl (*this)), unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_) { + ignoreUnused (blankPageShown); + ignoreUnused (unloadPageWhenBrowserIsHidden); + setOpaque (true); browser->init(); diff --git a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp index e0f68d0b1e..3a1f34d84f 100644 --- a/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_XEmbedComponent.cpp @@ -151,7 +151,7 @@ public: owner.addComponentListener (this); } - ~Pimpl() + ~Pimpl() override { owner.removeComponentListener (this); setClient (0, true); @@ -381,12 +381,16 @@ private: if (embedInfo.success && embedInfo.actualFormat == 32 && embedInfo.numItems >= 2 && embedInfo.data != nullptr) { - auto* buffer = (long*) embedInfo.data; + long version; + memcpy (&version, embedInfo.data, sizeof (long)); supportsXembed = true; - xembedVersion = jmin ((int) maxXEmbedVersionToSupport, (int) buffer[0]); + xembedVersion = jmin ((int) maxXEmbedVersionToSupport, (int) version); - return ((buffer[1] & XEMBED_MAPPED) != 0); + long flags; + memcpy (&flags, embedInfo.data + sizeof (long), sizeof (long)); + + return ((flags & XEMBED_MAPPED) != 0); } else { diff --git a/modules/juce_osc/osc/juce_OSCReceiver.cpp b/modules/juce_osc/osc/juce_OSCReceiver.cpp index a152ea1cf0..114819455b 100644 --- a/modules/juce_osc/osc/juce_OSCReceiver.cpp +++ b/modules/juce_osc/osc/juce_OSCReceiver.cpp @@ -321,7 +321,7 @@ struct OSCReceiver::Pimpl : private Thread, { } - ~Pimpl() + ~Pimpl() override { disconnect(); } diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp index 2ba9c6f7f5..19cc0887d6 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp @@ -62,7 +62,7 @@ struct OnlineUnlockForm::OverlayComp : public Component, startThread (4); } - ~OverlayComp() + ~OverlayComp() override { stopThread (10000); }