From 974b4a83511ced617a031982edde8cfaa035ea2b Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 13 Jun 2018 16:58:36 +0100 Subject: [PATCH] Removed some legacy friend class declarations that are no longer needed with modern compilers --- .../Source/Licenses/jucer_LicenseController.h | 3 - .../audio_io/juce_AudioDeviceManager.h | 2 - .../native/juce_linux_Midi.cpp | 67 +++++++++---------- .../format/juce_AudioFormatWriter.h | 1 - .../scanning/juce_PluginListComponent.h | 2 - .../juce_AudioProcessorValueTreeState.h | 3 - .../audio_cd/juce_AudioCDBurner.h | 1 - .../gui/juce_AudioDeviceSelectorComponent.h | 1 - .../gui/juce_AudioThumbnail.h | 7 -- .../gui/juce_AudioThumbnailCache.h | 1 - .../gui/juce_AudioVisualiserComponent.h | 2 - modules/juce_core/containers/juce_Variant.h | 24 +++---- .../juce_core/files/juce_DirectoryIterator.h | 8 +-- modules/juce_core/maths/juce_Expression.h | 4 -- modules/juce_core/network/juce_URL.h | 1 - .../juce_core/text/juce_LocalisedStrings.h | 1 - modules/juce_core/threads/juce_ChildProcess.h | 1 - .../threads/juce_HighResolutionTimer.h | 2 - .../juce_core/threads/juce_InterProcessLock.h | 1 - modules/juce_core/threads/juce_ThreadPool.h | 2 - .../zip/juce_GZIPCompressorOutputStream.h | 1 - .../zip/juce_GZIPDecompressorInputStream.h | 1 - modules/juce_core/zip/juce_ZipFile.h | 1 - .../undomanager/juce_UndoManager.h | 1 - .../interprocess/juce_ConnectedChildProcess.h | 4 -- .../juce_InterprocessConnection.h | 3 +- .../messages/juce_ApplicationBase.h | 2 - .../juce_MountedVolumeListChangeDetector.h | 1 - .../juce_graphics/fonts/juce_CustomTypeface.h | 3 +- modules/juce_graphics/fonts/juce_Typeface.h | 1 - .../native/juce_RenderingHelpers.h | 1 - .../juce_win32_Direct2DGraphicsContext.h | 2 - modules/juce_gui_basics/buttons/juce_Button.h | 2 - .../components/juce_Component.h | 2 - .../components/juce_ModalComponentManager.h | 5 +- .../layout/juce_ConcertinaPanel.h | 5 -- .../juce_gui_basics/layout/juce_ScrollBar.h | 1 - .../layout/juce_TabbedButtonBar.h | 2 - .../juce_gui_basics/layout/juce_Viewport.h | 2 - .../mouse/juce_DragAndDropContainer.h | 2 - modules/juce_gui_basics/widgets/juce_Slider.h | 2 - .../juce_gui_basics/widgets/juce_TreeView.h | 7 +- .../windows/juce_DocumentWindow.h | 1 - .../code_editor/juce_CodeEditorComponent.h | 4 -- .../embedding/juce_ActiveXControlComponent.h | 1 - .../embedding/juce_UIViewComponent.h | 1 - .../embedding/juce_XEmbedComponent.h | 1 - .../juce_gui_extra/misc/juce_ColourSelector.h | 4 -- .../misc/juce_KeyMappingEditorComponent.h | 3 - .../misc/juce_LiveConstantEditor.h | 2 - .../native/juce_linux_XEmbedComponent.cpp | 31 ++++----- .../opengl/juce_OpenGLFrameBuffer.h | 2 - modules/juce_osc/osc/juce_OSCReceiver.h | 2 - modules/juce_osc/osc/juce_OSCSender.h | 2 - .../juce_video/capture/juce_CameraDevice.h | 2 - .../juce_video/playback/juce_VideoComponent.h | 2 - 56 files changed, 64 insertions(+), 179 deletions(-) diff --git a/extras/Projucer/Source/Licenses/jucer_LicenseController.h b/extras/Projucer/Source/Licenses/jucer_LicenseController.h index d970d2968b..8070027cea 100644 --- a/extras/Projucer/Source/Licenses/jucer_LicenseController.h +++ b/extras/Projucer/Source/Licenses/jucer_LicenseController.h @@ -103,9 +103,6 @@ private: #if ! JUCER_ENABLE_GPL_MODE //============================================================================== struct ModalCompletionCallback; - friend struct ModalCompletionCallback; - - friend struct ContainerDeletePolicy; friend struct LicenseThread; //============================================================================== diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h index adbfa99fdb..c8a262fbc3 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h @@ -504,8 +504,6 @@ private: //============================================================================== class CallbackHandler; - friend class CallbackHandler; - friend struct ContainerDeletePolicy; std::unique_ptr callbackHandler; void audioDeviceIOCallbackInt (const float** inputChannelData, int totalNumInputChannels, diff --git a/modules/juce_audio_devices/native/juce_linux_Midi.cpp b/modules/juce_audio_devices/native/juce_linux_Midi.cpp index ad33f5517e..3e446a0765 100644 --- a/modules/juce_audio_devices/native/juce_linux_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_linux_Midi.cpp @@ -38,6 +38,37 @@ namespace class AlsaClient : public ReferenceCountedObject { public: + AlsaClient() + { + jassert (instance == nullptr); + + snd_seq_open (&handle, "default", SND_SEQ_OPEN_DUPLEX, 0); + + if (handle != nullptr) + { + snd_seq_nonblock (handle, SND_SEQ_NONBLOCK); + snd_seq_set_client_name (handle, JUCE_ALSA_MIDI_NAME); + clientId = snd_seq_client_id (handle); + + // It's good idea to pre-allocate a good number of elements + ports.ensureStorageAllocated (32); + } + } + + ~AlsaClient() + { + jassert (instance != nullptr); + instance = nullptr; + + if (handle != nullptr) + snd_seq_close (handle); + + jassert (activeCallbacks.get() == 0); + + if (inputThread) + inputThread->stopThread (3000); + } + using Ptr = ReferenceCountedObjectPtr; //============================================================================== @@ -251,42 +282,6 @@ private: static AlsaClient* instance; - //============================================================================== - friend class ReferenceCountedObjectPtr; - friend struct ContainerDeletePolicy; - - AlsaClient() - { - jassert (instance == nullptr); - - snd_seq_open (&handle, "default", SND_SEQ_OPEN_DUPLEX, 0); - - if (handle != nullptr) - { - snd_seq_nonblock (handle, SND_SEQ_NONBLOCK); - snd_seq_set_client_name (handle, JUCE_ALSA_MIDI_NAME); - clientId = snd_seq_client_id (handle); - - // It's good idea to pre-allocate a good number of elements - ports.ensureStorageAllocated (32); - } - } - - ~AlsaClient() - { - jassert (instance != nullptr); - - instance = nullptr; - - if (handle != nullptr) - snd_seq_close (handle); - - jassert (activeCallbacks.get() == 0); - - if (inputThread) - inputThread->stopThread (3000); - } - //============================================================================== class MidiInputThread : public Thread { diff --git a/modules/juce_audio_formats/format/juce_AudioFormatWriter.h b/modules/juce_audio_formats/format/juce_AudioFormatWriter.h index 3231dc87c2..16f699b295 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatWriter.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatWriter.h @@ -240,7 +240,6 @@ public: private: class Buffer; - friend struct ContainerDeletePolicy; std::unique_ptr buffer; }; diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.h b/modules/juce_audio_processors/scanning/juce_PluginListComponent.h index d7d71ffb77..53a228ff43 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.h +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.h @@ -113,8 +113,6 @@ private: std::unique_ptr tableModel; class Scanner; - friend class Scanner; - friend struct ContainerDeletePolicy; std::unique_ptr currentScanner; void scanFinished (const StringArray&); diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h index ed9557541c..3730bc95c4 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h @@ -197,7 +197,6 @@ public: private: struct Pimpl; - friend struct ContainerDeletePolicy; std::unique_ptr pimpl; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SliderAttachment) }; @@ -226,7 +225,6 @@ public: private: struct Pimpl; - friend struct ContainerDeletePolicy; std::unique_ptr pimpl; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComboBoxAttachment) }; @@ -250,7 +248,6 @@ public: private: struct Pimpl; - friend struct ContainerDeletePolicy; std::unique_ptr pimpl; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ButtonAttachment) }; diff --git a/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h b/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h index cca1367565..b74019dda1 100644 --- a/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h +++ b/modules/juce_audio_utils/audio_cd/juce_AudioCDBurner.h @@ -162,7 +162,6 @@ private: AudioCDBurner (const int deviceIndex); class Pimpl; - friend struct ContainerDeletePolicy; std::unique_ptr pimpl; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioCDBurner) diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h index f57fc69358..a589f9c415 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.h @@ -105,7 +105,6 @@ private: const bool hideAdvancedOptionsWithButton; class MidiInputSelectorComponentListBox; - friend struct ContainerDeletePolicy; std::unique_ptr midiInputsList; std::unique_ptr midiOutputSelector; std::unique_ptr