From b047d9be53333843685dc993de205f1019935d31 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Thu, 7 Apr 2011 22:20:25 +0100 Subject: [PATCH] More 'nullptr' updates and minor clean-ups. --- .../wrapper/AU/juce_AU_Wrapper.mm | 6 +- .../wrapper/VST/juce_VST_Wrapper.cpp | 2 +- juce_amalgamated.cpp | 614 ++++++++---------- juce_amalgamated.h | 14 +- src/application/juce_Application.cpp | 2 +- .../juce_ApplicationCommandManager.cpp | 2 +- .../juce_ApplicationCommandTarget.cpp | 4 +- .../juce_AiffAudioFormat.cpp | 4 +- .../juce_AudioFormatManager.cpp | 6 +- .../juce_AudioThumbnailCache.cpp | 2 +- .../juce_FlacAudioFormat.cpp | 4 +- .../juce_OggVorbisAudioFormat.cpp | 4 +- .../juce_QuickTimeAudioFormat.cpp | 4 +- .../juce_WavAudioFormat.cpp | 4 +- src/audio/devices/juce_AudioDeviceManager.cpp | 4 +- src/audio/devices/juce_AudioIODeviceType.cpp | 16 +- src/audio/dsp/juce_AudioDataConverters.cpp | 105 +-- src/audio/midi/juce_MidiMessage.cpp | 2 +- .../formats/juce_AudioUnitPluginFormat.mm | 2 +- .../plugins/formats/juce_VSTPluginFormat.cpp | 4 +- .../plugins/juce_AudioPluginInstance.cpp | 2 +- src/audio/plugins/juce_KnownPluginList.cpp | 4 +- src/audio/processors/juce_AudioProcessor.cpp | 2 +- .../processors/juce_AudioProcessorGraph.cpp | 8 +- .../processors/juce_AudioProcessorGraph.h | 2 +- .../processors/juce_AudioProcessorPlayer.cpp | 2 +- src/audio/synthesisers/juce_Synthesiser.cpp | 2 +- src/containers/juce_LinkedListPointer.h | 2 +- src/containers/juce_NamedValueSet.cpp | 2 +- src/containers/juce_SortedSet.h | 2 +- src/containers/juce_Variant.cpp | 2 +- src/core/juce_StandardHeader.h | 2 +- src/gui/components/buttons/juce_Button.cpp | 2 +- src/gui/components/controls/juce_ComboBox.cpp | 4 +- src/gui/components/controls/juce_ListBox.cpp | 6 +- .../controls/juce_TableHeaderComponent.cpp | 2 +- .../components/controls/juce_TableListBox.cpp | 2 +- src/gui/components/controls/juce_Toolbar.cpp | 2 +- src/gui/components/controls/juce_TreeView.cpp | 22 +- src/gui/components/controls/juce_TreeView.h | 2 +- src/gui/components/juce_Component.cpp | 8 +- src/gui/components/juce_Component.h | 2 +- src/gui/components/juce_Desktop.cpp | 4 +- .../components/juce_ModalComponentManager.cpp | 2 +- .../keyboard/juce_KeyboardFocusTraverser.cpp | 2 +- .../layout/juce_ComponentAnimator.cpp | 2 +- .../layout/juce_ComponentBuilder.cpp | 6 +- .../layout/juce_StretchableLayoutManager.cpp | 2 +- .../lookandfeel/juce_LookAndFeel.cpp | 6 +- .../lookandfeel/juce_OldSchoolLookAndFeel.cpp | 2 +- src/gui/components/menus/juce_PopupMenu.cpp | 2 +- .../mouse/juce_DragAndDropContainer.cpp | 2 +- .../mouse/juce_MouseInputSource.cpp | 2 +- .../positioning/juce_MarkerList.cpp | 2 +- .../juce_RelativeCoordinatePositioner.cpp | 2 +- .../positioning/juce_RelativePointPath.cpp | 2 +- .../special/juce_OpenGLComponent.cpp | 2 +- .../components/windows/juce_AlertWindow.cpp | 6 +- .../components/windows/juce_ComponentPeer.cpp | 6 +- .../windows/juce_ResizableWindow.cpp | 2 +- .../juce_LowLevelGraphicsSoftwareRenderer.cpp | 26 +- src/gui/graphics/drawables/juce_Drawable.cpp | 2 +- src/gui/graphics/drawables/juce_SVGParser.cpp | 10 +- src/gui/graphics/fonts/juce_Typeface.cpp | 4 +- .../graphics/imaging/juce_ImageFileFormat.cpp | 2 +- src/io/files/juce_File.cpp | 4 +- src/io/files/juce_ZipFile.cpp | 2 +- src/io/network/juce_Socket.cpp | 8 +- src/maths/juce_Expression.cpp | 30 +- .../android/juce_android_CameraDevice.cpp | 4 +- src/native/android/juce_android_Fonts.cpp | 2 +- src/native/android/juce_android_Midi.cpp | 4 +- .../android/juce_android_NativeCode.cpp | 2 +- src/native/android/juce_android_Network.cpp | 2 +- .../android/juce_android_OpenGLComponent.cpp | 4 +- src/native/android/juce_android_Windowing.cpp | 8 +- src/native/common/juce_posix_SharedCode.h | 12 +- src/native/linux/juce_linux_Audio.cpp | 4 +- src/native/linux/juce_linux_AudioCDReader.cpp | 2 +- src/native/linux/juce_linux_Fonts.cpp | 2 +- src/native/linux/juce_linux_JackAudio.cpp | 4 +- src/native/linux/juce_linux_Messaging.cpp | 6 +- src/native/linux/juce_linux_Midi.cpp | 8 +- src/native/linux/juce_linux_Network.cpp | 2 +- src/native/linux/juce_linux_Windowing.cpp | 6 +- src/native/mac/juce_ios_Audio.cpp | 2 +- src/native/mac/juce_ios_MiscUtilities.mm | 2 +- src/native/mac/juce_mac_AudioCDReader.mm | 6 +- src/native/mac/juce_mac_CameraDevice.mm | 2 +- src/native/mac/juce_mac_CoreAudio.cpp | 2 +- src/native/mac/juce_mac_CoreMidi.cpp | 4 +- src/native/mac/juce_mac_Fonts.mm | 2 +- src/native/mac/juce_mac_MainMenu.mm | 4 +- src/native/mac/juce_mac_MiscUtilities.mm | 2 +- src/native/mac/juce_mac_MouseCursor.mm | 6 +- src/native/mac/juce_mac_Network.mm | 6 +- src/native/mac/juce_mac_OpenGLComponent.mm | 6 +- src/native/windows/juce_win32_ASIO.cpp | 14 +- .../windows/juce_win32_ActiveXComponent.cpp | 2 +- .../windows/juce_win32_AudioCDReader.cpp | 6 +- .../windows/juce_win32_CameraDevice.cpp | 2 +- src/native/windows/juce_win32_DirectSound.cpp | 2 +- src/native/windows/juce_win32_Midi.cpp | 6 +- src/native/windows/juce_win32_Network.cpp | 2 +- .../windows/juce_win32_OpenGLComponent.cpp | 6 +- src/native/windows/juce_win32_Threads.cpp | 2 +- src/native/windows/juce_win32_WASAPI.cpp | 4 +- src/native/windows/juce_win32_Windowing.cpp | 14 +- src/text/juce_XmlDocument.cpp | 4 +- src/text/juce_XmlElement.cpp | 4 +- src/threads/juce_Thread.cpp | 2 +- src/utilities/juce_PropertiesFile.cpp | 4 +- src/utilities/juce_UndoableAction.h | 2 +- 113 files changed, 560 insertions(+), 663 deletions(-) diff --git a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm index d81d923fed..4f2c7e96f3 100644 --- a/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm +++ b/extras/audio plugins/wrapper/AU/juce_AU_Wrapper.mm @@ -1101,18 +1101,18 @@ private: 0, pointers, &propertySize) != noErr) - return 0; + return nil; AudioProcessor* filter = (AudioProcessor*) pointers[0]; JuceAU* au = (JuceAU*) pointers[1]; if (filter == nullptr) - return 0; + return nil; AudioProcessorEditor* editorComp = filter->createEditorIfNeeded(); if (editorComp == nullptr) - return 0; + return nil; return [[[JuceUIViewClass alloc] initWithFilter: filter withAU: au diff --git a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp index 63f13c07ee..30fcede9d9 100644 --- a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp +++ b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp @@ -1470,7 +1470,7 @@ namespace catch (...) {} - return 0; + return nullptr; } } diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 1aec3f666a..c6749a648e 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -4181,7 +4181,7 @@ public: virtual double toDouble (const ValueUnion&) const { return 0; } virtual const String toString (const ValueUnion&) const { return String::empty; } virtual bool toBool (const ValueUnion&) const { return false; } - virtual DynamicObject* toObject (const ValueUnion&) const { return 0; } + virtual DynamicObject* toObject (const ValueUnion&) const { return nullptr; } virtual bool isVoid() const noexcept { return false; } virtual bool isInt() const noexcept { return false; } @@ -4715,7 +4715,7 @@ var* NamedValueSet::getVarPointer (const Identifier& name) const if (i->name == name) return &(i->value); - return 0; + return nullptr; } bool NamedValueSet::set (const Identifier& name, const var& newValue) @@ -4886,14 +4886,14 @@ public: virtual int getInputIndexFor (const Term*) const { return -1; } virtual int getOperatorPrecedence() const { return 0; } virtual int getNumInputs() const { return 0; } - virtual Term* getInput (int) const { return 0; } + virtual Term* getInput (int) const { return nullptr; } virtual const ReferenceCountedObjectPtr negated(); virtual const ReferenceCountedObjectPtr createTermToEvaluateInput (const Scope&, const Term* /*inputTerm*/, double /*overallTarget*/, Term* /*topLevelTerm*/) const { jassertfalse; - return 0; + return nullptr; } virtual const String getName() const @@ -5032,7 +5032,7 @@ public: { jassert (input == left || input == right); if (input != left && input != right) - return 0; + return nullptr; const Term* const dest = findDestinationFor (topLevelTerm, this); @@ -5258,7 +5258,7 @@ public: Type getType() const noexcept { return operatorType; } int getInputIndexFor (const Term* possibleInput) const { return possibleInput == input ? 0 : -1; } int getNumInputs() const { return 1; } - Term* getInput (int index) const { return index == 0 ? input.getObject() : 0; } + Term* getInput (int index) const { return index == 0 ? input.getObject() : nullptr; } Term* clone() const { return new Negate (input->clone()); } const TermPtr resolve (const Scope& scope, int recursionDepth) @@ -5307,7 +5307,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; return new Subtract (newDest, (input == left ? right : left)->clone()); } @@ -5331,7 +5331,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; if (input == left) return new Add (newDest, right->clone()); @@ -5358,7 +5358,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; return new Divide (newDest, (input == left ? right : left)->clone()); } @@ -5382,7 +5382,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; if (input == left) return new Multiply (newDest, right->clone()); @@ -5408,7 +5408,7 @@ public: return t; } - return 0; + return nullptr; } static Constant* findTermToAdjust (Term* const term, const bool mustBeFlagged) @@ -5420,7 +5420,7 @@ public: } if (dynamic_cast (term) != nullptr) - return 0; + return nullptr; int i; const int numIns = term->getNumInputs(); @@ -5438,7 +5438,7 @@ public: return c; } - return 0; + return nullptr; } static bool containsAnySymbols (const Term* const t) @@ -5590,7 +5590,7 @@ public: if (isDecimalDigit (*t) || (*t == '.' && isDecimalDigit (t[1]))) return new Constant (CharacterFunctions::readDoubleValue (text), isResolutionTarget); - return 0; + return nullptr; } const TermPtr readExpression() @@ -5723,17 +5723,17 @@ public: } } - return 0; + return nullptr; } const TermPtr readParenthesisedExpression() { if (! readOperator ("(")) - return 0; + return nullptr; const TermPtr e (readExpression()); if (e == nullptr || ! readOperator (")")) - return 0; + return nullptr; return e; } @@ -8092,7 +8092,7 @@ FileInputStream* File::createInputStream() const if (existsAsFile()) return new FileInputStream (*this); - return 0; + return nullptr; } FileOutputStream* File::createOutputStream (const int bufferSize) const @@ -8100,7 +8100,7 @@ FileOutputStream* File::createOutputStream (const int bufferSize) const ScopedPointer out (new FileOutputStream (*this, bufferSize)); if (out->failedToOpen()) - return 0; + return nullptr; return out.release(); } @@ -9036,8 +9036,8 @@ namespace SocketHelpers FD_ZERO (&wset); FD_SET (handle, &wset); - fd_set* const prset = forReading ? &rset : 0; - fd_set* const pwset = forReading ? 0 : &wset; + fd_set* const prset = forReading ? &rset : nullptr; + fd_set* const pwset = forReading ? nullptr : &wset; #if JUCE_WINDOWS if (select (handle + 1, prset, pwset, 0, timeoutp) < 0) @@ -9325,7 +9325,7 @@ StreamingSocket* StreamingSocket::waitForNextConnection() const portNumber, newSocket); } - return 0; + return nullptr; } bool StreamingSocket::isLocal() const noexcept @@ -9429,7 +9429,7 @@ DatagramSocket* DatagramSocket::waitForNextConnection() const } } - return 0; + return nullptr; } int DatagramSocket::waitUntilReady (const bool readyForReading, @@ -10828,7 +10828,7 @@ int ZipFile::getNumEntries() const noexcept const ZipFile::ZipEntry* ZipFile::getEntry (const int index) const noexcept { ZipEntryInfo* const zei = entries [index]; - return zei != nullptr ? &(zei->entry) : 0; + return zei != nullptr ? &(zei->entry) : nullptr; } int ZipFile::getIndexOfFileName (const String& fileName) const noexcept @@ -14602,7 +14602,7 @@ XmlElement* XmlDocument::getDocumentElement (const bool onlyReadOuterDocumentEle } } - return 0; + return nullptr; } const String& XmlDocument::getLastParseError() const noexcept @@ -14812,7 +14812,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) skipNextWhiteSpace(); if (outOfData) - return 0; + return nullptr; const int openBracket = input.indexOf ((juce_wchar) '<'); @@ -16005,7 +16005,7 @@ bool XmlElement::containsChildElement (const XmlElement* const possibleChild) co XmlElement* XmlElement::findParentElementOf (const XmlElement* const elementToLookFor) noexcept { if (this == elementToLookFor || elementToLookFor == nullptr) - return 0; + return nullptr; XmlElement* child = firstChildElement; @@ -16022,7 +16022,7 @@ XmlElement* XmlElement::findParentElementOf (const XmlElement* const elementToLo child = child->nextListItem; } - return 0; + return nullptr; } void XmlElement::getChildElementsAsArray (XmlElement** elems) const noexcept @@ -16309,7 +16309,7 @@ public: return t; } - return 0; + return nullptr; } void stopAll (const int timeOutMilliseconds) @@ -18272,7 +18272,7 @@ void JUCEApplication::sendUnhandledException (const std::exception* const e, ApplicationCommandTarget* JUCEApplication::getNextCommandTarget() { - return 0; + return nullptr; } void JUCEApplication::getAllCommands (Array & commands) @@ -18572,7 +18572,7 @@ const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const if (commands.getUnchecked(i)->commandID == commandID) return commands.getUnchecked(i); - return 0; + return nullptr; } const String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) const noexcept @@ -18808,7 +18808,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::findFirstTargetParentCompone // (unable to use the syntax findParentComponentOfClass () because of a VC6 compiler bug) return c->findParentComponentOfClass ((ApplicationCommandTarget*) 0); - return 0; + return nullptr; } ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const CommandID commandID) @@ -18848,7 +18848,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C } } - return 0; + return nullptr; } bool ApplicationCommandTarget::isCommandActive (const CommandID commandID) @@ -19173,7 +19173,7 @@ PropertiesFile::~PropertiesFile() InterProcessLock::ScopedLockType* PropertiesFile::createProcessLock() const { - return processLock != nullptr ? new InterProcessLock::ScopedLockType (*processLock) : 0; + return processLock != nullptr ? new InterProcessLock::ScopedLockType (*processLock) : nullptr; } bool PropertiesFile::saveIfNeeded() @@ -19351,7 +19351,7 @@ PropertiesFile* PropertiesFile::createDefaultAppPropertiesFile (const String& ap jassert (file != File::nonexistent); if (file == File::nonexistent) - return 0; + return nullptr; return new PropertiesFile (file, millisecondsBeforeSaving, propertiesFileOptions,processLock_); } @@ -20616,7 +20616,7 @@ AudioFormatReader* AiffAudioFormat::createReaderFor (InputStream* sourceStream, if (! deleteStreamIfOpeningFails) w->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* AiffAudioFormat::createWriterFor (OutputStream* out, @@ -20629,7 +20629,7 @@ AudioFormatWriter* AiffAudioFormat::createWriterFor (OutputStream* out, if (getPossibleBitDepths().contains (bitsPerSample)) return new AiffAudioFormatWriter (out, sampleRate, numberOfChannels, bitsPerSample); - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -21335,7 +21335,7 @@ AudioFormat* AudioFormatManager::findFormatForFileExtension (const String& fileE if (getKnownFormat(i)->getFileExtensions().contains (e, true)) return getKnownFormat(i); - return 0; + return nullptr; } const String AudioFormatManager::getWildcardForAllFormats() const @@ -21390,7 +21390,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (const File& file) } } - return 0; + return nullptr; } AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileStream) @@ -21423,7 +21423,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt } } - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -22259,7 +22259,7 @@ ThumbnailCacheEntry* AudioThumbnailCache::findThumbFor (const int64 hash) const if (thumbs.getUnchecked(i)->hash == hash) return thumbs.getUnchecked(i); - return 0; + return nullptr; } bool AudioThumbnailCache::loadThumb (AudioThumbnail& thumb, const int64 hashCode) @@ -22660,7 +22660,7 @@ AudioFormatReader* QuickTimeAudioFormat::createReaderFor (InputStream* sourceStr if (! deleteStreamIfOpeningFails) r->input = 0; - return 0; + return nullptr; } AudioFormatWriter* QuickTimeAudioFormat::createWriterFor (OutputStream* /*streamToWriteTo*/, @@ -22671,7 +22671,7 @@ AudioFormatWriter* QuickTimeAudioFormat::createWriterFor (OutputStream* /*stream int /*qualityOptionIndex*/) { jassertfalse; // not yet implemented! - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -23360,7 +23360,7 @@ AudioFormatReader* WavAudioFormat::createReaderFor (InputStream* sourceStream, if (! deleteStreamIfOpeningFails) r->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* WavAudioFormat::createWriterFor (OutputStream* out, double sampleRate, @@ -23370,7 +23370,7 @@ AudioFormatWriter* WavAudioFormat::createWriterFor (OutputStream* out, double sa if (getPossibleBitDepths().contains (bitsPerSample)) return new WavAudioFormatWriter (out, sampleRate, numChannels, bitsPerSample, metadataValues); - return 0; + return nullptr; } namespace WavFileHelpers @@ -25254,7 +25254,7 @@ void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) cons XmlElement* AudioDeviceManager::createStateXml() const { - return lastExplicitSettings != nullptr ? new XmlElement (*lastExplicitSettings) : 0; + return lastExplicitSettings != nullptr ? new XmlElement (*lastExplicitSettings) : nullptr; } void AudioDeviceManager::scanDevicesIfNeeded() @@ -25285,7 +25285,7 @@ AudioIODeviceType* AudioDeviceManager::findType (const String& inputName, const } } - return 0; + return nullptr; } void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup) @@ -25974,35 +25974,35 @@ AudioIODeviceType::~AudioIODeviceType() } #if ! JUCE_MAC -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_CoreAudio() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_CoreAudio() { return nullptr; } #endif #if ! JUCE_IOS -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_iOSAudio() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_iOSAudio() { return nullptr; } #endif #if ! (JUCE_WINDOWS && JUCE_WASAPI) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI() { return nullptr; } #endif #if ! (JUCE_WINDOWS && JUCE_DIRECTSOUND) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_DirectSound() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_DirectSound() { return nullptr; } #endif #if ! (JUCE_WINDOWS && JUCE_ASIO) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return nullptr; } #endif #if ! (JUCE_LINUX && JUCE_ALSA) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return nullptr; } #endif #if ! (JUCE_LINUX && JUCE_JACK) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; } #endif #if ! JUCE_ANDROID -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android() { return nullptr; } #endif END_JUCE_NAMESPACE @@ -26172,9 +26172,9 @@ void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* de { *(float*) d = source[i]; -#if JUCE_BIG_ENDIAN + #if JUCE_BIG_ENDIAN *(uint32*) d = ByteOrder::swap (*(uint32*) d); -#endif + #endif d += destBytesPerSample; } @@ -26190,9 +26190,9 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de { *(float*) d = source[i]; -#if JUCE_LITTLE_ENDIAN + #if JUCE_LITTLE_ENDIAN *(uint32*) d = ByteOrder::swap (*(uint32*) d); -#endif + #endif d += destBytesPerSample; } @@ -26356,10 +26356,10 @@ void AudioDataConverters::convertFloat32LEToFloat (const void* const source, flo { dest[i] = *(float*)s; -#if JUCE_BIG_ENDIAN + #if JUCE_BIG_ENDIAN uint32* const d = (uint32*) (dest + i); *d = ByteOrder::swap (*d); -#endif + #endif s += srcBytesPerSample; } @@ -26373,10 +26373,10 @@ void AudioDataConverters::convertFloat32BEToFloat (const void* const source, flo { dest[i] = *(float*)s; -#if JUCE_LITTLE_ENDIAN + #if JUCE_LITTLE_ENDIAN uint32* const d = (uint32*) (dest + i); *d = ByteOrder::swap (*d); -#endif + #endif s += srcBytesPerSample; } @@ -26389,41 +26389,15 @@ void AudioDataConverters::convertFloatToFormat (const DataFormat destFormat, { switch (destFormat) { - case int16LE: - convertFloatToInt16LE (source, dest, numSamples); - break; - - case int16BE: - convertFloatToInt16BE (source, dest, numSamples); - break; - - case int24LE: - convertFloatToInt24LE (source, dest, numSamples); - break; - - case int24BE: - convertFloatToInt24BE (source, dest, numSamples); - break; - - case int32LE: - convertFloatToInt32LE (source, dest, numSamples); - break; - - case int32BE: - convertFloatToInt32BE (source, dest, numSamples); - break; - - case float32LE: - convertFloatToFloat32LE (source, dest, numSamples); - break; - - case float32BE: - convertFloatToFloat32BE (source, dest, numSamples); - break; - - default: - jassertfalse; - break; + case int16LE: convertFloatToInt16LE (source, dest, numSamples); break; + case int16BE: convertFloatToInt16BE (source, dest, numSamples); break; + case int24LE: convertFloatToInt24LE (source, dest, numSamples); break; + case int24BE: convertFloatToInt24BE (source, dest, numSamples); break; + case int32LE: convertFloatToInt32LE (source, dest, numSamples); break; + case int32BE: convertFloatToInt32BE (source, dest, numSamples); break; + case float32LE: convertFloatToFloat32LE (source, dest, numSamples); break; + case float32BE: convertFloatToFloat32BE (source, dest, numSamples); break; + default: jassertfalse; break; } } @@ -26434,41 +26408,15 @@ void AudioDataConverters::convertFormatToFloat (const DataFormat sourceFormat, { switch (sourceFormat) { - case int16LE: - convertInt16LEToFloat (source, dest, numSamples); - break; - - case int16BE: - convertInt16BEToFloat (source, dest, numSamples); - break; - - case int24LE: - convertInt24LEToFloat (source, dest, numSamples); - break; - - case int24BE: - convertInt24BEToFloat (source, dest, numSamples); - break; - - case int32LE: - convertInt32LEToFloat (source, dest, numSamples); - break; - - case int32BE: - convertInt32BEToFloat (source, dest, numSamples); - break; - - case float32LE: - convertFloat32LEToFloat (source, dest, numSamples); - break; - - case float32BE: - convertFloat32BEToFloat (source, dest, numSamples); - break; - - default: - jassertfalse; - break; + case int16LE: convertInt16LEToFloat (source, dest, numSamples); break; + case int16BE: convertInt16BEToFloat (source, dest, numSamples); break; + case int24LE: convertInt24LEToFloat (source, dest, numSamples); break; + case int24BE: convertInt24BEToFloat (source, dest, numSamples); break; + case int32LE: convertInt32LEToFloat (source, dest, numSamples); break; + case int32BE: convertInt32BEToFloat (source, dest, numSamples); break; + case float32LE: convertFloat32LEToFloat (source, dest, numSamples); break; + case float32BE: convertFloat32BEToFloat (source, dest, numSamples); break; + default: jassertfalse; break; } } @@ -28991,7 +28939,7 @@ const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const const uint8* MidiMessage::getSysExData() const noexcept { - return isSysEx() ? getRawData() + 1 : 0; + return isSysEx() ? getRawData() + 1 : nullptr; } int MidiMessage::getSysExDataSize() const noexcept @@ -30103,7 +30051,7 @@ AudioPluginInstance::~AudioPluginInstance() void* AudioPluginInstance::getPlatformSpecificData() { - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -30136,7 +30084,7 @@ PluginDescription* KnownPluginList::getTypeForFile (const String& fileOrIdentifi if (types.getUnchecked(i)->fileOrIdentifier == fileOrIdentifier) return types.getUnchecked(i); - return 0; + return nullptr; } PluginDescription* KnownPluginList::getTypeForIdentifierString (const String& identifierString) const @@ -30145,7 +30093,7 @@ PluginDescription* KnownPluginList::getTypeForIdentifierString (const String& id if (types.getUnchecked(i)->createIdentifierString() == identifierString) return types.getUnchecked(i); - return 0; + return nullptr; } bool KnownPluginList::addType (const PluginDescription& type) @@ -32464,7 +32412,7 @@ AudioPluginInstance* AudioUnitPluginFormat::createInstanceFromDescription (const } } - return 0; + return nullptr; } const StringArray AudioUnitPluginFormat::searchPathsForPlugins (const FileSearchPath& /*directoriesToSearch*/, @@ -33302,7 +33250,7 @@ public: static void* newMachOFromCFM (void* cfmfp) { if (cfmfp == 0) - return 0; + return nullptr; UInt32* const mfp = new UInt32[6]; @@ -34502,7 +34450,7 @@ AudioProcessorEditor* VSTPluginInstance::createEditor() if (hasEditor()) return new VSTPluginWindow (*this); - return 0; + return nullptr; } void VSTPluginInstance::handleAsyncUpdate() @@ -35807,7 +35755,7 @@ XmlElement* AudioProcessor::getXmlFromBinary (const void* data, jmin ((sizeInBytes - 8), stringLength))); } - return 0; + return nullptr; } void AudioProcessorListener::audioProcessorParameterChangeGestureBegin (AudioProcessor*, int) {} @@ -35939,7 +35887,7 @@ AudioProcessorGraph::Node* AudioProcessorGraph::getNodeForId (const uint32 nodeI if (nodes.getUnchecked(i)->id == nodeId) return nodes.getUnchecked(i); - return 0; + return nullptr; } AudioProcessorGraph::Node* AudioProcessorGraph::addNode (AudioProcessor* const newProcessor, @@ -35948,7 +35896,7 @@ AudioProcessorGraph::Node* AudioProcessorGraph::addNode (AudioProcessor* const n if (newProcessor == nullptr) { jassertfalse; - return 0; + return nullptr; } if (nodeId == 0) @@ -36019,7 +35967,7 @@ const AudioProcessorGraph::Connection* AudioProcessorGraph::getConnectionBetween } } - return 0; + return nullptr; } bool AudioProcessorGraph::isConnected (const uint32 possibleSourceNodeId, @@ -37069,7 +37017,7 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::isOutput() const } bool AudioProcessorGraph::AudioGraphIOProcessor::hasEditor() const { return false; } -AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return 0; } +AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; } int AudioProcessorGraph::AudioGraphIOProcessor::getNumParameters() { return 0; } const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterName (int) { return String::empty; } @@ -37147,7 +37095,7 @@ void AudioProcessorPlayer::setProcessor (AudioProcessor* const processorToPlay) { const ScopedLock sl (lock); - oldOne = isPrepared ? processor : 0; + oldOne = isPrepared ? processor : nullptr; processor = processorToPlay; isPrepared = true; } @@ -37956,7 +37904,7 @@ SynthesiserVoice* Synthesiser::findFreeVoice (SynthesiserSound* soundToPlay, return oldest; } - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -39921,7 +39869,7 @@ void* Component::getWindowHandle() const if (peer != nullptr) return peer->getNativeHandle(); - return 0; + return nullptr; } void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo) @@ -40656,7 +40604,7 @@ Component* Component::getComponentAt (const Point& position) return this; } - return 0; + return nullptr; } Component* Component::getComponentAt (const int x, const int y) @@ -41420,7 +41368,7 @@ void Component::colourChanged() MarkerList* Component::getMarkers (bool /*xAxis*/) { - return 0; + return nullptr; } Component::Positioner::Positioner (Component& component_) noexcept @@ -42334,7 +42282,7 @@ ComponentPeer* Component::getPeer() const if (flags.hasHeavyweightPeerFlag) return ComponentPeer::getPeerFor (this); else if (parentComponent == nullptr) - return 0; + return nullptr; return parentComponent->getPeer(); } @@ -42499,7 +42447,7 @@ Component* Desktop::findComponentAt (const Point& screenPosition) const } } - return 0; + return nullptr; } void Desktop::addDesktopComponent (Component* const c) @@ -42583,7 +42531,7 @@ MouseInputSource* Desktop::getDraggingMouseSource (int index) const noexcept } } - return 0; + return nullptr; } class MouseDragAutoRepeater : public Timer @@ -42892,7 +42840,7 @@ Component* ModalComponentManager::getModalComponent (const int index) const return item->component; } - return 0; + return nullptr; } bool ModalComponentManager::isModal (Component* const comp) const @@ -43492,7 +43440,7 @@ void Button::visibilityChanged() void Button::parentHierarchyChanged() { - Component* const newKeySource = (shortcuts.size() == 0) ? 0 : getTopLevelComponent(); + Component* const newKeySource = (shortcuts.size() == 0) ? nullptr : getTopLevelComponent(); if (newKeySource != keySource.get()) { @@ -47399,7 +47347,7 @@ ComboBox::ItemInfo* ComboBox::getItemForId (const int itemId) const noexcept return items.getUnchecked(i); } - return 0; + return nullptr; } ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const noexcept @@ -47413,7 +47361,7 @@ ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const noexcept return item; } - return 0; + return nullptr; } int ComboBox::getNumItems() const noexcept @@ -48445,7 +48393,7 @@ public: ListBoxRowComponent* getComponentForRowIfOnscreen (const int row) const noexcept { return (row >= firstIndex && row < firstIndex + rows.size()) - ? getComponentForRow (row) : 0; + ? getComponentForRow (row) : nullptr; } int getRowNumberOfComponent (Component* const rowComponent) const noexcept @@ -48893,7 +48841,7 @@ int ListBox::getInsertionIndexForPosition (const int x, const int y) const noexc Component* ListBox::getComponentForRowNumber (const int row) const noexcept { ListBoxRowComponent* const listRowComp = viewport->getComponentForRowIfOnscreen (row); - return listRowComp != nullptr ? static_cast (listRowComp->customComponent) : 0; + return listRowComp != nullptr ? static_cast (listRowComp->customComponent) : nullptr; } int ListBox::getRowNumberOfComponent (Component* const rowComponent) const noexcept @@ -49201,7 +49149,7 @@ Component* ListBoxModel::refreshComponentForRow (int, bool, Component* existingC { (void) existingComponentToUpdate; jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code the recycles the components - return 0; + return nullptr; } void ListBoxModel::listBoxItemClicked (int, const MouseEvent&) {} @@ -51485,7 +51433,7 @@ TableHeaderComponent::ColumnInfo* TableHeaderComponent::getInfoForId (const int if (columns.getUnchecked(i)->id == id) return columns.getUnchecked(i); - return 0; + return nullptr; } int TableHeaderComponent::visibleIndexToTotalIndex (const int visibleIndex) const @@ -52076,7 +52024,7 @@ Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component { (void) existingComponentToUpdate; jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code the recycles the components - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -54983,7 +54931,7 @@ ToolbarItemComponent* Toolbar::getNextActiveComponent (int index, const int delt return tc; } - return 0; + return nullptr; } void Toolbar::setStyle (const ToolbarItemStyle& newStyle) @@ -55911,7 +55859,7 @@ public: return ti; } - return 0; + return nullptr; } void updateComponents() @@ -56119,7 +56067,7 @@ private: return ri; } - return 0; + return nullptr; } static bool isMouseDraggingInChildCompOf (Component* const comp) @@ -56323,7 +56271,7 @@ TreeViewItem* TreeView::getItemOnRow (int index) const if (rootItem != nullptr && index >= 0) return rootItem->getItemOnRow (index); - return 0; + return nullptr; } TreeViewItem* TreeView::getItemAt (int y) const noexcept @@ -56336,7 +56284,7 @@ TreeViewItem* TreeView::getItemAt (int y) const noexcept TreeViewItem* TreeView::findItemFromIdentifierString (const String& identifierString) const { if (rootItem == nullptr) - return 0; + return nullptr; return rootItem->findItemFromIdentifierString (identifierString); } @@ -56661,7 +56609,7 @@ TreeViewItem* TreeView::getInsertPosition (int& x, int& y, int& insertIndex, TreeViewItem* item = getItemAt (y); if (item == nullptr) - return 0; + return nullptr; Rectangle itemPos (item->getItemPosition (true)); insertIndex = item->getIndexInParent(); @@ -57291,7 +57239,7 @@ TreeViewItem* TreeViewItem::getItemOnRow (int index) noexcept } } - return 0; + return nullptr; } TreeViewItem* TreeViewItem::findItemRecursively (int targetY) noexcept @@ -57319,7 +57267,7 @@ TreeViewItem* TreeViewItem::findItemRecursively (int targetY) noexcept } } - return 0; + return nullptr; } int TreeViewItem::countSelectedItemsRecursively (int depth) const noexcept @@ -57358,7 +57306,7 @@ TreeViewItem* TreeViewItem::getSelectedItemWithIndex (int index) noexcept } } - return 0; + return nullptr; } int TreeViewItem::getRowNumberInTree() const noexcept @@ -57405,7 +57353,7 @@ TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const noexce return parentItem->subItems [nextIndex]; } - return 0; + return nullptr; } const String TreeViewItem::getItemIdentifierString() const @@ -57443,7 +57391,7 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi setOpen (wasOpen); } - return 0; + return nullptr; } void TreeViewItem::restoreOpennessState (const XmlElement& e) noexcept @@ -57505,7 +57453,7 @@ XmlElement* TreeViewItem::getOpennessState() const noexcept jassertfalse; } - return 0; + return nullptr; } TreeViewItem::OpennessRestorer::OpennessRestorer (TreeViewItem& treeViewItem_) @@ -59927,7 +59875,7 @@ namespace KeyboardFocusHelpers } } - return 0; + return nullptr; } } @@ -61343,7 +61291,7 @@ ComponentAnimator::AnimationTask* ComponentAnimator::findTaskFor (Component* con if (component == tasks.getUnchecked(i)->component.get()) return tasks.getUnchecked(i); - return 0; + return nullptr; } void ComponentAnimator::animateComponent (Component* const component, @@ -61494,7 +61442,7 @@ namespace ComponentBuilderHelpers return components.removeAndReturn (i); } - return 0; + return nullptr; } Component* findComponentWithID (Component* const c, const String& compId) @@ -61511,7 +61459,7 @@ namespace ComponentBuilderHelpers return child; } - return 0; + return nullptr; } Component* createNewComponent (ComponentBuilder::TypeHandler& type, @@ -61616,7 +61564,7 @@ ComponentBuilder::TypeHandler* ComponentBuilder::getHandlerForState (const Value return t; } - return 0; + return nullptr; } int ComponentBuilder::getNumHandlers() const noexcept @@ -63697,7 +63645,7 @@ StretchableLayoutManager::ItemLayoutProperties* StretchableLayoutManager::getInf if (items.getUnchecked(i)->itemIndex == itemIndex) return items.getUnchecked(i); - return 0; + return nullptr; } int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, @@ -65989,7 +65937,7 @@ void LookAndFeel::drawScrollbar (Graphics& g, ImageEffectFilter* LookAndFeel::getScrollbarEffect() { - return 0; + return nullptr; } int LookAndFeel::getMinimumScrollbarThumbSize (ScrollBar& scrollbar) @@ -66769,7 +66717,7 @@ Label* LookAndFeel::createSliderTextBox (Slider& slider) ImageEffectFilter* LookAndFeel::getSliderEffect() { - return 0; + return nullptr; } void LookAndFeel::getTooltipSize (const String& tipText, int& width, int& height) @@ -67056,7 +67004,7 @@ Button* LookAndFeel::createDocumentWindowButton (int buttonType) } jassertfalse; - return 0; + return nullptr; } void LookAndFeel::positionDocumentWindowButtons (DocumentWindow&, @@ -68682,7 +68630,7 @@ Button* OldSchoolLookAndFeel::createDocumentWindowButton (int buttonType) } jassertfalse; - return 0; + return nullptr; } void OldSchoolLookAndFeel::positionDocumentWindowButtons (DocumentWindow&, @@ -69407,7 +69355,7 @@ public: minimumWidth, maximumNumColumns, standardItemHeight, dismissOnMouseUp, managerOfChosenCommand, componentAttachedTo); - return 0; + return nullptr; } void paint (Graphics& g) @@ -70942,7 +70890,7 @@ public: hit = hit->getParentComponent(); } - return 0; + return nullptr; } void mouseUp (const MouseEvent& e) @@ -71624,7 +71572,7 @@ public: return comp->getComponentAt (relativePos); } - return 0; + return nullptr; } const Point getScreenPosition() const @@ -76006,7 +75954,7 @@ OpenGLContext* OpenGLContext::getCurrentContext() return oglc; } - return 0; + return nullptr; } class OpenGLComponent::OpenGLComponentWatcher : public ComponentMovementWatcher @@ -76518,7 +76466,7 @@ TextEditor* AlertWindow::getTextEditor (const String& nameOfTextEditor) const if (textBoxes.getUnchecked(i)->getName() == nameOfTextEditor) return textBoxes.getUnchecked(i); - return 0; + return nullptr; } const String AlertWindow::getTextEditorContents (const String& nameOfTextEditor) const @@ -76551,7 +76499,7 @@ ComboBox* AlertWindow::getComboBoxComponent (const String& nameOfList) const if (comboBoxes.getUnchecked(i)->getName() == nameOfList) return comboBoxes.getUnchecked(i); - return 0; + return nullptr; } class AlertTextComp : public TextEditor @@ -76955,7 +76903,7 @@ private: static void* showCallback (void* userData) { static_cast (userData)->show(); - return 0; + return nullptr; } }; @@ -77345,7 +77293,7 @@ ComponentPeer* ComponentPeer::getPeerFor (const Component* const component) noex return peer; } - return 0; + return nullptr; } bool ComponentPeer::isValidPeer (const ComponentPeer* const peer) noexcept @@ -77541,7 +77489,7 @@ TextInputTarget* ComponentPeer::findCurrentTextInputTarget() return ti; } - return 0; + return nullptr; } void ComponentPeer::dismissPendingTextInput() @@ -77687,7 +77635,7 @@ namespace ComponentPeerHelpers c = c->getParentComponent(); } - return 0; + return nullptr; } } @@ -78797,7 +78745,7 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s) const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (newPos.getCentre())); - ComponentPeer* const peer = isOnDesktop() ? getPeer() : 0; + ComponentPeer* const peer = isOnDesktop() ? getPeer() : nullptr; if (peer != nullptr) peer->getFrameSize().addTo (newPos); @@ -79593,7 +79541,7 @@ const MarkerList::Marker* MarkerList::getMarker (const String& name) const noexc return m; } - return 0; + return nullptr; } void MarkerList::setMarker (const String& name, const RelativeCoordinate& position) @@ -80401,7 +80349,7 @@ void RelativePointPath::CloseSubPath::addToPath (Path& path, Expression::Scope*) RelativePoint* RelativePointPath::CloseSubPath::getControlPoints (int& numPoints) { numPoints = 0; - return 0; + return nullptr; } RelativePointPath::ElementBase* RelativePointPath::CloseSubPath::clone() const @@ -80693,7 +80641,7 @@ Component* RelativeCoordinatePositionerBase::ComponentScope::findSiblingComponen } } - return 0; + return nullptr; } const MarkerList::Marker* RelativeCoordinatePositionerBase::ComponentScope::findMarker (const String& name, MarkerList*& list) const @@ -85135,7 +85083,7 @@ public: const Ptr clipToRectangle (const Rectangle& r) { edgeTable.clipToRectangle (r); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToRectangleList (const RectangleList& r) @@ -85146,26 +85094,26 @@ public: for (RectangleList::Iterator iter (inverse); iter.next();) edgeTable.excludeRectangle (*iter.getRectangle()); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr excludeClipRectangle (const Rectangle& r) { edgeTable.excludeRectangle (r); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToPath (const Path& p, const AffineTransform& transform) { EdgeTable et (edgeTable.getMaximumBounds(), p, transform); edgeTable.clipToEdgeTable (et); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToEdgeTable (const EdgeTable& et) { edgeTable.clipToEdgeTable (et); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToImageAlpha (const Image& image, const AffineTransform& transform, const bool betterQuality) @@ -85188,12 +85136,12 @@ public: else straightClipImage (srcData, imageX, imageY, (PixelAlpha*) 0); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } } if (transform.isSingularity()) - return 0; + return nullptr; { Path p; @@ -85210,13 +85158,13 @@ public: transformedClipImage (srcData, transform, betterQuality, (PixelAlpha*) 0); } - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr translated (const Point& delta) { edgeTable.translate ((float) delta.getX(), delta.getY()); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } bool clipRegionIntersects (const Rectangle& r) const @@ -85338,19 +85286,19 @@ public: const Ptr clipToRectangle (const Rectangle& r) { clip.clipTo (r); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } const Ptr clipToRectangleList (const RectangleList& r) { clip.clipTo (r); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } const Ptr excludeClipRectangle (const Rectangle& r) { clip.subtract (r); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } const Ptr clipToPath (const Path& p, const AffineTransform& transform) @@ -85371,7 +85319,7 @@ public: const Ptr translated (const Point& delta) { clip.offsetAll (delta.getX(), delta.getY()); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } bool clipRegionIntersects (const Rectangle& r) const @@ -86653,7 +86601,7 @@ Drawable* Drawable::createFromImageFile (const File& file) { const ScopedPointer fin (file.createInputStream()); - return fin != nullptr ? createFromImageDataStream (*fin) : 0; + return fin != nullptr ? createFromImageDataStream (*fin) : nullptr; } template @@ -88766,7 +88714,7 @@ public: Drawable* parseSVGElement (const XmlElement& xml) { if (! xml.hasTagName ("svg")) - return 0; + return nullptr; DrawableComposite* const drawable = new DrawableComposite(); @@ -88884,7 +88832,7 @@ private: if (group != nullptr) return parseGroupElement (*group); - return 0; + return nullptr; } DrawableComposite* parseGroupElement (const XmlElement& xml) @@ -89354,7 +89302,7 @@ private: const String id (e->getStringAttribute ("xlink:href")); if (! id.startsWithChar ('#')) - return 0; + return nullptr; return findElementForId (topLevelXml, id.substring (1)); } @@ -89558,7 +89506,7 @@ private: } } - return 0; + return nullptr; } void addTransform (const XmlElement& xml) @@ -89993,7 +89941,7 @@ private: return found; } - return 0; + return nullptr; } SVGState& operator= (const SVGState&); @@ -91939,7 +91887,7 @@ CustomTypeface::GlyphInfo* CustomTypeface::findGlyph (const juce_wchar character if (loadIfNeeded && loadGlyphIfPossible (character)) return findGlyph (character, false); - return 0; + return nullptr; } CustomTypeface::GlyphInfo* CustomTypeface::findGlyphSubstituting (const juce_wchar character) noexcept @@ -92164,7 +92112,7 @@ EdgeTable* CustomTypeface::getEdgeTableForGlyph (int glyphNumber, const AffineTr return new EdgeTable (glyph->path.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), glyph->path, transform); - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -96400,7 +96348,7 @@ ImageFileFormat* ImageFileFormat::findImageFormatForStream (InputStream& input) return formats[i]; } - return 0; + return nullptr; } const Image ImageFileFormat::loadFrom (InputStream& input) @@ -129368,7 +129316,7 @@ AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, if (! deleteStreamIfOpeningFails) r->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, @@ -129386,7 +129334,7 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, return w.release(); } - return 0; + return nullptr; } END_JUCE_NAMESPACE @@ -192518,7 +192466,7 @@ AudioFormatReader* OggVorbisAudioFormat::createReaderFor (InputStream* in, if (! deleteStreamIfOpeningFails) r->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* OggVorbisAudioFormat::createWriterFor (OutputStream* out, @@ -192534,7 +192482,7 @@ AudioFormatWriter* OggVorbisAudioFormat::createWriterFor (OutputStream* out, bitsPerSample, qualityOptionIndex)); - return w->ok ? w.release() : 0; + return w->ok ? w.release() : nullptr; } const StringArray OggVorbisAudioFormat::getQualityOptions() @@ -242851,7 +242799,7 @@ void PlatformUtilities::freeDynamicLibrary (void* h) void* PlatformUtilities::getProcedureEntryPoint (void* h, const String& name) { - return (h != 0) ? (void*) GetProcAddress ((HMODULE) h, name.toUTF8()) : 0; // (void* cast is required for mingw) + return (h != 0) ? (void*) GetProcAddress ((HMODULE) h, name.toUTF8()) : nullptr; // (void* cast is required for mingw) } class InterProcessLock::Pimpl @@ -244103,7 +244051,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->isError() ? 0 : wi.release(); + return wi->isError() ? nullptr : wi.release(); } namespace MACAddressHelpers @@ -246750,7 +246698,7 @@ public: if (h != 0 && GetWindowLongPtr (h, GWLP_USERDATA) == improbableWindowNumber) return (Win32ComponentPeer*) (pointer_sized_int) GetWindowLongPtr (h, 8); - return 0; + return nullptr; } void setTaskBarIcon (const Image& image) @@ -246997,7 +246945,7 @@ private: static void* createWindowCallback (void* userData) { static_cast (userData)->createWindow(); - return 0; + return nullptr; } void createWindow() @@ -247087,25 +247035,25 @@ private: { RevokeDragDrop ((HWND) handle); DestroyWindow ((HWND) handle); - return 0; + return nullptr; } static void* toFrontCallback1 (void* h) { SetForegroundWindow ((HWND) h); - return 0; + return nullptr; } static void* toFrontCallback2 (void* h) { SetWindowPos ((HWND) h, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); - return 0; + return nullptr; } static void* setFocusCallback (void* h) { SetFocus ((HWND) h); - return 0; + return nullptr; } static void* getFocusCallback (void*) @@ -248664,7 +248612,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType return mb->getResult() != 0; mb.release(); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, @@ -249888,7 +249836,7 @@ void* ActiveXControlComponent::queryInterface (const void* iid) const && SUCCEEDED (control->control->QueryInterface (*(const IID*) iid, &result))) return result; - return 0; + return nullptr; } void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const @@ -251006,7 +250954,7 @@ public: void* getNativeWindowHandle() const { - return nativeWindow != nullptr ? nativeWindow->getNativeHandle() : 0; + return nativeWindow != nullptr ? nativeWindow->getNativeHandle() : nullptr; } HGLRC renderContext; @@ -251126,12 +251074,12 @@ OpenGLContext* OpenGLComponent::createContext() contextToShareListsWith != nullptr ? (HGLRC) contextToShareListsWith->getRawContext() : 0, preferredPixelFormat)); - return (c->renderContext != 0) ? c.release() : 0; + return (c->renderContext != 0) ? c.release() : nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { - return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() : 0; + return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() : nullptr; } void juce_glViewport (const int w, const int h) @@ -252116,7 +252064,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) return new AudioCDReader (new CDDeviceWrapper (list [deviceIndex], h)); } - return 0; + return nullptr; } AudioCDReader::AudioCDReader (void* handle_) @@ -252166,7 +252114,7 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta const int toDo = (int) jmin ((int64) numSamples, bufferEndSample - startSampleInFile); int* const l = destSamples[0] + startOffsetInDestBuffer; - int* const r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : 0; + int* const r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : nullptr; const short* src = (const short*) buffer.getData(); src += 2 * (startSampleInFile - bufferStartSample); @@ -252222,7 +252170,7 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta else { int* l = destSamples[0] + startOffsetInDestBuffer; - int* r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : 0; + int* r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : nullptr; while (--numSamples >= 0) { @@ -253045,7 +252993,7 @@ int MidiInput::getDefaultDeviceIndex() MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const callback) { if (callback == nullptr) - return 0; + return nullptr; UINT deviceId = MIDI_MAPPER; int n = 0; @@ -253086,7 +253034,7 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call return in.release(); } - return 0; + return nullptr; } MidiInput::MidiInput (const String& name_) @@ -253229,7 +253177,7 @@ MidiOutput* MidiOutput::openDevice (int index) } } - return 0; + return nullptr; } MidiOutput::~MidiOutput() @@ -254567,7 +254515,7 @@ private: if (currentASIODev[0] != nullptr) currentASIODev[0]->callback (index); - return 0; + return nullptr; } static ASIOTime* JUCE_ASIOCALLBACK bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) @@ -254575,7 +254523,7 @@ private: if (currentASIODev[1] != nullptr) currentASIODev[1]->callback (index); - return 0; + return nullptr; } static ASIOTime* JUCE_ASIOCALLBACK bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) @@ -254583,7 +254531,7 @@ private: if (currentASIODev[2] != nullptr) currentASIODev[2]->callback (index); - return 0; + return nullptr; } static void JUCE_ASIOCALLBACK bufferSwitchCallback0 (long index, long) @@ -254975,11 +254923,11 @@ public: if (deviceNames[i].containsIgnoreCase ("asio4all")) return i; // asio4all is a safe choice for a default.. -#if JUCE_DEBUG + #if JUCE_DEBUG if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase ("digidesign")) return 1; // (the digi m-box driver crashes the app when you run // it in the debugger, which can be a bit annoying) -#endif + #endif return 0; } @@ -255022,7 +254970,7 @@ public: return new ASIOAudioIODevice (outputDeviceName, *(classIds [index]), freeSlot, String::empty); } - return 0; + return nullptr; } private: @@ -255126,7 +255074,7 @@ AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, const int freeSlot = ASIOAudioIODeviceType::findFreeSlot(); if (freeSlot < 0) - return 0; + return nullptr; return new ASIOAudioIODevice (name, *(CLSID*) guid, freeSlot, optionalDllForDirectLoading); } @@ -256268,7 +256216,7 @@ public: : inputDeviceName, outputIndex, inputIndex); - return 0; + return nullptr; } StringArray outputDeviceNames, inputDeviceNames; @@ -256825,7 +256773,7 @@ private: WAVEFORMATEXTENSIBLE* nearestFormat = nullptr; HRESULT hr = client->IsFormatSupported (useExclusiveMode ? AUDCLNT_SHAREMODE_EXCLUSIVE : AUDCLNT_SHAREMODE_SHARED, - (WAVEFORMATEX*) &format, useExclusiveMode ? 0 : (WAVEFORMATEX**) &nearestFormat); + (WAVEFORMATEX*) &format, useExclusiveMode ? nullptr : (WAVEFORMATEX**) &nearestFormat); logFailure (hr); if (hr == S_FALSE && format.Format.nSamplesPerSec == nearestFormat->Format.nSamplesPerSec) @@ -257585,7 +257533,7 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI() if (SystemStats::getOperatingSystemType() >= SystemStats::WinVista) return new WasapiClasses::WASAPIAudioIODeviceType(); - return 0; + return nullptr; } #endif @@ -258421,7 +258369,7 @@ CameraDevice* CameraDevice::openDevice (int index, } } - return 0; + return nullptr; } #endif @@ -258965,13 +258913,13 @@ void FileOutputStream::flushInternal() const File juce_getExecutableFile() { - #if JUCE_ANDROID + #if JUCE_ANDROID return File (android.appFile); - #else + #else Dl_info exeInfo; dladdr ((void*) juce_getExecutableFile, &exeInfo); // (can't be a const void* on android) return File::getCurrentWorkingDirectory().getChildFile (CharPointer_UTF8 (exeInfo.dli_fname)); - #endif + #endif } int64 File::getBytesFreeOnVolume() const @@ -258994,7 +258942,7 @@ int64 File::getVolumeTotalSize() const const String File::getVolumeLabel() const { -#if JUCE_MAC + #if JUCE_MAC struct VolAttrBuf { u_int32_t length; @@ -259021,7 +258969,7 @@ const String File::getVolumeLabel() const f = parent; } -#endif + #endif return String::empty; } @@ -259184,7 +259132,7 @@ void* threadEntryProc (void* userData) #endif juce_threadEntryPoint (userData); - return 0; + return nullptr; } void Thread::launchThread() @@ -260230,7 +260178,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->isError() ? 0 : wi.release(); + return wi->isError() ? nullptr : wi.release(); } #endif @@ -260944,14 +260892,14 @@ namespace LinuxErrorHandling // A protocol error has occurred static int juce_XErrorHandler (Display* display, XErrorEvent* event) { - #if JUCE_DEBUG_XERRORS + #if JUCE_DEBUG_XERRORS char errorStr[64] = { 0 }; char requestStr[64] = { 0 }; XGetErrorText (display, event->error_code, errorStr, 64); XGetErrorDatabaseText (display, "XRequest", String (event->request_code).toUTF8(), "Unknown", requestStr, 64); DBG ("ERROR: X returned " + String (errorStr) + " for operation " + String (requestStr)); - #endif + #endif return 0; } @@ -261110,7 +261058,7 @@ private: void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func, void* parameter) { if (LinuxErrorHandling::errorOccurred) - return 0; + return nullptr; return AsyncFunctionCaller::call (func, parameter); } @@ -261264,7 +261212,7 @@ public: return faces[i]; if (! create) - return 0; + return nullptr; FreeTypeFontFace* newFace = new FreeTypeFontFace (familyName); faces.add (newFace); @@ -262250,7 +262198,7 @@ public: SharedImage* clone() { jassertfalse; - return 0; + return nullptr; } void blitToWindow (Window window, int dx, int dy, int dw, int dh, int sx, int sy) @@ -264565,7 +264513,7 @@ void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, Window root = RootWindow (display, DefaultScreen (display)); unsigned int cursorW, cursorH; if (! XQueryBestCursor (display, root, imageW, imageH, &cursorW, &cursorH)) - return 0; + return nullptr; Image im (Image::ARGB, cursorW, cursorH, true); @@ -264897,7 +264845,7 @@ OpenGLContext* OpenGLComponent::createContext() ScopedPointer c (new WindowedGLContext (this, preferredPixelFormat, contextToShareListsWith != 0 ? (GLXContext) contextToShareListsWith->getRawContext() : 0)); - return (c->renderContext != 0) ? c.release() : 0; + return (c->renderContext != 0) ? c.release() : nullptr; } void juce_glViewport (const int w, const int h) @@ -265392,7 +265340,7 @@ private: default: jassertfalse; break; // unsupported format! } - return 0; + return nullptr; } bool failed (const int errorNum) @@ -265991,7 +265939,7 @@ public: inputIds [inputIndex], outputIds [outputIndex]); - return 0; + return nullptr; } private: @@ -266049,7 +265997,7 @@ static void* juce_libjack_handle = nullptr; void* juce_load_jack_function (const char* const name) { if (juce_libjack_handle == 0) - return 0; + return nullptr; return dlsym (juce_libjack_handle, name); } @@ -266586,7 +266534,7 @@ public: inputIds [inputIndex], outputIds [outputIndex]); - return 0; + return nullptr; } private: @@ -267006,8 +266954,8 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba const StringArray MidiOutput::getDevices() { return StringArray(); } int MidiOutput::getDefaultDeviceIndex() { return 0; } -MidiOutput* MidiOutput::openDevice (int) { return 0; } -MidiOutput* MidiOutput::createNewDevice (const String&) { return 0; } +MidiOutput* MidiOutput::openDevice (int) { return nullptr; } +MidiOutput* MidiOutput::createNewDevice (const String&) { return nullptr; } MidiOutput::~MidiOutput() {} void MidiOutput::reset() {} bool MidiOutput::getVolume (float&, float&) { return false; } @@ -267020,8 +266968,8 @@ void MidiInput::start() {} void MidiInput::stop() {} int MidiInput::getDefaultDeviceIndex() { return 0; } const StringArray MidiInput::getDevices() { return StringArray(); } -MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return 0; } -MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return 0; } +MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return nullptr; } +MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return nullptr; } #endif #endif @@ -267046,7 +266994,7 @@ const StringArray AudioCDReader::getAvailableCDNames() AudioCDReader* AudioCDReader::createReaderForCD (const int index) { - return 0; + return nullptr; } AudioCDReader::~AudioCDReader() @@ -268131,7 +268079,7 @@ private: timeoutInterval: timeOutMs <= 0 ? 60.0 : (timeOutMs / 1000.0)]; if (req == nil) - return 0; + return nil; [req setHTTPMethod: isPost ? @"POST" : @"GET"]; //[req setCachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData]; @@ -268161,7 +268109,7 @@ private: return s; [s release]; - return 0; + return nil; } JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream); @@ -268175,7 +268123,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->isError() ? 0 : wi.release(); + return wi->isError() ? nullptr : wi.release(); } #endif @@ -268866,13 +268814,13 @@ void FileOutputStream::flushInternal() const File juce_getExecutableFile() { - #if JUCE_ANDROID + #if JUCE_ANDROID return File (android.appFile); - #else + #else Dl_info exeInfo; dladdr ((void*) juce_getExecutableFile, &exeInfo); // (can't be a const void* on android) return File::getCurrentWorkingDirectory().getChildFile (CharPointer_UTF8 (exeInfo.dli_fname)); - #endif + #endif } int64 File::getBytesFreeOnVolume() const @@ -268895,7 +268843,7 @@ int64 File::getVolumeTotalSize() const const String File::getVolumeLabel() const { -#if JUCE_MAC + #if JUCE_MAC struct VolAttrBuf { u_int32_t length; @@ -268922,7 +268870,7 @@ const String File::getVolumeLabel() const f = parent; } -#endif + #endif return String::empty; } @@ -269085,7 +269033,7 @@ void* threadEntryProc (void* userData) #endif juce_threadEntryPoint (userData); - return 0; + return nullptr; } void Thread::launchThread() @@ -269829,7 +269777,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType return mb->getResult() == 1; mb.release(); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, @@ -270001,7 +269949,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType return mb->getResult() == 1; mb.release(); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, @@ -270546,7 +270494,7 @@ public: return new EdgeTable (path.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), path, transform); - return 0; + return nullptr; } bool getOutlineForGlyph (int glyphNumber, Path& path) @@ -273222,13 +273170,13 @@ OpenGLContext* OpenGLComponent::createContext() ScopedPointer c (new WindowedGLContext (*this, preferredPixelFormat, contextToShareListsWith != nullptr ? (NSOpenGLContext*) contextToShareListsWith->getRawContext() : 0)); - return (c->renderContext != nil) ? c.release() : 0; + return (c->renderContext != nil) ? c.release() : nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() - : 0; + : nullptr; } void juce_glViewport (const int w, const int h) @@ -273476,7 +273424,7 @@ OpenGLContext* OpenGLComponent::createContext() dynamic_cast (contextToShareListsWith), type == openGLES2 ? kEAGLRenderingAPIOpenGLES2 : kEAGLRenderingAPIOpenGLES1); - return 0; + return nullptr; } void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, @@ -273525,7 +273473,7 @@ namespace MouseCursorHelpers return createFromImage (im, hx * im.getWidth(), hy * im.getHeight()); jassertfalse; - return 0; + return nullptr; } } @@ -273600,8 +273548,8 @@ void MouseCursor::showInWindow (ComponentPeer*) const #else -void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) { return 0; } -void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return 0; } +void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) { return nullptr; } +void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return nullptr; } void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) {} void MouseCursor::showInAllWindows() const {} void MouseCursor::showInWindow (ComponentPeer*) const {} @@ -274466,7 +274414,7 @@ public: : inputDeviceName); } - return 0; + return nullptr; } private: @@ -275025,9 +274973,9 @@ bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return fa void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) {} void MidiOutput::sendMessageNow (const MidiMessage& message) {} const StringArray MidiOutput::getDevices() { return StringArray(); } -MidiOutput* MidiOutput::openDevice (int index) { return 0; } +MidiOutput* MidiOutput::openDevice (int index) { return nullptr; } const StringArray MidiInput::getDevices() { return StringArray(); } -MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return 0; } +MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return nullptr; } #endif @@ -275309,7 +275257,7 @@ public: return new EdgeTable (path.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), path, transform); - return 0; + return nullptr; } bool getOutlineForGlyph (int glyphNumber, Path& path) @@ -278241,7 +278189,7 @@ namespace MouseCursorHelpers return createFromImage (im, hx * im.getWidth(), hy * im.getHeight()); jassertfalse; - return 0; + return nullptr; } } @@ -278316,8 +278264,8 @@ void MouseCursor::showInWindow (ComponentPeer*) const #else -void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) { return 0; } -void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return 0; } +void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) { return nullptr; } +void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return nullptr; } void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) {} void MouseCursor::showInAllWindows() const {} void MouseCursor::showInWindow (ComponentPeer*) const {} @@ -278959,13 +278907,13 @@ OpenGLContext* OpenGLComponent::createContext() ScopedPointer c (new WindowedGLContext (*this, preferredPixelFormat, contextToShareListsWith != nullptr ? (NSOpenGLContext*) contextToShareListsWith->getRawContext() : 0)); - return (c->renderContext != nil) ? c.release() : 0; + return (c->renderContext != nil) ? c.release() : nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() - : 0; + : nullptr; } void juce_glViewport (const int w, const int h) @@ -279213,7 +279161,7 @@ OpenGLContext* OpenGLComponent::createContext() dynamic_cast (contextToShareListsWith), type == openGLES2 ? kEAGLRenderingAPIOpenGLES2 : kEAGLRenderingAPIOpenGLES1); - return 0; + return nullptr; } void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, @@ -279528,7 +279476,7 @@ private: } } - return 0; + return nil; } static void flashMenuBar (NSMenu* menu) @@ -279755,7 +279703,7 @@ void MenuBarModel::setMacMainMenu (MenuBarModel* newMenuBarModel, MenuBarModel* MenuBarModel::getMacMainMenu() { return JuceMainMenuHandler::instance != nullptr - ? JuceMainMenuHandler::instance->currentModel : 0; + ? JuceMainMenuHandler::instance->currentModel : nullptr; } void juce_initialiseMacMainMenu() @@ -280811,7 +280759,7 @@ namespace CDReaderHelpers if (child->getAllSubText().trim() == key) return child->getNextElement(); - return 0; + return nullptr; } static int getIntValueForKey (const XmlElement& xml, const String& key, int defaultValue = -1) @@ -280858,7 +280806,7 @@ namespace CDReaderHelpers } offsets.add (leadOut * AudioCDReader::samplesPerFrame - 88200); - return 0; + return nullptr; } static void findDevices (Array& cds) @@ -280911,7 +280859,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int index) if (cds[index].exists()) return new AudioCDReader (cds[index]); - return 0; + return nullptr; } AudioCDReader::AudioCDReader (const File& volume) @@ -283060,7 +283008,7 @@ public: outputIds [outputIndex], outputIndex); - return 0; + return nullptr; } private: @@ -283656,9 +283604,9 @@ bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { return fa void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) {} void MidiOutput::sendMessageNow (const MidiMessage& message) {} const StringArray MidiOutput::getDevices() { return StringArray(); } -MidiOutput* MidiOutput::openDevice (int index) { return 0; } +MidiOutput* MidiOutput::openDevice (int index) { return nullptr; } const StringArray MidiInput::getDevices() { return StringArray(); } -MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return 0; } +MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return nullptr; } #endif @@ -284062,7 +284010,7 @@ CameraDevice* CameraDevice::openDevice (int index, if (static_cast (d->internal)->openingError.isEmpty()) return d.release(); - return 0; + return nullptr; } #endif @@ -284320,7 +284268,7 @@ public: if (threads[i] == thisThread) return envs[i]; - return 0; + return nullptr; } enum { maxThreads = 16 }; @@ -285252,13 +285200,13 @@ void FileOutputStream::flushInternal() const File juce_getExecutableFile() { - #if JUCE_ANDROID + #if JUCE_ANDROID return File (android.appFile); - #else + #else Dl_info exeInfo; dladdr ((void*) juce_getExecutableFile, &exeInfo); // (can't be a const void* on android) return File::getCurrentWorkingDirectory().getChildFile (CharPointer_UTF8 (exeInfo.dli_fname)); - #endif + #endif } int64 File::getBytesFreeOnVolume() const @@ -285281,7 +285229,7 @@ int64 File::getVolumeTotalSize() const const String File::getVolumeLabel() const { -#if JUCE_MAC + #if JUCE_MAC struct VolAttrBuf { u_int32_t length; @@ -285308,7 +285256,7 @@ const String File::getVolumeLabel() const f = parent; } -#endif + #endif return String::empty; } @@ -285471,7 +285419,7 @@ void* threadEntryProc (void* userData) #endif juce_threadEntryPoint (userData); - return 0; + return nullptr; } void Thread::launchThread() @@ -286174,7 +286122,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->stream != 0 ? wi.release() : 0; + return wi->stream != 0 ? wi.release() : nullptr; } #endif @@ -286410,7 +286358,7 @@ public: const Rectangle bounds (left, top, right - left, bottom - top); if (bounds.isEmpty()) - return 0; + return nullptr; jint* const maskDataElements = env->GetIntArrayElements (maskData, 0); @@ -287632,7 +287580,7 @@ public: return ap; } - return 0; + return nullptr; } static ModifierKeys currentModifiers; @@ -287799,7 +287747,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType android.activity.callVoidMethod (android.showOkCancelBox, javaString (title).get(), javaString (message).get(), (jlong) (pointer_sized_int) callback); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, @@ -287859,8 +287807,8 @@ const Image juce_createIconForFile (const File& file) return Image::null; } -void* MouseCursor::createMouseCursorFromImage (const Image&, int, int) { return 0; } -void* MouseCursor::createStandardMouseCursor (const MouseCursor::StandardCursorType) { return 0; } +void* MouseCursor::createMouseCursorFromImage (const Image&, int, int) { return nullptr; } +void* MouseCursor::createStandardMouseCursor (const MouseCursor::StandardCursorType) { return nullptr; } void MouseCursor::deleteMouseCursor (void* const /*cursorHandle*/, const bool /*isStandard*/) {} void MouseCursor::showInWindow (ComponentPeer*) const {} @@ -288065,12 +288013,12 @@ bool WebBrowserComponent::pageAboutToLoad (const String& url) // TODO OpenGLContext* OpenGLComponent::createContext() { - return 0; + return nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { - return 0; + return nullptr; } void juce_glViewport (const int w, const int h) @@ -288107,7 +288055,7 @@ int MidiOutput::getDefaultDeviceIndex() MidiOutput* MidiOutput::openDevice (int index) { - return 0; + return nullptr; } MidiOutput::~MidiOutput() @@ -288163,7 +288111,7 @@ const StringArray MidiInput::getDevices() MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { - return 0; + return nullptr; } #endif @@ -288573,7 +288521,7 @@ Component* CameraDevice::createViewerComponent() { // TODO - return 0; + return nullptr; } const String CameraDevice::getFileExtension() @@ -288622,7 +288570,7 @@ CameraDevice* CameraDevice::openDevice (int index, { // TODO - return 0; + return nullptr; } #endif diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 3bd5adf10a..d857770c17 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 69 +#define JUCE_BUILDNUMBER 70 /** Current Juce version number. @@ -9139,7 +9139,7 @@ public: l = &(l->item->nextListItem); } - return 0; + return nullptr; } /** Copies the items in the list to an array. @@ -14947,7 +14947,7 @@ public: return removed; } - return 0; + return ElementType(); } /** Removes an item from the set. @@ -16484,7 +16484,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 0; } + virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { (void) nextAction; return nullptr; } }; #endif // __JUCE_UNDOABLEACTION_JUCEHEADER__ @@ -31206,7 +31206,7 @@ public: p = p->parentComponent; } - return 0; + return nullptr; } /** Returns the highest-level component which contains this one or its parents. @@ -47375,7 +47375,7 @@ public: bool producesMidi() const; bool hasEditor() const { return false; } - AudioProcessorEditor* createEditor() { return 0; } + AudioProcessorEditor* createEditor() { return nullptr; } int getNumParameters() { return 0; } const String getParameterName (int) { return String::empty; } @@ -54259,7 +54259,7 @@ public: component you like. It's most useful if you're doing things like drag-and-drop of items, or want to use a Label component to edit item names, etc. */ - virtual Component* createItemComponent() { return 0; } + virtual Component* createItemComponent() { return nullptr; } /** Draws the item's contents. diff --git a/src/application/juce_Application.cpp b/src/application/juce_Application.cpp index dfb36b2cff..dca0c570cf 100644 --- a/src/application/juce_Application.cpp +++ b/src/application/juce_Application.cpp @@ -112,7 +112,7 @@ void JUCEApplication::sendUnhandledException (const std::exception* const e, //============================================================================== ApplicationCommandTarget* JUCEApplication::getNextCommandTarget() { - return 0; + return nullptr; } void JUCEApplication::getAllCommands (Array & commands) diff --git a/src/application/juce_ApplicationCommandManager.cpp b/src/application/juce_ApplicationCommandManager.cpp index 16c1aa38d5..2d5382cd16 100644 --- a/src/application/juce_ApplicationCommandManager.cpp +++ b/src/application/juce_ApplicationCommandManager.cpp @@ -136,7 +136,7 @@ const ApplicationCommandInfo* ApplicationCommandManager::getCommandForID (const if (commands.getUnchecked(i)->commandID == commandID) return commands.getUnchecked(i); - return 0; + return nullptr; } const String ApplicationCommandManager::getNameOfCommand (const CommandID commandID) const noexcept diff --git a/src/application/juce_ApplicationCommandTarget.cpp b/src/application/juce_ApplicationCommandTarget.cpp index 544da700a5..e72fabe943 100644 --- a/src/application/juce_ApplicationCommandTarget.cpp +++ b/src/application/juce_ApplicationCommandTarget.cpp @@ -76,7 +76,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::findFirstTargetParentCompone // (unable to use the syntax findParentComponentOfClass () because of a VC6 compiler bug) return c->findParentComponentOfClass ((ApplicationCommandTarget*) 0); - return 0; + return nullptr; } ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const CommandID commandID) @@ -116,7 +116,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C } } - return 0; + return nullptr; } bool ApplicationCommandTarget::isCommandActive (const CommandID commandID) diff --git a/src/audio/audio_file_formats/juce_AiffAudioFormat.cpp b/src/audio/audio_file_formats/juce_AiffAudioFormat.cpp index 7460cf3d36..f6eadee2bc 100644 --- a/src/audio/audio_file_formats/juce_AiffAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_AiffAudioFormat.cpp @@ -409,7 +409,7 @@ AudioFormatReader* AiffAudioFormat::createReaderFor (InputStream* sourceStream, if (! deleteStreamIfOpeningFails) w->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* AiffAudioFormat::createWriterFor (OutputStream* out, @@ -422,7 +422,7 @@ AudioFormatWriter* AiffAudioFormat::createWriterFor (OutputStream* out, if (getPossibleBitDepths().contains (bitsPerSample)) return new AiffAudioFormatWriter (out, sampleRate, numberOfChannels, bitsPerSample); - return 0; + return nullptr; } END_JUCE_NAMESPACE diff --git a/src/audio/audio_file_formats/juce_AudioFormatManager.cpp b/src/audio/audio_file_formats/juce_AudioFormatManager.cpp index d6718086e5..a4c31120e9 100644 --- a/src/audio/audio_file_formats/juce_AudioFormatManager.cpp +++ b/src/audio/audio_file_formats/juce_AudioFormatManager.cpp @@ -120,7 +120,7 @@ AudioFormat* AudioFormatManager::findFormatForFileExtension (const String& fileE if (getKnownFormat(i)->getFileExtensions().contains (e, true)) return getKnownFormat(i); - return 0; + return nullptr; } const String AudioFormatManager::getWildcardForAllFormats() const @@ -176,7 +176,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (const File& file) } } - return 0; + return nullptr; } AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileStream) @@ -209,7 +209,7 @@ AudioFormatReader* AudioFormatManager::createReaderFor (InputStream* audioFileSt } } - return 0; + return nullptr; } diff --git a/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp b/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp index 66f7ac254f..34cf38be1f 100644 --- a/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp +++ b/src/audio/audio_file_formats/juce_AudioThumbnailCache.cpp @@ -60,7 +60,7 @@ ThumbnailCacheEntry* AudioThumbnailCache::findThumbFor (const int64 hash) const if (thumbs.getUnchecked(i)->hash == hash) return thumbs.getUnchecked(i); - return 0; + return nullptr; } bool AudioThumbnailCache::loadThumb (AudioThumbnail& thumb, const int64 hashCode) diff --git a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp index 2c158c8917..9c41e09423 100644 --- a/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_FlacAudioFormat.cpp @@ -513,7 +513,7 @@ AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, if (! deleteStreamIfOpeningFails) r->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, @@ -531,7 +531,7 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, return w.release(); } - return 0; + return nullptr; } END_JUCE_NAMESPACE diff --git a/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp b/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp index 8d80045a19..d967fcc943 100644 --- a/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp @@ -427,7 +427,7 @@ AudioFormatReader* OggVorbisAudioFormat::createReaderFor (InputStream* in, if (! deleteStreamIfOpeningFails) r->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* OggVorbisAudioFormat::createWriterFor (OutputStream* out, @@ -443,7 +443,7 @@ AudioFormatWriter* OggVorbisAudioFormat::createWriterFor (OutputStream* out, bitsPerSample, qualityOptionIndex)); - return w->ok ? w.release() : 0; + return w->ok ? w.release() : nullptr; } const StringArray OggVorbisAudioFormat::getQualityOptions() diff --git a/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp b/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp index b10fe8f52d..6b7e0c6549 100644 --- a/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp @@ -374,7 +374,7 @@ AudioFormatReader* QuickTimeAudioFormat::createReaderFor (InputStream* sourceStr if (! deleteStreamIfOpeningFails) r->input = 0; - return 0; + return nullptr; } AudioFormatWriter* QuickTimeAudioFormat::createWriterFor (OutputStream* /*streamToWriteTo*/, @@ -385,7 +385,7 @@ AudioFormatWriter* QuickTimeAudioFormat::createWriterFor (OutputStream* /*stream int /*qualityOptionIndex*/) { jassertfalse; // not yet implemented! - return 0; + return nullptr; } END_JUCE_NAMESPACE diff --git a/src/audio/audio_file_formats/juce_WavAudioFormat.cpp b/src/audio/audio_file_formats/juce_WavAudioFormat.cpp index 7880faaff0..838ab22231 100644 --- a/src/audio/audio_file_formats/juce_WavAudioFormat.cpp +++ b/src/audio/audio_file_formats/juce_WavAudioFormat.cpp @@ -725,7 +725,7 @@ AudioFormatReader* WavAudioFormat::createReaderFor (InputStream* sourceStream, if (! deleteStreamIfOpeningFails) r->input = nullptr; - return 0; + return nullptr; } AudioFormatWriter* WavAudioFormat::createWriterFor (OutputStream* out, double sampleRate, @@ -735,7 +735,7 @@ AudioFormatWriter* WavAudioFormat::createWriterFor (OutputStream* out, double sa if (getPossibleBitDepths().contains (bitsPerSample)) return new WavAudioFormatWriter (out, sampleRate, numChannels, bitsPerSample, metadataValues); - return 0; + return nullptr; } namespace WavFileHelpers diff --git a/src/audio/devices/juce_AudioDeviceManager.cpp b/src/audio/devices/juce_AudioDeviceManager.cpp index 58478cfaa6..a665b77dda 100644 --- a/src/audio/devices/juce_AudioDeviceManager.cpp +++ b/src/audio/devices/juce_AudioDeviceManager.cpp @@ -249,7 +249,7 @@ void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) cons XmlElement* AudioDeviceManager::createStateXml() const { - return lastExplicitSettings != nullptr ? new XmlElement (*lastExplicitSettings) : 0; + return lastExplicitSettings != nullptr ? new XmlElement (*lastExplicitSettings) : nullptr; } //============================================================================== @@ -281,7 +281,7 @@ AudioIODeviceType* AudioDeviceManager::findType (const String& inputName, const } } - return 0; + return nullptr; } void AudioDeviceManager::getAudioDeviceSetup (AudioDeviceSetup& setup) diff --git a/src/audio/devices/juce_AudioIODeviceType.cpp b/src/audio/devices/juce_AudioIODeviceType.cpp index 38f4a1fb2a..f8bb45f23a 100644 --- a/src/audio/devices/juce_AudioIODeviceType.cpp +++ b/src/audio/devices/juce_AudioIODeviceType.cpp @@ -41,35 +41,35 @@ AudioIODeviceType::~AudioIODeviceType() } #if ! JUCE_MAC -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_CoreAudio() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_CoreAudio() { return nullptr; } #endif #if ! JUCE_IOS -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_iOSAudio() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_iOSAudio() { return nullptr; } #endif #if ! (JUCE_WINDOWS && JUCE_WASAPI) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI() { return nullptr; } #endif #if ! (JUCE_WINDOWS && JUCE_DIRECTSOUND) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_DirectSound() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_DirectSound() { return nullptr; } #endif #if ! (JUCE_WINDOWS && JUCE_ASIO) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return nullptr; } #endif #if ! (JUCE_LINUX && JUCE_ALSA) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return nullptr; } #endif #if ! (JUCE_LINUX && JUCE_JACK) -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; } #endif #if ! JUCE_ANDROID -AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android() { return 0; } +AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Android() { return nullptr; } #endif diff --git a/src/audio/dsp/juce_AudioDataConverters.cpp b/src/audio/dsp/juce_AudioDataConverters.cpp index 9f7d348302..ff547b1469 100644 --- a/src/audio/dsp/juce_AudioDataConverters.cpp +++ b/src/audio/dsp/juce_AudioDataConverters.cpp @@ -191,9 +191,9 @@ void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* de { *(float*) d = source[i]; -#if JUCE_BIG_ENDIAN + #if JUCE_BIG_ENDIAN *(uint32*) d = ByteOrder::swap (*(uint32*) d); -#endif + #endif d += destBytesPerSample; } @@ -209,9 +209,9 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de { *(float*) d = source[i]; -#if JUCE_LITTLE_ENDIAN + #if JUCE_LITTLE_ENDIAN *(uint32*) d = ByteOrder::swap (*(uint32*) d); -#endif + #endif d += destBytesPerSample; } @@ -376,10 +376,10 @@ void AudioDataConverters::convertFloat32LEToFloat (const void* const source, flo { dest[i] = *(float*)s; -#if JUCE_BIG_ENDIAN + #if JUCE_BIG_ENDIAN uint32* const d = (uint32*) (dest + i); *d = ByteOrder::swap (*d); -#endif + #endif s += srcBytesPerSample; } @@ -393,10 +393,10 @@ void AudioDataConverters::convertFloat32BEToFloat (const void* const source, flo { dest[i] = *(float*)s; -#if JUCE_LITTLE_ENDIAN + #if JUCE_LITTLE_ENDIAN uint32* const d = (uint32*) (dest + i); *d = ByteOrder::swap (*d); -#endif + #endif s += srcBytesPerSample; } @@ -411,41 +411,15 @@ void AudioDataConverters::convertFloatToFormat (const DataFormat destFormat, { switch (destFormat) { - case int16LE: - convertFloatToInt16LE (source, dest, numSamples); - break; - - case int16BE: - convertFloatToInt16BE (source, dest, numSamples); - break; - - case int24LE: - convertFloatToInt24LE (source, dest, numSamples); - break; - - case int24BE: - convertFloatToInt24BE (source, dest, numSamples); - break; - - case int32LE: - convertFloatToInt32LE (source, dest, numSamples); - break; - - case int32BE: - convertFloatToInt32BE (source, dest, numSamples); - break; - - case float32LE: - convertFloatToFloat32LE (source, dest, numSamples); - break; - - case float32BE: - convertFloatToFloat32BE (source, dest, numSamples); - break; - - default: - jassertfalse; - break; + case int16LE: convertFloatToInt16LE (source, dest, numSamples); break; + case int16BE: convertFloatToInt16BE (source, dest, numSamples); break; + case int24LE: convertFloatToInt24LE (source, dest, numSamples); break; + case int24BE: convertFloatToInt24BE (source, dest, numSamples); break; + case int32LE: convertFloatToInt32LE (source, dest, numSamples); break; + case int32BE: convertFloatToInt32BE (source, dest, numSamples); break; + case float32LE: convertFloatToFloat32LE (source, dest, numSamples); break; + case float32BE: convertFloatToFloat32BE (source, dest, numSamples); break; + default: jassertfalse; break; } } @@ -456,41 +430,15 @@ void AudioDataConverters::convertFormatToFloat (const DataFormat sourceFormat, { switch (sourceFormat) { - case int16LE: - convertInt16LEToFloat (source, dest, numSamples); - break; - - case int16BE: - convertInt16BEToFloat (source, dest, numSamples); - break; - - case int24LE: - convertInt24LEToFloat (source, dest, numSamples); - break; - - case int24BE: - convertInt24BEToFloat (source, dest, numSamples); - break; - - case int32LE: - convertInt32LEToFloat (source, dest, numSamples); - break; - - case int32BE: - convertInt32BEToFloat (source, dest, numSamples); - break; - - case float32LE: - convertFloat32LEToFloat (source, dest, numSamples); - break; - - case float32BE: - convertFloat32BEToFloat (source, dest, numSamples); - break; - - default: - jassertfalse; - break; + case int16LE: convertInt16LEToFloat (source, dest, numSamples); break; + case int16BE: convertInt16BEToFloat (source, dest, numSamples); break; + case int24LE: convertInt24LEToFloat (source, dest, numSamples); break; + case int24BE: convertInt24BEToFloat (source, dest, numSamples); break; + case int32LE: convertInt32LEToFloat (source, dest, numSamples); break; + case int32BE: convertInt32BEToFloat (source, dest, numSamples); break; + case float32LE: convertFloat32LEToFloat (source, dest, numSamples); break; + case float32BE: convertFloat32BEToFloat (source, dest, numSamples); break; + default: jassertfalse; break; } } @@ -532,6 +480,7 @@ void AudioDataConverters::deinterleaveSamples (const float* const source, } +//============================================================================== #if JUCE_UNIT_TESTS #include "../../utilities/juce_UnitTest.h" diff --git a/src/audio/midi/juce_MidiMessage.cpp b/src/audio/midi/juce_MidiMessage.cpp index 3702156f84..16d08ab967 100644 --- a/src/audio/midi/juce_MidiMessage.cpp +++ b/src/audio/midi/juce_MidiMessage.cpp @@ -566,7 +566,7 @@ const MidiMessage MidiMessage::createSysExMessage (const uint8* sysexData, const const uint8* MidiMessage::getSysExData() const noexcept { - return isSysEx() ? getRawData() + 1 : 0; + return isSysEx() ? getRawData() + 1 : nullptr; } int MidiMessage::getSysExDataSize() const noexcept diff --git a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm index bd6b654e3f..5ebd93ecac 100644 --- a/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm +++ b/src/audio/plugins/formats/juce_AudioUnitPluginFormat.mm @@ -1491,7 +1491,7 @@ AudioPluginInstance* AudioUnitPluginFormat::createInstanceFromDescription (const } } - return 0; + return nullptr; } const StringArray AudioUnitPluginFormat::searchPathsForPlugins (const FileSearchPath& /*directoriesToSearch*/, diff --git a/src/audio/plugins/formats/juce_VSTPluginFormat.cpp b/src/audio/plugins/formats/juce_VSTPluginFormat.cpp index 44192d06cb..43b5d05021 100644 --- a/src/audio/plugins/formats/juce_VSTPluginFormat.cpp +++ b/src/audio/plugins/formats/juce_VSTPluginFormat.cpp @@ -648,7 +648,7 @@ public: static void* newMachOFromCFM (void* cfmfp) { if (cfmfp == 0) - return 0; + return nullptr; UInt32* const mfp = new UInt32[6]; @@ -1874,7 +1874,7 @@ AudioProcessorEditor* VSTPluginInstance::createEditor() if (hasEditor()) return new VSTPluginWindow (*this); - return 0; + return nullptr; } diff --git a/src/audio/plugins/juce_AudioPluginInstance.cpp b/src/audio/plugins/juce_AudioPluginInstance.cpp index 567ba2711c..ba7913d2f2 100644 --- a/src/audio/plugins/juce_AudioPluginInstance.cpp +++ b/src/audio/plugins/juce_AudioPluginInstance.cpp @@ -43,7 +43,7 @@ AudioPluginInstance::~AudioPluginInstance() void* AudioPluginInstance::getPlatformSpecificData() { - return 0; + return nullptr; } END_JUCE_NAMESPACE diff --git a/src/audio/plugins/juce_KnownPluginList.cpp b/src/audio/plugins/juce_KnownPluginList.cpp index 27a27e475e..3bb169d748 100644 --- a/src/audio/plugins/juce_KnownPluginList.cpp +++ b/src/audio/plugins/juce_KnownPluginList.cpp @@ -55,7 +55,7 @@ PluginDescription* KnownPluginList::getTypeForFile (const String& fileOrIdentifi if (types.getUnchecked(i)->fileOrIdentifier == fileOrIdentifier) return types.getUnchecked(i); - return 0; + return nullptr; } PluginDescription* KnownPluginList::getTypeForIdentifierString (const String& identifierString) const @@ -64,7 +64,7 @@ PluginDescription* KnownPluginList::getTypeForIdentifierString (const String& id if (types.getUnchecked(i)->createIdentifierString() == identifierString) return types.getUnchecked(i); - return 0; + return nullptr; } bool KnownPluginList::addType (const PluginDescription& type) diff --git a/src/audio/processors/juce_AudioProcessor.cpp b/src/audio/processors/juce_AudioProcessor.cpp index 81b92520d8..6989f4ca3c 100644 --- a/src/audio/processors/juce_AudioProcessor.cpp +++ b/src/audio/processors/juce_AudioProcessor.cpp @@ -285,7 +285,7 @@ XmlElement* AudioProcessor::getXmlFromBinary (const void* data, jmin ((sizeInBytes - 8), stringLength))); } - return 0; + return nullptr; } //============================================================================== diff --git a/src/audio/processors/juce_AudioProcessorGraph.cpp b/src/audio/processors/juce_AudioProcessorGraph.cpp index 77339bc1fb..f82da1ecd9 100644 --- a/src/audio/processors/juce_AudioProcessorGraph.cpp +++ b/src/audio/processors/juce_AudioProcessorGraph.cpp @@ -105,7 +105,7 @@ AudioProcessorGraph::Node* AudioProcessorGraph::getNodeForId (const uint32 nodeI if (nodes.getUnchecked(i)->id == nodeId) return nodes.getUnchecked(i); - return 0; + return nullptr; } AudioProcessorGraph::Node* AudioProcessorGraph::addNode (AudioProcessor* const newProcessor, @@ -114,7 +114,7 @@ AudioProcessorGraph::Node* AudioProcessorGraph::addNode (AudioProcessor* const n if (newProcessor == nullptr) { jassertfalse; - return 0; + return nullptr; } if (nodeId == 0) @@ -186,7 +186,7 @@ const AudioProcessorGraph::Connection* AudioProcessorGraph::getConnectionBetween } } - return 0; + return nullptr; } bool AudioProcessorGraph::isConnected (const uint32 possibleSourceNodeId, @@ -1252,7 +1252,7 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::isOutput() const } bool AudioProcessorGraph::AudioGraphIOProcessor::hasEditor() const { return false; } -AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return 0; } +AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; } int AudioProcessorGraph::AudioGraphIOProcessor::getNumParameters() { return 0; } const String AudioProcessorGraph::AudioGraphIOProcessor::getParameterName (int) { return String::empty; } diff --git a/src/audio/processors/juce_AudioProcessorGraph.h b/src/audio/processors/juce_AudioProcessorGraph.h index 32ba934376..9c6c849228 100644 --- a/src/audio/processors/juce_AudioProcessorGraph.h +++ b/src/audio/processors/juce_AudioProcessorGraph.h @@ -372,7 +372,7 @@ public: bool producesMidi() const; bool hasEditor() const { return false; } - AudioProcessorEditor* createEditor() { return 0; } + AudioProcessorEditor* createEditor() { return nullptr; } int getNumParameters() { return 0; } const String getParameterName (int) { return String::empty; } diff --git a/src/audio/processors/juce_AudioProcessorPlayer.cpp b/src/audio/processors/juce_AudioProcessorPlayer.cpp index e8bf4048e7..77767d2b93 100644 --- a/src/audio/processors/juce_AudioProcessorPlayer.cpp +++ b/src/audio/processors/juce_AudioProcessorPlayer.cpp @@ -64,7 +64,7 @@ void AudioProcessorPlayer::setProcessor (AudioProcessor* const processorToPlay) { const ScopedLock sl (lock); - oldOne = isPrepared ? processor : 0; + oldOne = isPrepared ? processor : nullptr; processor = processorToPlay; isPrepared = true; } diff --git a/src/audio/synthesisers/juce_Synthesiser.cpp b/src/audio/synthesisers/juce_Synthesiser.cpp index 146f040579..c50b084cf7 100644 --- a/src/audio/synthesisers/juce_Synthesiser.cpp +++ b/src/audio/synthesisers/juce_Synthesiser.cpp @@ -359,7 +359,7 @@ SynthesiserVoice* Synthesiser::findFreeVoice (SynthesiserSound* soundToPlay, return oldest; } - return 0; + return nullptr; } diff --git a/src/containers/juce_LinkedListPointer.h b/src/containers/juce_LinkedListPointer.h index 56b14438af..826c8c4adf 100644 --- a/src/containers/juce_LinkedListPointer.h +++ b/src/containers/juce_LinkedListPointer.h @@ -288,7 +288,7 @@ public: l = &(l->item->nextListItem); } - return 0; + return nullptr; } /** Copies the items in the list to an array. diff --git a/src/containers/juce_NamedValueSet.cpp b/src/containers/juce_NamedValueSet.cpp index 9461e4880d..b41fa02294 100644 --- a/src/containers/juce_NamedValueSet.cpp +++ b/src/containers/juce_NamedValueSet.cpp @@ -133,7 +133,7 @@ var* NamedValueSet::getVarPointer (const Identifier& name) const if (i->name == name) return &(i->value); - return 0; + return nullptr; } bool NamedValueSet::set (const Identifier& name, const var& newValue) diff --git a/src/containers/juce_SortedSet.h b/src/containers/juce_SortedSet.h index accd675682..3d5d44d08a 100644 --- a/src/containers/juce_SortedSet.h +++ b/src/containers/juce_SortedSet.h @@ -446,7 +446,7 @@ public: return removed; } - return 0; + return ElementType(); } /** Removes an item from the set. diff --git a/src/containers/juce_Variant.cpp b/src/containers/juce_Variant.cpp index 1603049b30..5cda57f780 100644 --- a/src/containers/juce_Variant.cpp +++ b/src/containers/juce_Variant.cpp @@ -53,7 +53,7 @@ public: virtual double toDouble (const ValueUnion&) const { return 0; } virtual const String toString (const ValueUnion&) const { return String::empty; } virtual bool toBool (const ValueUnion&) const { return false; } - virtual DynamicObject* toObject (const ValueUnion&) const { return 0; } + virtual DynamicObject* toObject (const ValueUnion&) const { return nullptr; } virtual bool isVoid() const noexcept { return false; } virtual bool isInt() const noexcept { return false; } diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index f636268613..20c550ffec 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 69 +#define JUCE_BUILDNUMBER 70 /** Current Juce version number. diff --git a/src/gui/components/buttons/juce_Button.cpp b/src/gui/components/buttons/juce_Button.cpp index cd79324cf1..a53a630d91 100644 --- a/src/gui/components/buttons/juce_Button.cpp +++ b/src/gui/components/buttons/juce_Button.cpp @@ -469,7 +469,7 @@ void Button::visibilityChanged() void Button::parentHierarchyChanged() { - Component* const newKeySource = (shortcuts.size() == 0) ? 0 : getTopLevelComponent(); + Component* const newKeySource = (shortcuts.size() == 0) ? nullptr : getTopLevelComponent(); if (newKeySource != keySource.get()) { diff --git a/src/gui/components/controls/juce_ComboBox.cpp b/src/gui/components/controls/juce_ComboBox.cpp index 6d29e2084c..c1a9923e7d 100644 --- a/src/gui/components/controls/juce_ComboBox.cpp +++ b/src/gui/components/controls/juce_ComboBox.cpp @@ -194,7 +194,7 @@ ComboBox::ItemInfo* ComboBox::getItemForId (const int itemId) const noexcept return items.getUnchecked(i); } - return 0; + return nullptr; } ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const noexcept @@ -208,7 +208,7 @@ ComboBox::ItemInfo* ComboBox::getItemForIndex (const int index) const noexcept return item; } - return 0; + return nullptr; } int ComboBox::getNumItems() const noexcept diff --git a/src/gui/components/controls/juce_ListBox.cpp b/src/gui/components/controls/juce_ListBox.cpp index 3a96cfdd2a..3c4ff214c0 100644 --- a/src/gui/components/controls/juce_ListBox.cpp +++ b/src/gui/components/controls/juce_ListBox.cpp @@ -177,7 +177,7 @@ public: ListBoxRowComponent* getComponentForRowIfOnscreen (const int row) const noexcept { return (row >= firstIndex && row < firstIndex + rows.size()) - ? getComponentForRow (row) : 0; + ? getComponentForRow (row) : nullptr; } int getRowNumberOfComponent (Component* const rowComponent) const noexcept @@ -631,7 +631,7 @@ int ListBox::getInsertionIndexForPosition (const int x, const int y) const noexc Component* ListBox::getComponentForRowNumber (const int row) const noexcept { ListBoxRowComponent* const listRowComp = viewport->getComponentForRowIfOnscreen (row); - return listRowComp != nullptr ? static_cast (listRowComp->customComponent) : 0; + return listRowComp != nullptr ? static_cast (listRowComp->customComponent) : nullptr; } int ListBox::getRowNumberOfComponent (Component* const rowComponent) const noexcept @@ -942,7 +942,7 @@ Component* ListBoxModel::refreshComponentForRow (int, bool, Component* existingC { (void) existingComponentToUpdate; jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code the recycles the components - return 0; + return nullptr; } void ListBoxModel::listBoxItemClicked (int, const MouseEvent&) {} diff --git a/src/gui/components/controls/juce_TableHeaderComponent.cpp b/src/gui/components/controls/juce_TableHeaderComponent.cpp index 1cd9657a79..2e3c0e6620 100644 --- a/src/gui/components/controls/juce_TableHeaderComponent.cpp +++ b/src/gui/components/controls/juce_TableHeaderComponent.cpp @@ -808,7 +808,7 @@ TableHeaderComponent::ColumnInfo* TableHeaderComponent::getInfoForId (const int if (columns.getUnchecked(i)->id == id) return columns.getUnchecked(i); - return 0; + return nullptr; } int TableHeaderComponent::visibleIndexToTotalIndex (const int visibleIndex) const diff --git a/src/gui/components/controls/juce_TableListBox.cpp b/src/gui/components/controls/juce_TableListBox.cpp index 86e8d4752d..8c512a93a2 100644 --- a/src/gui/components/controls/juce_TableListBox.cpp +++ b/src/gui/components/controls/juce_TableListBox.cpp @@ -496,7 +496,7 @@ Component* TableListBoxModel::refreshComponentForCell (int, int, bool, Component { (void) existingComponentToUpdate; jassert (existingComponentToUpdate == nullptr); // indicates a failure in the code the recycles the components - return 0; + return nullptr; } diff --git a/src/gui/components/controls/juce_Toolbar.cpp b/src/gui/components/controls/juce_Toolbar.cpp index 112787c313..0dfbe3e5e1 100644 --- a/src/gui/components/controls/juce_Toolbar.cpp +++ b/src/gui/components/controls/juce_Toolbar.cpp @@ -386,7 +386,7 @@ ToolbarItemComponent* Toolbar::getNextActiveComponent (int index, const int delt return tc; } - return 0; + return nullptr; } void Toolbar::setStyle (const ToolbarItemStyle& newStyle) diff --git a/src/gui/components/controls/juce_TreeView.cpp b/src/gui/components/controls/juce_TreeView.cpp index ff1acd4577..63af79a182 100644 --- a/src/gui/components/controls/juce_TreeView.cpp +++ b/src/gui/components/controls/juce_TreeView.cpp @@ -191,7 +191,7 @@ public: return ti; } - return 0; + return nullptr; } void updateComponents() @@ -399,7 +399,7 @@ private: return ri; } - return 0; + return nullptr; } static bool isMouseDraggingInChildCompOf (Component* const comp) @@ -607,7 +607,7 @@ TreeViewItem* TreeView::getItemOnRow (int index) const if (rootItem != nullptr && index >= 0) return rootItem->getItemOnRow (index); - return 0; + return nullptr; } TreeViewItem* TreeView::getItemAt (int y) const noexcept @@ -620,7 +620,7 @@ TreeViewItem* TreeView::getItemAt (int y) const noexcept TreeViewItem* TreeView::findItemFromIdentifierString (const String& identifierString) const { if (rootItem == nullptr) - return 0; + return nullptr; return rootItem->findItemFromIdentifierString (identifierString); } @@ -950,7 +950,7 @@ TreeViewItem* TreeView::getInsertPosition (int& x, int& y, int& insertIndex, TreeViewItem* item = getItemAt (y); if (item == nullptr) - return 0; + return nullptr; Rectangle itemPos (item->getItemPosition (true)); insertIndex = item->getIndexInParent(); @@ -1583,7 +1583,7 @@ TreeViewItem* TreeViewItem::getItemOnRow (int index) noexcept } } - return 0; + return nullptr; } TreeViewItem* TreeViewItem::findItemRecursively (int targetY) noexcept @@ -1611,7 +1611,7 @@ TreeViewItem* TreeViewItem::findItemRecursively (int targetY) noexcept } } - return 0; + return nullptr; } int TreeViewItem::countSelectedItemsRecursively (int depth) const noexcept @@ -1650,7 +1650,7 @@ TreeViewItem* TreeViewItem::getSelectedItemWithIndex (int index) noexcept } } - return 0; + return nullptr; } int TreeViewItem::getRowNumberInTree() const noexcept @@ -1697,7 +1697,7 @@ TreeViewItem* TreeViewItem::getNextVisibleItem (const bool recurse) const noexce return parentItem->subItems [nextIndex]; } - return 0; + return nullptr; } const String TreeViewItem::getItemIdentifierString() const @@ -1735,7 +1735,7 @@ TreeViewItem* TreeViewItem::findItemFromIdentifierString (const String& identifi setOpen (wasOpen); } - return 0; + return nullptr; } void TreeViewItem::restoreOpennessState (const XmlElement& e) noexcept @@ -1797,7 +1797,7 @@ XmlElement* TreeViewItem::getOpennessState() const noexcept jassertfalse; } - return 0; + return nullptr; } //============================================================================== diff --git a/src/gui/components/controls/juce_TreeView.h b/src/gui/components/controls/juce_TreeView.h index 234e943448..1476bb8626 100644 --- a/src/gui/components/controls/juce_TreeView.h +++ b/src/gui/components/controls/juce_TreeView.h @@ -268,7 +268,7 @@ public: component you like. It's most useful if you're doing things like drag-and-drop of items, or want to use a Label component to edit item names, etc. */ - virtual Component* createItemComponent() { return 0; } + virtual Component* createItemComponent() { return nullptr; } //============================================================================== /** Draws the item's contents. diff --git a/src/gui/components/juce_Component.cpp b/src/gui/components/juce_Component.cpp index 7174ce3776..6a9582276c 100644 --- a/src/gui/components/juce_Component.cpp +++ b/src/gui/components/juce_Component.cpp @@ -565,7 +565,7 @@ void* Component::getWindowHandle() const if (peer != nullptr) return peer->getNativeHandle(); - return 0; + return nullptr; } //============================================================================== @@ -1309,7 +1309,7 @@ Component* Component::getComponentAt (const Point& position) return this; } - return 0; + return nullptr; } Component* Component::getComponentAt (const int x, const int y) @@ -2087,7 +2087,7 @@ void Component::colourChanged() //============================================================================== MarkerList* Component::getMarkers (bool /*xAxis*/) { - return 0; + return nullptr; } //============================================================================== @@ -3020,7 +3020,7 @@ ComponentPeer* Component::getPeer() const if (flags.hasHeavyweightPeerFlag) return ComponentPeer::getPeerFor (this); else if (parentComponent == nullptr) - return 0; + return nullptr; return parentComponent->getPeer(); } diff --git a/src/gui/components/juce_Component.h b/src/gui/components/juce_Component.h index 4bca5c4c93..992524c5fe 100644 --- a/src/gui/components/juce_Component.h +++ b/src/gui/components/juce_Component.h @@ -785,7 +785,7 @@ public: p = p->parentComponent; } - return 0; + return nullptr; } /** Returns the highest-level component which contains this one or its parents. diff --git a/src/gui/components/juce_Desktop.cpp b/src/gui/components/juce_Desktop.cpp index 9d2b384c11..bdd76c4a2b 100644 --- a/src/gui/components/juce_Desktop.cpp +++ b/src/gui/components/juce_Desktop.cpp @@ -163,7 +163,7 @@ Component* Desktop::findComponentAt (const Point& screenPosition) const } } - return 0; + return nullptr; } //============================================================================== @@ -249,7 +249,7 @@ MouseInputSource* Desktop::getDraggingMouseSource (int index) const noexcept } } - return 0; + return nullptr; } //============================================================================== diff --git a/src/gui/components/juce_ModalComponentManager.cpp b/src/gui/components/juce_ModalComponentManager.cpp index c8c83dae6a..83b7b8033e 100644 --- a/src/gui/components/juce_ModalComponentManager.cpp +++ b/src/gui/components/juce_ModalComponentManager.cpp @@ -172,7 +172,7 @@ Component* ModalComponentManager::getModalComponent (const int index) const return item->component; } - return 0; + return nullptr; } bool ModalComponentManager::isModal (Component* const comp) const diff --git a/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp b/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp index d6b2c975c2..fd28472f66 100644 --- a/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp +++ b/src/gui/components/keyboard/juce_KeyboardFocusTraverser.cpp @@ -124,7 +124,7 @@ namespace KeyboardFocusHelpers } } - return 0; + return nullptr; } } diff --git a/src/gui/components/layout/juce_ComponentAnimator.cpp b/src/gui/components/layout/juce_ComponentAnimator.cpp index d4dcb2d10b..74ce63b2be 100644 --- a/src/gui/components/layout/juce_ComponentAnimator.cpp +++ b/src/gui/components/layout/juce_ComponentAnimator.cpp @@ -218,7 +218,7 @@ ComponentAnimator::AnimationTask* ComponentAnimator::findTaskFor (Component* con if (component == tasks.getUnchecked(i)->component.get()) return tasks.getUnchecked(i); - return 0; + return nullptr; } void ComponentAnimator::animateComponent (Component* const component, diff --git a/src/gui/components/layout/juce_ComponentBuilder.cpp b/src/gui/components/layout/juce_ComponentBuilder.cpp index ad49e7015e..5b5b286b7e 100644 --- a/src/gui/components/layout/juce_ComponentBuilder.cpp +++ b/src/gui/components/layout/juce_ComponentBuilder.cpp @@ -50,7 +50,7 @@ namespace ComponentBuilderHelpers return components.removeAndReturn (i); } - return 0; + return nullptr; } Component* findComponentWithID (Component* const c, const String& compId) @@ -67,7 +67,7 @@ namespace ComponentBuilderHelpers return child; } - return 0; + return nullptr; } Component* createNewComponent (ComponentBuilder::TypeHandler& type, @@ -173,7 +173,7 @@ ComponentBuilder::TypeHandler* ComponentBuilder::getHandlerForState (const Value return t; } - return 0; + return nullptr; } int ComponentBuilder::getNumHandlers() const noexcept diff --git a/src/gui/components/layout/juce_StretchableLayoutManager.cpp b/src/gui/components/layout/juce_StretchableLayoutManager.cpp index 84edf03e9a..5bb29fee51 100644 --- a/src/gui/components/layout/juce_StretchableLayoutManager.cpp +++ b/src/gui/components/layout/juce_StretchableLayoutManager.cpp @@ -231,7 +231,7 @@ StretchableLayoutManager::ItemLayoutProperties* StretchableLayoutManager::getInf if (items.getUnchecked(i)->itemIndex == itemIndex) return items.getUnchecked(i); - return 0; + return nullptr; } int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp index 35a316d03d..54a2ef4e1f 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -943,7 +943,7 @@ void LookAndFeel::drawScrollbar (Graphics& g, ImageEffectFilter* LookAndFeel::getScrollbarEffect() { - return 0; + return nullptr; } int LookAndFeel::getMinimumScrollbarThumbSize (ScrollBar& scrollbar) @@ -1733,7 +1733,7 @@ Label* LookAndFeel::createSliderTextBox (Slider& slider) ImageEffectFilter* LookAndFeel::getSliderEffect() { - return 0; + return nullptr; } //============================================================================== @@ -2028,7 +2028,7 @@ Button* LookAndFeel::createDocumentWindowButton (int buttonType) } jassertfalse; - return 0; + return nullptr; } void LookAndFeel::positionDocumentWindowButtons (DocumentWindow&, diff --git a/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp b/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp index 8fcf7d4d1f..d20582d9d2 100644 --- a/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_OldSchoolLookAndFeel.cpp @@ -575,7 +575,7 @@ Button* OldSchoolLookAndFeel::createDocumentWindowButton (int buttonType) } jassertfalse; - return 0; + return nullptr; } void OldSchoolLookAndFeel::positionDocumentWindowButtons (DocumentWindow&, diff --git a/src/gui/components/menus/juce_PopupMenu.cpp b/src/gui/components/menus/juce_PopupMenu.cpp index 19a84fe61d..84600ab94b 100644 --- a/src/gui/components/menus/juce_PopupMenu.cpp +++ b/src/gui/components/menus/juce_PopupMenu.cpp @@ -329,7 +329,7 @@ public: minimumWidth, maximumNumColumns, standardItemHeight, dismissOnMouseUp, managerOfChosenCommand, componentAttachedTo); - return 0; + return nullptr; } //============================================================================== diff --git a/src/gui/components/mouse/juce_DragAndDropContainer.cpp b/src/gui/components/mouse/juce_DragAndDropContainer.cpp index ee3f65d253..f7439e8d22 100644 --- a/src/gui/components/mouse/juce_DragAndDropContainer.cpp +++ b/src/gui/components/mouse/juce_DragAndDropContainer.cpp @@ -131,7 +131,7 @@ public: hit = hit->getParentComponent(); } - return 0; + return nullptr; } void mouseUp (const MouseEvent& e) diff --git a/src/gui/components/mouse/juce_MouseInputSource.cpp b/src/gui/components/mouse/juce_MouseInputSource.cpp index ea4b689147..8750fd3480 100644 --- a/src/gui/components/mouse/juce_MouseInputSource.cpp +++ b/src/gui/components/mouse/juce_MouseInputSource.cpp @@ -86,7 +86,7 @@ public: return comp->getComponentAt (relativePos); } - return 0; + return nullptr; } const Point getScreenPosition() const diff --git a/src/gui/components/positioning/juce_MarkerList.cpp b/src/gui/components/positioning/juce_MarkerList.cpp index b4bea4640f..9d31d9a2fd 100644 --- a/src/gui/components/positioning/juce_MarkerList.cpp +++ b/src/gui/components/positioning/juce_MarkerList.cpp @@ -104,7 +104,7 @@ const MarkerList::Marker* MarkerList::getMarker (const String& name) const noexc return m; } - return 0; + return nullptr; } void MarkerList::setMarker (const String& name, const RelativeCoordinate& position) diff --git a/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp b/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp index a4853fe523..66b8da36c3 100644 --- a/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp +++ b/src/gui/components/positioning/juce_RelativeCoordinatePositioner.cpp @@ -95,7 +95,7 @@ Component* RelativeCoordinatePositionerBase::ComponentScope::findSiblingComponen } } - return 0; + return nullptr; } const MarkerList::Marker* RelativeCoordinatePositionerBase::ComponentScope::findMarker (const String& name, MarkerList*& list) const diff --git a/src/gui/components/positioning/juce_RelativePointPath.cpp b/src/gui/components/positioning/juce_RelativePointPath.cpp index 1ef45b35dc..8dd6411a2e 100644 --- a/src/gui/components/positioning/juce_RelativePointPath.cpp +++ b/src/gui/components/positioning/juce_RelativePointPath.cpp @@ -194,7 +194,7 @@ void RelativePointPath::CloseSubPath::addToPath (Path& path, Expression::Scope*) RelativePoint* RelativePointPath::CloseSubPath::getControlPoints (int& numPoints) { numPoints = 0; - return 0; + return nullptr; } RelativePointPath::ElementBase* RelativePointPath::CloseSubPath::clone() const diff --git a/src/gui/components/special/juce_OpenGLComponent.cpp b/src/gui/components/special/juce_OpenGLComponent.cpp index fc30f3faee..b07239e714 100644 --- a/src/gui/components/special/juce_OpenGLComponent.cpp +++ b/src/gui/components/special/juce_OpenGLComponent.cpp @@ -126,7 +126,7 @@ OpenGLContext* OpenGLContext::getCurrentContext() return oglc; } - return 0; + return nullptr; } diff --git a/src/gui/components/windows/juce_AlertWindow.cpp b/src/gui/components/windows/juce_AlertWindow.cpp index 125c29273f..3f6ab8cd22 100644 --- a/src/gui/components/windows/juce_AlertWindow.cpp +++ b/src/gui/components/windows/juce_AlertWindow.cpp @@ -212,7 +212,7 @@ TextEditor* AlertWindow::getTextEditor (const String& nameOfTextEditor) const if (textBoxes.getUnchecked(i)->getName() == nameOfTextEditor) return textBoxes.getUnchecked(i); - return 0; + return nullptr; } const String AlertWindow::getTextEditorContents (const String& nameOfTextEditor) const @@ -247,7 +247,7 @@ ComboBox* AlertWindow::getComboBoxComponent (const String& nameOfList) const if (comboBoxes.getUnchecked(i)->getName() == nameOfList) return comboBoxes.getUnchecked(i); - return 0; + return nullptr; } //============================================================================== @@ -657,7 +657,7 @@ private: static void* showCallback (void* userData) { static_cast (userData)->show(); - return 0; + return nullptr; } }; diff --git a/src/gui/components/windows/juce_ComponentPeer.cpp b/src/gui/components/windows/juce_ComponentPeer.cpp index cd4a72f2fa..d033c6a09a 100644 --- a/src/gui/components/windows/juce_ComponentPeer.cpp +++ b/src/gui/components/windows/juce_ComponentPeer.cpp @@ -85,7 +85,7 @@ ComponentPeer* ComponentPeer::getPeerFor (const Component* const component) noex return peer; } - return 0; + return nullptr; } bool ComponentPeer::isValidPeer (const ComponentPeer* const peer) noexcept @@ -283,7 +283,7 @@ TextInputTarget* ComponentPeer::findCurrentTextInputTarget() return ti; } - return 0; + return nullptr; } void ComponentPeer::dismissPendingTextInput() @@ -431,7 +431,7 @@ namespace ComponentPeerHelpers c = c->getParentComponent(); } - return 0; + return nullptr; } } diff --git a/src/gui/components/windows/juce_ResizableWindow.cpp b/src/gui/components/windows/juce_ResizableWindow.cpp index a47b745752..a246bcddfa 100644 --- a/src/gui/components/windows/juce_ResizableWindow.cpp +++ b/src/gui/components/windows/juce_ResizableWindow.cpp @@ -538,7 +538,7 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s) const Rectangle screen (Desktop::getInstance().getMonitorAreaContaining (newPos.getCentre())); - ComponentPeer* const peer = isOnDesktop() ? getPeer() : 0; + ComponentPeer* const peer = isOnDesktop() ? getPeer() : nullptr; if (peer != nullptr) peer->getFrameSize().addTo (newPos); diff --git a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index e46ce9ed42..56a689c491 100644 --- a/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/src/gui/graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -1239,7 +1239,7 @@ public: const Ptr clipToRectangle (const Rectangle& r) { edgeTable.clipToRectangle (r); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToRectangleList (const RectangleList& r) @@ -1250,26 +1250,26 @@ public: for (RectangleList::Iterator iter (inverse); iter.next();) edgeTable.excludeRectangle (*iter.getRectangle()); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr excludeClipRectangle (const Rectangle& r) { edgeTable.excludeRectangle (r); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToPath (const Path& p, const AffineTransform& transform) { EdgeTable et (edgeTable.getMaximumBounds(), p, transform); edgeTable.clipToEdgeTable (et); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToEdgeTable (const EdgeTable& et) { edgeTable.clipToEdgeTable (et); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr clipToImageAlpha (const Image& image, const AffineTransform& transform, const bool betterQuality) @@ -1292,12 +1292,12 @@ public: else straightClipImage (srcData, imageX, imageY, (PixelAlpha*) 0); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } } if (transform.isSingularity()) - return 0; + return nullptr; { Path p; @@ -1314,13 +1314,13 @@ public: transformedClipImage (srcData, transform, betterQuality, (PixelAlpha*) 0); } - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } const Ptr translated (const Point& delta) { edgeTable.translate ((float) delta.getX(), delta.getY()); - return edgeTable.isEmpty() ? 0 : this; + return edgeTable.isEmpty() ? nullptr : this; } bool clipRegionIntersects (const Rectangle& r) const @@ -1444,19 +1444,19 @@ public: const Ptr clipToRectangle (const Rectangle& r) { clip.clipTo (r); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } const Ptr clipToRectangleList (const RectangleList& r) { clip.clipTo (r); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } const Ptr excludeClipRectangle (const Rectangle& r) { clip.subtract (r); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } const Ptr clipToPath (const Path& p, const AffineTransform& transform) @@ -1477,7 +1477,7 @@ public: const Ptr translated (const Point& delta) { clip.offsetAll (delta.getX(), delta.getY()); - return clip.isEmpty() ? 0 : this; + return clip.isEmpty() ? nullptr : this; } bool clipRegionIntersects (const Rectangle& r) const diff --git a/src/gui/graphics/drawables/juce_Drawable.cpp b/src/gui/graphics/drawables/juce_Drawable.cpp index cedeb205bf..df89f6e826 100644 --- a/src/gui/graphics/drawables/juce_Drawable.cpp +++ b/src/gui/graphics/drawables/juce_Drawable.cpp @@ -168,7 +168,7 @@ Drawable* Drawable::createFromImageFile (const File& file) { const ScopedPointer fin (file.createInputStream()); - return fin != nullptr ? createFromImageDataStream (*fin) : 0; + return fin != nullptr ? createFromImageDataStream (*fin) : nullptr; } //============================================================================== diff --git a/src/gui/graphics/drawables/juce_SVGParser.cpp b/src/gui/graphics/drawables/juce_SVGParser.cpp index 328d60cd64..629358e90b 100644 --- a/src/gui/graphics/drawables/juce_SVGParser.cpp +++ b/src/gui/graphics/drawables/juce_SVGParser.cpp @@ -49,7 +49,7 @@ public: Drawable* parseSVGElement (const XmlElement& xml) { if (! xml.hasTagName ("svg")) - return 0; + return nullptr; DrawableComposite* const drawable = new DrawableComposite(); @@ -168,7 +168,7 @@ private: if (group != nullptr) return parseGroupElement (*group); - return 0; + return nullptr; } DrawableComposite* parseGroupElement (const XmlElement& xml) @@ -640,7 +640,7 @@ private: const String id (e->getStringAttribute ("xlink:href")); if (! id.startsWithChar ('#')) - return 0; + return nullptr; return findElementForId (topLevelXml, id.substring (1)); } @@ -847,7 +847,7 @@ private: } } - return 0; + return nullptr; } //============================================================================== @@ -1288,7 +1288,7 @@ private: return found; } - return 0; + return nullptr; } SVGState& operator= (const SVGState&); diff --git a/src/gui/graphics/fonts/juce_Typeface.cpp b/src/gui/graphics/fonts/juce_Typeface.cpp index 804add343e..4065562086 100644 --- a/src/gui/graphics/fonts/juce_Typeface.cpp +++ b/src/gui/graphics/fonts/juce_Typeface.cpp @@ -238,7 +238,7 @@ CustomTypeface::GlyphInfo* CustomTypeface::findGlyph (const juce_wchar character if (loadIfNeeded && loadGlyphIfPossible (character)) return findGlyph (character, false); - return 0; + return nullptr; } CustomTypeface::GlyphInfo* CustomTypeface::findGlyphSubstituting (const juce_wchar character) noexcept @@ -464,7 +464,7 @@ EdgeTable* CustomTypeface::getEdgeTableForGlyph (int glyphNumber, const AffineTr return new EdgeTable (glyph->path.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), glyph->path, transform); - return 0; + return nullptr; } diff --git a/src/gui/graphics/imaging/juce_ImageFileFormat.cpp b/src/gui/graphics/imaging/juce_ImageFileFormat.cpp index f98a3ad961..792f65429a 100644 --- a/src/gui/graphics/imaging/juce_ImageFileFormat.cpp +++ b/src/gui/graphics/imaging/juce_ImageFileFormat.cpp @@ -58,7 +58,7 @@ ImageFileFormat* ImageFileFormat::findImageFormatForStream (InputStream& input) return formats[i]; } - return 0; + return nullptr; } //============================================================================== diff --git a/src/io/files/juce_File.cpp b/src/io/files/juce_File.cpp index 427b0cecbd..737efdf4ca 100644 --- a/src/io/files/juce_File.cpp +++ b/src/io/files/juce_File.cpp @@ -680,7 +680,7 @@ FileInputStream* File::createInputStream() const if (existsAsFile()) return new FileInputStream (*this); - return 0; + return nullptr; } FileOutputStream* File::createOutputStream (const int bufferSize) const @@ -688,7 +688,7 @@ FileOutputStream* File::createOutputStream (const int bufferSize) const ScopedPointer out (new FileOutputStream (*this, bufferSize)); if (out->failedToOpen()) - return 0; + return nullptr; return out.release(); } diff --git a/src/io/files/juce_ZipFile.cpp b/src/io/files/juce_ZipFile.cpp index 513afd6be0..c22e90691f 100644 --- a/src/io/files/juce_ZipFile.cpp +++ b/src/io/files/juce_ZipFile.cpp @@ -209,7 +209,7 @@ int ZipFile::getNumEntries() const noexcept const ZipFile::ZipEntry* ZipFile::getEntry (const int index) const noexcept { ZipEntryInfo* const zei = entries [index]; - return zei != nullptr ? &(zei->entry) : 0; + return zei != nullptr ? &(zei->entry) : nullptr; } int ZipFile::getIndexOfFileName (const String& fileName) const noexcept diff --git a/src/io/network/juce_Socket.cpp b/src/io/network/juce_Socket.cpp index da6cc98f29..798e526c9e 100644 --- a/src/io/network/juce_Socket.cpp +++ b/src/io/network/juce_Socket.cpp @@ -171,8 +171,8 @@ namespace SocketHelpers FD_ZERO (&wset); FD_SET (handle, &wset); - fd_set* const prset = forReading ? &rset : 0; - fd_set* const pwset = forReading ? 0 : &wset; + fd_set* const prset = forReading ? &rset : nullptr; + fd_set* const pwset = forReading ? nullptr : &wset; #if JUCE_WINDOWS if (select (handle + 1, prset, pwset, 0, timeoutp) < 0) @@ -465,7 +465,7 @@ StreamingSocket* StreamingSocket::waitForNextConnection() const portNumber, newSocket); } - return 0; + return nullptr; } bool StreamingSocket::isLocal() const noexcept @@ -572,7 +572,7 @@ DatagramSocket* DatagramSocket::waitForNextConnection() const } } - return 0; + return nullptr; } //============================================================================== diff --git a/src/maths/juce_Expression.cpp b/src/maths/juce_Expression.cpp index 4d08c74bb1..6510c8b764 100644 --- a/src/maths/juce_Expression.cpp +++ b/src/maths/juce_Expression.cpp @@ -46,14 +46,14 @@ public: virtual int getInputIndexFor (const Term*) const { return -1; } virtual int getOperatorPrecedence() const { return 0; } virtual int getNumInputs() const { return 0; } - virtual Term* getInput (int) const { return 0; } + virtual Term* getInput (int) const { return nullptr; } virtual const ReferenceCountedObjectPtr negated(); virtual const ReferenceCountedObjectPtr createTermToEvaluateInput (const Scope&, const Term* /*inputTerm*/, double /*overallTarget*/, Term* /*topLevelTerm*/) const { jassertfalse; - return 0; + return nullptr; } virtual const String getName() const @@ -197,7 +197,7 @@ public: { jassert (input == left || input == right); if (input != left && input != right) - return 0; + return nullptr; const Term* const dest = findDestinationFor (topLevelTerm, this); @@ -427,7 +427,7 @@ public: Type getType() const noexcept { return operatorType; } int getInputIndexFor (const Term* possibleInput) const { return possibleInput == input ? 0 : -1; } int getNumInputs() const { return 1; } - Term* getInput (int index) const { return index == 0 ? input.getObject() : 0; } + Term* getInput (int index) const { return index == 0 ? input.getObject() : nullptr; } Term* clone() const { return new Negate (input->clone()); } const TermPtr resolve (const Scope& scope, int recursionDepth) @@ -477,7 +477,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; return new Subtract (newDest, (input == left ? right : left)->clone()); } @@ -502,7 +502,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; if (input == left) return new Add (newDest, right->clone()); @@ -530,7 +530,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; return new Divide (newDest, (input == left ? right : left)->clone()); } @@ -555,7 +555,7 @@ public: { const TermPtr newDest (createDestinationTerm (scope, input, overallTarget, topLevelTerm)); if (newDest == nullptr) - return 0; + return nullptr; if (input == left) return new Multiply (newDest, right->clone()); @@ -582,7 +582,7 @@ public: return t; } - return 0; + return nullptr; } static Constant* findTermToAdjust (Term* const term, const bool mustBeFlagged) @@ -594,7 +594,7 @@ public: } if (dynamic_cast (term) != nullptr) - return 0; + return nullptr; int i; const int numIns = term->getNumInputs(); @@ -612,7 +612,7 @@ public: return c; } - return 0; + return nullptr; } static bool containsAnySymbols (const Term* const t) @@ -768,7 +768,7 @@ public: if (isDecimalDigit (*t) || (*t == '.' && isDecimalDigit (t[1]))) return new Constant (CharacterFunctions::readDoubleValue (text), isResolutionTarget); - return 0; + return nullptr; } const TermPtr readExpression() @@ -901,17 +901,17 @@ public: } } - return 0; + return nullptr; } const TermPtr readParenthesisedExpression() { if (! readOperator ("(")) - return 0; + return nullptr; const TermPtr e (readExpression()); if (e == nullptr || ! readOperator (")")) - return 0; + return nullptr; return e; } diff --git a/src/native/android/juce_android_CameraDevice.cpp b/src/native/android/juce_android_CameraDevice.cpp index 0e677d5cdd..d507cd334e 100644 --- a/src/native/android/juce_android_CameraDevice.cpp +++ b/src/native/android/juce_android_CameraDevice.cpp @@ -66,7 +66,7 @@ Component* CameraDevice::createViewerComponent() { // TODO - return 0; + return nullptr; } const String CameraDevice::getFileExtension() @@ -115,7 +115,7 @@ CameraDevice* CameraDevice::openDevice (int index, { // TODO - return 0; + return nullptr; } diff --git a/src/native/android/juce_android_Fonts.cpp b/src/native/android/juce_android_Fonts.cpp index a301db1cbb..1d9f194ce1 100644 --- a/src/native/android/juce_android_Fonts.cpp +++ b/src/native/android/juce_android_Fonts.cpp @@ -157,7 +157,7 @@ public: const Rectangle bounds (left, top, right - left, bottom - top); if (bounds.isEmpty()) - return 0; + return nullptr; jint* const maskDataElements = env->GetIntArrayElements (maskData, 0); diff --git a/src/native/android/juce_android_Midi.cpp b/src/native/android/juce_android_Midi.cpp index 9b0d8fbe7d..601b8bf5cc 100644 --- a/src/native/android/juce_android_Midi.cpp +++ b/src/native/android/juce_android_Midi.cpp @@ -43,7 +43,7 @@ int MidiOutput::getDefaultDeviceIndex() MidiOutput* MidiOutput::openDevice (int index) { - return 0; + return nullptr; } MidiOutput::~MidiOutput() @@ -100,7 +100,7 @@ const StringArray MidiInput::getDevices() MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { - return 0; + return nullptr; } diff --git a/src/native/android/juce_android_NativeCode.cpp b/src/native/android/juce_android_NativeCode.cpp index 77772202e8..aae8ddc2ff 100644 --- a/src/native/android/juce_android_NativeCode.cpp +++ b/src/native/android/juce_android_NativeCode.cpp @@ -326,7 +326,7 @@ public: if (threads[i] == thisThread) return envs[i]; - return 0; + return nullptr; } enum { maxThreads = 16 }; diff --git a/src/native/android/juce_android_Network.cpp b/src/native/android/juce_android_Network.cpp index 827af5e4b1..5f1c3e144c 100644 --- a/src/native/android/juce_android_Network.cpp +++ b/src/native/android/juce_android_Network.cpp @@ -152,7 +152,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->stream != 0 ? wi.release() : 0; + return wi->stream != 0 ? wi.release() : nullptr; } #endif diff --git a/src/native/android/juce_android_OpenGLComponent.cpp b/src/native/android/juce_android_OpenGLComponent.cpp index 314b1691fa..bd13d3aa3a 100644 --- a/src/native/android/juce_android_OpenGLComponent.cpp +++ b/src/native/android/juce_android_OpenGLComponent.cpp @@ -32,12 +32,12 @@ // TODO OpenGLContext* OpenGLComponent::createContext() { - return 0; + return nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { - return 0; + return nullptr; } void juce_glViewport (const int w, const int h) diff --git a/src/native/android/juce_android_Windowing.cpp b/src/native/android/juce_android_Windowing.cpp index 44d577dcd0..f8dffd7a71 100644 --- a/src/native/android/juce_android_Windowing.cpp +++ b/src/native/android/juce_android_Windowing.cpp @@ -433,7 +433,7 @@ public: return ap; } - return 0; + return nullptr; } static ModifierKeys currentModifiers; @@ -608,7 +608,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType android.activity.callVoidMethod (android.showOkCancelBox, javaString (title).get(), javaString (message).get(), (jlong) (pointer_sized_int) callback); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, @@ -673,8 +673,8 @@ const Image juce_createIconForFile (const File& file) } //============================================================================== -void* MouseCursor::createMouseCursorFromImage (const Image&, int, int) { return 0; } -void* MouseCursor::createStandardMouseCursor (const MouseCursor::StandardCursorType) { return 0; } +void* MouseCursor::createMouseCursorFromImage (const Image&, int, int) { return nullptr; } +void* MouseCursor::createStandardMouseCursor (const MouseCursor::StandardCursorType) { return nullptr; } void MouseCursor::deleteMouseCursor (void* const /*cursorHandle*/, const bool /*isStandard*/) {} //============================================================================== diff --git a/src/native/common/juce_posix_SharedCode.h b/src/native/common/juce_posix_SharedCode.h index 765d6f8a3e..ce755b54d6 100644 --- a/src/native/common/juce_posix_SharedCode.h +++ b/src/native/common/juce_posix_SharedCode.h @@ -485,13 +485,13 @@ void FileOutputStream::flushInternal() //============================================================================== const File juce_getExecutableFile() { - #if JUCE_ANDROID + #if JUCE_ANDROID return File (android.appFile); - #else + #else Dl_info exeInfo; dladdr ((void*) juce_getExecutableFile, &exeInfo); // (can't be a const void* on android) return File::getCurrentWorkingDirectory().getChildFile (CharPointer_UTF8 (exeInfo.dli_fname)); - #endif + #endif } //============================================================================== @@ -515,7 +515,7 @@ int64 File::getVolumeTotalSize() const const String File::getVolumeLabel() const { -#if JUCE_MAC + #if JUCE_MAC struct VolAttrBuf { u_int32_t length; @@ -542,7 +542,7 @@ const String File::getVolumeLabel() const f = parent; } -#endif + #endif return String::empty; } @@ -709,7 +709,7 @@ void* threadEntryProc (void* userData) #endif juce_threadEntryPoint (userData); - return 0; + return nullptr; } void Thread::launchThread() diff --git a/src/native/linux/juce_linux_Audio.cpp b/src/native/linux/juce_linux_Audio.cpp index d24df01a5f..e39c468add 100644 --- a/src/native/linux/juce_linux_Audio.cpp +++ b/src/native/linux/juce_linux_Audio.cpp @@ -366,7 +366,7 @@ private: default: jassertfalse; break; // unsupported format! } - return 0; + return nullptr; } //============================================================================== @@ -973,7 +973,7 @@ public: inputIds [inputIndex], outputIds [outputIndex]); - return 0; + return nullptr; } //============================================================================== diff --git a/src/native/linux/juce_linux_AudioCDReader.cpp b/src/native/linux/juce_linux_AudioCDReader.cpp index 1922008f6d..92b3335742 100644 --- a/src/native/linux/juce_linux_AudioCDReader.cpp +++ b/src/native/linux/juce_linux_AudioCDReader.cpp @@ -42,7 +42,7 @@ const StringArray AudioCDReader::getAvailableCDNames() AudioCDReader* AudioCDReader::createReaderForCD (const int index) { - return 0; + return nullptr; } AudioCDReader::~AudioCDReader() diff --git a/src/native/linux/juce_linux_Fonts.cpp b/src/native/linux/juce_linux_Fonts.cpp index 8c465daf13..cfbab691ac 100644 --- a/src/native/linux/juce_linux_Fonts.cpp +++ b/src/native/linux/juce_linux_Fonts.cpp @@ -145,7 +145,7 @@ public: return faces[i]; if (! create) - return 0; + return nullptr; FreeTypeFontFace* newFace = new FreeTypeFontFace (familyName); faces.add (newFace); diff --git a/src/native/linux/juce_linux_JackAudio.cpp b/src/native/linux/juce_linux_JackAudio.cpp index 5a13ad7ff8..95f38e6ad6 100644 --- a/src/native/linux/juce_linux_JackAudio.cpp +++ b/src/native/linux/juce_linux_JackAudio.cpp @@ -35,7 +35,7 @@ static void* juce_libjack_handle = nullptr; void* juce_load_jack_function (const char* const name) { if (juce_libjack_handle == 0) - return 0; + return nullptr; return dlsym (juce_libjack_handle, name); } @@ -580,7 +580,7 @@ public: inputIds [inputIndex], outputIds [outputIndex]); - return 0; + return nullptr; } //============================================================================== diff --git a/src/native/linux/juce_linux_Messaging.cpp b/src/native/linux/juce_linux_Messaging.cpp index 453b3c99bc..65df3c9aca 100644 --- a/src/native/linux/juce_linux_Messaging.cpp +++ b/src/native/linux/juce_linux_Messaging.cpp @@ -263,14 +263,14 @@ namespace LinuxErrorHandling // A protocol error has occurred static int juce_XErrorHandler (Display* display, XErrorEvent* event) { - #if JUCE_DEBUG_XERRORS + #if JUCE_DEBUG_XERRORS char errorStr[64] = { 0 }; char requestStr[64] = { 0 }; XGetErrorText (display, event->error_code, errorStr, 64); XGetErrorDatabaseText (display, "XRequest", String (event->request_code).toUTF8(), "Unknown", requestStr, 64); DBG ("ERROR: X returned " + String (errorStr) + " for operation " + String (requestStr)); - #endif + #endif return 0; } @@ -433,7 +433,7 @@ private: void* MessageManager::callFunctionOnMessageThread (MessageCallbackFunction* func, void* parameter) { if (LinuxErrorHandling::errorOccurred) - return 0; + return nullptr; return AsyncFunctionCaller::call (func, parameter); } diff --git a/src/native/linux/juce_linux_Midi.cpp b/src/native/linux/juce_linux_Midi.cpp index f4fcd98815..0b9f3ac53d 100644 --- a/src/native/linux/juce_linux_Midi.cpp +++ b/src/native/linux/juce_linux_Midi.cpp @@ -432,8 +432,8 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba const StringArray MidiOutput::getDevices() { return StringArray(); } int MidiOutput::getDefaultDeviceIndex() { return 0; } -MidiOutput* MidiOutput::openDevice (int) { return 0; } -MidiOutput* MidiOutput::createNewDevice (const String&) { return 0; } +MidiOutput* MidiOutput::openDevice (int) { return nullptr; } +MidiOutput* MidiOutput::createNewDevice (const String&) { return nullptr; } MidiOutput::~MidiOutput() {} void MidiOutput::reset() {} bool MidiOutput::getVolume (float&, float&) { return false; } @@ -446,8 +446,8 @@ void MidiInput::start() {} void MidiInput::stop() {} int MidiInput::getDefaultDeviceIndex() { return 0; } const StringArray MidiInput::getDevices() { return StringArray(); } -MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return 0; } -MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return 0; } +MidiInput* MidiInput::openDevice (int, MidiInputCallback*) { return nullptr; } +MidiInput* MidiInput::createNewDevice (const String&, MidiInputCallback*) { return nullptr; } #endif #endif diff --git a/src/native/linux/juce_linux_Network.cpp b/src/native/linux/juce_linux_Network.cpp index 9306d31441..c43d78b913 100644 --- a/src/native/linux/juce_linux_Network.cpp +++ b/src/native/linux/juce_linux_Network.cpp @@ -451,7 +451,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->isError() ? 0 : wi.release(); + return wi->isError() ? nullptr : wi.release(); } diff --git a/src/native/linux/juce_linux_Windowing.cpp b/src/native/linux/juce_linux_Windowing.cpp index 30061a5818..5dc978ae61 100644 --- a/src/native/linux/juce_linux_Windowing.cpp +++ b/src/native/linux/juce_linux_Windowing.cpp @@ -592,7 +592,7 @@ public: SharedImage* clone() { jassertfalse; - return 0; + return nullptr; } void blitToWindow (Window window, int dx, int dy, int dw, int dh, int sx, int sy) @@ -2928,7 +2928,7 @@ void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, Window root = RootWindow (display, DefaultScreen (display)); unsigned int cursorW, cursorH; if (! XQueryBestCursor (display, root, imageW, imageH, &cursorW, &cursorH)) - return 0; + return nullptr; Image im (Image::ARGB, cursorW, cursorH, true); @@ -3268,7 +3268,7 @@ OpenGLContext* OpenGLComponent::createContext() ScopedPointer c (new WindowedGLContext (this, preferredPixelFormat, contextToShareListsWith != 0 ? (GLXContext) contextToShareListsWith->getRawContext() : 0)); - return (c->renderContext != 0) ? c.release() : 0; + return (c->renderContext != 0) ? c.release() : nullptr; } void juce_glViewport (const int w, const int h) diff --git a/src/native/mac/juce_ios_Audio.cpp b/src/native/mac/juce_ios_Audio.cpp index bcc0783e3f..0c0e114b8b 100644 --- a/src/native/mac/juce_ios_Audio.cpp +++ b/src/native/mac/juce_ios_Audio.cpp @@ -566,7 +566,7 @@ public: : inputDeviceName); } - return 0; + return nullptr; } private: diff --git a/src/native/mac/juce_ios_MiscUtilities.mm b/src/native/mac/juce_ios_MiscUtilities.mm index d498d534d7..fe078336eb 100644 --- a/src/native/mac/juce_ios_MiscUtilities.mm +++ b/src/native/mac/juce_ios_MiscUtilities.mm @@ -210,7 +210,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType return mb->getResult() == 1; mb.release(); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, diff --git a/src/native/mac/juce_mac_AudioCDReader.mm b/src/native/mac/juce_mac_AudioCDReader.mm index 953b588093..d49ba812ad 100644 --- a/src/native/mac/juce_mac_AudioCDReader.mm +++ b/src/native/mac/juce_mac_AudioCDReader.mm @@ -36,7 +36,7 @@ namespace CDReaderHelpers if (child->getAllSubText().trim() == key) return child->getNextElement(); - return 0; + return nullptr; } static int getIntValueForKey (const XmlElement& xml, const String& key, int defaultValue = -1) @@ -83,7 +83,7 @@ namespace CDReaderHelpers } offsets.add (leadOut * AudioCDReader::samplesPerFrame - 88200); - return 0; + return nullptr; } static void findDevices (Array& cds) @@ -137,7 +137,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int index) if (cds[index].exists()) return new AudioCDReader (cds[index]); - return 0; + return nullptr; } AudioCDReader::AudioCDReader (const File& volume) diff --git a/src/native/mac/juce_mac_CameraDevice.mm b/src/native/mac/juce_mac_CameraDevice.mm index 0b745ff69e..e53e63aac5 100644 --- a/src/native/mac/juce_mac_CameraDevice.mm +++ b/src/native/mac/juce_mac_CameraDevice.mm @@ -423,7 +423,7 @@ CameraDevice* CameraDevice::openDevice (int index, if (static_cast (d->internal)->openingError.isEmpty()) return d.release(); - return 0; + return nullptr; } #endif diff --git a/src/native/mac/juce_mac_CoreAudio.cpp b/src/native/mac/juce_mac_CoreAudio.cpp index d05bfcd3dd..98ff0e8a1b 100644 --- a/src/native/mac/juce_mac_CoreAudio.cpp +++ b/src/native/mac/juce_mac_CoreAudio.cpp @@ -1248,7 +1248,7 @@ public: outputIds [outputIndex], outputIndex); - return 0; + return nullptr; } //============================================================================== diff --git a/src/native/mac/juce_mac_CoreMidi.cpp b/src/native/mac/juce_mac_CoreMidi.cpp index 821c97cb04..3ee32df2ba 100644 --- a/src/native/mac/juce_mac_CoreMidi.cpp +++ b/src/native/mac/juce_mac_CoreMidi.cpp @@ -573,9 +573,9 @@ bool MidiOutput::getVolume (float& /*leftVol*/, float& /*rightVol*/) { re void MidiOutput::setVolume (float /*leftVol*/, float /*rightVol*/) {} void MidiOutput::sendMessageNow (const MidiMessage& message) {} const StringArray MidiOutput::getDevices() { return StringArray(); } -MidiOutput* MidiOutput::openDevice (int index) { return 0; } +MidiOutput* MidiOutput::openDevice (int index) { return nullptr; } const StringArray MidiInput::getDevices() { return StringArray(); } -MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return 0; } +MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback) { return nullptr; } #endif diff --git a/src/native/mac/juce_mac_Fonts.mm b/src/native/mac/juce_mac_Fonts.mm index 371bda95d3..e0dda0d573 100644 --- a/src/native/mac/juce_mac_Fonts.mm +++ b/src/native/mac/juce_mac_Fonts.mm @@ -296,7 +296,7 @@ public: return new EdgeTable (path.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0), path, transform); - return 0; + return nullptr; } bool getOutlineForGlyph (int glyphNumber, Path& path) diff --git a/src/native/mac/juce_mac_MainMenu.mm b/src/native/mac/juce_mac_MainMenu.mm index 720bed0cef..f5d5d412d3 100644 --- a/src/native/mac/juce_mac_MainMenu.mm +++ b/src/native/mac/juce_mac_MainMenu.mm @@ -321,7 +321,7 @@ private: } } - return 0; + return nil; } static void flashMenuBar (NSMenu* menu) @@ -550,7 +550,7 @@ void MenuBarModel::setMacMainMenu (MenuBarModel* newMenuBarModel, MenuBarModel* MenuBarModel::getMacMainMenu() { return JuceMainMenuHandler::instance != nullptr - ? JuceMainMenuHandler::instance->currentModel : 0; + ? JuceMainMenuHandler::instance->currentModel : nullptr; } void juce_initialiseMacMainMenu() diff --git a/src/native/mac/juce_mac_MiscUtilities.mm b/src/native/mac/juce_mac_MiscUtilities.mm index 23209c8731..c321277f80 100644 --- a/src/native/mac/juce_mac_MiscUtilities.mm +++ b/src/native/mac/juce_mac_MiscUtilities.mm @@ -155,7 +155,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType return mb->getResult() == 1; mb.release(); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, diff --git a/src/native/mac/juce_mac_MouseCursor.mm b/src/native/mac/juce_mac_MouseCursor.mm index 07e50470f7..3264297725 100644 --- a/src/native/mac/juce_mac_MouseCursor.mm +++ b/src/native/mac/juce_mac_MouseCursor.mm @@ -53,7 +53,7 @@ namespace MouseCursorHelpers return createFromImage (im, hx * im.getWidth(), hy * im.getHeight()); jassertfalse; - return 0; + return nullptr; } } @@ -128,8 +128,8 @@ void MouseCursor::showInWindow (ComponentPeer*) const #else -void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) { return 0; } -void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return 0; } +void* MouseCursor::createMouseCursorFromImage (const Image& image, int hotspotX, int hotspotY) { return nullptr; } +void* MouseCursor::createStandardMouseCursor (MouseCursor::StandardCursorType type) { return nullptr; } void MouseCursor::deleteMouseCursor (void* const cursorHandle, const bool isStandard) {} void MouseCursor::showInAllWindows() const {} void MouseCursor::showInWindow (ComponentPeer*) const {} diff --git a/src/native/mac/juce_mac_Network.mm b/src/native/mac/juce_mac_Network.mm index ffcee844b4..d421cfcdda 100644 --- a/src/native/mac/juce_mac_Network.mm +++ b/src/native/mac/juce_mac_Network.mm @@ -428,7 +428,7 @@ private: timeoutInterval: timeOutMs <= 0 ? 60.0 : (timeOutMs / 1000.0)]; if (req == nil) - return 0; + return nil; [req setHTTPMethod: isPost ? @"POST" : @"GET"]; //[req setCachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData]; @@ -458,7 +458,7 @@ private: return s; [s release]; - return 0; + return nil; } JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream); @@ -472,7 +472,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->isError() ? 0 : wi.release(); + return wi->isError() ? nullptr : wi.release(); } diff --git a/src/native/mac/juce_mac_OpenGLComponent.mm b/src/native/mac/juce_mac_OpenGLComponent.mm index 8e6a9fbb56..a717f3fd53 100644 --- a/src/native/mac/juce_mac_OpenGLComponent.mm +++ b/src/native/mac/juce_mac_OpenGLComponent.mm @@ -273,13 +273,13 @@ OpenGLContext* OpenGLComponent::createContext() ScopedPointer c (new WindowedGLContext (*this, preferredPixelFormat, contextToShareListsWith != nullptr ? (NSOpenGLContext*) contextToShareListsWith->getRawContext() : 0)); - return (c->renderContext != nil) ? c.release() : 0; + return (c->renderContext != nil) ? c.release() : nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() - : 0; + : nullptr; } void juce_glViewport (const int w, const int h) @@ -533,7 +533,7 @@ OpenGLContext* OpenGLComponent::createContext() dynamic_cast (contextToShareListsWith), type == openGLES2 ? kEAGLRenderingAPIOpenGLES2 : kEAGLRenderingAPIOpenGLES1); - return 0; + return nullptr; } void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, diff --git a/src/native/windows/juce_win32_ASIO.cpp b/src/native/windows/juce_win32_ASIO.cpp index ce45e0e28f..74ff78a785 100644 --- a/src/native/windows/juce_win32_ASIO.cpp +++ b/src/native/windows/juce_win32_ASIO.cpp @@ -1269,7 +1269,7 @@ private: if (currentASIODev[0] != nullptr) currentASIODev[0]->callback (index); - return 0; + return nullptr; } static ASIOTime* JUCE_ASIOCALLBACK bufferSwitchTimeInfoCallback1 (ASIOTime*, long index, long) @@ -1277,7 +1277,7 @@ private: if (currentASIODev[1] != nullptr) currentASIODev[1]->callback (index); - return 0; + return nullptr; } static ASIOTime* JUCE_ASIOCALLBACK bufferSwitchTimeInfoCallback2 (ASIOTime*, long index, long) @@ -1285,7 +1285,7 @@ private: if (currentASIODev[2] != nullptr) currentASIODev[2]->callback (index); - return 0; + return nullptr; } static void JUCE_ASIOCALLBACK bufferSwitchCallback0 (long index, long) @@ -1682,11 +1682,11 @@ public: if (deviceNames[i].containsIgnoreCase ("asio4all")) return i; // asio4all is a safe choice for a default.. -#if JUCE_DEBUG + #if JUCE_DEBUG if (deviceNames.size() > 1 && deviceNames[0].containsIgnoreCase ("digidesign")) return 1; // (the digi m-box driver crashes the app when you run // it in the debugger, which can be a bit annoying) -#endif + #endif return 0; } @@ -1729,7 +1729,7 @@ public: return new ASIOAudioIODevice (outputDeviceName, *(classIds [index]), freeSlot, String::empty); } - return 0; + return nullptr; } //============================================================================== @@ -1836,7 +1836,7 @@ AudioIODevice* juce_createASIOAudioIODeviceForGUID (const String& name, const int freeSlot = ASIOAudioIODeviceType::findFreeSlot(); if (freeSlot < 0) - return 0; + return nullptr; return new ASIOAudioIODevice (name, *(CLSID*) guid, freeSlot, optionalDllForDirectLoading); } diff --git a/src/native/windows/juce_win32_ActiveXComponent.cpp b/src/native/windows/juce_win32_ActiveXComponent.cpp index 18b05a7340..067a9246a8 100644 --- a/src/native/windows/juce_win32_ActiveXComponent.cpp +++ b/src/native/windows/juce_win32_ActiveXComponent.cpp @@ -394,7 +394,7 @@ void* ActiveXControlComponent::queryInterface (const void* iid) const && SUCCEEDED (control->control->QueryInterface (*(const IID*) iid, &result))) return result; - return 0; + return nullptr; } void ActiveXControlComponent::setControlBounds (const Rectangle& newBounds) const diff --git a/src/native/windows/juce_win32_AudioCDReader.cpp b/src/native/windows/juce_win32_AudioCDReader.cpp index aeb0965cad..dd0478e845 100644 --- a/src/native/windows/juce_win32_AudioCDReader.cpp +++ b/src/native/windows/juce_win32_AudioCDReader.cpp @@ -1002,7 +1002,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int deviceIndex) return new AudioCDReader (new CDDeviceWrapper (list [deviceIndex], h)); } - return 0; + return nullptr; } AudioCDReader::AudioCDReader (void* handle_) @@ -1052,7 +1052,7 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta const int toDo = (int) jmin ((int64) numSamples, bufferEndSample - startSampleInFile); int* const l = destSamples[0] + startOffsetInDestBuffer; - int* const r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : 0; + int* const r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : nullptr; const short* src = (const short*) buffer.getData(); src += 2 * (startSampleInFile - bufferStartSample); @@ -1108,7 +1108,7 @@ bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int sta else { int* l = destSamples[0] + startOffsetInDestBuffer; - int* r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : 0; + int* r = numDestChannels > 1 ? (destSamples[1] + startOffsetInDestBuffer) : nullptr; while (--numSamples >= 0) { diff --git a/src/native/windows/juce_win32_CameraDevice.cpp b/src/native/windows/juce_win32_CameraDevice.cpp index e13135eada..49e21ac16c 100644 --- a/src/native/windows/juce_win32_CameraDevice.cpp +++ b/src/native/windows/juce_win32_CameraDevice.cpp @@ -864,7 +864,7 @@ CameraDevice* CameraDevice::openDevice (int index, } } - return 0; + return nullptr; } diff --git a/src/native/windows/juce_win32_DirectSound.cpp b/src/native/windows/juce_win32_DirectSound.cpp index 8903ade0d2..1ea20bf8a4 100644 --- a/src/native/windows/juce_win32_DirectSound.cpp +++ b/src/native/windows/juce_win32_DirectSound.cpp @@ -1164,7 +1164,7 @@ public: : inputDeviceName, outputIndex, inputIndex); - return 0; + return nullptr; } //============================================================================== diff --git a/src/native/windows/juce_win32_Midi.cpp b/src/native/windows/juce_win32_Midi.cpp index 62f6b872e3..e7f9359c8b 100644 --- a/src/native/windows/juce_win32_Midi.cpp +++ b/src/native/windows/juce_win32_Midi.cpp @@ -250,7 +250,7 @@ int MidiInput::getDefaultDeviceIndex() MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const callback) { if (callback == nullptr) - return 0; + return nullptr; UINT deviceId = MIDI_MAPPER; int n = 0; @@ -291,7 +291,7 @@ MidiInput* MidiInput::openDevice (const int index, MidiInputCallback* const call return in.release(); } - return 0; + return nullptr; } MidiInput::MidiInput (const String& name_) @@ -437,7 +437,7 @@ MidiOutput* MidiOutput::openDevice (int index) } } - return 0; + return nullptr; } MidiOutput::~MidiOutput() diff --git a/src/native/windows/juce_win32_Network.cpp b/src/native/windows/juce_win32_Network.cpp index 8b3b3bb59f..7b10cdaafa 100644 --- a/src/native/windows/juce_win32_Network.cpp +++ b/src/native/windows/juce_win32_Network.cpp @@ -348,7 +348,7 @@ InputStream* URL::createNativeStream (const String& address, bool isPost, const progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders)); - return wi->isError() ? 0 : wi.release(); + return wi->isError() ? nullptr : wi.release(); } diff --git a/src/native/windows/juce_win32_OpenGLComponent.cpp b/src/native/windows/juce_win32_OpenGLComponent.cpp index 0eeb43eeea..a4cda69f88 100644 --- a/src/native/windows/juce_win32_OpenGLComponent.cpp +++ b/src/native/windows/juce_win32_OpenGLComponent.cpp @@ -373,7 +373,7 @@ public: void* getNativeWindowHandle() const { - return nativeWindow != nullptr ? nativeWindow->getNativeHandle() : 0; + return nativeWindow != nullptr ? nativeWindow->getNativeHandle() : nullptr; } //============================================================================== @@ -496,12 +496,12 @@ OpenGLContext* OpenGLComponent::createContext() contextToShareListsWith != nullptr ? (HGLRC) contextToShareListsWith->getRawContext() : 0, preferredPixelFormat)); - return (c->renderContext != 0) ? c.release() : 0; + return (c->renderContext != 0) ? c.release() : nullptr; } void* OpenGLComponent::getNativeWindowHandle() const { - return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() : 0; + return context != nullptr ? static_cast (static_cast (context))->getNativeWindowHandle() : nullptr; } void juce_glViewport (const int w, const int h) diff --git a/src/native/windows/juce_win32_Threads.cpp b/src/native/windows/juce_win32_Threads.cpp index 5fe14dd94f..471d27daf5 100644 --- a/src/native/windows/juce_win32_Threads.cpp +++ b/src/native/windows/juce_win32_Threads.cpp @@ -337,7 +337,7 @@ void PlatformUtilities::freeDynamicLibrary (void* h) void* PlatformUtilities::getProcedureEntryPoint (void* h, const String& name) { - return (h != 0) ? (void*) GetProcAddress ((HMODULE) h, name.toUTF8()) : 0; // (void* cast is required for mingw) + return (h != 0) ? (void*) GetProcAddress ((HMODULE) h, name.toUTF8()) : nullptr; // (void* cast is required for mingw) } diff --git a/src/native/windows/juce_win32_WASAPI.cpp b/src/native/windows/juce_win32_WASAPI.cpp index a50203a260..a9c1bd0e01 100644 --- a/src/native/windows/juce_win32_WASAPI.cpp +++ b/src/native/windows/juce_win32_WASAPI.cpp @@ -363,7 +363,7 @@ private: WAVEFORMATEXTENSIBLE* nearestFormat = nullptr; HRESULT hr = client->IsFormatSupported (useExclusiveMode ? AUDCLNT_SHAREMODE_EXCLUSIVE : AUDCLNT_SHAREMODE_SHARED, - (WAVEFORMATEX*) &format, useExclusiveMode ? 0 : (WAVEFORMATEX**) &nearestFormat); + (WAVEFORMATEX*) &format, useExclusiveMode ? nullptr : (WAVEFORMATEX**) &nearestFormat); logFailure (hr); if (hr == S_FALSE && format.Format.nSamplesPerSec == nearestFormat->Format.nSamplesPerSec) @@ -1137,7 +1137,7 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_WASAPI() if (SystemStats::getOperatingSystemType() >= SystemStats::WinVista) return new WasapiClasses::WASAPIAudioIODeviceType(); - return 0; + return nullptr; } #endif diff --git a/src/native/windows/juce_win32_Windowing.cpp b/src/native/windows/juce_win32_Windowing.cpp index d62de6eab6..3505bfbce3 100644 --- a/src/native/windows/juce_win32_Windowing.cpp +++ b/src/native/windows/juce_win32_Windowing.cpp @@ -830,7 +830,7 @@ public: if (h != 0 && GetWindowLongPtr (h, GWLP_USERDATA) == improbableWindowNumber) return (Win32ComponentPeer*) (pointer_sized_int) GetWindowLongPtr (h, 8); - return 0; + return nullptr; } //============================================================================== @@ -1084,7 +1084,7 @@ private: static void* createWindowCallback (void* userData) { static_cast (userData)->createWindow(); - return 0; + return nullptr; } void createWindow() @@ -1174,25 +1174,25 @@ private: { RevokeDragDrop ((HWND) handle); DestroyWindow ((HWND) handle); - return 0; + return nullptr; } static void* toFrontCallback1 (void* h) { SetForegroundWindow ((HWND) h); - return 0; + return nullptr; } static void* toFrontCallback2 (void* h) { SetWindowPos ((HWND) h, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); - return 0; + return nullptr; } static void* setFocusCallback (void* h) { SetFocus ((HWND) h); - return 0; + return nullptr; } static void* getFocusCallback (void*) @@ -2773,7 +2773,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType return mb->getResult() != 0; mb.release(); - return 0; + return false; } int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconType iconType, diff --git a/src/text/juce_XmlDocument.cpp b/src/text/juce_XmlDocument.cpp index 5bc6c08587..fa8d146220 100644 --- a/src/text/juce_XmlDocument.cpp +++ b/src/text/juce_XmlDocument.cpp @@ -150,7 +150,7 @@ XmlElement* XmlDocument::getDocumentElement (const bool onlyReadOuterDocumentEle } } - return 0; + return nullptr; } const String& XmlDocument::getLastParseError() const noexcept @@ -360,7 +360,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) skipNextWhiteSpace(); if (outOfData) - return 0; + return nullptr; const int openBracket = input.indexOf ((juce_wchar) '<'); diff --git a/src/text/juce_XmlElement.cpp b/src/text/juce_XmlElement.cpp index 5e55b64fca..c53c1dedf9 100644 --- a/src/text/juce_XmlElement.cpp +++ b/src/text/juce_XmlElement.cpp @@ -734,7 +734,7 @@ bool XmlElement::containsChildElement (const XmlElement* const possibleChild) co XmlElement* XmlElement::findParentElementOf (const XmlElement* const elementToLookFor) noexcept { if (this == elementToLookFor || elementToLookFor == nullptr) - return 0; + return nullptr; XmlElement* child = firstChildElement; @@ -751,7 +751,7 @@ XmlElement* XmlElement::findParentElementOf (const XmlElement* const elementToLo child = child->nextListItem; } - return 0; + return nullptr; } void XmlElement::getChildElementsAsArray (XmlElement** elems) const noexcept diff --git a/src/threads/juce_Thread.cpp b/src/threads/juce_Thread.cpp index ac0102c568..e0a0b68df3 100644 --- a/src/threads/juce_Thread.cpp +++ b/src/threads/juce_Thread.cpp @@ -71,7 +71,7 @@ public: return t; } - return 0; + return nullptr; } void stopAll (const int timeOutMilliseconds) diff --git a/src/utilities/juce_PropertiesFile.cpp b/src/utilities/juce_PropertiesFile.cpp index 563576e6ba..c6a7ead36e 100644 --- a/src/utilities/juce_PropertiesFile.cpp +++ b/src/utilities/juce_PropertiesFile.cpp @@ -156,7 +156,7 @@ PropertiesFile::~PropertiesFile() InterProcessLock::ScopedLockType* PropertiesFile::createProcessLock() const { - return processLock != nullptr ? new InterProcessLock::ScopedLockType (*processLock) : 0; + return processLock != nullptr ? new InterProcessLock::ScopedLockType (*processLock) : nullptr; } bool PropertiesFile::saveIfNeeded() @@ -335,7 +335,7 @@ PropertiesFile* PropertiesFile::createDefaultAppPropertiesFile (const String& ap jassert (file != File::nonexistent); if (file == File::nonexistent) - return 0; + return nullptr; return new PropertiesFile (file, millisecondsBeforeSaving, propertiesFileOptions,processLock_); } diff --git a/src/utilities/juce_UndoableAction.h b/src/utilities/juce_UndoableAction.h index f55c227436..a3c731ae6d 100644 --- a/src/utilities/juce_UndoableAction.h +++ b/src/utilities/juce_UndoableAction.h @@ -93,7 +93,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 0; } + virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { (void) nextAction; return nullptr; } };