diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp index 634be514d0..2bb2854ddf 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_GeneratedCode.cpp @@ -161,7 +161,7 @@ String GeneratedCode::getCallbackDefinitions() const String GeneratedCode::getClassDeclaration() const { StringArray parentClassLines; - parentClassLines.addTokens (parentClasses, ",", String::empty); + parentClassLines.addTokens (parentClasses, ",", StringRef()); parentClassLines.addArray (getExtraParentClasses()); parentClassLines.trim(); diff --git a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp index d2f33f778b..78a47f7583 100644 --- a/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Introjucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -159,7 +159,7 @@ void JucerDocument::setParentClasses (const String& classes) if (classes != parentClasses) { StringArray parentClassLines; - parentClassLines.addTokens (classes, ",", String::empty); + parentClassLines.addTokens (classes, ",", StringRef()); parentClassLines.trim(); parentClassLines.removeEmptyStrings(); parentClassLines.removeDuplicates (false); diff --git a/extras/Introjucer/Source/ComponentEditor/paintelements/jucer_FillType.h b/extras/Introjucer/Source/ComponentEditor/paintelements/jucer_FillType.h index 5406f833a6..8218a9fa65 100644 --- a/extras/Introjucer/Source/ComponentEditor/paintelements/jucer_FillType.h +++ b/extras/Introjucer/Source/ComponentEditor/paintelements/jucer_FillType.h @@ -212,7 +212,7 @@ public: if (s.isNotEmpty()) { StringArray toks; - toks.addTokens (s, ",:", String::empty); + toks.addTokens (s, ",:", StringRef()); toks.trim(); if (toks[0] == "solid") diff --git a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h index 43e6f5c2ca..678c6cdb03 100644 --- a/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h +++ b/extras/Introjucer/Source/Project/jucer_AudioPluginModule.h @@ -109,7 +109,7 @@ namespace int countMaxPluginChannels (const String& configString, bool isInput) { StringArray configs; - configs.addTokens (configString, ", {}", String::empty); + configs.addTokens (configString, ", {}", StringRef()); configs.trim(); configs.removeEmptyStrings(); jassert ((configs.size() & 1) == 0); // looks like a syntax error in the configs? diff --git a/extras/Introjucer/Source/Project/jucer_Module.cpp b/extras/Introjucer/Source/Project/jucer_Module.cpp index 6c89dd75ec..8e96458c07 100644 --- a/extras/Introjucer/Source/Project/jucer_Module.cpp +++ b/extras/Introjucer/Source/Project/jucer_Module.cpp @@ -358,12 +358,12 @@ void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& pr exporter.xcodeFrameworks.addTokens ("AudioUnit CoreAudioKit", false); const String frameworks (moduleInfo.moduleInfo [exporter.isOSX() ? "OSXFrameworks" : "iOSFrameworks"].toString()); - exporter.xcodeFrameworks.addTokens (frameworks, ", ", String::empty); + exporter.xcodeFrameworks.addTokens (frameworks, ", ", StringRef()); } else if (exporter.isLinux()) { const String libs (moduleInfo.moduleInfo ["LinuxLibs"].toString()); - exporter.linuxLibs.addTokens (libs, ", ", String::empty); + exporter.linuxLibs.addTokens (libs, ", ", StringRef()); exporter.linuxLibs.trim(); exporter.linuxLibs.sort (false); exporter.linuxLibs.removeDuplicates (false); @@ -371,7 +371,7 @@ void LibraryModule::prepareExporter (ProjectExporter& exporter, ProjectSaver& pr else if (exporter.isCodeBlocks()) { const String libs (moduleInfo.moduleInfo ["mingwLibs"].toString()); - exporter.mingwLibs.addTokens (libs, ", ", String::empty); + exporter.mingwLibs.addTokens (libs, ", ", StringRef()); exporter.mingwLibs.trim(); exporter.mingwLibs.sort (false); exporter.mingwLibs.removeDuplicates (false); diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index 0b04f694a8..ec914c6f05 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -184,10 +184,10 @@ void Project::updateOldModulePaths() } //============================================================================== -static int getVersionElement (const String& v, int index) +static int getVersionElement (StringRef v, int index) { StringArray parts; - parts.addTokens (v, "., ", String::empty); + parts.addTokens (v, "., ", StringRef()); return parts [parts.size() - index - 1].getIntValue(); } diff --git a/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp b/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp index 25baa33907..92e9b51a4a 100644 --- a/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp +++ b/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp @@ -178,9 +178,9 @@ namespace FileHelpers StringArray toks; #if JUCE_WINDOWS - toks.addTokens (p, "\\/", String::empty); + toks.addTokens (p, "\\/", StringRef()); #else - toks.addTokens (p, "/", String::empty); + toks.addTokens (p, "/", StringRef()); #endif while (toks[0] == ".") diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp index 78453b284b..f990098e79 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp @@ -164,7 +164,7 @@ String replacePreprocessorDefs (const StringPairArray& definitions, String sourc StringArray getSearchPathsFromString (const String& searchPath) { StringArray s; - s.addTokens (searchPath, ";\r\n", String::empty); + s.addTokens (searchPath, ";\r\n", StringRef()); s.trim(); s.removeEmptyStrings(); s.removeDuplicates (false); diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h index da32b2b43e..d6cd99a5a6 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h @@ -34,7 +34,7 @@ method. Each of the objects returned can then be used to list the available devices of that type. E.g. @code - OwnedArray types; + OwnedArray types; myAudioDeviceManager.createAudioDeviceTypes (types); for (int i = 0; i < types.size(); ++i) diff --git a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index d7edd45dc7..f5b0b9a60b 100644 --- a/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -888,13 +888,13 @@ AiffAudioFormat::~AiffAudioFormat() Array AiffAudioFormat::getPossibleSampleRates() { const int rates[] = { 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 0 }; - return Array (rates); + return Array (rates); } Array AiffAudioFormat::getPossibleBitDepths() { const int depths[] = { 8, 16, 24, 0 }; - return Array (depths); + return Array (depths); } bool AiffAudioFormat::canDoStereo() { return true; } diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormat.h b/modules/juce_audio_processors/format/juce_AudioPluginFormat.h index 6336b5bda2..d0af2013ce 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormat.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormat.h @@ -54,7 +54,7 @@ public: (e.g. VST shells) can use a single DLL to create a set of different plugin subtypes, so in that case, each subtype is returned as a separate object. */ - virtual void findAllTypesForFile (OwnedArray & results, + virtual void findAllTypesForFile (OwnedArray& results, const String& fileOrIdentifier) = 0; /** Tries to recreate a type from a previously generated PluginDescription. diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h index 7e502b39ef..a6f1607d16 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h @@ -89,7 +89,7 @@ public: private: //============================================================================== - OwnedArray formats; + OwnedArray formats; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormatManager) }; diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h index ef6d59a158..46c2b10eeb 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h @@ -37,7 +37,7 @@ public: //============================================================================== String getName() const override { return "AudioUnit"; } - void findAllTypesForFile (OwnedArray &, const String& fileOrIdentifier) override; + void findAllTypesForFile (OwnedArray&, const String& fileOrIdentifier) override; AudioPluginInstance* createInstanceFromDescription (const PluginDescription& desc, double, int) override; bool fileMightContainThisPluginType (const String& fileOrIdentifier) override; String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override; diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index 60d4c9962b..a4e58b164a 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -138,7 +138,7 @@ namespace AudioUnitFormatHelpers fileOrIdentifier.lastIndexOfChar ('/')) + 1)); StringArray tokens; - tokens.addTokens (s, ",", String()); + tokens.addTokens (s, ",", StringRef()); tokens.removeEmptyStrings(); if (tokens.size() == 3) @@ -915,7 +915,7 @@ private: bool automatable; }; - OwnedArray parameters; + OwnedArray parameters; MidiDataConcatenator midiConcatenator; CriticalSection midiInLock; @@ -1600,7 +1600,7 @@ AudioUnitPluginFormat::~AudioUnitPluginFormat() { } -void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray & results, +void AudioUnitPluginFormat::findAllTypesForFile (OwnedArray& results, const String& fileOrIdentifier) { if (! fileMightContainThisPluginType (fileOrIdentifier)) diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h index 7deb9b5981..d94468235a 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h @@ -388,11 +388,11 @@ public: private: //============================================================================== - ReferenceCountedArray nodes; - OwnedArray connections; + ReferenceCountedArray nodes; + OwnedArray connections; uint32 lastNodeId; AudioSampleBuffer renderingBuffers; - OwnedArray midiBuffers; + OwnedArray midiBuffers; Array renderingOps; friend class AudioGraphIOProcessor; diff --git a/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp b/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp index f15f86566b..f5cf5d6c6a 100644 --- a/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioThumbnail.cpp @@ -342,7 +342,7 @@ public: } private: - Array data; + Array data; int peakLevel; void ensureSize (const int thumbSamples) @@ -414,7 +414,7 @@ public: } private: - Array data; + Array data; double cachedStart, cachedTimePerPixel; int numChannelsCached, numSamplesCached; bool cacheNeedsRefilling; diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 8c0f59261e..375576adc7 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -42,7 +42,7 @@ - it must be able to be relocated in memory by a memcpy without this causing any problems - so objects whose functionality relies on external pointers or references to themselves can not be used. - You can of course have an array of pointers to any kind of object, e.g. Array , but if + You can of course have an array of pointers to any kind of object, e.g. Array, but if you do this, the array doesn't take any ownership of the objects - see the OwnedArray class or the ReferenceCountedArray class for more powerful ways of holding lists of objects. diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index 45967ee510..01e333dcae 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -124,7 +124,7 @@ SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() return iOS; #else StringArray parts; - parts.addTokens (getOSXVersion(), ".", String()); + parts.addTokens (getOSXVersion(), ".", StringRef()); jassert (parts[0].getIntValue() == 10); const int major = parts[1].getIntValue(); diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp index 81dd0c374b..c31d1874d5 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp @@ -91,7 +91,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C while (target != nullptr) { - Array commandIDs; + Array commandIDs; target->getAllCommands (commandIDs); if (commandIDs.contains (commandID)) @@ -113,7 +113,7 @@ ApplicationCommandTarget* ApplicationCommandTarget::getTargetForCommand (const C if (target != nullptr) { - Array commandIDs; + Array commandIDs; target->getAllCommands (commandIDs); if (commandIDs.contains (commandID)) diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h index 474c4ed44e..c14faa818c 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h @@ -134,7 +134,7 @@ public: Your target should add all the command IDs that it handles to the array that is passed-in. */ - virtual void getAllCommands (Array & commands) = 0; + virtual void getAllCommands (Array& commands) = 0; /** This must provide details about one of the commands that this target can perform. diff --git a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp index 66b5481249..60b66d932d 100644 --- a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.cpp @@ -74,7 +74,7 @@ ChoicePropertyComponent::ChoicePropertyComponent (const String& name) ChoicePropertyComponent::ChoicePropertyComponent (const Value& valueToControl, const String& name, const StringArray& choiceList, - const Array & correspondingValues) + const Array& correspondingValues) : PropertyComponent (name), choices (choiceList), isCustomClass (false) diff --git a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h index be01bac99a..2956ae66d5 100644 --- a/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_ChoicePropertyComponent.h @@ -70,7 +70,7 @@ public: ChoicePropertyComponent (const Value& valueToControl, const String& propertyName, const StringArray& choices, - const Array & correspondingValues); + const Array& correspondingValues); /** Destructor. */ ~ChoicePropertyComponent(); diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp index 04a4ed5c7e..b622452312 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp @@ -1645,7 +1645,7 @@ void CodeEditorComponent::State::restoreState (CodeEditorComponent& editor) cons CodeEditorComponent::State::State (const String& s) { StringArray tokens; - tokens.addTokens (s, ":", String::empty); + tokens.addTokens (s, ":", StringRef()); lastTopLine = tokens[0].getIntValue(); lastCaretPos = tokens[1].getIntValue();