diff --git a/examples/Audio/AudioPlaybackDemo.h b/examples/Audio/AudioPlaybackDemo.h index e4da079e72..a0db324f78 100644 --- a/examples/Audio/AudioPlaybackDemo.h +++ b/examples/Audio/AudioPlaybackDemo.h @@ -423,7 +423,7 @@ private: void showAudioResource (URL resource) { if (loadURLIntoTransport (resource)) - currentAudioFile = static_cast (resource); + currentAudioFile = std::move (resource); zoomSlider.setValue (0, dontSendNotification); thumbnail->setURL (currentAudioFile); @@ -513,7 +513,7 @@ private: { auto u = fc.getURLResult(); - safeThis->showAudioResource (static_cast (u)); + safeThis->showAudioResource (std::move (u)); } safeThis->fileChooser = nullptr; diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index 1c2ce7f8b9..231fdbab9f 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -179,7 +179,7 @@ public: : numChannels (other.numChannels), size (other.size), allocatedBytes (other.allocatedBytes), - allocatedData (static_cast&&> (other.allocatedData)), + allocatedData (std::move (other.allocatedData)), isClear (other.isClear) { if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) @@ -205,7 +205,7 @@ public: numChannels = other.numChannels; size = other.size; allocatedBytes = other.allocatedBytes; - allocatedData = static_cast&&> (other.allocatedData); + allocatedData = std::move (other.allocatedData); isClear = other.isClear; if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) diff --git a/modules/juce_audio_basics/midi/juce_MidiFile.cpp b/modules/juce_audio_basics/midi/juce_MidiFile.cpp index d6aef7944a..7a08c9640f 100644 --- a/modules/juce_audio_basics/midi/juce_MidiFile.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiFile.cpp @@ -169,14 +169,14 @@ MidiFile& MidiFile::operator= (const MidiFile& other) } MidiFile::MidiFile (MidiFile&& other) - : tracks (static_cast&&> (other.tracks)), + : tracks (std::move (other.tracks)), timeFormat (other.timeFormat) { } MidiFile& MidiFile::operator= (MidiFile&& other) { - tracks = static_cast&&> (other.tracks); + tracks = std::move (other.tracks); timeFormat = other.timeFormat; return *this; } diff --git a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp index 0321e46674..6477e7d730 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp @@ -24,7 +24,7 @@ namespace juce { MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& mm) : message (mm) {} -MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (static_cast (mm)) {} +MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (std::move (mm)) {} MidiMessageSequence::MidiEventHolder::~MidiEventHolder() {} //============================================================================== @@ -53,13 +53,13 @@ MidiMessageSequence& MidiMessageSequence::operator= (const MidiMessageSequence& } MidiMessageSequence::MidiMessageSequence (MidiMessageSequence&& other) noexcept - : list (static_cast&&> (other.list)) + : list (std::move (other.list)) { } MidiMessageSequence& MidiMessageSequence::operator= (MidiMessageSequence&& other) noexcept { - list = static_cast&&> (other.list); + list = std::move (other.list); return *this; } @@ -174,7 +174,7 @@ MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (const MidiM MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (MidiMessage&& newMessage, double timeAdjustment) { - return addEvent (new MidiEventHolder (static_cast (newMessage)), timeAdjustment); + return addEvent (new MidiEventHolder (std::move (newMessage)), timeAdjustment); } void MidiMessageSequence::deleteEvent (int index, bool deleteMatchingNoteUp) diff --git a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index 158dfa2f26..dd3eb514c9 100644 --- a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -88,12 +88,12 @@ public: //============================================================================== SlObjectRef() noexcept {} SlObjectRef (const SlObjectRef& obj) noexcept : cb (obj.cb) {} - SlObjectRef (SlObjectRef&& obj) noexcept : cb (static_cast&&> (obj.cb)) { obj.cb = nullptr; } + SlObjectRef (SlObjectRef&& obj) noexcept : cb (std::move (obj.cb)) { obj.cb = nullptr; } explicit SlObjectRef (SLObjectItf o) : cb (new ControlBlock (o)) {} //============================================================================== SlObjectRef& operator= (const SlObjectRef& r) noexcept { cb = r.cb; return *this; } - SlObjectRef& operator= (SlObjectRef&& r) noexcept { cb = static_cast&&> (r.cb); r.cb = nullptr; return *this; } + SlObjectRef& operator= (SlObjectRef&& r) noexcept { cb = std::move (r.cb); r.cb = nullptr; return *this; } SlObjectRef& operator= (std::nullptr_t) noexcept { cb = nullptr; return *this; } //============================================================================== @@ -125,11 +125,11 @@ public: //============================================================================== SlRef() noexcept {} SlRef (const SlRef& r) noexcept : SlObjectRef (r), type (r.type) {} - SlRef (SlRef&& r) noexcept : SlObjectRef (static_cast (r)), type (r.type) { r.type = nullptr; } + SlRef (SlRef&& r) noexcept : SlObjectRef (std::move (r)), type (r.type) { r.type = nullptr; } //============================================================================== SlRef& operator= (const SlRef& r) noexcept { SlObjectRef::operator= (r); type = r.type; return *this; } - SlRef& operator= (SlRef&& r) noexcept { SlObjectRef::operator= (static_cast (r)); type = r.type; r.type = nullptr; return *this; } + SlRef& operator= (SlRef&& r) noexcept { SlObjectRef::operator= (std::move (r)); type = r.type; r.type = nullptr; return *this; } SlRef& operator= (std::nullptr_t) noexcept { SlObjectRef::operator= (nullptr); type = nullptr; return *this; } //============================================================================== @@ -139,7 +139,7 @@ public: //============================================================================== static SlRef cast (SlObjectRef& base) { return SlRef (base); } - static SlRef cast (SlObjectRef&& base) { return SlRef (static_cast (base)); } + static SlRef cast (SlObjectRef&& base) { return SlRef (std::move (base)); } private: SlRef (SlObjectRef& base) : SlObjectRef (base) @@ -155,7 +155,7 @@ private: *this = nullptr; } - SlRef (SlObjectRef&& base) : SlObjectRef (static_cast (base)) + SlRef (SlObjectRef&& base) : SlObjectRef (std::move (base)) { if (auto obj = SlObjectRef::operator->()) { diff --git a/modules/juce_audio_processors/format_types/juce_VSTCommon.h b/modules/juce_audio_processors/format_types/juce_VSTCommon.h index f66876e8bb..0c863fea83 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTCommon.h +++ b/modules/juce_audio_processors/format_types/juce_VSTCommon.h @@ -145,7 +145,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e VstSpeakerConfigurationHolder (const Vst2::VstSpeakerArrangement& vstConfig) { operator= (vstConfig); } VstSpeakerConfigurationHolder (const VstSpeakerConfigurationHolder& other) { operator= (other.get()); } VstSpeakerConfigurationHolder (VstSpeakerConfigurationHolder&& other) - : storage (static_cast&&> (other.storage)) { other.clear(); } + : storage (std::move (other.storage)) { other.clear(); } VstSpeakerConfigurationHolder (const AudioChannelSet& channels) { @@ -180,7 +180,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e VstSpeakerConfigurationHolder& operator= (VstSpeakerConfigurationHolder && vstConfig) { - storage = static_cast&&> (vstConfig.storage); + storage = std::move (vstConfig.storage); vstConfig.clear(); return *this; diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp index 6f5232b831..0edcb0626a 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp @@ -191,13 +191,13 @@ private: { struct LambdaOp : public RenderingOp { - LambdaOp (LambdaType&& f) : function (static_cast (f)) {} + LambdaOp (LambdaType&& f) : function (std::move (f)) {} void perform (const Context& c) override { function (c); } LambdaType function; }; - renderOps.add (new LambdaOp (static_cast (fn))); + renderOps.add (new LambdaOp (std::move (fn))); } //============================================================================== diff --git a/modules/juce_core/containers/juce_ArrayAllocationBase.h b/modules/juce_core/containers/juce_ArrayAllocationBase.h index 5a82d6ec3e..ab75a76528 100644 --- a/modules/juce_core/containers/juce_ArrayAllocationBase.h +++ b/modules/juce_core/containers/juce_ArrayAllocationBase.h @@ -49,14 +49,14 @@ public: } ArrayAllocationBase (ArrayAllocationBase&& other) noexcept - : elements (static_cast&&> (other.elements)), + : elements (std::move (other.elements)), numAllocated (other.numAllocated) { } ArrayAllocationBase& operator= (ArrayAllocationBase&& other) noexcept { - elements = static_cast&&> (other.elements); + elements = std::move (other.elements); numAllocated = other.numAllocated; return *this; } diff --git a/modules/juce_core/containers/juce_NamedValueSet.cpp b/modules/juce_core/containers/juce_NamedValueSet.cpp index e9f0338876..339e60ed01 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.cpp +++ b/modules/juce_core/containers/juce_NamedValueSet.cpp @@ -30,24 +30,24 @@ NamedValueSet::NamedValue::NamedValue (const Identifier& n, const var& v) : nam NamedValueSet::NamedValue::NamedValue (const NamedValue& other) : NamedValue (other.name, other.value) {} NamedValueSet::NamedValue::NamedValue (NamedValue&& other) noexcept - : NamedValue (static_cast (other.name), - static_cast (other.value)) + : NamedValue (std::move (other.name), + std::move (other.value)) {} NamedValueSet::NamedValue::NamedValue (const Identifier& n, var&& v) noexcept - : name (n), value (static_cast (v)) + : name (n), value (std::move (v)) { } NamedValueSet::NamedValue::NamedValue (Identifier&& n, var&& v) noexcept - : name (static_cast (n)), - value (static_cast (v)) + : name (std::move (n)), + value (std::move (v)) {} NamedValueSet::NamedValue& NamedValueSet::NamedValue::operator= (NamedValue&& other) noexcept { - name = static_cast (other.name); - value = static_cast (other.value); + name = std::move (other.name); + value = std::move (other.value); return *this; } @@ -61,10 +61,10 @@ NamedValueSet::~NamedValueSet() noexcept {} NamedValueSet::NamedValueSet (const NamedValueSet& other) : values (other.values) {} NamedValueSet::NamedValueSet (NamedValueSet&& other) noexcept - : values (static_cast&&> (other.values)) {} + : values (std::move (other.values)) {} NamedValueSet::NamedValueSet (std::initializer_list list) - : values (static_cast&&> (list)) + : values (std::move (list)) { } @@ -163,11 +163,11 @@ bool NamedValueSet::set (const Identifier& name, var&& newValue) if (v->equalsWithSameType (newValue)) return false; - *v = static_cast (newValue); + *v = std::move (newValue); return true; } - values.add ({ name, static_cast (newValue) }); + values.add ({ name, std::move (newValue) }); return true; } diff --git a/modules/juce_core/containers/juce_SortedSet.h b/modules/juce_core/containers/juce_SortedSet.h index ea6e3e9888..2a594974fb 100644 --- a/modules/juce_core/containers/juce_SortedSet.h +++ b/modules/juce_core/containers/juce_SortedSet.h @@ -66,14 +66,14 @@ public: /** Creates a copy of another set. */ // VS2013 doesn't allow defaulted noexcept constructors. - SortedSet (SortedSet&& other) noexcept : data (static_cast (other.data)) {} + SortedSet (SortedSet&& other) noexcept : data (std::move (other.data)) {} /** Makes a copy of another set. */ SortedSet& operator= (const SortedSet&) = default; /** Makes a copy of another set. */ // VS2013 doesn't allow defaulted noexcept constructors. - SortedSet& operator= (SortedSet&& other) noexcept { data = static_cast (other.data); return *this; } + SortedSet& operator= (SortedSet&& other) noexcept { data = std::move (other.data); return *this; } /** Destructor. */ ~SortedSet() noexcept {} diff --git a/modules/juce_core/containers/juce_SparseSet.h b/modules/juce_core/containers/juce_SparseSet.h index 11c2c8ee73..aeb96ffa5c 100644 --- a/modules/juce_core/containers/juce_SparseSet.h +++ b/modules/juce_core/containers/juce_SparseSet.h @@ -46,8 +46,8 @@ public: SparseSet (const SparseSet&) = default; SparseSet& operator= (const SparseSet&) = default; - SparseSet (SparseSet&& other) noexcept : ranges (static_cast>&&> (other.ranges)) {} - SparseSet& operator= (SparseSet&& other) noexcept { ranges = static_cast>&&> (other.ranges); return *this; } + SparseSet (SparseSet&& other) noexcept : ranges (std::move (other.ranges)) {} + SparseSet& operator= (SparseSet&& other) noexcept { ranges = std::move (other.ranges); return *this; } //============================================================================== /** Clears the set. */ diff --git a/modules/juce_core/containers/juce_Variant.cpp b/modules/juce_core/containers/juce_Variant.cpp index eca034280e..05e6d929d3 100644 --- a/modules/juce_core/containers/juce_Variant.cpp +++ b/modules/juce_core/containers/juce_Variant.cpp @@ -363,7 +363,7 @@ public: struct RefCountedArray : public ReferenceCountedObject { RefCountedArray (const Array& a) : array (a) { incReferenceCount(); } - RefCountedArray (Array&& a) : array (static_cast&&> (a)) { incReferenceCount(); } + RefCountedArray (Array&& a) : array (std::move (a)) { incReferenceCount(); } Array array; }; }; @@ -543,24 +543,24 @@ var& var::operator= (var&& other) noexcept var::var (String&& v) : type (&VariantType_String::instance) { - new (value.stringValue) String (static_cast (v)); + new (value.stringValue) String (std::move (v)); } var::var (MemoryBlock&& v) : type (&VariantType_Binary::instance) { - value.binaryValue = new MemoryBlock (static_cast (v)); + value.binaryValue = new MemoryBlock (std::move (v)); } var::var (Array&& v) : type (&VariantType_Array::instance) { - value.objectValue = new VariantType_Array::RefCountedArray (static_cast&&> (v)); + value.objectValue = new VariantType_Array::RefCountedArray (std::move (v)); } var& var::operator= (String&& v) { type->cleanUp (value); type = &VariantType_String::instance; - new (value.stringValue) String (static_cast (v)); + new (value.stringValue) String (std::move (v)); return *this; } diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 26171e7a15..66a29256b8 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -53,13 +53,13 @@ File& File::operator= (const File& other) } File::File (File&& other) noexcept - : fullPath (static_cast (other.fullPath)) + : fullPath (std::move (other.fullPath)) { } File& File::operator= (File&& other) noexcept { - fullPath = static_cast (other.fullPath); + fullPath = std::move (other.fullPath); return *this; } diff --git a/modules/juce_core/javascript/juce_Javascript.cpp b/modules/juce_core/javascript/juce_Javascript.cpp index 226aeaccc9..720f525797 100644 --- a/modules/juce_core/javascript/juce_Javascript.cpp +++ b/modules/juce_core/javascript/juce_Javascript.cpp @@ -132,8 +132,8 @@ struct JavascriptEngine::RootObject : public DynamicObject struct Scope { Scope (const Scope* p, ReferenceCountedObjectPtr rt, DynamicObject::Ptr scp) noexcept - : parent (p), root (static_cast&&> (rt)), - scope (static_cast (scp)) {} + : parent (p), root (std::move (rt)), + scope (std::move (scp)) {} const Scope* const parent; ReferenceCountedObjectPtr root; diff --git a/modules/juce_core/maths/juce_BigInteger.cpp b/modules/juce_core/maths/juce_BigInteger.cpp index 9d336d2f12..6589e55483 100644 --- a/modules/juce_core/maths/juce_BigInteger.cpp +++ b/modules/juce_core/maths/juce_BigInteger.cpp @@ -112,7 +112,7 @@ BigInteger::BigInteger (const BigInteger& other) } BigInteger::BigInteger (BigInteger&& other) noexcept - : heapAllocation (static_cast&&> (other.heapAllocation)), + : heapAllocation (std::move (other.heapAllocation)), allocatedSize (other.allocatedSize), highestBit (other.highestBit), negative (other.negative) @@ -122,7 +122,7 @@ BigInteger::BigInteger (BigInteger&& other) noexcept BigInteger& BigInteger::operator= (BigInteger&& other) noexcept { - heapAllocation = static_cast&&> (other.heapAllocation); + heapAllocation = std::move (other.heapAllocation); memcpy (preallocated, other.preallocated, sizeof (preallocated)); allocatedSize = other.allocatedSize; highestBit = other.highestBit; diff --git a/modules/juce_core/maths/juce_Expression.cpp b/modules/juce_core/maths/juce_Expression.cpp index 2e0526b258..41a5036019 100644 --- a/modules/juce_core/maths/juce_Expression.cpp +++ b/modules/juce_core/maths/juce_Expression.cpp @@ -133,7 +133,7 @@ struct Expression::Helpers class BinaryTerm : public Term { public: - BinaryTerm (TermPtr l, TermPtr r) : left (static_cast (l)), right (static_cast (r)) + BinaryTerm (TermPtr l, TermPtr r) : left (std::move (l)), right (std::move (r)) { jassert (left != nullptr && right != nullptr); } @@ -951,13 +951,13 @@ Expression& Expression::operator= (const Expression& other) } Expression::Expression (Expression&& other) noexcept - : term (static_cast&&> (other.term)) + : term (std::move (other.term)) { } Expression& Expression::operator= (Expression&& other) noexcept { - term = static_cast&&> (other.term); + term = std::move (other.term); return *this; } diff --git a/modules/juce_core/maths/juce_NormalisableRange.h b/modules/juce_core/maths/juce_NormalisableRange.h index 92bc71c675..a0855a4c10 100644 --- a/modules/juce_core/maths/juce_NormalisableRange.h +++ b/modules/juce_core/maths/juce_NormalisableRange.h @@ -50,9 +50,9 @@ public: : start (other.start), end (other.end), interval (other.interval), skew (other.skew), symmetricSkew (other.symmetricSkew), - convertFrom0To1Function (static_cast (other.convertFrom0To1Function)), - convertTo0To1Function (static_cast (other.convertTo0To1Function)), - snapToLegalValueFunction (static_cast (other.snapToLegalValueFunction)) + convertFrom0To1Function (std::move (other.convertFrom0To1Function)), + convertTo0To1Function (std::move (other.convertTo0To1Function)), + snapToLegalValueFunction (std::move (other.snapToLegalValueFunction)) { } @@ -64,9 +64,9 @@ public: interval = other.interval; skew = other.skew; symmetricSkew = other.symmetricSkew; - convertFrom0To1Function = static_cast (other.convertFrom0To1Function); - convertTo0To1Function = static_cast (other.convertTo0To1Function); - snapToLegalValueFunction = static_cast (other.snapToLegalValueFunction); + convertFrom0To1Function = std::move (other.convertFrom0To1Function); + convertTo0To1Function = std::move (other.convertTo0To1Function); + snapToLegalValueFunction = std::move (other.snapToLegalValueFunction); return *this; } diff --git a/modules/juce_core/memory/juce_MemoryBlock.cpp b/modules/juce_core/memory/juce_MemoryBlock.cpp index d533a6a1b0..8e8998480a 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.cpp +++ b/modules/juce_core/memory/juce_MemoryBlock.cpp @@ -81,14 +81,14 @@ MemoryBlock& MemoryBlock::operator= (const MemoryBlock& other) } MemoryBlock::MemoryBlock (MemoryBlock&& other) noexcept - : data (static_cast (other.data)), + : data (std::move (other.data)), size (other.size) { } MemoryBlock& MemoryBlock::operator= (MemoryBlock&& other) noexcept { - data = static_cast (other.data); + data = std::move (other.data); size = other.size; return *this; } diff --git a/modules/juce_core/memory/juce_WeakReference.h b/modules/juce_core/memory/juce_WeakReference.h index 166313b486..9c0fd23eb7 100644 --- a/modules/juce_core/memory/juce_WeakReference.h +++ b/modules/juce_core/memory/juce_WeakReference.h @@ -87,7 +87,7 @@ public: WeakReference (const WeakReference& other) noexcept : holder (other.holder) {} /** Move constructor */ - WeakReference (WeakReference&& other) noexcept : holder (static_cast (other.holder)) {} + WeakReference (WeakReference&& other) noexcept : holder (std::move (other.holder)) {} /** Copies another pointer to this one. */ WeakReference& operator= (const WeakReference& other) { holder = other.holder; return *this; } @@ -96,7 +96,7 @@ public: WeakReference& operator= (ObjectType* newObject) { holder = getRef (newObject); return *this; } /** Move assignment operator */ - WeakReference& operator= (WeakReference&& other) noexcept { holder = static_cast (other.holder); return *this; } + WeakReference& operator= (WeakReference&& other) noexcept { holder = std::move (other.holder); return *this; } /** Returns the object that this pointer refers to, or null if the object no longer exists. */ ObjectType* get() const noexcept { return holder != nullptr ? holder->get() : nullptr; } diff --git a/modules/juce_core/misc/juce_Result.cpp b/modules/juce_core/misc/juce_Result.cpp index f94e0f2688..f727873099 100644 --- a/modules/juce_core/misc/juce_Result.cpp +++ b/modules/juce_core/misc/juce_Result.cpp @@ -42,13 +42,13 @@ Result& Result::operator= (const Result& other) } Result::Result (Result&& other) noexcept - : errorMessage (static_cast (other.errorMessage)) + : errorMessage (std::move (other.errorMessage)) { } Result& Result::operator= (Result&& other) noexcept { - errorMessage = static_cast (other.errorMessage); + errorMessage = std::move (other.errorMessage); return *this; } diff --git a/modules/juce_core/misc/juce_StdFunctionCompat.cpp b/modules/juce_core/misc/juce_StdFunctionCompat.cpp index 1687201fcf..f6139e383b 100644 --- a/modules/juce_core/misc/juce_StdFunctionCompat.cpp +++ b/modules/juce_core/misc/juce_StdFunctionCompat.cpp @@ -197,13 +197,13 @@ public: beginTest ("move constructor"); std::unique_ptr> fStackTmp (new std::function (fStack)); - std::function f1 (static_cast&&> (*fStackTmp)); + std::function f1 (std::move (*fStackTmp)); fStackTmp.reset(); expectEquals (f1(), 3); std::unique_ptr> fHeapTmp (new std::function (fHeap)); - std::function f2 (static_cast&&> (*fHeapTmp)); + std::function f2 (std::move (*fHeapTmp)); if (*fHeapTmp) expect (false); @@ -211,7 +211,7 @@ public: expectEquals (f2(), FunctionTestsHelpers::BigData::bigDataSum); std::unique_ptr> fEmptyTmp (new std::function()); - std::function f3 (static_cast&&> (*fEmptyTmp)); + std::function f3 (std::move (*fEmptyTmp)); fEmptyTmp.reset(); if (f3) expect (false); @@ -222,14 +222,14 @@ public: std::function f1 (fHeap); std::unique_ptr> fStackTmp (new std::function (fStack)); - f1 = static_cast&&> (*fStackTmp); + f1 = std::move (*fStackTmp); fStackTmp.reset(); expectEquals (f1(), 3); std::function f2 (fStack); std::unique_ptr> fHeapTmp (new std::function (fHeap)); - f2 = static_cast&&> (*fHeapTmp); + f2 = std::move (*fHeapTmp); if (*fHeapTmp) expect (false); @@ -238,7 +238,7 @@ public: std::function f3 (fHeap); std::unique_ptr> fEmptyTmp (new std::function()); - f3 = static_cast&&> (*fEmptyTmp); + f3 = std::move (*fEmptyTmp); fEmptyTmp.reset(); if (f3) expect (false); diff --git a/modules/juce_core/native/juce_android_Files.cpp b/modules/juce_core/native/juce_android_Files.cpp index 65f76164ad..0fbf0481b9 100644 --- a/modules/juce_core/native/juce_android_Files.cpp +++ b/modules/juce_core/native/juce_android_Files.cpp @@ -484,7 +484,7 @@ OutputStream* juce_CreateContentURIOutputStream (const URL& url) { auto stream = AndroidContentUriResolver::getStreamForContentUri (url, false); - return (stream.get() != 0 ? new AndroidContentUriOutputStream (static_cast&&> (stream)) : nullptr); + return (stream.get() != 0 ? new AndroidContentUriOutputStream (std::move (stream)) : nullptr); } //============================================================================== diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index fc9709848a..c423a3ce3b 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -209,26 +209,26 @@ void URL::init() URL::URL (const String& u, int) : url (u) {} URL::URL (URL&& other) - : url (static_cast (other.url)), - postData (static_cast (other.postData)), - parameterNames (static_cast (other.parameterNames)), - parameterValues (static_cast (other.parameterValues)), - filesToUpload (static_cast&&> (other.filesToUpload)) + : url (std::move (other.url)), + postData (std::move (other.postData)), + parameterNames (std::move (other.parameterNames)), + parameterValues (std::move (other.parameterValues)), + filesToUpload (std::move (other.filesToUpload)) #if JUCE_IOS - , bookmark (static_cast (other.bookmark)) + , bookmark (std::move (other.bookmark)) #endif { } URL& URL::operator= (URL&& other) { - url = static_cast (other.url); - postData = static_cast (other.postData); - parameterNames = static_cast (other.parameterNames); - parameterValues = static_cast (other.parameterValues); - filesToUpload = static_cast&&> (other.filesToUpload); + url = std::move (other.url); + postData = std::move (other.postData); + parameterNames = std::move (other.parameterNames); + parameterValues = std::move (other.parameterValues); + filesToUpload = std::move (other.filesToUpload); #if JUCE_IOS - bookmark = static_cast (other.bookmark); + bookmark = std::move (other.bookmark); #endif return *this; diff --git a/modules/juce_core/streams/juce_URLInputSource.cpp b/modules/juce_core/streams/juce_URLInputSource.cpp index d7c954abd2..0ecddbb9f4 100644 --- a/modules/juce_core/streams/juce_URLInputSource.cpp +++ b/modules/juce_core/streams/juce_URLInputSource.cpp @@ -29,7 +29,7 @@ URLInputSource::URLInputSource (const URL& url) } URLInputSource::URLInputSource (URL&& url) - : u (static_cast (url)) + : u (std::move (url)) { } diff --git a/modules/juce_core/text/juce_Identifier.cpp b/modules/juce_core/text/juce_Identifier.cpp index 3ca2b45ff7..a56a364ca8 100644 --- a/modules/juce_core/text/juce_Identifier.cpp +++ b/modules/juce_core/text/juce_Identifier.cpp @@ -28,11 +28,11 @@ Identifier::~Identifier() noexcept {} Identifier::Identifier (const Identifier& other) noexcept : name (other.name) {} -Identifier::Identifier (Identifier&& other) noexcept : name (static_cast (other.name)) {} +Identifier::Identifier (Identifier&& other) noexcept : name (std::move (other.name)) {} Identifier& Identifier::operator= (Identifier&& other) noexcept { - name = static_cast (other.name); + name = std::move (other.name); return *this; } diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 2e2f0cc309..2d743f137e 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -1422,7 +1422,7 @@ String String::replaceCharacter (const juce_wchar charToReplace, const juce_wcha break; } - return static_cast (builder.result); + return std::move (builder.result); } String String::replaceCharacters (StringRef charactersToReplace, StringRef charactersToInsertInstead) const @@ -1447,7 +1447,7 @@ String String::replaceCharacters (StringRef charactersToReplace, StringRef chara break; } - return static_cast (builder.result); + return std::move (builder.result); } //============================================================================== @@ -1529,7 +1529,7 @@ String String::toUpperCase() const ++(builder.source); } - return static_cast (builder.result); + return std::move (builder.result); } String String::toLowerCase() const @@ -1547,7 +1547,7 @@ String String::toLowerCase() const ++(builder.source); } - return static_cast (builder.result); + return std::move (builder.result); } //============================================================================== @@ -1812,7 +1812,7 @@ String String::retainCharacters (StringRef charactersToRetain) const } builder.write (0); - return static_cast (builder.result); + return std::move (builder.result); } String String::removeCharacters (StringRef charactersToRemove) const @@ -1833,7 +1833,7 @@ String String::removeCharacters (StringRef charactersToRemove) const break; } - return static_cast (builder.result); + return std::move (builder.result); } String String::initialSectionContainingOnly (StringRef permittedCharacters) const @@ -2049,7 +2049,7 @@ String String::createStringFromData (const void* const unknownData, int size) } builder.write (0); - return static_cast (builder.result); + return std::move (builder.result); } auto* start = (const char*) data; diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index 2ccc159134..bd1074698f 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -33,12 +33,12 @@ StringArray::StringArray (const StringArray& other) } StringArray::StringArray (StringArray&& other) noexcept - : strings (static_cast&&> (other.strings)) + : strings (std::move (other.strings)) { } StringArray::StringArray (Array&& other) noexcept - : strings (static_cast&&> (other)) + : strings (std::move (other)) { } @@ -85,7 +85,7 @@ StringArray& StringArray::operator= (const StringArray& other) StringArray& StringArray::operator= (StringArray&& other) noexcept { - strings = static_cast&&> (other.strings); + strings = std::move (other.strings); return *this; } diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index 5c74492212..18c0a60673 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -127,10 +127,10 @@ XmlElement& XmlElement::operator= (const XmlElement& other) } XmlElement::XmlElement (XmlElement&& other) noexcept - : nextListItem (static_cast&&> (other.nextListItem)), - firstChildElement (static_cast&&> (other.firstChildElement)), - attributes (static_cast&&> (other.attributes)), - tagName (static_cast (other.tagName)) + : nextListItem (std::move (other.nextListItem)), + firstChildElement (std::move (other.firstChildElement)), + attributes (std::move (other.attributes)), + tagName (std::move (other.tagName)) { } @@ -141,10 +141,10 @@ XmlElement& XmlElement::operator= (XmlElement&& other) noexcept removeAllAttributes(); deleteAllChildElements(); - nextListItem = static_cast&&> (other.nextListItem); - firstChildElement = static_cast&&> (other.firstChildElement); - attributes = static_cast&&> (other.attributes); - tagName = static_cast (other.tagName); + nextListItem = std::move (other.nextListItem); + firstChildElement = std::move (other.firstChildElement); + attributes = std::move (other.attributes); + tagName = std::move (other.tagName); return *this; } diff --git a/modules/juce_data_structures/values/juce_Value.cpp b/modules/juce_data_structures/values/juce_Value.cpp index 2435b96840..d67f9d2c53 100644 --- a/modules/juce_data_structures/values/juce_Value.cpp +++ b/modules/juce_data_structures/values/juce_Value.cpp @@ -123,7 +123,7 @@ Value::Value (Value&& other) noexcept jassert (other.listeners.size() == 0); other.removeFromListenerList(); - value = static_cast&&> (other.value); + value = std::move (other.value); } Value& Value::operator= (Value&& other) noexcept @@ -133,7 +133,7 @@ Value& Value::operator= (Value&& other) noexcept jassert (other.listeners.size() == 0); other.removeFromListenerList(); - value = static_cast&&> (other.value); + value = std::move (other.value); return *this; } diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index 10d16ebb43..091f1c5a78 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -414,7 +414,7 @@ public: SetPropertyAction (Ptr targetObject, const Identifier& propertyName, const var& newVal, const var& oldVal, bool isAdding, bool isDeleting, ValueTree::Listener* listenerToExclude = nullptr) - : target (static_cast (targetObject)), + : target (std::move (targetObject)), name (propertyName), newValue (newVal), oldValue (oldVal), isAddingNewProperty (isAdding), isDeletingProperty (isDeleting), excludeListener (listenerToExclude) @@ -476,7 +476,7 @@ public: struct AddOrRemoveChildAction : public UndoableAction { AddOrRemoveChildAction (Ptr parentObject, int index, SharedObject* newChild) - : target (static_cast (parentObject)), + : target (std::move (parentObject)), child (newChild != nullptr ? newChild : target->children.getObjectPointer (index)), childIndex (index), isDeleting (newChild == nullptr) @@ -528,7 +528,7 @@ public: struct MoveChildAction : public UndoableAction { MoveChildAction (Ptr parentObject, int fromIndex, int toIndex) noexcept - : parent (static_cast (parentObject)), startIndex (fromIndex), endIndex (toIndex) + : parent (std::move (parentObject)), startIndex (fromIndex), endIndex (toIndex) { } @@ -598,7 +598,7 @@ ValueTree::ValueTree (const Identifier& type, addChild (tree, -1, nullptr); } -ValueTree::ValueTree (SharedObject::Ptr so) noexcept : object (static_cast (so)) {} +ValueTree::ValueTree (SharedObject::Ptr so) noexcept : object (std::move (so)) {} ValueTree::ValueTree (SharedObject& so) noexcept : object (so) {} ValueTree::ValueTree (const ValueTree& other) noexcept : object (other.object) @@ -631,7 +631,7 @@ ValueTree& ValueTree::operator= (const ValueTree& other) } ValueTree::ValueTree (ValueTree&& other) noexcept - : object (static_cast (other.object)) + : object (std::move (other.object)) { if (object != nullptr) object->valueTreesWithListeners.removeValue (&other); diff --git a/modules/juce_dsp/frequency/juce_FFT.cpp b/modules/juce_dsp/frequency/juce_FFT.cpp index 34778f889c..7a79b88f88 100644 --- a/modules/juce_dsp/frequency/juce_FFT.cpp +++ b/modules/juce_dsp/frequency/juce_FFT.cpp @@ -632,7 +632,7 @@ struct FFTWImpl : public FFT::Instance if (! Symbols::symbol (lib, symbols.execute_c2r_fftw, "fftwf_execute_dft_c2r")) return nullptr; #endif - return new FFTWImpl (static_cast (order), static_cast (lib), symbols); + return new FFTWImpl (std::move (lib), symbols); } return nullptr; diff --git a/modules/juce_dsp/processors/juce_FIRFilter.h b/modules/juce_dsp/processors/juce_FIRFilter.h index 98195e4580..b89ad57f10 100644 --- a/modules/juce_dsp/processors/juce_FIRFilter.h +++ b/modules/juce_dsp/processors/juce_FIRFilter.h @@ -68,7 +68,7 @@ namespace FIR Filter() : coefficients (new Coefficients) { reset(); } /** Creates a filter with a given set of coefficients. */ - Filter (CoefficientsPtr coefficientsToUse) : coefficients (static_cast (coefficientsToUse)) { reset(); } + Filter (CoefficientsPtr coefficientsToUse) : coefficients (std::move (coefficientsToUse)) { reset(); } Filter (const Filter&) = default; Filter (Filter&&) = default; diff --git a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h index b2ce0d0d4b..37fb2aeb80 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h +++ b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h @@ -42,7 +42,7 @@ Filter::Filter() } template -Filter::Filter (CoefficientsPtr c) : coefficients (static_cast (c)) +Filter::Filter (CoefficientsPtr c) : coefficients (std::move (c)) { reset(); } diff --git a/modules/juce_dsp/processors/juce_ProcessorDuplicator.h b/modules/juce_dsp/processors/juce_ProcessorDuplicator.h index 280945bc60..725a3c349c 100644 --- a/modules/juce_dsp/processors/juce_ProcessorDuplicator.h +++ b/modules/juce_dsp/processors/juce_ProcessorDuplicator.h @@ -44,7 +44,7 @@ struct ProcessorDuplicator { ProcessorDuplicator() : state (new StateType()) {} ProcessorDuplicator (StateType* stateToUse) : state (stateToUse) {} - ProcessorDuplicator (typename StateType::Ptr stateToUse) : state (static_cast (stateToUse)) {} + ProcessorDuplicator (typename StateType::Ptr stateToUse) : state (std::move (stateToUse)) {} ProcessorDuplicator (const ProcessorDuplicator&) = default; ProcessorDuplicator (ProcessorDuplicator&&) = default; diff --git a/modules/juce_dsp/processors/juce_StateVariableFilter.h b/modules/juce_dsp/processors/juce_StateVariableFilter.h index 2e8b1b0aaf..6f65484500 100644 --- a/modules/juce_dsp/processors/juce_StateVariableFilter.h +++ b/modules/juce_dsp/processors/juce_StateVariableFilter.h @@ -67,7 +67,7 @@ namespace StateVariableFilter /** Creates a filter with default parameters. */ Filter() : parameters (new Parameters) { reset(); } - Filter (ParametersPtr parametersToUse) : parameters (static_cast (parametersToUse)) { reset(); } + Filter (ParametersPtr parametersToUse) : parameters (std::move (parametersToUse)) { reset(); } /** Creates a copy of another filter. */ Filter (const Filter&) = default; diff --git a/modules/juce_events/native/juce_android_Messaging.cpp b/modules/juce_events/native/juce_android_Messaging.cpp index 63f5bcabd6..7cee9b0730 100644 --- a/modules/juce_events/native/juce_android_Messaging.cpp +++ b/modules/juce_events/native/juce_android_Messaging.cpp @@ -84,7 +84,7 @@ struct AndroidMessageQueue : private Android::Runnable bool post (MessageManager::MessageBase::Ptr&& message) { - queue.add (static_cast (message)); + queue.add (std::move (message)); // this will call us on the message thread return handler.post (self.get()); diff --git a/modules/juce_graphics/colour/juce_ColourGradient.cpp b/modules/juce_graphics/colour/juce_ColourGradient.cpp index 8ee7280a6c..a0b100ed79 100644 --- a/modules/juce_graphics/colour/juce_ColourGradient.cpp +++ b/modules/juce_graphics/colour/juce_ColourGradient.cpp @@ -43,7 +43,7 @@ ColourGradient::ColourGradient (const ColourGradient& other) ColourGradient::ColourGradient (ColourGradient&& other) noexcept : point1 (other.point1), point2 (other.point2), isRadial (other.isRadial), - colours (static_cast&&> (other.colours)) + colours (std::move (other.colours)) {} ColourGradient& ColourGradient::operator= (const ColourGradient& other) @@ -60,7 +60,7 @@ ColourGradient& ColourGradient::operator= (ColourGradient&& other) noexcept point1 = other.point1; point2 = other.point2; isRadial = other.isRadial; - colours = static_cast&&> (other.colours); + colours = std::move (other.colours); return *this; } diff --git a/modules/juce_graphics/colour/juce_FillType.cpp b/modules/juce_graphics/colour/juce_FillType.cpp index 85788119fd..746b017978 100644 --- a/modules/juce_graphics/colour/juce_FillType.cpp +++ b/modules/juce_graphics/colour/juce_FillType.cpp @@ -43,7 +43,7 @@ FillType::FillType (const ColourGradient& g) } FillType::FillType (ColourGradient&& g) - : colour (0xff000000), gradient (new ColourGradient (static_cast (g))) + : colour (0xff000000), gradient (new ColourGradient (std::move (g))) { } @@ -75,8 +75,8 @@ FillType& FillType::operator= (const FillType& other) FillType::FillType (FillType&& other) noexcept : colour (other.colour), - gradient (static_cast&&> (other.gradient)), - image (static_cast (other.image)), + gradient (std::move (other.gradient)), + image (std::move (other.image)), transform (other.transform) { } @@ -86,8 +86,8 @@ FillType& FillType::operator= (FillType&& other) noexcept jassert (this != &other); // hopefully the compiler should make this situation impossible! colour = other.colour; - gradient = static_cast&&> (other.gradient); - image = static_cast (other.image); + gradient = std::move (other.gradient); + image = std::move (other.image); transform = other.transform; return *this; } diff --git a/modules/juce_graphics/contexts/juce_GraphicsContext.cpp b/modules/juce_graphics/contexts/juce_GraphicsContext.cpp index 1c43b9a277..7dfed77266 100644 --- a/modules/juce_graphics/contexts/juce_GraphicsContext.cpp +++ b/modules/juce_graphics/contexts/juce_GraphicsContext.cpp @@ -203,7 +203,7 @@ void Graphics::setGradientFill (const ColourGradient& gradient) void Graphics::setGradientFill (ColourGradient&& gradient) { - setFillType (static_cast (gradient)); + setFillType (std::move (gradient)); } void Graphics::setTiledImageFill (const Image& imageToUse, const int anchorX, const int anchorY, const float opacity) diff --git a/modules/juce_graphics/fonts/juce_Font.cpp b/modules/juce_graphics/fonts/juce_Font.cpp index a0da9e81f7..fc61328f17 100644 --- a/modules/juce_graphics/fonts/juce_Font.cpp +++ b/modules/juce_graphics/fonts/juce_Font.cpp @@ -280,13 +280,13 @@ Font& Font::operator= (const Font& other) noexcept } Font::Font (Font&& other) noexcept - : font (static_cast&&> (other.font)) + : font (std::move (other.font)) { } Font& Font::operator= (Font&& other) noexcept { - font = static_cast&&> (other.font); + font = std::move (other.font); return *this; } diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp index fe97d7a156..73d3c3f8c6 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp @@ -40,7 +40,7 @@ PositionedGlyph::PositionedGlyph (const Font& font_, juce_wchar character_, int } PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept - : font (static_cast (other.font)), + : font (std::move (other.font)), character (other.character), glyph (other.glyph), x (other.x), y (other.y), w (other.w), whitespace (other.whitespace) { @@ -48,7 +48,7 @@ PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept PositionedGlyph& PositionedGlyph::operator= (PositionedGlyph&& other) noexcept { - font = static_cast (other.font); + font = std::move (other.font); character = other.character; glyph = other.glyph; x = other.x; @@ -129,13 +129,13 @@ GlyphArrangement::GlyphArrangement() } GlyphArrangement::GlyphArrangement (GlyphArrangement&& other) - : glyphs (static_cast&&> (other.glyphs)) + : glyphs (std::move (other.glyphs)) { } GlyphArrangement& GlyphArrangement::operator= (GlyphArrangement&& other) { - glyphs = static_cast&&> (other.glyphs); + glyphs = std::move (other.glyphs); return *this; } diff --git a/modules/juce_graphics/fonts/juce_TextLayout.cpp b/modules/juce_graphics/fonts/juce_TextLayout.cpp index 9cddd48529..20da553bdf 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.cpp +++ b/modules/juce_graphics/fonts/juce_TextLayout.cpp @@ -168,7 +168,7 @@ TextLayout::TextLayout (const TextLayout& other) } TextLayout::TextLayout (TextLayout&& other) noexcept - : lines (static_cast&&> (other.lines)), + : lines (std::move (other.lines)), width (other.width), height (other.height), justification (other.justification) { @@ -176,7 +176,7 @@ TextLayout::TextLayout (TextLayout&& other) noexcept TextLayout& TextLayout::operator= (TextLayout&& other) noexcept { - lines = static_cast&&> (other.lines); + lines = std::move (other.lines); width = other.width; height = other.height; justification = other.justification; diff --git a/modules/juce_graphics/geometry/juce_Path.cpp b/modules/juce_graphics/geometry/juce_Path.cpp index 42e2a6a550..df63978656 100644 --- a/modules/juce_graphics/geometry/juce_Path.cpp +++ b/modules/juce_graphics/geometry/juce_Path.cpp @@ -132,7 +132,7 @@ Path& Path::operator= (const Path& other) } Path::Path (Path&& other) noexcept - : data (static_cast&&> (other.data)), + : data (std::move (other.data)), bounds (other.bounds), useNonZeroWinding (other.useNonZeroWinding) { @@ -140,7 +140,7 @@ Path::Path (Path&& other) noexcept Path& Path::operator= (Path&& other) noexcept { - data = static_cast&&> (other.data); + data = std::move (other.data); bounds = other.bounds; useNonZeroWinding = other.useNonZeroWinding; return *this; diff --git a/modules/juce_graphics/geometry/juce_RectangleList.h b/modules/juce_graphics/geometry/juce_RectangleList.h index 53e513402c..108df0b8f6 100644 --- a/modules/juce_graphics/geometry/juce_RectangleList.h +++ b/modules/juce_graphics/geometry/juce_RectangleList.h @@ -69,14 +69,14 @@ public: /** Move constructor */ RectangleList (RectangleList&& other) noexcept - : rects (static_cast&&> (other.rects)) + : rects (std::move (other.rects)) { } /** Move assignment operator */ RectangleList& operator= (RectangleList&& other) noexcept { - rects = static_cast&&> (other.rects); + rects = std::move (other.rects); return *this; } diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index 0f3b1290b2..1673b25867 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -158,7 +158,7 @@ class SubsectionPixelData : public ImagePixelData public: SubsectionPixelData (ImagePixelData::Ptr source, Rectangle r) : ImagePixelData (source->pixelFormat, r.getWidth(), r.getHeight()), - sourceImage (static_cast (source)), area (r) + sourceImage (std::move (source)), area (r) { } @@ -226,7 +226,7 @@ Image::Image() noexcept } Image::Image (ReferenceCountedObjectPtr instance) noexcept - : image (static_cast&&> (instance)) + : image (std::move (instance)) { } diff --git a/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp b/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp index c648f46cf9..6905717dad 100644 --- a/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp +++ b/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp @@ -48,7 +48,7 @@ void DrawablePath::setPath (const Path& newPath) void DrawablePath::setPath (Path&& newPath) { - path = static_cast (newPath); + path = std::move (newPath); pathChanged(); } diff --git a/modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp b/modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp index 9759956dac..6b948c82b3 100644 --- a/modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp @@ -183,7 +183,7 @@ void ContentSharer::startNewShare (std::function cal // You need to pass a valid callback. jassert (callbackToUse); - callback = static_cast&&> (callbackToUse); + callback = std::move (callbackToUse); pimpl.reset (createPimpl()); } diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp b/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp index d5321163d5..4325ef864b 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp @@ -178,7 +178,7 @@ void FileChooser::launchAsync (int flags, std::function&&> (callback); + asyncCallback = std::move (callback); pimpl.reset (createPimpl (flags, previewComp)); pimpl->launch(); diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index d9c82bbb4e..72c719c64c 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1136,7 +1136,7 @@ struct UWPUIViewSettings return; // move dll into member var - comBaseDLL = static_cast (dll); + comBaseDLL = std::move (dll); } } diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp index fcb803bafb..d7a179105c 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp @@ -73,13 +73,13 @@ RelativeCoordinate& RelativeCoordinate::operator= (const RelativeCoordinate& oth } RelativeCoordinate::RelativeCoordinate (RelativeCoordinate&& other) noexcept - : term (static_cast (other.term)) + : term (std::move (other.term)) { } RelativeCoordinate& RelativeCoordinate::operator= (RelativeCoordinate&& other) noexcept { - term = static_cast (other.term); + term = std::move (other.term); return *this; } diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp index 7c4e1faa40..fc14b446d6 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp @@ -77,9 +77,9 @@ public: // VS2013 can't default move constructors UniformTextSection (UniformTextSection&& other) - : font (static_cast (other.font)), + : font (std::move (other.font)), colour (other.colour), - atoms (static_cast&&> (other.atoms)) + atoms (std::move (other.atoms)) { } diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 0746ee36d9..ba961fce44 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -540,7 +540,7 @@ public: struct BlockingWorker : public OpenGLContext::AsyncWorker { BlockingWorker (OpenGLContext::AsyncWorker::Ptr && workerToUse) - : originalWorker (static_cast (workerToUse)) + : originalWorker (std::move (workerToUse)) {} void operator() (OpenGLContext& calleeContext) @@ -590,7 +590,7 @@ public: { if (shouldBlock) { - auto blocker = new BlockingWorker (static_cast (workerToUse)); + auto blocker = new BlockingWorker (std::move (workerToUse)); OpenGLContext::AsyncWorker::Ptr worker (*blocker); workQueue.add (worker); @@ -601,7 +601,7 @@ public: } else { - workQueue.add (static_cast (workerToUse)); + workQueue.add (std::move (workerToUse)); messageManagerLock.abort(); context.triggerRepaint(); @@ -1057,7 +1057,7 @@ size_t OpenGLContext::getImageCacheSize() const noexcept { return ima void OpenGLContext::execute (OpenGLContext::AsyncWorker::Ptr workerToUse, bool shouldBlock) { if (auto* c = getCachedImage()) - c->execute (static_cast (workerToUse), shouldBlock); + c->execute (std::move (workerToUse), shouldBlock); else jassertfalse; // You must have attached the context to a component } diff --git a/modules/juce_osc/osc/juce_OSCArgument.cpp b/modules/juce_osc/osc/juce_OSCArgument.cpp index 4d968354f1..5b95c6f733 100644 --- a/modules/juce_osc/osc/juce_OSCArgument.cpp +++ b/modules/juce_osc/osc/juce_OSCArgument.cpp @@ -30,7 +30,7 @@ namespace juce OSCArgument::OSCArgument (int32 v) : type (OSCTypes::int32), intValue (v) {} OSCArgument::OSCArgument (float v) : type (OSCTypes::float32), floatValue (v) {} OSCArgument::OSCArgument (const String& s) : type (OSCTypes::string), stringValue (s) {} -OSCArgument::OSCArgument (MemoryBlock b) : type (OSCTypes::blob), blob (static_cast (b)) {} +OSCArgument::OSCArgument (MemoryBlock b) : type (OSCTypes::blob), blob (std::move (b)) {} OSCArgument::OSCArgument (OSCColour c) : type (OSCTypes::colour), intValue ((int32) c.toInt32()) {} //============================================================================== diff --git a/modules/juce_osc/osc/juce_OSCMessage.cpp b/modules/juce_osc/osc/juce_OSCMessage.cpp index 44d77e9e9d..30e05f2623 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.cpp +++ b/modules/juce_osc/osc/juce_OSCMessage.cpp @@ -82,7 +82,7 @@ void OSCMessage::clear() void OSCMessage::addInt32 (int32 value) { arguments.add (OSCArgument (value)); } void OSCMessage::addFloat32 (float value) { arguments.add (OSCArgument (value)); } void OSCMessage::addString (const String& value) { arguments.add (OSCArgument (value)); } -void OSCMessage::addBlob (MemoryBlock blob) { arguments.add (OSCArgument (static_cast (blob))); } +void OSCMessage::addBlob (MemoryBlock blob) { arguments.add (OSCArgument (std::move (blob))); } void OSCMessage::addColour (OSCColour colour) { arguments.add (OSCArgument (colour)); } void OSCMessage::addArgument (OSCArgument arg) { arguments.add (arg); } diff --git a/modules/juce_video/capture/juce_CameraDevice.cpp b/modules/juce_video/capture/juce_CameraDevice.cpp index 35dbdd84bf..bd6243eb13 100644 --- a/modules/juce_video/capture/juce_CameraDevice.cpp +++ b/modules/juce_video/capture/juce_CameraDevice.cpp @@ -237,7 +237,7 @@ void CameraDevice::openDeviceAsync (int index, OpenCameraResultCallback resultCa } #if JUCE_ANDROID || JUCE_IOS - CameraFactory::getInstance().openCamera (index, static_cast (resultCallback), + CameraFactory::getInstance().openCamera (index, std::move (resultCallback), minWidth, minHeight, maxWidth, maxHeight, useHighQuality); #else auto* device = openDevice (index, minWidth, minHeight, maxWidth, maxHeight, useHighQuality); diff --git a/modules/juce_video/native/juce_android_CameraDevice.h b/modules/juce_video/native/juce_android_CameraDevice.h index 84044f90fd..d94202950f 100644 --- a/modules/juce_video/native/juce_android_CameraDevice.h +++ b/modules/juce_video/native/juce_android_CameraDevice.h @@ -522,7 +522,7 @@ struct CameraDevice::Pimpl void open (InternalOpenCameraResultCallback cameraOpenCallbackToUse) { - cameraOpenCallback = static_cast (cameraOpenCallbackToUse); + cameraOpenCallback = std::move (cameraOpenCallbackToUse); // A valid camera open callback must be passed. jassert (cameraOpenCallback != nullptr); @@ -578,7 +578,7 @@ struct CameraDevice::Pimpl return; } - pictureTakenCallback = static_cast&&> (pictureTakenCallbackToUse); + pictureTakenCallback = std::move (pictureTakenCallbackToUse); triggerStillPictureCapture(); } diff --git a/modules/juce_video/native/juce_ios_CameraDevice.h b/modules/juce_video/native/juce_ios_CameraDevice.h index 233775c3de..3c513da33f 100644 --- a/modules/juce_video/native/juce_ios_CameraDevice.h +++ b/modules/juce_video/native/juce_ios_CameraDevice.h @@ -41,7 +41,7 @@ struct CameraDevice::Pimpl void open (InternalOpenCameraResultCallback cameraOpenCallbackToUse) { - cameraOpenCallback = static_cast (cameraOpenCallbackToUse); + cameraOpenCallback = std::move (cameraOpenCallbackToUse); if (cameraOpenCallback == nullptr) { @@ -83,7 +83,7 @@ struct CameraDevice::Pimpl return; } - pictureTakenCallback = static_cast&&> (pictureTakenCallbackToUse); + pictureTakenCallback = std::move (pictureTakenCallbackToUse); triggerStillPictureCapture(); } diff --git a/modules/juce_video/native/juce_mac_CameraDevice.h b/modules/juce_video/native/juce_mac_CameraDevice.h index e22e14861d..2c35138103 100644 --- a/modules/juce_video/native/juce_mac_CameraDevice.h +++ b/modules/juce_video/native/juce_mac_CameraDevice.h @@ -131,7 +131,7 @@ struct CameraDevice::Pimpl return; } - pictureTakenCallback = static_cast&&> (pictureTakenCallbackToUse); + pictureTakenCallback = std::move (pictureTakenCallbackToUse); triggerImageCapture(); } diff --git a/modules/juce_video/native/juce_win32_CameraDevice.h b/modules/juce_video/native/juce_win32_CameraDevice.h index 9f4840038c..c41f94d3fc 100644 --- a/modules/juce_video/native/juce_win32_CameraDevice.h +++ b/modules/juce_video/native/juce_win32_CameraDevice.h @@ -195,7 +195,7 @@ struct CameraDevice::Pimpl : public ChangeBroadcaster if (pictureTakenCallbackToUse == nullptr) return; - pictureTakenCallback = static_cast&&> (pictureTakenCallbackToUse); + pictureTakenCallback = std::move (pictureTakenCallbackToUse); } addUser();