From 4583fa3fbfe24a3a3c684305502af0ec8310cf0a Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 23 Dec 2015 16:27:50 +0000 Subject: [PATCH] Used the ignoreUnused() function to tidy up some old code --- examples/Demo/Source/Demos/DialogsDemo.cpp | 3 +-- .../buffers/juce_FloatVectorOperations.cpp | 2 +- .../sources/juce_PositionableAudioSource.h | 2 +- .../synthesisers/juce_Synthesiser.cpp | 4 ++-- .../midi_io/juce_MidiInput.h | 3 +-- .../native/juce_android_OpenSL.cpp | 4 ++-- .../native/juce_mac_AudioCDReader.mm | 2 +- .../native/juce_mac_CoreMidi.cpp | 2 +- .../native/juce_win32_ASIO.cpp | 2 +- .../native/juce_win32_DirectSound.cpp | 4 ++-- .../native/juce_win32_WASAPI.cpp | 2 +- .../codecs/juce_AiffAudioFormat.cpp | 2 +- .../codecs/juce_FlacAudioFormat.cpp | 2 +- .../codecs/juce_LAMEEncoderAudioFormat.cpp | 2 +- .../AAX/juce_AAX_Wrapper.cpp | 7 ++----- .../VST/juce_VST_Wrapper.cpp | 4 ++-- .../VST3/juce_VST3_Wrapper.cpp | 2 +- .../utility/juce_PluginUtilities.cpp | 2 +- .../format_types/juce_VST3PluginFormat.cpp | 5 ++--- .../format_types/juce_VSTPluginFormat.cpp | 2 +- modules/juce_core/containers/juce_Array.h | 8 +++---- .../containers/juce_ElementComparator.h | 4 ++-- .../juce_core/containers/juce_OwnedArray.h | 10 ++++----- .../containers/juce_ReferenceCountedArray.h | 6 +++--- .../juce_core/javascript/juce_Javascript.cpp | 2 +- modules/juce_core/maths/juce_Expression.cpp | 2 +- modules/juce_core/maths/juce_MathsFunctions.h | 2 +- modules/juce_core/native/juce_mac_Files.mm | 2 +- modules/juce_core/native/juce_mac_Network.mm | 7 ++----- .../juce_core/native/juce_osx_ObjCHelpers.h | 6 +++--- .../juce_core/native/juce_posix_SharedCode.h | 4 ++-- .../native/juce_win32_SystemStats.cpp | 2 +- .../juce_core/native/juce_win32_Threads.cpp | 2 +- .../undomanager/juce_UndoableAction.h | 2 +- .../native/juce_linux_Messaging.cpp | 8 +++---- .../native/juce_mac_CoreGraphicsContext.mm | 2 +- .../juce_graphics/native/juce_mac_Fonts.mm | 2 +- .../juce_win32_Direct2DGraphicsContext.cpp | 2 +- .../juce_FileSearchPathListComponent.cpp | 2 +- .../lookandfeel/juce_LookAndFeel_V3.cpp | 2 +- .../juce_gui_basics/menus/juce_PopupMenu.cpp | 2 +- .../native/juce_ios_UIViewComponentPeer.mm | 17 +++++++-------- .../native/juce_mac_NSViewComponentPeer.mm | 4 ++-- .../native/juce_mac_Windowing.mm | 4 ++-- .../native/juce_win32_Windowing.cpp | 2 +- .../juce_gui_basics/widgets/juce_Label.cpp | 2 +- .../juce_gui_basics/widgets/juce_ListBox.cpp | 2 +- .../widgets/juce_TableListBox.cpp | 2 +- .../windows/juce_AlertWindow.cpp | 2 +- .../windows/juce_ComponentPeer.cpp | 2 +- .../misc/juce_RecentlyOpenedFilesList.cpp | 2 +- .../native/juce_mac_AppleRemote.mm | 21 +++++++++---------- .../native/juce_mac_WebBrowserComponent.mm | 8 +++---- modules/juce_opengl/native/juce_OpenGL_ios.h | 2 +- modules/juce_opengl/native/juce_OpenGL_osx.h | 2 +- 55 files changed, 98 insertions(+), 111 deletions(-) diff --git a/examples/Demo/Source/Demos/DialogsDemo.cpp b/examples/Demo/Source/Demos/DialogsDemo.cpp index b1bbf5523c..2c9284da27 100644 --- a/examples/Demo/Source/Demos/DialogsDemo.cpp +++ b/examples/Demo/Source/Demos/DialogsDemo.cpp @@ -249,8 +249,7 @@ private: { // this is the item they chose in the drop-down list.. const int optionIndexChosen = w.getComboBoxComponent ("option")->getSelectedItemIndex(); - (void) optionIndexChosen; // (just avoids a compiler warning about unused variables) - + ignoreUnused (optionIndexChosen); // this is the text they entered.. String text = w.getTextEditorContents ("text"); diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index 1d804a160c..f6548ce64f 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -1005,7 +1005,7 @@ void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode (bool shouldEnab if (FloatVectorHelpers::isSSE2Available()) _MM_SET_FLUSH_ZERO_MODE (shouldEnable ? _MM_FLUSH_ZERO_ON : _MM_FLUSH_ZERO_OFF); #endif - (void) shouldEnable; + ignoreUnused (shouldEnable); } //============================================================================== diff --git a/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h b/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h index 2084f0be94..f69e6d569c 100644 --- a/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h +++ b/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h @@ -71,7 +71,7 @@ public: virtual bool isLooping() const = 0; /** Tells the source whether you'd like it to play in a loop. */ - virtual void setLooping (bool shouldLoop) { (void) shouldLoop; } + virtual void setLooping (bool shouldLoop) { ignoreUnused (shouldLoop); } }; diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp index 3433428bc9..7f27b33d77 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp @@ -512,13 +512,13 @@ void Synthesiser::handleSostenutoPedal (int midiChannel, bool isDown) void Synthesiser::handleSoftPedal (int midiChannel, bool /*isDown*/) { - (void) midiChannel; + ignoreUnused (midiChannel); jassert (midiChannel > 0 && midiChannel <= 16); } void Synthesiser::handleProgramChange (int midiChannel, int programNumber) { - (void) midiChannel; (void) programNumber; + ignoreUnused (midiChannel, programNumber); jassert (midiChannel > 0 && midiChannel <= 16); } diff --git a/modules/juce_audio_devices/midi_io/juce_MidiInput.h b/modules/juce_audio_devices/midi_io/juce_MidiInput.h index 0c5a5b62e1..65c51a75e0 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiInput.h +++ b/modules/juce_audio_devices/midi_io/juce_MidiInput.h @@ -74,8 +74,7 @@ public: int numBytesSoFar, double timestamp) { - // (this bit is just to avoid compiler warnings about unused variables) - (void) source; (void) messageData; (void) numBytesSoFar; (void) timestamp; + ignoreUnused (source, messageData, numBytesSoFar, timestamp); } }; diff --git a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index da7ccb2d9d..08580aa081 100644 --- a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -552,7 +552,7 @@ private: static void staticCallback (SLAndroidSimpleBufferQueueItf queue, void* context) noexcept { - jassert (queue == static_cast (context)->playerBufferQueue); (void) queue; + jassert (queue == static_cast (context)->playerBufferQueue); ignoreUnused (queue); static_cast (context)->bufferList.bufferReturned(); } @@ -687,7 +687,7 @@ private: static void staticCallback (SLAndroidSimpleBufferQueueItf queue, void* context) noexcept { - jassert (queue == static_cast (context)->recorderBufferQueue); (void) queue; + jassert (queue == static_cast (context)->recorderBufferQueue); ignoreUnused (queue); static_cast (context)->bufferList.bufferReturned(); } diff --git a/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm b/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm index 8d87fac115..1ef5bd3ecf 100644 --- a/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm +++ b/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm @@ -169,7 +169,7 @@ void AudioCDReader::refreshTrackLengths() { XmlDocument doc (toc); const char* error = CDReaderHelpers::getTrackOffsets (doc, trackStartSamples); - (void) error; // could be logged.. + ignoreUnused (error); // could be logged.. lengthInSamples = trackStartSamples.getLast() - trackStartSamples.getFirst(); } diff --git a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp index d1ad9370e9..a5d75b779f 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp @@ -37,7 +37,7 @@ namespace CoreMidiHelpers Logger::writeToLog ("CoreMIDI error: " + String (lineNum) + " - " + String::toHexString ((int) err)); #endif - (void) lineNum; + ignoreUnused (lineNum); return false; } diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index dc0f4e04b6..44af72d868 100644 --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -67,7 +67,7 @@ namespace ASIODebugging #else static void dummyLog() {} #define JUCE_ASIO_LOG(msg) ASIODebugging::dummyLog() - #define JUCE_ASIO_LOG_ERROR(msg, errNum) (void) errNum; ASIODebugging::dummyLog() + #define JUCE_ASIO_LOG_ERROR(msg, errNum) ignoreUnused (errNum); ASIODebugging::dummyLog() #endif } diff --git a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp index 75e007c61e..410e98062e 100644 --- a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp +++ b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp @@ -249,7 +249,7 @@ public: { JUCE_DS_LOG ("closing output: " + name); HRESULT hr = pOutputBuffer->Stop(); - JUCE_DS_LOG_ERROR (hr); (void) hr; + JUCE_DS_LOG_ERROR (hr); ignoreUnused (hr); pOutputBuffer->Release(); pOutputBuffer = nullptr; @@ -532,7 +532,7 @@ public: { JUCE_DS_LOG ("closing input: " + name); HRESULT hr = pInputBuffer->Stop(); - JUCE_DS_LOG_ERROR (hr); (void) hr; + JUCE_DS_LOG_ERROR (hr); ignoreUnused (hr); pInputBuffer->Release(); pInputBuffer = nullptr; diff --git a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp index 1b2a4ad495..8211dbc2ed 100644 --- a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp +++ b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp @@ -32,7 +32,7 @@ namespace WasapiClasses void logFailure (HRESULT hr) { - (void) hr; + ignoreUnused (hr); jassert (hr != (HRESULT) 0x800401f0); // If you hit this, it means you're trying to call from // a thread which hasn't been initialised with CoInitialize(). diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index 8a4057fd41..73515f3d6d 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -715,7 +715,7 @@ private: using namespace AiffFileHelpers; const bool couldSeekOk = output->setPosition (headerPosition); - (void) couldSeekOk; + ignoreUnused (couldSeekOk); // if this fails, you've given it an output stream that can't seek! It needs // to be able to seek back to write the header diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp index 34e6a3bb06..3d257d1374 100644 --- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp @@ -433,7 +433,7 @@ public: memcpy (buffer + 18, info.md5sum, 16); const bool seekOk = output->setPosition (4); - (void) seekOk; + ignoreUnused (seekOk); // if this fails, you've given it an output stream that can't seek! It needs // to be able to seek back to write the header diff --git a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp index c7468fbeb4..9eda5014b0 100644 --- a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp @@ -110,7 +110,7 @@ private: if (cp.start (processArgs)) { const String childOutput (cp.readAllProcessOutput()); - DBG (childOutput); (void) childOutput; + DBG (childOutput); ignoreUnused (childOutput); cp.waitForProcessToFinish (10000); return tempMP3.getFile().getSize() > 0; diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index b2e078411f..3aeddac900 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -111,7 +111,7 @@ struct AAXClasses { static void check (AAX_Result result) { - jassert (result == AAX_SUCCESS); (void) result; + jassert (result == AAX_SUCCESS); ignoreUnused (result); } static int getParamIndexFromID (AAX_CParamID paramID) noexcept @@ -900,8 +900,7 @@ struct AAXClasses midiBuffer.clear(); - (void) midiNodeIn; - (void) midiNodesOut; + ignoreUnused (midiNodeIn, midiNodesOut); #if JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect { @@ -969,8 +968,6 @@ struct AAXClasses } } } - #else - (void) midiNodesOut; #endif } 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 a06441c08b..57220fee95 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -454,7 +454,7 @@ public: VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) override { - (void) lArg; (void) lArg2; (void) ptrArg; (void) floatArg; + ignoreUnused (lArg, lArg2, ptrArg, floatArg); #if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 if ((lArg == 'stCA' || lArg == 'stCa') && lArg2 == 'FUID' && ptrArg != nullptr) @@ -488,7 +488,7 @@ public: VSTMidiEventList::addEventsToMidiBuffer (events, midiEvents); return 1; #else - (void) events; + ignoreUnused (events); return 0; #endif } 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 e267a50ad5..49c3ed63da 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -1014,7 +1014,7 @@ public: { const int headerLen = static_cast (htonl (*(juce::int32*) (data + 4))); const struct fxBank* bank = (const struct fxBank*) (data + (8 + headerLen)); - const int version = static_cast (htonl (bank->version)); (void) version; + const int version = static_cast (htonl (bank->version)); ignoreUnused (version); jassert ('VstW' == htonl (*(juce::int32*) data)); jassert (1 == htonl (*(juce::int32*) (data + 8))); // version should be 1 according to Steinberg's docs diff --git a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp index 19ee6a7ef9..48855f7d3c 100644 --- a/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp +++ b/modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp @@ -54,7 +54,7 @@ extern "C" BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserve } #endif - (void) reserved; + ignoreUnused (reserved); return TRUE; } diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 1cf35f8076..f8bd159306 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -455,7 +455,7 @@ public: tresult PLUGIN_API requestOpenEditor (FIDString name) override { - (void) name; + ignoreUnused (name); jassertfalse; return kResultFalse; } @@ -2015,8 +2015,7 @@ public: /** @note Not applicable to VST3 */ void setCurrentProgramStateInformation (const void* data, int sizeInBytes) override { - (void) data; - (void) sizeInBytes; + ignoreUnused (data, sizeInBytes); } //============================================================================== diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 2f7e99df70..80581bfb0d 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2158,7 +2158,7 @@ public: //============================================================================== void mouseDown (const MouseEvent& e) override { - (void) e; + ignoreUnused (e); #if JUCE_LINUX if (pluginWindow == 0) diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 8c48dabc6d..a927d87055 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -762,8 +762,8 @@ public: template int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); @@ -1116,8 +1116,8 @@ public: const bool retainOrderOfEquivalentItems = false) { const ScopedLockType lock (getLock()); - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems); } diff --git a/modules/juce_core/containers/juce_ElementComparator.h b/modules/juce_core/containers/juce_ElementComparator.h index 41f63ca88e..2cca3f510a 100644 --- a/modules/juce_core/containers/juce_ElementComparator.h +++ b/modules/juce_core/containers/juce_ElementComparator.h @@ -128,8 +128,8 @@ static int findInsertIndexInSortedArray (ElementComparator& comparator, { jassert (firstElement <= lastElement); - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused while (firstElement < lastElement) { diff --git a/modules/juce_core/containers/juce_OwnedArray.h b/modules/juce_core/containers/juce_OwnedArray.h index d066a21e77..31078f619c 100644 --- a/modules/juce_core/containers/juce_OwnedArray.h +++ b/modules/juce_core/containers/juce_OwnedArray.h @@ -523,8 +523,8 @@ public: template int addSorted (ElementComparator& comparator, ObjectClass* const newObject) noexcept { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); insert (index, newObject); @@ -546,7 +546,7 @@ public: template int indexOfSorted (ElementComparator& comparator, const ObjectClass* const objectToLookFor) const noexcept { - (void) comparator; + ignoreUnused (comparator); const ScopedLockType lock (getLock()); int s = 0, e = numUsed; @@ -854,8 +854,8 @@ public: void sort (ElementComparator& comparator, bool retainOrderOfEquivalentItems = false) const noexcept { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems); diff --git a/modules/juce_core/containers/juce_ReferenceCountedArray.h b/modules/juce_core/containers/juce_ReferenceCountedArray.h index db02fb1e6c..1b4668eda9 100644 --- a/modules/juce_core/containers/juce_ReferenceCountedArray.h +++ b/modules/juce_core/containers/juce_ReferenceCountedArray.h @@ -518,7 +518,7 @@ public: int indexOfSorted (ElementComparator& comparator, const ObjectClass* const objectToLookFor) const noexcept { - (void) comparator; + ignoreUnused (comparator); const ScopedLockType lock (getLock()); int s = 0, e = numUsed; @@ -835,8 +835,8 @@ public: void sort (ElementComparator& comparator, const bool retainOrderOfEquivalentItems = false) const noexcept { - (void) comparator; // if you pass in an object with a static compareElements() method, this - // avoids getting warning messages about the parameter being unused + ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this + // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems); diff --git a/modules/juce_core/javascript/juce_Javascript.cpp b/modules/juce_core/javascript/juce_Javascript.cpp index 1656b56f59..3c8c0114d8 100644 --- a/modules/juce_core/javascript/juce_Javascript.cpp +++ b/modules/juce_core/javascript/juce_Javascript.cpp @@ -1466,7 +1466,7 @@ struct JavascriptEngine::RootObject : public DynamicObject } static Identifier getClassName() { static const Identifier i ("Object"); return i; } - static var dump (Args a) { DBG (JSON::toString (a.thisObject)); (void) a; return var::undefined(); } + static var dump (Args a) { DBG (JSON::toString (a.thisObject)); ignoreUnused (a); return var::undefined(); } static var cloneFn (Args a) { return a.thisObject.clone(); } }; diff --git a/modules/juce_core/maths/juce_Expression.cpp b/modules/juce_core/maths/juce_Expression.cpp index fb9660a1da..97a15a50f2 100644 --- a/modules/juce_core/maths/juce_Expression.cpp +++ b/modules/juce_core/maths/juce_Expression.cpp @@ -427,7 +427,7 @@ struct Expression::Helpers TermPtr createTermToEvaluateInput (const Scope& scope, const Term* t, double overallTarget, Term* topLevelTerm) const { - (void) t; + ignoreUnused (t); jassert (t == input); const Term* const dest = findDestinationFor (topLevelTerm, this); diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 0f2ee6e4e6..9d9a142cc3 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -299,7 +299,7 @@ void ignoreUnused (const Type1&, const Type2&, const Type3&, const Type4&) noexc template int numElementsInArray (Type (&array)[N]) { - (void) array; // (required to avoid a spurious warning in MS compilers) + ignoreUnused (array); (void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator return N; } diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm index 5817bb6252..a715e1fba8 100644 --- a/modules/juce_core/native/juce_mac_Files.mm +++ b/modules/juce_core/native/juce_mac_Files.mm @@ -404,7 +404,7 @@ bool JUCE_CALLTYPE Process::openDocument (const String& fileName, const String& filenameAsURL = [NSURL fileURLWithPath: fileNameAsNS]; #if JUCE_IOS - (void) parameters; + ignoreUnused (parameters); return [[UIApplication sharedApplication] openURL: filenameAsURL]; #else NSWorkspace* workspace = [NSWorkspace sharedWorkspace]; diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 287bba98da..f14adc744c 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -64,10 +64,7 @@ bool JUCE_CALLTYPE Process::openEmailWithAttachments (const String& targetEmailA const StringArray& filesToAttach) { #if JUCE_IOS - (void) targetEmailAddress; - (void) emailSubject; - (void) bodyText; - (void) filesToAttach; + ignoreUnused (targetEmailAddress, emailSubject, bodyText, filesToAttach); //xxx probably need to use MFMailComposeViewController jassertfalse; @@ -234,7 +231,7 @@ public: void didFailWithError (NSError* error) { - DBG (nsStringToJuce ([error description])); (void) error; + DBG (nsStringToJuce ([error description])); ignoreUnused (error); hasFailed = true; initialised = true; signalThreadShouldExit(); diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h index b0222635cb..afd1d02289 100644 --- a/modules/juce_core/native/juce_osx_ObjCHelpers.h +++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h @@ -115,14 +115,14 @@ struct ObjCClass void addIvar (const char* name) { BOOL b = class_addIvar (cls, name, sizeof (Type), (uint8_t) rint (log2 (sizeof (Type))), @encode (Type)); - jassert (b); (void) b; + jassert (b); ignoreUnused (b); } template void addMethod (SEL selector, FunctionType callbackFn, const char* signature) { BOOL b = class_addMethod (cls, selector, (IMP) callbackFn, signature); - jassert (b); (void) b; + jassert (b); ignoreUnused (b); } template @@ -146,7 +146,7 @@ struct ObjCClass void addProtocol (Protocol* protocol) { BOOL b = class_addProtocol (cls, protocol); - jassert (b); (void) b; + jassert (b); ignoreUnused (b); } #if JUCE_MAC diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 2bb5a6a108..b2f02ca85c 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -680,7 +680,7 @@ void juce_runSystemCommand (const String&); void juce_runSystemCommand (const String& command) { int result = system (command.toUTF8()); - (void) result; + ignoreUnused (result); } String juce_getOutputFromCommand (const String&); @@ -1286,7 +1286,7 @@ private: THREAD_TIME_CONSTRAINT_POLICY_COUNT) == KERN_SUCCESS; #else - (void) periodMs; + ignoreUnused (periodMs); struct sched_param param; param.sched_priority = sched_get_priority_max (SCHED_RR); return pthread_setschedparam (thread, SCHED_RR, ¶m) == 0; diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index 0db49030a5..fee1b764ef 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -275,7 +275,7 @@ public: #if JUCE_WIN32_TIMER_PERIOD > 0 const MMRESULT res = timeBeginPeriod (JUCE_WIN32_TIMER_PERIOD); - (void) res; + ignoreUnused (res); jassert (res == TIMERR_NOERROR); #endif diff --git a/modules/juce_core/native/juce_win32_Threads.cpp b/modules/juce_core/native/juce_win32_Threads.cpp index 7bef2ec2b5..fec0635c93 100644 --- a/modules/juce_core/native/juce_win32_Threads.cpp +++ b/modules/juce_core/native/juce_win32_Threads.cpp @@ -154,7 +154,7 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const String& name) __except (EXCEPTION_CONTINUE_EXECUTION) {} #else - (void) name; + ignoreUnused (name); #endif } diff --git a/modules/juce_data_structures/undomanager/juce_UndoableAction.h b/modules/juce_data_structures/undomanager/juce_UndoableAction.h index ff22895be2..479dd7692f 100644 --- a/modules/juce_data_structures/undomanager/juce_UndoableAction.h +++ b/modules/juce_data_structures/undomanager/juce_UndoableAction.h @@ -92,7 +92,7 @@ public: If it's not possible to merge the two actions, the method should return zero. */ - virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { (void) nextAction; return nullptr; } + virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { ignoreUnused (nextAction); return nullptr; } }; diff --git a/modules/juce_events/native/juce_linux_Messaging.cpp b/modules/juce_events/native/juce_linux_Messaging.cpp index 62f8e4ad27..cdd9eff459 100644 --- a/modules/juce_events/native/juce_linux_Messaging.cpp +++ b/modules/juce_events/native/juce_linux_Messaging.cpp @@ -49,7 +49,7 @@ public: totalEventCount (0) { int ret = ::socketpair (AF_LOCAL, SOCK_STREAM, 0, fd); - (void) ret; jassert (ret == 0); + ignoreUnused (ret); jassert (ret == 0); } ~InternalMessageQueue() @@ -75,7 +75,7 @@ public: ScopedUnlock ul (lock); const unsigned char x = 0xff; ssize_t bytesWritten = write (fd[0], &x, 1); - (void) bytesWritten; + ignoreUnused (bytesWritten); } } @@ -187,7 +187,7 @@ private: const ScopedUnlock ul (lock); unsigned char x; ssize_t numBytes = read (fd[1], &x, 1); - (void) numBytes; + ignoreUnused (numBytes); } return queue.removeAndReturn (0); @@ -235,7 +235,7 @@ namespace LinuxErrorHandling int errorHandler (Display* display, XErrorEvent* event) { - (void) display; (void) event; + ignoreUnused (display, event); #if JUCE_DEBUG_XERRORS char errorStr[64] = { 0 }; diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 76ac98f30a..2aa0ffa05f 100644 --- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -656,7 +656,7 @@ bool CoreGraphicsContext::drawTextLayout (const AttributedString& text, const Re CoreTextTypeLayout::drawToCGContext (text, area, context, (float) flipHeight); return true; #else - (void) text; (void) area; + ignoreUnused (text, area); return false; #endif } diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm index 80a4630dcb..329eee84ba 100644 --- a/modules/juce_graphics/native/juce_mac_Fonts.mm +++ b/modules/juce_graphics/native/juce_mac_Fonts.mm @@ -1206,6 +1206,6 @@ bool TextLayout::createNativeLayout (const AttributedString& text) } #endif - (void) text; + ignoreUnused (text); return false; } diff --git a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp index 3c25e62520..b364092360 100644 --- a/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp +++ b/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp @@ -40,7 +40,7 @@ public: if (factories->d2dFactory != nullptr) { HRESULT hr = factories->d2dFactory->CreateHwndRenderTarget (props, propsHwnd, renderingTarget.resetAndGetPointerAddress()); - jassert (SUCCEEDED (hr)); (void) hr; + jassert (SUCCEEDED (hr)); ignoreUnused (hr); hr = renderingTarget->CreateSolidColorBrush (D2D1::ColorF::ColorF (0.0f, 0.0f, 0.0f, 1.0f), colourBrush.resetAndGetPointerAddress()); } } diff --git a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp index 2adaa9a519..3239085fc3 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp @@ -153,7 +153,7 @@ void FileSearchPathListComponent::returnKeyPressed (int row) changed(); } #else - (void) row; + ignoreUnused (row); #endif } diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp index 3e8e135c3d..72f0933257 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp @@ -457,7 +457,7 @@ void LookAndFeel_V3::drawLinearSliderBackground (Graphics& g, int x, int y, int void LookAndFeel_V3::drawPopupMenuBackground (Graphics& g, int width, int height) { g.fillAll (findColour (PopupMenu::backgroundColourId)); - (void) width; (void) height; + ignoreUnused (width, height); #if ! JUCE_MAC g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.6f)); diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index 3848e4e170..7954104885 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -1544,7 +1544,7 @@ int PopupMenu::showWithOptionalCallback (const Options& options, ModalComponentM if (userCallback == nullptr && canBeModal) return window->runModalLoop(); #else - (void) canBeModal; + ignoreUnused (canBeModal); jassert (! (userCallback == nullptr && canBeModal)); #endif } diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index 5e2fc6f318..6b56ade38c 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -317,15 +317,14 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c) - (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation duration: (NSTimeInterval) duration { - (void) toInterfaceOrientation; - (void) duration; + ignoreUnused (toInterfaceOrientation, duration); [UIView setAnimationsEnabled: NO]; // disable this because it goes the wrong way and looks like crap. } - (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation { - (void) fromInterfaceOrientation; + ignoreUnused (fromInterfaceOrientation); sendScreenBoundsUpdate (self); [UIView setAnimationsEnabled: YES]; } @@ -347,13 +346,13 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c) - (void) viewWillAppear: (BOOL) animated { - (void) animated; + ignoreUnused (animated); [self viewDidLoad]; } - (void) viewDidAppear: (BOOL) animated { - (void) animated; + ignoreUnused (animated); [self viewDidLoad]; } @@ -405,7 +404,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c) //============================================================================== - (void) touchesBegan: (NSSet*) touches withEvent: (UIEvent*) event { - (void) touches; + ignoreUnused (touches); if (owner != nullptr) owner->handleTouches (event, true, false, false); @@ -413,7 +412,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c) - (void) touchesMoved: (NSSet*) touches withEvent: (UIEvent*) event { - (void) touches; + ignoreUnused (touches); if (owner != nullptr) owner->handleTouches (event, false, false, false); @@ -421,7 +420,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c) - (void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*) event { - (void) touches; + ignoreUnused (touches); if (owner != nullptr) owner->handleTouches (event, false, true, false); @@ -459,7 +458,7 @@ static void sendScreenBoundsUpdate (JuceUIViewController* c) - (BOOL) textView: (UITextView*) textView shouldChangeTextInRange: (NSRange) range replacementText: (NSString*) text { - (void) textView; + ignoreUnused (textView); return owner->textViewReplaceCharacters (Range ((int) range.location, (int) (range.location + range.length)), nsStringToJuce (text)); } diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 8bfee01d02..9287ae6694 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -658,7 +658,7 @@ public: if (invScale > 0.0f) handleMagnifyGesture (0, getMousePos (ev, view), getMouseTime (ev), 1.0f / invScale); #endif - (void) ev; + ignoreUnused (ev); } void redirectCopy (NSObject*) { handleKeyPress (KeyPress ('c', ModifierKeys (ModifierKeys::commandModifier), 'c')); } @@ -1998,7 +1998,7 @@ void Desktop::setKioskComponent (Component* kioskComp, bool shouldBeEnabled, boo SetSystemUIMode (kUIModeNormal, 0); } #else - (void) kioskComp; (void) shouldBeEnabled; (void) allowMenusAndBars; + ignoreUnused (kioskComp, shouldBeEnabled, allowMenusAndBars); // If you're targeting OSes earlier than 10.6 and want to use this feature, // you'll need to enable JUCE_SUPPORT_CARBON. diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm index cb9a4a0f91..ced9b0f7a5 100644 --- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm @@ -270,7 +270,7 @@ public: kIOPMAssertionLevelOn, CFSTR ("JUCE Playback"), &assertionID); - jassert (res == kIOReturnSuccess); (void) res; + jassert (res == kIOReturnSuccess); ignoreUnused (res); } ~PMAssertion() @@ -443,7 +443,7 @@ void Process::setDockIconVisible (bool isVisible) [NSApp setActivationPolicy: isVisible ? NSApplicationActivationPolicyRegular : NSApplicationActivationPolicyProhibited]; #else - (void) isVisible; + ignoreUnused (isVisible); jassertfalse; // sorry, not available in 10.5! #endif } diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index fad1fefa0a..a2b08ade37 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1691,7 +1691,7 @@ private: void setCurrentRenderingEngine (int index) override { - (void) index; + ignoreUnused (index); #if JUCE_DIRECT2D if (getAvailableRenderingEngines().size() > 1) diff --git a/modules/juce_gui_basics/widgets/juce_Label.cpp b/modules/juce_gui_basics/widgets/juce_Label.cpp index 2727c378a5..2fb4b6d0a8 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.cpp +++ b/modules/juce_gui_basics/widgets/juce_Label.cpp @@ -460,7 +460,7 @@ void Label::textEditorEscapeKeyPressed (TextEditor& ed) if (editor != nullptr) { jassert (&ed == editor); - (void) ed; + ignoreUnused (ed); editor->setText (textValue.toString(), false); hideEditor (true); diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.cpp b/modules/juce_gui_basics/widgets/juce_ListBox.cpp index 279bda4f0b..91487420bd 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ListBox.cpp @@ -951,7 +951,7 @@ void ListBox::startDragAndDrop (const MouseEvent& e, const SparseSet& rowsT //============================================================================== Component* ListBoxModel::refreshComponentForRow (int, bool, Component* existingComponentToUpdate) { - (void) existingComponentToUpdate; + ignoreUnused (existingComponentToUpdate); jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code that recycles the components return nullptr; } diff --git a/modules/juce_gui_basics/widgets/juce_TableListBox.cpp b/modules/juce_gui_basics/widgets/juce_TableListBox.cpp index 3cfbc19b82..541f424d3e 100644 --- a/modules/juce_gui_basics/widgets/juce_TableListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_TableListBox.cpp @@ -470,7 +470,7 @@ var TableListBoxModel::getDragSourceDescription (const SparseSet&) Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component* existingComponentToUpdate) { - (void) existingComponentToUpdate; + ignoreUnused (existingComponentToUpdate); jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code that recycles the components return nullptr; } diff --git a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp index 625b95abae..19c9468829 100644 --- a/modules/juce_gui_basics/windows/juce_AlertWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_AlertWindow.cpp @@ -601,7 +601,7 @@ private: else #endif { - (void) modal; // (to avoid an unused variable warning) + ignoreUnused (modal); alertBox->enterModalState (true, callback, true); alertBox.release(); diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp index 70b3d9662d..324b9d274b 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp @@ -593,4 +593,4 @@ void ComponentPeer::setRepresentedFile (const File&) //============================================================================== int ComponentPeer::getCurrentRenderingEngine() const { return 0; } -void ComponentPeer::setCurrentRenderingEngine (int index) { jassert (index == 0); (void) index; } +void ComponentPeer::setCurrentRenderingEngine (int index) { jassert (index == 0); ignoreUnused (index); } diff --git a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp index d9ea43258d..39d7048935 100644 --- a/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp +++ b/modules/juce_gui_extra/misc/juce_RecentlyOpenedFilesList.cpp @@ -141,6 +141,6 @@ void RecentlyOpenedFilesList::registerRecentFileNatively (const File& file) noteNewRecentDocumentURL: [NSURL fileURLWithPath: juceStringToNS (file.getFullPathName())]]; } #else - (void) file; + ignoreUnused (file); #endif } diff --git a/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm b/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm index 6671992e97..8ea7979ef4 100644 --- a/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm +++ b/modules/juce_gui_extra/native/juce_mac_AppleRemote.mm @@ -23,8 +23,8 @@ */ AppleRemoteDevice::AppleRemoteDevice() - : device (0), - queue (0), + : device (nullptr), + queue (nullptr), remoteId (0) { } @@ -73,13 +73,13 @@ namespace CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), device); - (void) hr; + ignoreUnused (hr); (*cfPlugInInterface)->Release (cfPlugInInterface); } } - return *device != 0; + return *device != nullptr; } void appleRemoteQueueCallback (void* const target, const IOReturn result, void*, void*) @@ -91,7 +91,7 @@ namespace bool AppleRemoteDevice::start (const bool inExclusiveMode) { - if (queue != 0) + if (queue != nullptr) return true; stop(); @@ -114,25 +114,25 @@ bool AppleRemoteDevice::start (const bool inExclusiveMode) void AppleRemoteDevice::stop() { - if (queue != 0) + if (queue != nullptr) { (*(IOHIDQueueInterface**) queue)->stop ((IOHIDQueueInterface**) queue); (*(IOHIDQueueInterface**) queue)->dispose ((IOHIDQueueInterface**) queue); (*(IOHIDQueueInterface**) queue)->Release ((IOHIDQueueInterface**) queue); - queue = 0; + queue = nullptr; } - if (device != 0) + if (device != nullptr) { (*(IOHIDDeviceInterface**) device)->close ((IOHIDDeviceInterface**) device); (*(IOHIDDeviceInterface**) device)->Release ((IOHIDDeviceInterface**) device); - device = 0; + device = nullptr; } } bool AppleRemoteDevice::isActive() const { - return queue != 0; + return queue != nullptr; } bool AppleRemoteDevice::open (const bool openInExclusiveMode) @@ -229,7 +229,6 @@ void AppleRemoteDevice::handleCallbackInternal() } cookies [numCookies++] = 0; - //DBG (String::toHexString ((uint8*) cookies, numCookies, 1) + " " + String (totalValues)); static const char buttonPatterns[] = { diff --git a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm index c591d0b18d..36cd7817b5 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -98,7 +98,7 @@ private: [resultListener chooseFilename: juceStringToNS (files.getReference(i).getFullPathName())]; } #else - (void) resultListener; (void) allowMultipleFiles; + ignoreUnused (resultListener, allowMultipleFiles); jassertfalse; // Can't use this without modal loops being enabled! #endif } @@ -122,8 +122,7 @@ private: - (BOOL) gestureRecognizer: (UIGestureRecognizer*) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer*) otherGestureRecognizer { - (void) gestureRecognizer; - (void) otherGestureRecognizer; + ignoreUnused (gestureRecognizer, otherGestureRecognizer); return YES; } @@ -153,8 +152,7 @@ private: - (BOOL) webView: (UIWebView*) webView shouldStartLoadWithRequest: (NSURLRequest*) request navigationType: (UIWebViewNavigationType) navigationType { - (void) webView; - (void) navigationType; + ignoreUnused (webView, navigationType); return ownerComponent->pageAboutToLoad (nsStringToJuce (request.URL.absoluteString)); } diff --git a/modules/juce_opengl/native/juce_OpenGL_ios.h b/modules/juce_opengl/native/juce_OpenGL_ios.h index fa193f2846..816e5eecf8 100644 --- a/modules/juce_opengl/native/juce_OpenGL_ios.h +++ b/modules/juce_opengl/native/juce_OpenGL_ios.h @@ -240,7 +240,7 @@ private: glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorBufferHandle); bool ok = [context renderbufferStorage: GL_RENDERBUFFER fromDrawable: glLayer]; - jassert (ok); (void) ok; + jassert (ok); ignoreUnused (ok); GLint width, height; glGetRenderbufferParameteriv (GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index 21c929070b..3468593f0f 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -72,7 +72,7 @@ public: static void createAttribs (NSOpenGLPixelFormatAttribute* attribs, OpenGLVersion version, const OpenGLPixelFormat& pixFormat, bool shouldUseMultisampling) { - (void) version; + ignoreUnused (version); int numAttribs = 0; #if JUCE_OPENGL3