From 7c6f3d40b6e9fec3d822aa2d4011e13e62662642 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 5 Sep 2017 16:06:57 +0100 Subject: [PATCH] Tidied up some method calls involving HeapBlock --- examples/AUv3Synth/Source/AUv3SynthProcessor.cpp | 15 ++++++--------- .../buffers/juce_AudioSampleBuffer.h | 8 ++++---- .../buffers/juce_FloatVectorOperations.cpp | 6 +++--- .../native/juce_android_Midi.cpp | 4 ++-- .../native/juce_android_OpenSL.cpp | 8 ++++---- .../native/juce_mac_CoreAudio.cpp | 4 ++-- .../codecs/juce_CoreAudioFormat.cpp | 4 ++-- .../codecs/juce_FlacAudioFormat.cpp | 4 ++-- .../format/juce_AudioFormatReader.cpp | 4 ++-- .../format_types/juce_AU_Shared.h | 6 +++--- .../format_types/juce_AudioUnitPluginFormat.mm | 16 ++++++++-------- .../format_types/juce_VSTCommon.h | 4 ++-- .../format_types/juce_VSTPluginFormat.cpp | 10 +++++----- modules/juce_core/containers/juce_Array.h | 12 ++++++------ modules/juce_core/containers/juce_OwnedArray.h | 12 ++++++------ .../containers/juce_ReferenceCountedArray.h | 12 ++++++------ modules/juce_core/native/juce_mac_Files.mm | 2 +- modules/juce_core/native/juce_mac_Strings.mm | 6 +++--- modules/juce_core/native/juce_mac_SystemStats.mm | 2 +- modules/juce_core/network/juce_URL.cpp | 4 ++-- modules/juce_core/text/juce_String.cpp | 4 ++-- .../juce_graphics/geometry/juce_PathIterator.cpp | 2 +- .../juce_graphics/native/juce_RenderingHelpers.h | 4 ++-- modules/juce_opengl/opengl/juce_OpenGLImage.cpp | 2 +- 24 files changed, 76 insertions(+), 79 deletions(-) diff --git a/examples/AUv3Synth/Source/AUv3SynthProcessor.cpp b/examples/AUv3Synth/Source/AUv3SynthProcessor.cpp index 348bf98d8c..72a9ba6ac2 100644 --- a/examples/AUv3Synth/Source/AUv3SynthProcessor.cpp +++ b/examples/AUv3Synth/Source/AUv3SynthProcessor.cpp @@ -96,19 +96,16 @@ public: const String getName() const override { return "AUv3 Synth"; } int getNumPrograms() override { return 4; } int getCurrentProgram() override { return currentProgram; } - void setCurrentProgram (int index) override { currentProgram = index; } + void setCurrentProgram (int index) override { currentProgram = index; } + const String getProgramName (int index) override { switch (index) { - case 0: - return "Piano"; - case 1: - return "Singing"; - case 2: - return "Pinched Balloon"; - case 3: - return "Gazeebo"; + case 0: return "Piano"; + case 1: return "Singing"; + case 2: return "Pinched Balloon"; + case 3: return "Gazeebo"; } return ""; diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index dc78d7b2ec..ed945e0896 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -332,7 +332,7 @@ public: auto numSamplesToCopy = (size_t) jmin (newNumSamples, size); - auto newChannels = reinterpret_cast (newData.getData()); + auto newChannels = reinterpret_cast (newData.get()); auto newChan = reinterpret_cast (newData + channelListSize); for (int j = 0; j < newNumChannels; ++j) @@ -364,7 +364,7 @@ public: { allocatedBytes = newTotalBytes; allocatedData.allocate (newTotalBytes, clearExtraSpace || isClear); - channels = reinterpret_cast (allocatedData.getData()); + channels = reinterpret_cast (allocatedData.get()); } auto* chan = reinterpret_cast (allocatedData + channelListSize); @@ -1051,7 +1051,7 @@ private: auto channelListSize = sizeof (Type*) * (size_t) (numChannels + 1); allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (Type) + channelListSize + 32; allocatedData.malloc (allocatedBytes); - channels = reinterpret_cast (allocatedData.getData()); + channels = reinterpret_cast (allocatedData.get()); auto* chan = (Type*) (allocatedData + channelListSize); for (int i = 0; i < numChannels; ++i) @@ -1076,7 +1076,7 @@ private: else { allocatedData.malloc ((size_t) numChannels + 1, sizeof (Type*)); - channels = reinterpret_cast (allocatedData.getData()); + channels = reinterpret_cast (allocatedData.get()); } for (int i = 0; i < numChannels; ++i) diff --git a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index 5ec378ab49..7813c81abc 100644 --- a/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -1068,9 +1068,9 @@ public: #else // These tests deliberately operate on misaligned memory and will be flagged up by // checks for undefined behavior! - ValueType* const data1 = addBytesToPointer (buffer1.getData(), random.nextInt (16)); - ValueType* const data2 = addBytesToPointer (buffer2.getData(), random.nextInt (16)); - int* const int1 = addBytesToPointer (buffer3.getData(), random.nextInt (16)); + ValueType* const data1 = addBytesToPointer (buffer1.get(), random.nextInt (16)); + ValueType* const data2 = addBytesToPointer (buffer2.get(), random.nextInt (16)); + int* const int1 = addBytesToPointer (buffer3.get(), random.nextInt (16)); #endif fillRandomly (random, data1, num); diff --git a/modules/juce_audio_devices/native/juce_android_Midi.cpp b/modules/juce_audio_devices/native/juce_android_Midi.cpp index c968982cb3..3bcd3ea053 100644 --- a/modules/juce_audio_devices/native/juce_android_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_android_Midi.cpp @@ -89,9 +89,9 @@ public: jbyte* data = getEnv()->GetByteArrayElements (byteArray, nullptr); HeapBlock buffer (static_cast (len)); - std::memcpy (buffer.getData(), data + offset, static_cast (len)); + std::memcpy (buffer.get(), data + offset, static_cast (len)); - midiConcatenator.pushMidiData (buffer.getData(), + midiConcatenator.pushMidiData (buffer.get(), len, static_cast (timestamp) * 1.0e-9, juceMidiInput, *callback); diff --git a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index d1dd6be331..400d0f54f8 100644 --- a/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -308,7 +308,7 @@ public: nextBlock.set (0); numBlocksOut.set (0); - zeromem (nativeBuffer.getData(), static_cast (owner.bufferSize * numChannels * owner.numBuffers) * sizeof (T)); + zeromem (nativeBuffer.get(), static_cast (owner.bufferSize * numChannels * owner.numBuffers) * sizeof (T)); scratchBuffer.clear(); (*queue)->Clear (queue); } @@ -321,7 +321,7 @@ public: bool isBufferAvailable() const { return (numBlocksOut.get() < owner.numBuffers); } T* getNextBuffer() { nextBlock.set((nextBlock.get() + 1) % owner.numBuffers); return getCurrentBuffer(); } - T* getCurrentBuffer() { return nativeBuffer.getData() + (static_cast (nextBlock.get()) * getBufferSizeInSamples()); } + T* getCurrentBuffer() { return nativeBuffer.get() + (static_cast (nextBlock.get()) * getBufferSizeInSamples()); } size_t getBufferSizeInSamples() const { return static_cast (owner.bufferSize * numChannels); } void finished (SLAndroidSimpleBufferQueueItf) @@ -1203,11 +1203,11 @@ public: pthread_t startThread (void* (*entry) (void*), void* userPtr) { - memset (buffer.getData(), 0, static_cast (sizeof (int16) * static_cast (bufferSize * numBuffers))); + memset (buffer.get(), 0, static_cast (sizeof (int16) * static_cast (bufferSize * numBuffers))); for (int i = 0; i < numBuffers; ++i) { - int16* dst = buffer.getData() + (bufferSize * i); + int16* dst = buffer.get() + (bufferSize * i); (*queue)->Enqueue (queue, dst, static_cast (static_cast (bufferSize) * sizeof (int16))); } diff --git a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp index 80758de9f3..0cb091a7e6 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp @@ -228,7 +228,7 @@ public: for (int i = 0; i < numStreams; ++i) { - const ::AudioBuffer& b = bufList->mBuffers[i]; + auto& b = bufList->mBuffers[i]; for (unsigned int j = 0; j < b.mNumberChannels; ++j) { @@ -733,7 +733,7 @@ public: } } - callback->audioDeviceIOCallback (const_cast (tempInputBuffers.getData()), + callback->audioDeviceIOCallback (const_cast (tempInputBuffers.get()), numInputChans, tempOutputBuffers, numOutputChans, diff --git a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp index 4d28dee8bb..1b310579e4 100644 --- a/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp @@ -389,11 +389,11 @@ public: caLayout.malloc (1, static_cast (sizeOfLayout)); status = AudioFileGetProperty (audioFileID, kAudioFilePropertyChannelLayout, - &sizeOfLayout, caLayout.getData()); + &sizeOfLayout, caLayout.get()); if (status == noErr) { - auto fileLayout = CoreAudioLayouts::fromCoreAudio (*caLayout.getData()); + auto fileLayout = CoreAudioLayouts::fromCoreAudio (*caLayout.get()); if (fileLayout.size() == static_cast (numChannels)) { diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp index 0c6b267595..d8b97fc2f0 100644 --- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp @@ -449,14 +449,14 @@ public: if (samplesToWrite[i] == nullptr) break; - int* const destData = temp.getData() + i * (size_t) numSamples; + int* const destData = temp.get() + i * (size_t) numSamples; channels[i] = destData; for (int j = 0; j < numSamples; ++j) destData[j] = (samplesToWrite[i][j] >> bitsToShift); } - samplesToWrite = const_cast (channels.getData()); + samplesToWrite = const_cast (channels.get()); } return FLAC__stream_encoder_process (encoder, (const FLAC__int32**) samplesToWrite, (unsigned) numSamples) != 0; diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp b/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp index ccd002a0f3..d0521d2df5 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp @@ -262,8 +262,8 @@ int64 AudioFormatReader::searchForLevel (int64 startSample, HeapBlock tempSpace (bufferSize * 2 + 64); int* tempBuffer[3]; - tempBuffer[0] = tempSpace.getData(); - tempBuffer[1] = tempSpace.getData() + bufferSize; + tempBuffer[0] = tempSpace.get(); + tempBuffer[1] = tempSpace.get() + bufferSize; tempBuffer[2] = 0; int consecutive = 0; diff --git a/modules/juce_audio_processors/format_types/juce_AU_Shared.h b/modules/juce_audio_processors/format_types/juce_AU_Shared.h index 71768e3b47..5b5e5fcf65 100644 --- a/modules/juce_audio_processors/format_types/juce_AU_Shared.h +++ b/modules/juce_audio_processors/format_types/juce_AU_Shared.h @@ -84,12 +84,12 @@ struct AudioUnitHelpers layoutMapPtrStorage.calloc (static_cast (numBuses)); layoutMapStorage.calloc (static_cast (isInput ? totalInChannels : totalOutChannels)); - layoutMap = layoutMapPtrStorage. getData(); + layoutMap = layoutMapPtrStorage. get(); int ch = 0; for (int busIdx = 0; busIdx < numBuses; ++busIdx) { - layoutMap[busIdx] = layoutMapStorage.getData() + ch; + layoutMap[busIdx] = layoutMapStorage.get() + ch; ch += processor.getChannelCountOfBus (isInput, busIdx); } } @@ -138,7 +138,7 @@ struct AudioUnitHelpers { pushIdx = 0; popIdx = 0; - zeromem (channels.getData(), sizeof(float*) * static_cast (scratch.getNumChannels())); + zeromem (channels.get(), sizeof(float*) * static_cast (scratch.getNumChannels())); } //============================================================================== diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index ed05018b44..fb3ae77b7f 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -581,7 +581,7 @@ public: dataSize = expectedSize; err = AudioUnitGetProperty (audioUnit, kAudioUnitProperty_AudioChannelLayout, scope, - static_cast (i), layoutBuffer.getData(), &dataSize); + static_cast (i), layoutBuffer.get(), &dataSize); if (err != noErr || dataSize < expectedSize) return false; @@ -834,7 +834,7 @@ public: AudioUnitRenderActionFlags flags = 0; if (AUBuffer* buf = outputBufferList[i]) - AudioUnitRender (audioUnit, &flags, &timeStamp, static_cast (i), (UInt32) numSamples, buf->bufferList.getData()); + AudioUnitRender (audioUnit, &flags, &timeStamp, static_cast (i), (UInt32) numSamples, buf->bufferList.get()); } timeStamp.mSampleTime += numSamples; @@ -1232,14 +1232,14 @@ private: AUBuffer (size_t numBuffers) { bufferList.calloc (1, (sizeof (AudioBufferList) - sizeof (::AudioBuffer)) + (sizeof (::AudioBuffer) * numBuffers)); - AudioBufferList& buffer = *bufferList.getData(); + AudioBufferList& buffer = *bufferList.get(); buffer.mNumberBuffers = static_cast (numBuffers); } operator AudioBufferList&() { - return *bufferList.getData(); + return *bufferList.get(); } HeapBlock bufferList; @@ -1721,7 +1721,7 @@ private: propertySize = static_cast (sizeof (AudioChannelLayoutTag) * numElements); if (AudioUnitGetProperty (audioUnit, kAudioUnitProperty_SupportedChannelLayoutTags, scope, - static_cast (busIdx), layoutTags.getData(), &propertySize) == noErr) + static_cast (busIdx), layoutTags.get(), &propertySize) == noErr) { for (int j = 0; j < static_cast (numElements); ++j) { @@ -1757,15 +1757,15 @@ private: channelInfos.malloc (static_cast (numChannelInfos)); propertySize = static_cast (sizeof (AUChannelInfo) * static_cast (numChannelInfos)); - if (AudioUnitGetProperty (audioUnit, kAudioUnitProperty_SupportedNumChannels, kAudioUnitScope_Global, 0, channelInfos.getData(), &propertySize) != noErr) + if (AudioUnitGetProperty (audioUnit, kAudioUnitProperty_SupportedNumChannels, kAudioUnitScope_Global, 0, channelInfos.get(), &propertySize) != noErr) numChannelInfos = 0; } else { numChannelInfos = 1; channelInfos.malloc (static_cast (numChannelInfos)); - channelInfos.getData()->inChannels = -1; - channelInfos.getData()->outChannels = -1; + channelInfos.get()->inChannels = -1; + channelInfos.get()->outChannels = -1; } } } diff --git a/modules/juce_audio_processors/format_types/juce_VSTCommon.h b/modules/juce_audio_processors/format_types/juce_VSTCommon.h index bda9ec84af..cbd5446d1b 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTCommon.h +++ b/modules/juce_audio_processors/format_types/juce_VSTCommon.h @@ -171,7 +171,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e return *this; } - const VstSpeakerConfiguration& get() const { return *storage.getData(); } + const VstSpeakerConfiguration& get() const { return *storage.get(); } private: JUCE_LEAK_DETECTOR (VstSpeakerConfigurationHolder) @@ -184,7 +184,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e + sizeof (VstIndividualSpeakerInfo) * static_cast (jmax (8, numChannels) - 8); storage.malloc (1, arrangementSize); - return storage.getData(); + return storage.get(); } void clear() diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 8f394e8140..ea64a20085 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -1547,8 +1547,8 @@ private: HeapBlock inArrBlock (1, true), outArrBlock (1, true); - auto* inArr = inArrBlock.getData(); - auto* outArr = outArrBlock.getData(); + auto* inArr = inArrBlock.get(); + auto* outArr = outArrBlock.get(); if (! getSpeakerArrangementWrapper (effect, inArr, outArr)) inArr = outArr = nullptr; @@ -1611,8 +1611,8 @@ private: { HeapBlock inArrBlock (1, true), outArrBlock (1, true); - auto* inArr = inArrBlock.getData(); - auto* outArr = outArrBlock.getData(); + auto* inArr = inArrBlock.get(); + auto* outArr = outArrBlock.get(); if (getSpeakerArrangementWrapper (effect, inArr, outArr)) return true; @@ -1746,7 +1746,7 @@ private: // always ensure that the buffer is at least as large as the maximum number of channels auto maxChannels = jmax (vstEffect->numInputChannels, vstEffect->numOutputChannels); - auto channels = channelBuffer.getData(); + auto channels = channelBuffer.get(); if (numChannels < maxChannels) { diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 4e66a70eaa..11465ed4ee 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -358,12 +358,12 @@ public: int indexOf (ParameterType elementToLookFor) const { const ScopedLockType lock (getLock()); - const ElementType* e = data.elements.getData(); + const ElementType* e = data.elements.get(); const ElementType* const end_ = e + numUsed; for (; e != end_; ++e) if (elementToLookFor == *e) - return static_cast (e - data.elements.getData()); + return static_cast (e - data.elements.get()); return -1; } @@ -376,7 +376,7 @@ public: bool contains (ParameterType elementToLookFor) const { const ScopedLockType lock (getLock()); - const ElementType* e = data.elements.getData(); + const ElementType* e = data.elements.get(); const ElementType* const end_ = e + numUsed; for (; e != end_; ++e) @@ -719,8 +719,8 @@ public: void resize (const int targetNumItems) { jassert (targetNumItems >= 0); + auto numToAdd = targetNumItems - numUsed; - const int numToAdd = targetNumItems - numUsed; if (numToAdd > 0) insertMultiple (numUsed, ElementType(), numToAdd); else if (numToAdd < 0) @@ -743,7 +743,7 @@ public: int addSorted (ElementComparator& comparator, ParameterType newElement) { const ScopedLockType lock (getLock()); - const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newElement, 0, numUsed); + auto index = findInsertIndexInSortedArray (comparator, data.elements.get(), newElement, 0, numUsed); insert (index, newElement); return index; } @@ -1197,7 +1197,7 @@ public: const ScopedLockType lock (getLock()); ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this // avoids getting warning messages about the parameter being unused - sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems); + sortArray (comparator, data.elements.get(), 0, size() - 1, retainOrderOfEquivalentItems); } //============================================================================== diff --git a/modules/juce_core/containers/juce_OwnedArray.h b/modules/juce_core/containers/juce_OwnedArray.h index 4bb502814c..4edc190683 100644 --- a/modules/juce_core/containers/juce_OwnedArray.h +++ b/modules/juce_core/containers/juce_OwnedArray.h @@ -233,12 +233,12 @@ public: int indexOf (const ObjectClass* objectToLookFor) const noexcept { const ScopedLockType lock (getLock()); - ObjectClass* const* e = data.elements.getData(); + ObjectClass* const* e = data.elements.get(); ObjectClass* const* const end_ = e + numUsed; for (; e != end_; ++e) if (objectToLookFor == *e) - return static_cast (e - data.elements.getData()); + return static_cast (e - data.elements.get()); return -1; } @@ -251,7 +251,7 @@ public: bool contains (const ObjectClass* objectToLookFor) const noexcept { const ScopedLockType lock (getLock()); - ObjectClass* const* e = data.elements.getData(); + ObjectClass* const* e = data.elements.get(); ObjectClass* const* const end_ = e + numUsed; for (; e != end_; ++e) @@ -526,7 +526,7 @@ public: ignoreUnused (comparator); // if you pass in an object with a static compareElements() method, this // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); - const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + const int index = findInsertIndexInSortedArray (comparator, data.elements.get(), newObject, 0, numUsed); insert (index, newObject); return index; } @@ -648,7 +648,7 @@ public: void removeObject (const ObjectClass* objectToRemove, bool deleteObject = true) { const ScopedLockType lock (getLock()); - ObjectClass** const e = data.elements.getData(); + ObjectClass** const e = data.elements.get(); for (int i = 0; i < numUsed; ++i) { @@ -858,7 +858,7 @@ public: // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); - sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems); + sortArray (comparator, data.elements.get(), 0, size() - 1, retainOrderOfEquivalentItems); } //============================================================================== diff --git a/modules/juce_core/containers/juce_ReferenceCountedArray.h b/modules/juce_core/containers/juce_ReferenceCountedArray.h index 64eb2d5312..7c10c9c690 100644 --- a/modules/juce_core/containers/juce_ReferenceCountedArray.h +++ b/modules/juce_core/containers/juce_ReferenceCountedArray.h @@ -274,13 +274,13 @@ public: int indexOf (const ObjectClass* const objectToLookFor) const noexcept { const ScopedLockType lock (getLock()); - ObjectClass** e = data.elements.getData(); + ObjectClass** e = data.elements.get(); ObjectClass** const endPointer = e + numUsed; while (e != endPointer) { if (objectToLookFor == *e) - return static_cast (e - data.elements.getData()); + return static_cast (e - data.elements.get()); ++e; } @@ -296,7 +296,7 @@ public: bool contains (const ObjectClass* const objectToLookFor) const noexcept { const ScopedLockType lock (getLock()); - ObjectClass** e = data.elements.getData(); + ObjectClass** e = data.elements.get(); ObjectClass** const endPointer = e + numUsed; while (e != endPointer) @@ -483,7 +483,7 @@ public: int addSorted (ElementComparator& comparator, ObjectClass* newObject) noexcept { const ScopedLockType lock (getLock()); - const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + const int index = findInsertIndexInSortedArray (comparator, data.elements.get(), newObject, 0, numUsed); insert (index, newObject); return index; } @@ -498,7 +498,7 @@ public: ObjectClass* newObject) noexcept { const ScopedLockType lock (getLock()); - const int index = findInsertIndexInSortedArray (comparator, data.elements.getData(), newObject, 0, numUsed); + const int index = findInsertIndexInSortedArray (comparator, data.elements.get(), newObject, 0, numUsed); if (index > 0 && comparator.compareElements (newObject, data.elements [index - 1]) == 0) set (index - 1, newObject); // replace an existing object that matches @@ -843,7 +843,7 @@ public: // avoids getting warning messages about the parameter being unused const ScopedLockType lock (getLock()); - sortArray (comparator, data.elements.getData(), 0, size() - 1, retainOrderOfEquivalentItems); + sortArray (comparator, data.elements.get(), 0, size() - 1, retainOrderOfEquivalentItems); } //============================================================================== diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm index 78cab85051..a88b4d444f 100644 --- a/modules/juce_core/native/juce_mac_Files.mm +++ b/modules/juce_core/native/juce_mac_Files.mm @@ -237,7 +237,7 @@ File File::getSpecialLocation (const SpecialLocationType type) HeapBlock buffer; buffer.calloc (size + 8); - _NSGetExecutablePath (buffer.getData(), &size); + _NSGetExecutablePath (buffer.get(), &size); return File (String::fromUTF8 (buffer, (int) size)); } diff --git a/modules/juce_core/native/juce_mac_Strings.mm b/modules/juce_core/native/juce_mac_Strings.mm index 62f9d8717b..e8996ba5e0 100644 --- a/modules/juce_core/native/juce_mac_Strings.mm +++ b/modules/juce_core/native/juce_mac_Strings.mm @@ -32,8 +32,8 @@ String String::fromCFString (CFStringRef cfString) HeapBlock utf8 ((size_t) bytesNeeded + 1); CFStringGetBytes (cfString, range, kCFStringEncodingUTF8, 0, false, utf8, bytesNeeded + 1, nullptr); - return String (CharPointer_UTF8 ((const CharPointer_UTF8::CharType*) utf8.getData()), - CharPointer_UTF8 ((const CharPointer_UTF8::CharType*) utf8.getData() + bytesNeeded)); + return String (CharPointer_UTF8 ((const CharPointer_UTF8::CharType*) utf8.get()), + CharPointer_UTF8 ((const CharPointer_UTF8::CharType*) utf8.get() + bytesNeeded)); } CFStringRef String::toCFString() const @@ -89,7 +89,7 @@ String String::convertToPrecomposedUnicode() const bytesNeeded, &bytesRead, &outputBufferSize, tempOut) == noErr) { - result = String (CharPointer_UTF16 ((CharPointer_UTF16::CharType*) tempOut.getData())); + result = String (CharPointer_UTF16 ((CharPointer_UTF16::CharType*) tempOut.get())); } DisposeUnicodeToTextInfo (&conversionInfo); diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index db81b1991b..a3f97d208f 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -144,7 +144,7 @@ String SystemStats::getDeviceDescription() { HeapBlock model (size); if (sysctlbyname ("hw.model", model, &size, nullptr, 0) >= 0) - return model.getData(); + return model.get(); } return {}; #endif diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index 4264cace89..9505dd89b6 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -61,12 +61,12 @@ struct FallbackDownloadTask : public URL::DownloadTask, const int max = jmin ((int) bufferSize, contentLength < 0 ? std::numeric_limits::max() : static_cast (contentLength - downloaded)); - const int actual = stream->read (buffer.getData(), max); + const int actual = stream->read (buffer.get(), max); if (actual < 0 || threadShouldExit() || stream->isError()) break; - if (! fileStream->write (buffer.getData(), static_cast (actual))) + if (! fileStream->write (buffer.get(), static_cast (actual))) { error = true; break; diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 311117b012..5f2ac413de 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -1868,7 +1868,7 @@ String String::formattedRaw (const char* pf, ...) #if JUCE_ANDROID HeapBlock temp (bufferSize); - int num = (int) vsnprintf (temp.getData(), bufferSize - 1, pf, args); + int num = (int) vsnprintf (temp.get(), bufferSize - 1, pf, args); if (num >= static_cast (bufferSize)) num = -1; #else @@ -1880,7 +1880,7 @@ String String::formattedRaw (const char* pf, ...) #else vswprintf #endif - (temp.getData(), bufferSize - 1, wideCharVersion.toWideCharPointer(), args); + (temp.get(), bufferSize - 1, wideCharVersion.toWideCharPointer(), args); #endif va_end (args); diff --git a/modules/juce_graphics/geometry/juce_PathIterator.cpp b/modules/juce_graphics/geometry/juce_PathIterator.cpp index f3fbe128ab..d56cd436a1 100644 --- a/modules/juce_graphics/geometry/juce_PathIterator.cpp +++ b/modules/juce_graphics/geometry/juce_PathIterator.cpp @@ -51,7 +51,7 @@ PathFlatteningIterator::~PathFlatteningIterator() bool PathFlatteningIterator::isLastInSubpath() const noexcept { - return stackPos == stackBase.getData() + return stackPos == stackBase.get() && (index >= path.numElements || isMarker (points[index], Path::moveMarker)); } diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h index 5cbb679e38..67b9b561c0 100644 --- a/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -996,10 +996,10 @@ namespace EdgeTableFillers } y = y_; - generate (scratchBuffer.getData(), x, width); + generate (scratchBuffer.get(), x, width); et.clipLineToMask (x, y_, - reinterpret_cast (scratchBuffer.getData()) + SrcPixelType::indexA, + reinterpret_cast (scratchBuffer.get()) + SrcPixelType::indexA, sizeof (SrcPixelType), width); } diff --git a/modules/juce_opengl/opengl/juce_OpenGLImage.cpp b/modules/juce_opengl/opengl/juce_OpenGLImage.cpp index 027a90a6ad..36a1e1733b 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLImage.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLImage.cpp @@ -156,7 +156,7 @@ private: DataReleaser* r = new DataReleaser (frameBuffer, x, y, bitmapData.width, bitmapData.height); bitmapData.dataReleaser = r; - bitmapData.data = (uint8*) r->data.getData(); + bitmapData.data = (uint8*) r->data.get(); bitmapData.lineStride = (bitmapData.width * bitmapData.pixelStride + 3) & ~3; ReaderType::read (frameBuffer, bitmapData, x, y);