| @@ -65,7 +65,7 @@ public: | |||
| // We need to clear the output buffers before returning, in case they're full of junk.. | |||
| for (int j = 0; j < numOutputChannels; ++j) | |||
| if (float* outputChannel = outputChannelData[j]) | |||
| zeromem (outputChannel, sizeof (float) * (size_t) numberOfSamples); | |||
| zeromem (outputChannel, (size_t) numberOfSamples * sizeof (float)); | |||
| } | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LiveScrollingAudioDisplay) | |||
| @@ -175,7 +175,7 @@ public: | |||
| // We need to clear the output buffers, in case they're full of junk.. | |||
| for (int i = 0; i < numOutputChannels; ++i) | |||
| if (outputChannelData[i] != nullptr) | |||
| zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples); | |||
| zeromem (outputChannelData[i], (size_t) numSamples * sizeof (float)); | |||
| } | |||
| } | |||
| @@ -149,6 +149,8 @@ struct SineWaveVoice : public SynthesiserVoice | |||
| } | |||
| } | |||
| using SynthesiserVoice::renderNextBlock; | |||
| private: | |||
| double currentAngle = 0.0, angleDelta = 0.0, level = 0.0, tailOff = 0.0; | |||
| }; | |||
| @@ -828,6 +828,8 @@ public: | |||
| } | |||
| } | |||
| using MPESynthesiserVoice::renderNextBlock; | |||
| private: | |||
| //============================================================================== | |||
| float getNextSample() noexcept | |||
| @@ -150,7 +150,7 @@ public: | |||
| { CB::down } | |||
| }; | |||
| for (auto i = 0; i < numElementsInArray (map); ++i) | |||
| for (int i = 0; i < numElementsInArray (map); ++i) | |||
| if (map[i].contains (f)) | |||
| return i; | |||
| @@ -108,6 +108,8 @@ public: | |||
| } | |||
| } | |||
| using SynthesiserVoice::renderNextBlock; | |||
| /** Returns the next sample */ | |||
| double getSample() | |||
| { | |||
| @@ -173,7 +173,9 @@ private: | |||
| //============================================================================== | |||
| void componentMovedOrResized (bool, bool) override {} | |||
| using ComponentListener::componentMovedOrResized; | |||
| void componentVisibilityChanged() override {} | |||
| using ComponentListener::componentVisibilityChanged; | |||
| void componentPeerChanged() override | |||
| { | |||
| auto* newPeer = getPeer(); | |||
| @@ -97,6 +97,8 @@ public: | |||
| CallOutBox::launchAsynchronously (colourSelector, getScreenBounds(), nullptr); | |||
| } | |||
| using TextButton::clicked; | |||
| void changeListenerCallback (ChangeBroadcaster* source) override | |||
| { | |||
| if (auto* cs = dynamic_cast<ColourSelector*> (source)) | |||
| @@ -160,6 +160,8 @@ public: | |||
| } | |||
| } | |||
| using SynthesiserVoice::renderNextBlock; | |||
| private: | |||
| double currentAngle = 0.0; | |||
| double angleDelta = 0.0; | |||
| @@ -170,6 +170,8 @@ public: | |||
| buffer.applyGain (0.8f); | |||
| } | |||
| using InternalPlugin::processBlock; | |||
| private: | |||
| //============================================================================== | |||
| class SineWaveSound : public SynthesiserSound | |||
| @@ -282,6 +284,8 @@ private: | |||
| } | |||
| } | |||
| using SynthesiserVoice::renderNextBlock; | |||
| private: | |||
| double currentAngle, angleDelta, level, tailOff; | |||
| }; | |||
| @@ -337,6 +341,8 @@ public: | |||
| buffer.clear (ch, 0, buffer.getNumSamples()); | |||
| } | |||
| using InternalPlugin::processBlock; | |||
| private: | |||
| Reverb reverb; | |||
| }; | |||
| @@ -201,6 +201,8 @@ private: | |||
| if (auto* l = findParentComponentOfClass<LaunchClassOverlayComponent>()) | |||
| l->launch(); | |||
| } | |||
| using Button::clicked; | |||
| }; | |||
| void launch() | |||
| @@ -242,6 +242,8 @@ private: | |||
| classItem.launchEditor(); | |||
| } | |||
| using Button::clicked; | |||
| const ClassItem& classItem; | |||
| bool isShowCode; | |||
| }; | |||
| @@ -185,6 +185,8 @@ public: | |||
| CallOutBox::launchAsynchronously (w, getScreenBounds(), nullptr); | |||
| } | |||
| using Button::clicked; | |||
| void setInfoToDisplay (const String& infoToDisplay) | |||
| { | |||
| if (infoToDisplay.isNotEmpty()) | |||
| @@ -49,6 +49,8 @@ struct SlidingPanelComponent::DotButton : public Button | |||
| owner.goToTab (index); | |||
| } | |||
| using Button::clicked; | |||
| SlidingPanelComponent& owner; | |||
| int index; | |||
| }; | |||
| @@ -53,7 +53,6 @@ public: | |||
| /** Animates the window to the desired tab. */ | |||
| void goToTab (int targetTabIndex); | |||
| //============================================================================== | |||
| /** @internal */ | |||
| void resized() override; | |||
| @@ -127,6 +127,8 @@ private: | |||
| Analytics::getInstance()->logEvent ("Start Page Button", data, ProjucerAnalyticsEvent::startPageEvent); | |||
| } | |||
| using DrawableButton::clicked; | |||
| std::unique_ptr<Drawable> thumb, hoverBackground; | |||
| String name, description; | |||
| @@ -483,7 +483,9 @@ public: | |||
| static void test (UnitTest& unitTest, bool inPlace, Random& r) | |||
| { | |||
| const int numSamples = 2048; | |||
| int32 original[numSamples], converted[numSamples], reversed[numSamples]; | |||
| int32 original [(size_t) numSamples], | |||
| converted[(size_t) numSamples], | |||
| reversed [(size_t) numSamples]; | |||
| { | |||
| AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> d (original); | |||
| @@ -340,7 +340,7 @@ public: | |||
| if (newNumSamples != size || newNumChannels != numChannels) | |||
| { | |||
| auto allocatedSamplesPerChannel = ((size_t) newNumSamples + 3) & ~3u; | |||
| auto channelListSize = ((sizeof (Type*) * (size_t) (newNumChannels + 1)) + 15) & ~15u; | |||
| auto channelListSize = ((static_cast<size_t> (1 + newNumChannels) * sizeof (Type*)) + 15) & ~15u; | |||
| auto newTotalBytes = ((size_t) newNumChannels * (size_t) allocatedSamplesPerChannel * sizeof (Type)) | |||
| + channelListSize + 32; | |||
| @@ -1076,7 +1076,7 @@ private: | |||
| void allocateData() | |||
| { | |||
| jassert (size >= 0); | |||
| auto channelListSize = sizeof (Type*) * (size_t) (numChannels + 1); | |||
| auto channelListSize = (size_t) (numChannels + 1) * sizeof (Type*); | |||
| allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (Type) + channelListSize + 32; | |||
| allocatedData.malloc (allocatedBytes); | |||
| channels = reinterpret_cast<Type**> (allocatedData.get()); | |||
| @@ -274,11 +274,6 @@ private: | |||
| AudioBuffer<float> tempBuffer; | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // Note the new parameters for this method. | |||
| virtual int stopNote (bool) { return 0; } | |||
| #endif | |||
| JUCE_LEAK_DETECTOR (SynthesiserVoice) | |||
| }; | |||
| @@ -814,7 +814,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat | |||
| else | |||
| { | |||
| for (int i = 0; i < numOutputChannels; ++i) | |||
| zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples); | |||
| zeromem (outputChannelData[i], (size_t) numSamples * sizeof (float)); | |||
| } | |||
| if (testSound != nullptr) | |||
| @@ -424,7 +424,7 @@ private: | |||
| else | |||
| { | |||
| for (int i = 0; i < numOutputChannels; ++i) | |||
| zeromem (outputChannelData[i], sizeof (float) * static_cast<size_t> (numFrames)); | |||
| zeromem (outputChannelData[i], (size_t) (numFrames) * sizeof (float)); | |||
| } | |||
| } | |||
| @@ -261,7 +261,7 @@ public: | |||
| unsigned int periods = 4; | |||
| snd_pcm_uframes_t samplesPerPeriod = (snd_pcm_uframes_t) bufferSize; | |||
| if (JUCE_ALSA_FAILED (snd_pcm_hw_params_set_rate_near (handle, hwParams, &sampleRate, 0)) | |||
| if (JUCE_ALSA_FAILED (snd_pcm_hw_params_set_rate_near (handle, hwParams, &sampleRate, nullptr)) | |||
| || JUCE_ALSA_FAILED (snd_pcm_hw_params_set_channels (handle, hwParams, (unsigned int ) numChannels)) | |||
| || JUCE_ALSA_FAILED (snd_pcm_hw_params_set_periods_near (handle, hwParams, &periods, &dir)) | |||
| || JUCE_ALSA_FAILED (snd_pcm_hw_params_set_period_size_near (handle, hwParams, &samplesPerPeriod, &dir)) | |||
| @@ -722,7 +722,7 @@ public: | |||
| else | |||
| { | |||
| for (int i = 0; i < outputChannelDataForCallback.size(); ++i) | |||
| zeromem (outputChannelDataForCallback[i], sizeof (float) * (size_t) bufferSize); | |||
| zeromem (outputChannelDataForCallback[i], (size_t) bufferSize * sizeof (float)); | |||
| } | |||
| } | |||
| @@ -104,14 +104,14 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||
| for (int i = 0; i < numOutputs; ++i) | |||
| { | |||
| channels[numActiveChans] = outputChans[i]; | |||
| memcpy (channels[numActiveChans], inputChans[i], sizeof (float) * (size_t) numSamples); | |||
| memcpy (channels[numActiveChans], inputChans[i], (size_t) numSamples * sizeof (float)); | |||
| ++numActiveChans; | |||
| } | |||
| for (int i = numOutputs; i < numInputs; ++i) | |||
| { | |||
| channels[numActiveChans] = tempBuffer.getWritePointer (i - numOutputs); | |||
| memcpy (channels[numActiveChans], inputChans[i], sizeof (float) * (size_t) numSamples); | |||
| memcpy (channels[numActiveChans], inputChans[i], (size_t) numSamples * sizeof (float)); | |||
| ++numActiveChans; | |||
| } | |||
| } | |||
| @@ -120,14 +120,14 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||
| for (int i = 0; i < numInputs; ++i) | |||
| { | |||
| channels[numActiveChans] = outputChans[i]; | |||
| memcpy (channels[numActiveChans], inputChans[i], sizeof (float) * (size_t) numSamples); | |||
| memcpy (channels[numActiveChans], inputChans[i], (size_t) numSamples * sizeof (float)); | |||
| ++numActiveChans; | |||
| } | |||
| for (int i = numInputs; i < numOutputs; ++i) | |||
| { | |||
| channels[numActiveChans] = outputChans[i]; | |||
| zeromem (channels[numActiveChans], sizeof (float) * (size_t) numSamples); | |||
| zeromem (channels[numActiveChans], (size_t) numSamples * sizeof (float)); | |||
| ++numActiveChans; | |||
| } | |||
| } | |||
| @@ -146,7 +146,7 @@ void AudioSourcePlayer::audioDeviceIOCallback (const float** inputChannelData, | |||
| { | |||
| for (int i = 0; i < totalNumOutputChannels; ++i) | |||
| if (outputChannelData[i] != nullptr) | |||
| zeromem (outputChannelData[i], sizeof (float) * (size_t) numSamples); | |||
| zeromem (outputChannelData[i], (size_t) numSamples * sizeof (float)); | |||
| } | |||
| } | |||
| @@ -846,7 +846,7 @@ public: | |||
| { | |||
| jassertfalse; // you must make sure that the window contains all the samples you're going to attempt to read. | |||
| zeromem (result, sizeof (float) * (size_t) num); | |||
| zeromem (result, (size_t) num * sizeof (float)); | |||
| return; | |||
| } | |||
| @@ -907,6 +907,8 @@ public: | |||
| } | |||
| } | |||
| using AudioFormatReader::readMaxLevels; | |||
| private: | |||
| const bool littleEndian; | |||
| @@ -86,6 +86,7 @@ public: | |||
| int bitsPerSample, | |||
| const StringPairArray& metadataValues, | |||
| int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| private: | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AiffAudioFormat) | |||
| @@ -475,7 +475,7 @@ public: | |||
| while (numSamples > 0) | |||
| { | |||
| auto numThisTime = jmin (8192, numSamples); | |||
| auto numBytes = sizeof (float) * (size_t) numThisTime; | |||
| auto numBytes = (size_t) numThisTime * sizeof (float); | |||
| audioDataBlock.ensureSize (numBytes * numChannels, false); | |||
| auto* data = static_cast<float*> (audioDataBlock.getData()); | |||
| @@ -76,6 +76,7 @@ public: | |||
| int bitsPerSample, | |||
| const StringPairArray& metadataValues, | |||
| int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| private: | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CoreAudioFormat) | |||
| @@ -122,6 +122,13 @@ namespace FlacNamespace | |||
| #endif | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #pragma GCC diagnostic ignored "-Wconversion" | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #endif | |||
| #if JUCE_INTEL | |||
| #if JUCE_32BIT | |||
| #define FLAC__CPU_IA32 1 | |||
| @@ -161,6 +168,10 @@ namespace FlacNamespace | |||
| #if JUCE_CLANG | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| } | |||
| #undef max | |||
| @@ -240,7 +251,7 @@ public: | |||
| if (destSamples[i] != nullptr) | |||
| memcpy (destSamples[i] + startOffsetInDestBuffer, | |||
| reservoir.getReadPointer (i, (int) (startSampleInFile - reservoirStart)), | |||
| sizeof (int) * (size_t) num); | |||
| (size_t) num * sizeof (int)); | |||
| startOffsetInDestBuffer += num; | |||
| startSampleInFile += num; | |||
| @@ -277,7 +288,7 @@ public: | |||
| { | |||
| for (int i = numDestChannels; --i >= 0;) | |||
| if (destSamples[i] != nullptr) | |||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||
| zeromem (destSamples[i] + startOffsetInDestBuffer, (size_t) numSamples * sizeof (int)); | |||
| } | |||
| return true; | |||
| @@ -64,6 +64,8 @@ public: | |||
| int bitsPerSample, | |||
| const StringPairArray& metadataValues, | |||
| int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| private: | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FlacAudioFormat) | |||
| }; | |||
| @@ -67,6 +67,7 @@ public: | |||
| AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse, | |||
| unsigned int numberOfChannels, int bitsPerSample, | |||
| const StringPairArray& metadataValues, int qualityOptionIndex); | |||
| using AudioFormat::createWriterFor; | |||
| private: | |||
| File lameApp; | |||
| @@ -496,8 +496,8 @@ struct MP3Frame | |||
| mpeg25 = (header & (1 << 20)) == 0; | |||
| lsf = mpeg25 ? 1 : ((header & (1 << 19)) ? 0 : 1); | |||
| layer = 4 - ((header >> 17) & 3); | |||
| sampleRateIndex = mpeg25 ? (6 + ((header >> 10) & 3)) : ((int) ((header >> 10) & 3) + (lsf * 3)); | |||
| layer = (int) (4 - ((header >> 17) & 3)); | |||
| sampleRateIndex = (int) ((header >> 10) & 3) + (mpeg25 ? 6 : (lsf * 3)); | |||
| crc16FollowsHeader = ((header >> 16) & 1) == 0; | |||
| bitrateIndex = (header >> 12) & 15; | |||
| padding = (header >> 9) & 1; | |||
| @@ -1625,7 +1625,7 @@ private: | |||
| static bool isValidHeader (uint32 header, int oldLayer) noexcept | |||
| { | |||
| int newLayer = 4 - ((header >> 17) & 3); | |||
| auto newLayer = (int) (4 - ((header >> 17) & 3)); | |||
| return (header & 0xffe00000) == 0xffe00000 | |||
| && newLayer != 4 | |||
| @@ -1655,8 +1655,8 @@ private: | |||
| if (numBits <= 0 || bufferPointer == nullptr) | |||
| return 0; | |||
| const uint32 result = ((((((bufferPointer[0] << 8) | bufferPointer[1]) << 8) | |||
| | bufferPointer[2]) << bitIndex) & 0xffffff) >> (24 - numBits); | |||
| const auto result = (uint32) (((((((bufferPointer[0] << 8) | bufferPointer[1]) << 8) | |||
| | bufferPointer[2]) << bitIndex) & 0xffffff) >> (24 - numBits)); | |||
| bitIndex += numBits; | |||
| bufferPointer += (bitIndex >> 3); | |||
| bitIndex &= 7; | |||
| @@ -1669,12 +1669,12 @@ private: | |||
| ++bitIndex; | |||
| bufferPointer += (bitIndex >> 3); | |||
| bitIndex &= 7; | |||
| return result >> 7; | |||
| return (uint32) (result >> 7); | |||
| } | |||
| uint32 getBitsUnchecked (int numBits) noexcept | |||
| { | |||
| const uint32 result = ((((bufferPointer[0] << 8) | bufferPointer[1]) << bitIndex) & 0xffff) >> (16 - numBits); | |||
| const auto result = (uint32) (((((bufferPointer[0] << 8) | bufferPointer[1]) << bitIndex) & 0xffff) >> (16 - numBits)); | |||
| bitIndex += numBits; | |||
| bufferPointer += (bitIndex >> 3); | |||
| bitIndex &= 7; | |||
| @@ -1912,9 +1912,10 @@ private: | |||
| getLayer3SideInfo2 (numChannels, msStereo, sampleRate, single); | |||
| int databits = 0; | |||
| for (int gr = 0; gr < granules; ++gr) | |||
| for (int ch = 0; ch < numChannels; ++ch) | |||
| databits += sideinfo.ch[ch].gr[gr].part2_3Length; | |||
| databits += (int) sideinfo.ch[ch].gr[gr].part2_3Length; | |||
| return databits - 8 * (int) sideinfo.mainDataStart; | |||
| } | |||
| @@ -2452,7 +2453,7 @@ private: | |||
| auto* xrpnt = (float*) xr; | |||
| auto part2remain = (int) granule.part2_3Length - part2bits; | |||
| zeromem (xrpnt, sizeof (float) * (size_t) (&xr[32][0] - xrpnt)); | |||
| zeromem (xrpnt, (size_t) (&xr[32][0] - xrpnt) * sizeof (float)); | |||
| auto bv = (int) granule.bigValues; | |||
| auto region1 = (int) granule.region1Start; | |||
| @@ -2549,8 +2550,8 @@ private: | |||
| if (x == 15) | |||
| { | |||
| max[lwin] = cb; | |||
| part2remain -= h->bits + 1; | |||
| x += getBits ((int) h->bits); | |||
| part2remain -= (int) (h->bits + 1); | |||
| x += (int) getBits ((int) h->bits); | |||
| *xrpnt = constants.nToThe4Over3[x] * (getOneBit() ? -v : v); | |||
| } | |||
| else if (x) | |||
| @@ -2567,8 +2568,8 @@ private: | |||
| if (y == 15) | |||
| { | |||
| max[lwin] = cb; | |||
| part2remain -= h->bits + 1; | |||
| y += getBits ((int) h->bits); | |||
| part2remain -= (int) (h->bits + 1); | |||
| y += (int) getBits ((int) h->bits); | |||
| *xrpnt = constants.nToThe4Over3[y] * (getOneBit() ? -v : v); | |||
| } | |||
| else if (y) | |||
| @@ -2709,8 +2710,8 @@ private: | |||
| if (x == 15) | |||
| { | |||
| max = cb; | |||
| part2remain -= h->bits + 1; | |||
| x += getBits ((int) h->bits); | |||
| part2remain -= (int) (h->bits + 1); | |||
| x += (int) getBits ((int) h->bits); | |||
| *xrpnt++ = constants.nToThe4Over3[x] * (getOneBit() ? -v : v); | |||
| } | |||
| else if (x) | |||
| @@ -2725,8 +2726,8 @@ private: | |||
| if (y == 15) | |||
| { | |||
| max = cb; | |||
| part2remain -= h->bits + 1; | |||
| y += getBits ((int) h->bits); | |||
| part2remain -= (int) (h->bits + 1); | |||
| y += (int) getBits ((int) h->bits); | |||
| *xrpnt++ = constants.nToThe4Over3[y] * (getOneBit() ? -v : v); | |||
| } | |||
| else if (y) | |||
| @@ -2788,7 +2789,7 @@ private: | |||
| } | |||
| } | |||
| zeromem (xrpnt, sizeof (float) * (size_t) (&xr[32][0] - xrpnt)); | |||
| zeromem (xrpnt, (size_t) (&xr[32][0] - xrpnt) * sizeof (float)); | |||
| granule.maxBandl = (uint32) (max + 1); | |||
| granule.maxb = (uint32) constants.longLimit[sampleRate][granule.maxBandl]; | |||
| @@ -3006,17 +3007,17 @@ public: | |||
| { | |||
| for (int i = numDestChannels; --i >= 0;) | |||
| if (destSamples[i] != nullptr) | |||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (float) * (size_t) numSamples); | |||
| zeromem (destSamples[i] + startOffsetInDestBuffer, (size_t) numSamples * sizeof (float)); | |||
| return false; | |||
| } | |||
| const int numToCopy = jmin (decodedEnd - decodedStart, numSamples); | |||
| float* const* const dst = reinterpret_cast<float**> (destSamples); | |||
| memcpy (dst[0] + startOffsetInDestBuffer, decoded0 + decodedStart, sizeof (float) * (size_t) numToCopy); | |||
| memcpy (dst[0] + startOffsetInDestBuffer, decoded0 + decodedStart, (size_t) numToCopy * sizeof (float)); | |||
| if (numDestChannels > 1 && dst[1] != nullptr) | |||
| memcpy (dst[1] + startOffsetInDestBuffer, (numChannels < 2 ? decoded0 : decoded1) + decodedStart, sizeof (float) * (size_t) numToCopy); | |||
| memcpy (dst[1] + startOffsetInDestBuffer, (numChannels < 2 ? decoded0 : decoded1) + decodedStart, (size_t) numToCopy * sizeof (float)); | |||
| startOffsetInDestBuffer += numToCopy; | |||
| decodedStart += numToCopy; | |||
| @@ -66,6 +66,7 @@ public: | |||
| AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse, | |||
| unsigned int numberOfChannels, int bitsPerSample, | |||
| const StringPairArray& metadataValues, int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| }; | |||
| #endif | |||
| @@ -49,7 +49,10 @@ namespace OggVorbisNamespace | |||
| #endif | |||
| #elif JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wconversion" | |||
| #pragma GCC diagnostic ignored "-Wshadow" | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #include "oggvorbis/vorbisenc.h" | |||
| @@ -178,7 +181,7 @@ public: | |||
| if (destSamples[i] != nullptr) | |||
| memcpy (destSamples[i] + startOffsetInDestBuffer, | |||
| reservoir.getReadPointer (i, (int) (startSampleInFile - reservoirStart)), | |||
| sizeof (float) * (size_t) numToUse); | |||
| (size_t) numToUse * sizeof (float)); | |||
| startSampleInFile += numToUse; | |||
| numSamples -= numToUse; | |||
| @@ -213,7 +216,7 @@ public: | |||
| jassert (samps <= numToRead); | |||
| for (int i = jmin ((int) numChannels, reservoir.getNumChannels()); --i >= 0;) | |||
| memcpy (reservoir.getWritePointer (i, offset), dataIn[i], sizeof (float) * (size_t) samps); | |||
| memcpy (reservoir.getWritePointer (i, offset), dataIn[i], (size_t) samps * sizeof (float)); | |||
| numToRead -= samps; | |||
| offset += samps; | |||
| @@ -228,7 +231,7 @@ public: | |||
| { | |||
| for (int i = numDestChannels; --i >= 0;) | |||
| if (destSamples[i] != nullptr) | |||
| zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||
| zeromem (destSamples[i] + startOffsetInDestBuffer, (size_t) numSamples * sizeof (int)); | |||
| } | |||
| return true; | |||
| @@ -91,6 +91,7 @@ public: | |||
| int bitsPerSample, | |||
| const StringPairArray& metadataValues, | |||
| int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| private: | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OggVorbisAudioFormat) | |||
| @@ -1001,7 +1001,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| bytesPerFrame = numChannels * bitsPerSample / 8; | |||
| bytesPerFrame = (int) (numChannels * bitsPerSample / 8); | |||
| } | |||
| if (format == 3) | |||
| @@ -1581,7 +1581,7 @@ public: | |||
| { | |||
| jassertfalse; // you must make sure that the window contains all the samples you're going to attempt to read. | |||
| zeromem (result, sizeof (float) * (size_t) num); | |||
| zeromem (result, (size_t) num * sizeof (float)); | |||
| return; | |||
| } | |||
| @@ -1626,6 +1626,8 @@ public: | |||
| } | |||
| } | |||
| using AudioFormatReader::readMaxLevels; | |||
| private: | |||
| template <typename SampleType> | |||
| void scanMinAndMax (int64 startSampleInFile, int64 numSamples, Range<float>* results, int numChannelsToRead) const noexcept | |||
| @@ -210,6 +210,7 @@ public: | |||
| int bitsPerSample, | |||
| const StringPairArray& metadataValues, | |||
| int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| //============================================================================== | |||
| /** Utility function to replace the metadata in a wav file with a new set of values. | |||
| @@ -55,6 +55,7 @@ public: | |||
| AudioFormatWriter* createWriterFor (OutputStream*, double sampleRateToUse, | |||
| unsigned int numberOfChannels, int bitsPerSample, | |||
| const StringPairArray& metadataValues, int qualityOptionIndex) override; | |||
| using AudioFormat::createWriterFor; | |||
| }; | |||
| #endif | |||
| @@ -75,7 +75,7 @@ bool AudioFormatReader::read (int* const* destChannels, | |||
| for (int i = numDestChannels; --i >= 0;) | |||
| if (auto d = destChannels[i]) | |||
| zeromem (d, sizeof (int) * (size_t) silence); | |||
| zeromem (d, (size_t) silence * sizeof (int)); | |||
| startOffsetInDestBuffer += silence; | |||
| numSamplesToRead -= silence; | |||
| @@ -175,7 +175,7 @@ void AudioFormatReader::read (AudioBuffer<float>* buffer, | |||
| // if the target's stereo and the source is mono, dupe the first channel.. | |||
| if (numTargetChannels > 1 && (chans[0] == nullptr || chans[1] == nullptr)) | |||
| memcpy (dests[1], dests[0], sizeof (float) * (size_t) numSamples); | |||
| memcpy (dests[1], dests[0], (size_t) numSamples * sizeof (float)); | |||
| if (! usesFloatingPointData) | |||
| convertFixedToFloat (dests, 2, numSamples); | |||
| @@ -314,7 +314,7 @@ protected: | |||
| { | |||
| for (int i = numDestChannels; --i >= 0;) | |||
| if (destChannels[i] != nullptr) | |||
| zeromem (destChannels[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||
| zeromem (destChannels[i] + startOffsetInDestBuffer, (size_t) numSamples * sizeof (int)); | |||
| numSamples = (int) samplesAvailable; | |||
| } | |||
| @@ -73,6 +73,7 @@ public: | |||
| void readMaxLevels (int64 startSample, int64 numSamples, | |||
| Range<float>* results, int numChannelsToRead) override; | |||
| using AudioFormatReader::readMaxLevels; | |||
| private: | |||
| //============================================================================== | |||
| @@ -138,6 +138,7 @@ public: | |||
| void controllerMoved (int controllerNumber, int newValue) override; | |||
| void renderNextBlock (AudioBuffer<float>&, int startSample, int numSamples) override; | |||
| using SynthesiserVoice::renderNextBlock; | |||
| private: | |||
| //============================================================================== | |||
| @@ -917,7 +917,7 @@ public: | |||
| } | |||
| // Is this a meter? | |||
| if (((param->getCategory() & 0xffff0000) >> 16) == 2) | |||
| if ((((unsigned int) param->getCategory() & 0xffff0000) >> 16) == 2) | |||
| { | |||
| outParameterInfo.flags &= ~kAudioUnitParameterFlag_IsWritable; | |||
| outParameterInfo.flags |= kAudioUnitParameterFlag_MeterReadOnly | kAudioUnitParameterFlag_DisplayLogarithmic; | |||
| @@ -77,6 +77,12 @@ | |||
| #pragma clang diagnostic ignored "-Wnon-virtual-dtor" | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wshadow" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #ifdef _MSC_VER | |||
| #pragma warning (push) | |||
| #pragma warning (disable : 4458) | |||
| @@ -106,6 +112,10 @@ using namespace juce; | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| //============================================================================== | |||
| #ifdef _MSC_VER | |||
| #pragma pack (push, 8) | |||
| @@ -498,7 +508,7 @@ public: | |||
| if (i < numIn) | |||
| { | |||
| if (chan != inputs[i]) | |||
| memcpy (chan, inputs[i], sizeof (FloatType) * (size_t) numSamples); | |||
| memcpy (chan, inputs[i], (size_t) numSamples * sizeof (FloatType)); | |||
| } | |||
| else | |||
| { | |||
| @@ -525,7 +535,7 @@ public: | |||
| for (i = 0; i < numOut; ++i) | |||
| if (auto* chan = tmpBuffers.tempChannels.getUnchecked(i)) | |||
| if (auto* dest = outputs[i]) | |||
| memcpy (dest, chan, sizeof (FloatType) * (size_t) numSamples); | |||
| memcpy (dest, chan, (size_t) numSamples * sizeof (FloatType)); | |||
| } | |||
| } | |||
| @@ -630,7 +640,7 @@ public: | |||
| if (vstEffect.flags & Vst2::effFlagsIsSynth || JucePlugin_WantsMidiInput || JucePlugin_IsMidiEffect) | |||
| { | |||
| if (hostCallback != nullptr) | |||
| hostCallback (&vstEffect, Vst2::audioMasterWantMidi, 0, 1, 0, 0); | |||
| hostCallback (&vstEffect, Vst2::audioMasterWantMidi, 0, 1, nullptr, 0); | |||
| } | |||
| if (getHostType().isAbletonLive() | |||
| @@ -680,7 +690,7 @@ public: | |||
| | Vst2::kVstTimeSigValid | Vst2::kVstSmpteValid | |||
| | Vst2::kVstClockValid; | |||
| auto result = hostCallback (&vstEffect, Vst2::audioMasterGetTime, 0, flags, 0, 0); | |||
| auto result = hostCallback (&vstEffect, Vst2::audioMasterGetTime, 0, flags, nullptr, 0); | |||
| ti = reinterpret_cast<Vst2::VstTimeInfo*> (result); | |||
| } | |||
| @@ -796,19 +806,19 @@ public: | |||
| } | |||
| if (hostCallback != nullptr) | |||
| hostCallback (&vstEffect, Vst2::audioMasterAutomate, index, 0, 0, newValue); | |||
| hostCallback (&vstEffect, Vst2::audioMasterAutomate, index, 0, nullptr, newValue); | |||
| } | |||
| void audioProcessorParameterChangeGestureBegin (AudioProcessor*, int index) override | |||
| { | |||
| if (hostCallback != nullptr) | |||
| hostCallback (&vstEffect, Vst2::audioMasterBeginEdit, index, 0, 0, 0); | |||
| hostCallback (&vstEffect, Vst2::audioMasterBeginEdit, index, 0, nullptr, 0); | |||
| } | |||
| void audioProcessorParameterChangeGestureEnd (AudioProcessor*, int index) override | |||
| { | |||
| if (hostCallback != nullptr) | |||
| hostCallback (&vstEffect, Vst2::audioMasterEndEdit, index, 0, 0, 0); | |||
| hostCallback (&vstEffect, Vst2::audioMasterEndEdit, index, 0, nullptr, 0); | |||
| } | |||
| void parameterValueChanged (int, float newValue) override | |||
| @@ -824,7 +834,7 @@ public: | |||
| vstEffect.initialDelay = processor->getLatencySamples(); | |||
| if (hostCallback != nullptr) | |||
| hostCallback (&vstEffect, Vst2::audioMasterUpdateDisplay, 0, 0, 0, 0); | |||
| hostCallback (&vstEffect, Vst2::audioMasterUpdateDisplay, 0, 0, nullptr, 0); | |||
| triggerAsyncUpdate(); | |||
| } | |||
| @@ -832,7 +842,7 @@ public: | |||
| void handleAsyncUpdate() override | |||
| { | |||
| if (hostCallback != nullptr) | |||
| hostCallback (&vstEffect, Vst2::audioMasterIOChanged, 0, 0, 0, 0); | |||
| hostCallback (&vstEffect, Vst2::audioMasterIOChanged, 0, 0, nullptr, 0); | |||
| } | |||
| bool getPinProperties (Vst2::VstPinProperties& properties, bool direction, int index) const | |||
| @@ -1446,7 +1456,7 @@ public: | |||
| const ScopedValueSetter<bool> inSizeWindowSetter (isInSizeWindow, true); | |||
| sizeWasSuccessful = (host (wrapper.getAEffect(), Vst2::audioMasterSizeWindow, | |||
| newWidth, newHeight, 0, 0) != 0); | |||
| newWidth, newHeight, nullptr, 0) != 0); | |||
| } | |||
| } | |||
| @@ -1569,7 +1579,7 @@ private: | |||
| bool isProcessLevelOffline() | |||
| { | |||
| return hostCallback != nullptr | |||
| && (int32) hostCallback (&vstEffect, Vst2::audioMasterGetCurrentProcessLevel, 0, 0, 0, 0) == 4; | |||
| && (int32) hostCallback (&vstEffect, Vst2::audioMasterGetCurrentProcessLevel, 0, 0, nullptr, 0) == 4; | |||
| } | |||
| static inline int32 convertHexVersionToDecimal (const unsigned int hexVersion) | |||
| @@ -1897,7 +1907,7 @@ private: | |||
| { | |||
| if (auto* param = juceParameters.getParamForIndex (args.index)) | |||
| { | |||
| const bool isMeter = (((param->getCategory() & 0xffff0000) >> 16) == 2); | |||
| const bool isMeter = ((((unsigned int) param->getCategory() & 0xffff0000) >> 16) == 2); | |||
| return (param->isAutomatable() && (! isMeter) ? 1 : 0); | |||
| } | |||
| @@ -2305,7 +2315,7 @@ namespace | |||
| try | |||
| { | |||
| if (audioMaster (0, Vst2::audioMasterVersion, 0, 0, 0, 0) != 0) | |||
| if (audioMaster (nullptr, Vst2::audioMasterVersion, 0, 0, nullptr, 0) != 0) | |||
| { | |||
| #if JUCE_LINUX | |||
| MessageManagerLock mmLock; | |||
| @@ -308,7 +308,7 @@ struct AudioUnitHelpers | |||
| static bool isLayoutSupported (const AudioProcessor& processor, | |||
| bool isInput, int busIdx, | |||
| int numChannels, | |||
| const short (&channelLayoutList) [numLayouts][2], | |||
| const short (&channelLayoutList) [(size_t) numLayouts][2], | |||
| bool hasLayoutMap = true) | |||
| { | |||
| if (const AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx)) | |||
| @@ -1052,7 +1052,7 @@ public: | |||
| for (AudioUnitElement j = 0; j < abl.mNumberBuffers; ++j) | |||
| { | |||
| abl.mBuffers[j].mNumberChannels = 1; | |||
| abl.mBuffers[j].mDataByteSize = (UInt32) (sizeof (float) * (size_t) numSamples); | |||
| abl.mBuffers[j].mDataByteSize = (UInt32) ((size_t) numSamples * sizeof (float)); | |||
| abl.mBuffers[j].mData = buffer.getWritePointer (chIdx++); | |||
| } | |||
| } | |||
| @@ -217,7 +217,7 @@ public: | |||
| //============================================================================== | |||
| // AudioPluginInstance methods: | |||
| void fillInPluginDescription (PluginDescription& desc) const | |||
| void fillInPluginDescription (PluginDescription& desc) const override | |||
| { | |||
| desc.name = getName(); | |||
| desc.fileOrIdentifier = module->file.getFullPathName(); | |||
| @@ -233,7 +233,7 @@ public: | |||
| desc.isInstrument = false; | |||
| } | |||
| const String getName() const | |||
| const String getName() const override | |||
| { | |||
| if (plugin != nullptr && plugin->Label != nullptr) | |||
| return plugin->Label; | |||
| @@ -249,16 +249,16 @@ public: | |||
| return module->file.hashCode(); | |||
| } | |||
| String getVersion() const { return LADSPA_VERSION; } | |||
| String getCategory() const { return "Effect"; } | |||
| String getVersion() const { return LADSPA_VERSION; } | |||
| String getCategory() const { return "Effect"; } | |||
| bool acceptsMidi() const { return false; } | |||
| bool producesMidi() const { return false; } | |||
| bool acceptsMidi() const override { return false; } | |||
| bool producesMidi() const override { return false; } | |||
| double getTailLengthSeconds() const { return 0.0; } | |||
| double getTailLengthSeconds() const override { return 0.0; } | |||
| //============================================================================== | |||
| void prepareToPlay (double newSampleRate, int samplesPerBlockExpected) | |||
| void prepareToPlay (double newSampleRate, int samplesPerBlockExpected) override | |||
| { | |||
| setLatencySamples (0); | |||
| @@ -281,7 +281,7 @@ public: | |||
| } | |||
| } | |||
| void releaseResources() | |||
| void releaseResources() override | |||
| { | |||
| if (handle != nullptr && plugin->deactivate != nullptr) | |||
| plugin->deactivate (handle); | |||
| @@ -289,7 +289,7 @@ public: | |||
| tempBuffer.setSize (1, 1); | |||
| } | |||
| void processBlock (AudioBuffer<float>& buffer, MidiBuffer&) | |||
| void processBlock (AudioBuffer<float>& buffer, MidiBuffer&) override | |||
| { | |||
| auto numSamples = buffer.getNumSamples(); | |||
| @@ -333,10 +333,12 @@ public: | |||
| buffer.clear (i, 0, numSamples); | |||
| } | |||
| bool isInputChannelStereoPair (int index) const { return isPositiveAndBelow (index, getTotalNumInputChannels()); } | |||
| bool isOutputChannelStereoPair (int index) const { return isPositiveAndBelow (index, getTotalNumOutputChannels()); } | |||
| using AudioPluginInstance::processBlock; | |||
| const String getInputChannelName (const int index) const | |||
| bool isInputChannelStereoPair (int index) const override { return isPositiveAndBelow (index, getTotalNumInputChannels()); } | |||
| bool isOutputChannelStereoPair (int index) const override { return isPositiveAndBelow (index, getTotalNumOutputChannels()); } | |||
| const String getInputChannelName (const int index) const override | |||
| { | |||
| if (isPositiveAndBelow (index, getTotalNumInputChannels())) | |||
| return String (plugin->PortNames [inputs [index]]).trim(); | |||
| @@ -344,7 +346,7 @@ public: | |||
| return {}; | |||
| } | |||
| const String getOutputChannelName (const int index) const | |||
| const String getOutputChannelName (const int index) const override | |||
| { | |||
| if (isPositiveAndBelow (index, getTotalNumInputChannels())) | |||
| return String (plugin->PortNames [outputs [index]]).trim(); | |||
| @@ -353,24 +355,24 @@ public: | |||
| } | |||
| //============================================================================== | |||
| int getNumPrograms() { return 0; } | |||
| int getCurrentProgram() { return 0; } | |||
| int getNumPrograms() override { return 0; } | |||
| int getCurrentProgram() override { return 0; } | |||
| void setCurrentProgram (int) | |||
| void setCurrentProgram (int) override | |||
| { | |||
| for (auto* param : getParameters()) | |||
| if (auto* ladspaParam = dynamic_cast<LADSPAParameter*> (param)) | |||
| ladspaParam->reset(); | |||
| } | |||
| const String getProgramName (int) { return {}; } | |||
| void changeProgramName (int, const String&) {} | |||
| const String getProgramName (int) override { return {}; } | |||
| void changeProgramName (int, const String&) override {} | |||
| //============================================================================== | |||
| void getStateInformation (MemoryBlock& destData) | |||
| void getStateInformation (MemoryBlock& destData) override | |||
| { | |||
| auto numParameters = getParameters().size(); | |||
| destData.setSize (sizeof (float) * (size_t) numParameters); | |||
| destData.setSize ((size_t) numParameters * sizeof (float)); | |||
| destData.fillWith (0); | |||
| auto* p = (float*) ((char*) destData.getData()); | |||
| @@ -380,10 +382,10 @@ public: | |||
| p[i] = param->getValue(); | |||
| } | |||
| void getCurrentProgramStateInformation (MemoryBlock& destData) { getStateInformation (destData); } | |||
| void setCurrentProgramStateInformation (const void* data, int sizeInBytes) { setStateInformation (data, sizeInBytes); } | |||
| void getCurrentProgramStateInformation (MemoryBlock& destData) override { getStateInformation (destData); } | |||
| void setCurrentProgramStateInformation (const void* data, int sizeInBytes) override { setStateInformation (data, sizeInBytes); } | |||
| void setStateInformation (const void* data, int sizeInBytes) | |||
| void setStateInformation (const void* data, int sizeInBytes) override | |||
| { | |||
| ignoreUnused (sizeInBytes); | |||
| @@ -394,10 +396,10 @@ public: | |||
| param->setValue (p[i]); | |||
| } | |||
| bool hasEditor() const { return false; } | |||
| AudioProcessorEditor* createEditor() { return nullptr; } | |||
| bool hasEditor() const override { return false; } | |||
| AudioProcessorEditor* createEditor() override { return nullptr; } | |||
| bool isValid() const { return handle != nullptr; } | |||
| bool isValid() const { return handle != nullptr; } | |||
| //============================================================================== | |||
| LADSPAModuleHandle::Ptr module; | |||
| @@ -195,8 +195,8 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e | |||
| Vst2::VstSpeakerArrangement* allocate (int numChannels) | |||
| { | |||
| auto arrangementSize = sizeof (Vst2::VstSpeakerArrangement) | |||
| + sizeof (Vst2::VstSpeakerProperties) * static_cast<size_t> (jmax (8, numChannels) - 8); | |||
| auto arrangementSize = (size_t) (jmax (8, numChannels) - 8) * sizeof (Vst2::VstSpeakerProperties) | |||
| + sizeof (Vst2::VstSpeakerArrangement); | |||
| storage.malloc (1, arrangementSize); | |||
| return storage.get(); | |||
| @@ -61,7 +61,7 @@ public: | |||
| events->numEvents = 0; | |||
| } | |||
| void addEvent (const void* const midiData, const int numBytes, const int frameOffset) | |||
| void addEvent (const void* const midiData, int numBytes, int frameOffset) | |||
| { | |||
| ensureSize (numEventsUsed + 1); | |||
| @@ -137,7 +137,7 @@ public: | |||
| { | |||
| numEventsNeeded = (numEventsNeeded + 32) & ~31; | |||
| const size_t size = 20 + sizeof (Vst2::VstEvent*) * (size_t) numEventsNeeded; | |||
| const size_t size = 20 + (size_t) numEventsNeeded * sizeof (Vst2::VstEvent*); | |||
| if (events == nullptr) | |||
| events.calloc (size, 1); | |||
| @@ -36,10 +36,14 @@ | |||
| #define __cdecl | |||
| #endif | |||
| #if JUCE_CLANG | |||
| #if __has_warning("-Wzero-as-null-pointer-constant") | |||
| #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #if JUCE_CLANG && __has_warning("-Wzero-as-null-pointer-constant") | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #define VST_FORCE_DEPRECATED 0 | |||
| @@ -63,6 +67,14 @@ namespace Vst2 | |||
| #pragma warning (disable: 4355) // ("this" used in initialiser list warning) | |||
| #endif | |||
| #if JUCE_CLANG && __has_warning("-Wzero-as-null-pointer-constant") | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| #include "juce_VSTMidiEventList.h" | |||
| #if JUCE_MINGW | |||
| @@ -180,7 +192,7 @@ namespace | |||
| return timeGetTime() * 1000000.0; | |||
| #elif JUCE_LINUX || JUCE_IOS || JUCE_ANDROID | |||
| timeval micro; | |||
| gettimeofday (µ, 0); | |||
| gettimeofday (µ, nullptr); | |||
| return micro.tv_usec * 1000.0; | |||
| #elif JUCE_MAC | |||
| UnsignedWide micro; | |||
| @@ -692,7 +704,7 @@ struct ModuleHandle : public ReferenceCountedObject | |||
| void closeEffect (Vst2::AEffect* eff) | |||
| { | |||
| eff->dispatcher (eff, Vst2::effClose, 0, 0, 0, 0); | |||
| eff->dispatcher (eff, Vst2::effClose, 0, 0, nullptr, 0); | |||
| } | |||
| #if JUCE_WINDOWS | |||
| @@ -1131,7 +1143,7 @@ struct VSTPluginInstance : public AudioPluginInstance, | |||
| #endif | |||
| // Must delete any editors before deleting the plugin instance! | |||
| jassert (getActiveEditor() == 0); | |||
| jassert (getActiveEditor() == nullptr); | |||
| _fpreset(); // some dodgy plug-ins mess around with this | |||
| @@ -1894,7 +1906,7 @@ struct VSTPluginInstance : public AudioPluginInstance, | |||
| if (isFXB) | |||
| { | |||
| auto progLen = (int) sizeof (fxProgram) + (numParams - 1) * (int) sizeof (float); | |||
| auto len = (sizeof (fxSet) - sizeof (fxProgram)) + (size_t) (progLen * jmax (1, numPrograms)); | |||
| auto len = (size_t) (progLen * jmax (1, numPrograms)) + (sizeof (fxSet) - sizeof (fxProgram)); | |||
| dest.setSize (len, true); | |||
| auto set = (fxSet*) dest.getData(); | |||
| @@ -1930,7 +1942,7 @@ struct VSTPluginInstance : public AudioPluginInstance, | |||
| } | |||
| else | |||
| { | |||
| dest.setSize (sizeof (fxProgram) + (size_t) ((numParams - 1) * (int) sizeof (float)), true); | |||
| dest.setSize ((size_t) ((numParams - 1) * (int) sizeof (float)) + sizeof (fxProgram), true); | |||
| setParamsInProgramBlock ((fxProgram*) dest.getData()); | |||
| } | |||
| } | |||
| @@ -2162,7 +2174,7 @@ private: | |||
| if (effect != nullptr && effect->magic == 0x56737450 /* 'VstP' */) | |||
| { | |||
| jassert (effect->resvd2 == 0); | |||
| jassert (effect->object != 0); | |||
| jassert (effect->object != nullptr); | |||
| _fpreset(); // some dodgy plugs mess around with this | |||
| } | |||
| @@ -2891,6 +2903,8 @@ public: | |||
| } | |||
| } | |||
| using ComponentMovementWatcher::componentMovedOrResized; | |||
| void componentVisibilityChanged() override | |||
| { | |||
| if (isShowing()) | |||
| @@ -2904,6 +2918,8 @@ public: | |||
| componentMovedOrResized (true, true); | |||
| } | |||
| using ComponentMovementWatcher::componentVisibilityChanged; | |||
| void componentPeerChanged() override | |||
| { | |||
| closePluginWindow(); | |||
| @@ -3086,7 +3102,7 @@ private: | |||
| #else | |||
| void openPluginWindow() | |||
| { | |||
| if (isOpen || getWindowHandle() == 0) | |||
| if (isOpen || getWindowHandle() == nullptr) | |||
| return; | |||
| JUCE_VST_LOG ("Opening VST UI: " + plugin.getName()); | |||
| @@ -3121,10 +3137,10 @@ private: | |||
| // do this before and after like in the steinberg example | |||
| dispatch (Vst2::effEditGetRect, 0, 0, &rect, 0); | |||
| dispatch (Vst2::effGetProgram, 0, 0, 0, 0); // also in steinberg code | |||
| dispatch (Vst2::effGetProgram, 0, 0, nullptr, 0); // also in steinberg code | |||
| // Install keyboard hooks | |||
| pluginWantsKeys = (dispatch (Vst2::effKeysRequired, 0, 0, 0, 0) == 0); | |||
| pluginWantsKeys = (dispatch (Vst2::effKeysRequired, 0, 0, nullptr, 0) == 0); | |||
| #if JUCE_WINDOWS | |||
| originalWndProc = 0; | |||
| @@ -116,7 +116,7 @@ protected: | |||
| AudioPluginInstance() = default; | |||
| AudioPluginInstance (const BusesProperties& ioLayouts) : AudioProcessor (ioLayouts) {} | |||
| template <int numLayouts> | |||
| AudioPluginInstance (const short channelLayoutList[numLayouts][2]) : AudioProcessor (channelLayoutList) {} | |||
| AudioPluginInstance (const short channelLayoutList[(size_t) numLayouts][2]) : AudioProcessor (channelLayoutList) {} | |||
| private: | |||
| void assertOnceOnDeprecatedMethodUse() const noexcept; | |||
| @@ -764,7 +764,7 @@ public: | |||
| } | |||
| template <int numLayouts> | |||
| static bool containsLayout (const BusesLayout& layouts, const short (&channelLayoutList) [numLayouts][2]) | |||
| static bool containsLayout (const BusesLayout& layouts, const short (&channelLayoutList) [(size_t) numLayouts][2]) | |||
| { | |||
| return containsLayout (layouts, layoutListToArray (channelLayoutList)); | |||
| } | |||
| @@ -782,7 +782,7 @@ public: | |||
| */ | |||
| template <int numLayouts> | |||
| BusesLayout getNextBestLayoutInLayoutList (const BusesLayout& layouts, | |||
| const short (&channelLayoutList) [numLayouts][2]) | |||
| const short (&channelLayoutList) [(size_t) numLayouts][2]) | |||
| { | |||
| return getNextBestLayoutInList (layouts, layoutListToArray (channelLayoutList)); | |||
| } | |||
| @@ -1422,7 +1422,7 @@ private: | |||
| }; | |||
| template <int numLayouts> | |||
| static Array<InOutChannelPair> layoutListToArray (const short (&configuration) [numLayouts][2]) | |||
| static Array<InOutChannelPair> layoutListToArray (const short (&configuration) [(size_t) numLayouts][2]) | |||
| { | |||
| Array<InOutChannelPair> layouts; | |||
| @@ -297,6 +297,7 @@ private: | |||
| void prepareToPlay (double, int) override {} | |||
| void releaseResources() override {} | |||
| void processBlock (AudioBuffer<float>&, MidiBuffer&) override {} | |||
| using AudioProcessor::processBlock; | |||
| double getTailLengthSeconds() const override { return 0.0; } | |||
| bool acceptsMidi() const override { return false; } | |||
| bool producesMidi() const override { return false; } | |||
| @@ -857,6 +857,7 @@ private: | |||
| void prepareToPlay (double, int) override {} | |||
| void releaseResources() override {} | |||
| void processBlock (AudioBuffer<float>&, MidiBuffer&) override {} | |||
| using AudioProcessor::processBlock; | |||
| double getTailLengthSeconds() const override { return {}; } | |||
| bool acceptsMidi() const override { return {}; } | |||
| bool producesMidi() const override { return {}; } | |||
| @@ -50,6 +50,8 @@ struct MidiKeyboardComponent::UpDownButton : public Button | |||
| owner.setLowestVisibleKey (note * 12); | |||
| } | |||
| using Button::clicked; | |||
| void paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override | |||
| { | |||
| owner.drawUpDownButton (g, getWidth(), getHeight(), | |||
| @@ -122,14 +122,14 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann | |||
| for (int i = 0; i < numOutputChannels; ++i) | |||
| { | |||
| channels[totalNumChans] = outputChannelData[i]; | |||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples); | |||
| memcpy (channels[totalNumChans], inputChannelData[i], (size_t) numSamples * sizeof (float)); | |||
| ++totalNumChans; | |||
| } | |||
| for (int i = numOutputChannels; i < numInputChannels; ++i) | |||
| { | |||
| channels[totalNumChans] = tempBuffer.getWritePointer (i - numOutputChannels); | |||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples); | |||
| memcpy (channels[totalNumChans], inputChannelData[i], (size_t) numSamples * sizeof (float)); | |||
| ++totalNumChans; | |||
| } | |||
| } | |||
| @@ -138,14 +138,14 @@ void AudioProcessorPlayer::audioDeviceIOCallback (const float** const inputChann | |||
| for (int i = 0; i < numInputChannels; ++i) | |||
| { | |||
| channels[totalNumChans] = outputChannelData[i]; | |||
| memcpy (channels[totalNumChans], inputChannelData[i], sizeof (float) * (size_t) numSamples); | |||
| memcpy (channels[totalNumChans], inputChannelData[i], (size_t) numSamples * sizeof (float)); | |||
| ++totalNumChans; | |||
| } | |||
| for (int i = numInputChannels; i < numOutputChannels; ++i) | |||
| { | |||
| channels[totalNumChans] = outputChannelData[i]; | |||
| zeromem (channels[totalNumChans], sizeof (float) * (size_t) numSamples); | |||
| zeromem (channels[totalNumChans], (size_t) numSamples * sizeof (float)); | |||
| ++totalNumChans; | |||
| } | |||
| } | |||
| @@ -583,7 +583,7 @@ struct Runner | |||
| //============================================================================== | |||
| /** */ | |||
| uint8 allMemory[((programAndHeapSpace + stackAndGlobalsSpace) + 3) & ~3]; | |||
| uint8 allMemory[(size_t) (((programAndHeapSpace + stackAndGlobalsSpace) + 3) & ~3)]; | |||
| /** */ | |||
| Program program; | |||
| @@ -181,7 +181,7 @@ struct Packed7BitArrayBuilder | |||
| { | |||
| const int bitsToDo = jmin (7 - bitsInCurrentByte, numBits); | |||
| data[bytesWritten] |= ((value & ((1 << bitsToDo) - 1)) << bitsInCurrentByte); | |||
| data[bytesWritten] |= ((value & (uint32) ((1 << bitsToDo) - 1)) << bitsInCurrentByte); | |||
| value >>= bitsToDo; | |||
| numBits -= bitsToDo; | |||
| bitsInCurrentByte += bitsToDo; | |||
| @@ -213,7 +213,7 @@ struct Packed7BitArrayBuilder | |||
| } | |||
| private: | |||
| uint8 data[allocatedBytes]; | |||
| uint8 data[(size_t) allocatedBytes]; | |||
| int bytesWritten = 0, bitsInCurrentByte = 0; | |||
| }; | |||
| @@ -253,13 +253,13 @@ struct Packed7BitArrayReader | |||
| while (numBits > 0) | |||
| { | |||
| const uint32 valueInCurrentByte = (*data >> bitsReadInCurrentByte); | |||
| const auto valueInCurrentByte = (uint32) (*data >> bitsReadInCurrentByte); | |||
| const int bitsAvailable = 7 - bitsReadInCurrentByte; | |||
| if (bitsAvailable > numBits) | |||
| { | |||
| value |= ((valueInCurrentByte & ((1 << numBits) - 1)) << bitsSoFar); | |||
| value |= ((valueInCurrentByte & (uint32) ((1 << numBits) - 1)) << bitsSoFar); | |||
| bitsReadInCurrentByte += numBits; | |||
| break; | |||
| } | |||
| @@ -1041,9 +1041,9 @@ public: | |||
| void write565Colour (uint32 bitIndex, LEDColour colour) | |||
| { | |||
| block.setDataBits (bitIndex, 5, colour.getRed() >> 3); | |||
| block.setDataBits (bitIndex + 5, 6, colour.getGreen() >> 2); | |||
| block.setDataBits (bitIndex + 11, 5, colour.getBlue() >> 3); | |||
| block.setDataBits (bitIndex, 5, (uint32) (colour.getRed() >> 3)); | |||
| block.setDataBits (bitIndex + 5, 6, (uint32) (colour.getGreen() >> 2)); | |||
| block.setDataBits (bitIndex + 11, 5, (uint32) (colour.getBlue() >> 3)); | |||
| } | |||
| struct DefaultLEDGridProgram : public Block::Program | |||
| @@ -41,9 +41,9 @@ void BitmapLEDProgram::setLED (uint32 x, uint32 y, LEDColour colour) | |||
| { | |||
| auto bit = (x + y * w) * 16; | |||
| block.setDataBits (bit, 5, colour.getRed() >> 3); | |||
| block.setDataBits (bit + 5, 6, colour.getGreen() >> 2); | |||
| block.setDataBits (bit + 11, 5, colour.getBlue() >> 3); | |||
| block.setDataBits (bit, 5, (uint32) (colour.getRed() >> 3)); | |||
| block.setDataBits (bit + 5, 6, (uint32) (colour.getGreen() >> 2)); | |||
| block.setDataBits (bit + 11, 5, (uint32) (colour.getBlue() >> 3)); | |||
| } | |||
| } | |||
| else | |||
| @@ -102,9 +102,9 @@ void DrumPadGridProgram::setGridFills (int numColumns, int numRows, const Array< | |||
| const uint32 colourOffsetBytes = byteOffset + colours0_byte + i * colourSizeBytes; | |||
| const uint32 colourOffsetBits = colourOffsetBytes * 8; | |||
| block.setDataBits (colourOffsetBits, 5, fill.colour.getRed() >> 3); | |||
| block.setDataBits (colourOffsetBits + 5, 6, fill.colour.getGreen() >> 2); | |||
| block.setDataBits (colourOffsetBits + 11, 5, fill.colour.getBlue() >> 3); | |||
| block.setDataBits (colourOffsetBits, 5, (uint32) (fill.colour.getRed() >> 3)); | |||
| block.setDataBits (colourOffsetBits + 5, 6, (uint32) (fill.colour.getGreen() >> 2)); | |||
| block.setDataBits (colourOffsetBits + 11, 5, (uint32) (fill.colour.getBlue() >> 3)); | |||
| block.setDataByte (byteOffset + fillTypes0_byte + i, static_cast<uint8> (fill.fillType)); | |||
| @@ -33,21 +33,22 @@ | |||
| #error "Incorrect use of JUCE cpp file" | |||
| #endif | |||
| #if defined (__clang__) | |||
| #include "juce_box2d.h" | |||
| #if defined JUCE_CLANG | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wsign-conversion" | |||
| #pragma clang diagnostic ignored "-Wfloat-conversion" | |||
| #if __has_warning("-Wzero-as-null-pointer-constant") | |||
| #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #elif defined (__GNUC__) | |||
| #elif defined JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #pragma GCC diagnostic ignored "-Wunused-but-set-variable" | |||
| #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #include "juce_box2d.h" | |||
| #include <cstdarg> | |||
| using int8 = juce::int8; | |||
| @@ -105,8 +106,8 @@ using uint32 = juce::uint32; | |||
| #include "utils/juce_Box2DRenderer.cpp" | |||
| #if defined (__clang__) | |||
| #if defined JUCE_CLANG | |||
| #pragma clang diagnostic pop | |||
| #elif defined (__GNUC__) | |||
| #elif defined JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| @@ -54,22 +54,30 @@ | |||
| //============================================================================== | |||
| #include <juce_graphics/juce_graphics.h> | |||
| #ifdef __GNUC__ | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wconversion" | |||
| #if defined (__clang__) | |||
| #if __has_warning("-Wzero-as-null-pointer-constant") | |||
| #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #ifdef JUCE_CLANG | |||
| #pragma clang diagnostic push | |||
| #pragma clang diagnostic ignored "-Wconversion" | |||
| #if __has_warning("-Wzero-as-null-pointer-constant") | |||
| #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #endif | |||
| #ifdef JUCE_GCC | |||
| #pragma GCC diagnostic ignored "-Wconversion" | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #include <climits> | |||
| #include <cfloat> | |||
| #include "box2d/Box2D.h" | |||
| #ifdef __GNUC__ | |||
| #ifdef JUCE_CLANG | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #ifdef JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| @@ -521,13 +521,13 @@ private: | |||
| { | |||
| memmove (elements + currentIndex, | |||
| elements + currentIndex + 1, | |||
| sizeof (ElementType) * (size_t) (newIndex - currentIndex)); | |||
| (size_t) (newIndex - currentIndex) * sizeof (ElementType)); | |||
| } | |||
| else | |||
| { | |||
| memmove (elements + newIndex + 1, | |||
| elements + newIndex, | |||
| sizeof (ElementType) * (size_t) (currentIndex - newIndex)); | |||
| (size_t) (currentIndex - newIndex) * sizeof (ElementType)); | |||
| } | |||
| memcpy (elements + newIndex, tempCopy, sizeof (ElementType)); | |||
| @@ -1196,7 +1196,7 @@ void BigInteger::loadFromMemoryBlock (const MemoryBlock& data) | |||
| auto* values = ensureSize (numInts); | |||
| for (int i = 0; i < (int) numInts - 1; ++i) | |||
| values[i] = (uint32) ByteOrder::littleEndianInt (addBytesToPointer (data.getData(), sizeof (uint32) * (size_t) i)); | |||
| values[i] = (uint32) ByteOrder::littleEndianInt (addBytesToPointer (data.getData(), (size_t) i * sizeof (uint32))); | |||
| values[numInts - 1] = 0; | |||
| @@ -1240,7 +1240,7 @@ void writeLittleEndianBitsInBuffer (void* buffer, uint32 startBit, uint32 numBit | |||
| } | |||
| if (numBits > 0) | |||
| *data = (uint8) ((*data & (0xff << numBits)) | value); | |||
| *data = (uint8) ((*data & (uint32) (0xff << numBits)) | value); | |||
| } | |||
| uint32 readLittleEndianBitsInBuffer (const void* buffer, uint32 startBit, uint32 numBits) noexcept | |||
| @@ -1255,7 +1255,7 @@ uint32 readLittleEndianBitsInBuffer (const void* buffer, uint32 startBit, uint32 | |||
| if (const uint32 offset = (startBit & 7)) | |||
| { | |||
| const uint32 bitsInByte = 8 - offset; | |||
| result = (*data >> offset); | |||
| result = (uint32) (*data >> offset); | |||
| if (bitsInByte >= numBits) | |||
| return result & ((1u << numBits) - 1u); | |||
| @@ -296,7 +296,7 @@ void ignoreUnused (Types&&...) noexcept {} | |||
| int numElements = numElementsInArray (myArray) // returns 3 | |||
| @endcode | |||
| */ | |||
| template <typename Type, int N> | |||
| template <typename Type, size_t N> | |||
| JUCE_CONSTEXPR int numElementsInArray (Type (&)[N]) noexcept { return N; } | |||
| //============================================================================== | |||
| @@ -356,7 +356,7 @@ String MemoryBlock::toBase64Encoding() const | |||
| String destString ((unsigned int) size); // store the length, followed by a '.', and then the data. | |||
| auto initialLen = destString.length(); | |||
| destString.preallocateBytes (sizeof (String::CharPointerType::CharType) * (size_t) initialLen + 2 + numChars); | |||
| destString.preallocateBytes ((size_t) initialLen * sizeof (String::CharPointerType::CharType) + 2 + numChars); | |||
| auto d = destString.getCharPointer(); | |||
| d += initialLen; | |||
| @@ -207,7 +207,7 @@ bool Process::openDocument (const String& fileName, const String& parameters) | |||
| cmdString = cmdLines.joinIntoString (" || "); | |||
| } | |||
| const char* const argv[4] = { "/bin/sh", "-c", cmdString.toUTF8(), 0 }; | |||
| const char* const argv[4] = { "/bin/sh", "-c", cmdString.toUTF8(), nullptr }; | |||
| auto cpid = fork(); | |||
| @@ -205,7 +205,7 @@ bool Time::setSystemTimeToThisTime() const | |||
| t.tv_sec = millisSinceEpoch / 1000; | |||
| t.tv_usec = (millisSinceEpoch - t.tv_sec * 1000) * 1000; | |||
| return settimeofday (&t, 0) == 0; | |||
| return settimeofday (&t, nullptr) == 0; | |||
| } | |||
| JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger() noexcept | |||
| @@ -1043,8 +1043,8 @@ void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask) | |||
| CPU_ZERO (&affinity); | |||
| for (int i = 0; i < 32; ++i) | |||
| if ((affinityMask & (1 << i)) != 0) | |||
| CPU_SET (i, &affinity); | |||
| if ((affinityMask & (uint32) (1 << i)) != 0) | |||
| CPU_SET ((size_t) i, &affinity); | |||
| #if (! JUCE_ANDROID) && ((! JUCE_LINUX) || ((__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2004)) | |||
| pthread_setaffinity_np (pthread_self(), sizeof (cpu_set_t), &affinity); | |||
| @@ -183,7 +183,7 @@ | |||
| //============================================================================== | |||
| // Compiler type macros. | |||
| #ifdef __clang__ | |||
| #if defined (__clang__) | |||
| #define JUCE_CLANG 1 | |||
| #elif defined (__GNUC__) | |||
| @@ -151,7 +151,7 @@ public: | |||
| #else | |||
| JUCE_CONSTEXPR const int maxSignificantDigits = 17 + 1; // An additional digit for rounding | |||
| JUCE_CONSTEXPR const int bufferSize = maxSignificantDigits + 7 + 1; // -.E-XXX and a trailing null-terminator | |||
| char buffer[bufferSize] = {}; | |||
| char buffer[(size_t) bufferSize] = {}; | |||
| char* currentCharacter = &(buffer[0]); | |||
| #endif | |||
| @@ -505,12 +505,12 @@ public: | |||
| { | |||
| auto startAddress = dest.getAddress(); | |||
| auto maxBytes = (ssize_t) maxBytesToWrite; | |||
| maxBytes -= sizeof (typename DestCharPointerType::CharType); // (allow for a terminating null) | |||
| maxBytes -= (ssize_t) sizeof (typename DestCharPointerType::CharType); // (allow for a terminating null) | |||
| for (;;) | |||
| { | |||
| auto c = src.getAndAdvance(); | |||
| auto bytesNeeded = DestCharPointerType::getBytesRequiredFor (c); | |||
| auto bytesNeeded = (ssize_t) DestCharPointerType::getBytesRequiredFor (c); | |||
| maxBytes -= bytesNeeded; | |||
| if (c == 0 || maxBytes < 0) | |||
| @@ -733,7 +733,7 @@ void String::appendCharPointer (const CharPointerType startOfTextToAppend, | |||
| if (extraBytesNeeded > 0) | |||
| { | |||
| auto byteOffsetOfNull = getByteOffsetOfEnd(); | |||
| preallocateBytes (byteOffsetOfNull + (size_t) extraBytesNeeded); | |||
| preallocateBytes ((size_t) extraBytesNeeded + byteOffsetOfNull); | |||
| auto* newStringStart = addBytesToPointer (text.getAddress(), (int) byteOffsetOfNull); | |||
| memcpy (newStringStart, startOfTextToAppend.getAddress(), (size_t) extraBytesNeeded); | |||
| @@ -1929,7 +1929,7 @@ String String::toHexString (const void* const d, const int size, const int group | |||
| if (groupSize > 0) | |||
| numChars += size / groupSize; | |||
| String s (PreallocationBytes (sizeof (CharPointerType::CharType) * (size_t) numChars)); | |||
| String s (PreallocationBytes ((size_t) numChars * sizeof (CharPointerType::CharType))); | |||
| auto* data = static_cast<const unsigned char*> (d); | |||
| auto dest = s.text; | |||
| @@ -300,7 +300,7 @@ String StringArray::joinIntoString (StringRef separator, int start, int numberTo | |||
| return strings.getReference (start); | |||
| auto separatorBytes = separator.text.sizeInBytes() - sizeof (String::CharPointerType::CharType); | |||
| auto bytesNeeded = separatorBytes * (size_t) (last - start - 1); | |||
| auto bytesNeeded = (size_t) (last - start - 1) * separatorBytes; | |||
| for (int i = start; i < last; ++i) | |||
| bytesNeeded += strings.getReference(i).getCharPointer().sizeInBytes() - sizeof (String::CharPointerType::CharType); | |||
| @@ -80,7 +80,7 @@ namespace XmlIdentifierChars | |||
| { | |||
| static const uint32 legalChars[] = { 0, 0x7ff6000, 0x87fffffe, 0x7fffffe, 0 }; | |||
| return ((int) c < (int) numElementsInArray (legalChars) * 32) ? ((legalChars [c >> 5] & (1 << (c & 31))) != 0) | |||
| return ((int) c < (int) numElementsInArray (legalChars) * 32) ? ((legalChars [c >> 5] & (uint32) (1 << (c & 31))) != 0) | |||
| : isIdentifierCharSlow (c); | |||
| } | |||
| @@ -44,6 +44,14 @@ namespace zlibNamespace | |||
| #endif | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wconversion" | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #pragma GCC diagnostic ignored "-Wshadow" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #undef OS_CODE | |||
| #undef fdopen | |||
| #define ZLIB_INTERNAL | |||
| @@ -78,6 +86,10 @@ namespace zlibNamespace | |||
| #if JUCE_CLANG | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| #else | |||
| #include JUCE_ZLIB_INCLUDE_PATH | |||
| @@ -55,12 +55,12 @@ struct ZipFile::ZipEntryHolder | |||
| static Time parseFileTime (uint32 time, uint32 date) noexcept | |||
| { | |||
| int year = 1980 + (date >> 9); | |||
| int month = ((date >> 5) & 15) - 1; | |||
| int day = date & 31; | |||
| int hours = time >> 11; | |||
| int minutes = (time >> 5) & 63; | |||
| int seconds = (int) ((time & 31) << 1); | |||
| auto year = (int) (1980 + (date >> 9)); | |||
| auto month = (int) (((date >> 5) & 15) - 1); | |||
| auto day = (int) (date & 31); | |||
| auto hours = (int) time >> 11; | |||
| auto minutes = (int) ((time >> 5) & 63); | |||
| auto seconds = (int) ((time & 31) << 1); | |||
| return { year, month, day, hours, minutes, seconds }; | |||
| } | |||
| @@ -369,16 +369,16 @@ void ZipFile::init() | |||
| break; | |||
| auto* buffer = static_cast<const char*> (headerData.getData()) + pos; | |||
| auto fileNameLen = readUnalignedLittleEndianShort (buffer + 28); | |||
| auto fileNameLen = readUnalignedLittleEndianShort (buffer + 28u); | |||
| if (pos + 46 + fileNameLen > size) | |||
| break; | |||
| entries.add (new ZipEntryHolder (buffer, fileNameLen)); | |||
| pos += 46 + fileNameLen | |||
| + readUnalignedLittleEndianShort (buffer + 30) | |||
| + readUnalignedLittleEndianShort (buffer + 32); | |||
| pos += 46u + fileNameLen | |||
| + readUnalignedLittleEndianShort (buffer + 30u) | |||
| + readUnalignedLittleEndianShort (buffer + 32u); | |||
| } | |||
| } | |||
| } | |||
| @@ -137,7 +137,7 @@ public: | |||
| break; | |||
| } | |||
| numBytesToRead -= sizeof (buffer); | |||
| numBytesToRead -= (int64) sizeof (buffer); | |||
| processFullBlock (buffer); | |||
| } | |||
| @@ -51,7 +51,7 @@ struct WhirlpoolProcessor | |||
| if (bytesRead < (int) sizeof (data)) | |||
| break; | |||
| numBytesToRead -= sizeof (data); | |||
| numBytesToRead -= (int64) sizeof (data); | |||
| } | |||
| finalize (result); | |||
| @@ -84,7 +84,7 @@ private: | |||
| while (numBits > 8) | |||
| { | |||
| b = ((source[sourcePos] << sourceGap) & 0xff) | |||
| | ((source[sourcePos + 1] & 0xff) >> (8 - sourceGap)); | |||
| | (uint32) ((source[sourcePos + 1] & 0xff) >> (8 - sourceGap)); | |||
| buffer[bufferPos++] |= (uint8) (b >> bufferRem); | |||
| bufferBits += 8 - bufferRem; | |||
| @@ -120,7 +120,7 @@ struct CmplxSIMDOps<std::complex<Scalar>> | |||
| union | |||
| { | |||
| vSIMDType v; | |||
| Scalar floats[n]; | |||
| Scalar floats[(size_t) n]; | |||
| } u; | |||
| for (int i = 0; i < n; ++i) | |||
| @@ -96,7 +96,7 @@ namespace SIMDRegister_test_internal | |||
| #ifdef _MSC_VER | |||
| __declspec(align(sizeof (SIMDRegister<type>))) type elements[size]; | |||
| #else | |||
| type elements[size] __attribute__((aligned(sizeof (SIMDRegister<type>)))); | |||
| type elements[(size_t) size] __attribute__((aligned(sizeof (SIMDRegister<type>)))); | |||
| #endif | |||
| VecFiller<type>::fill (elements, size, random); | |||
| @@ -132,7 +132,7 @@ struct FFTFallback : public FFT::Instance | |||
| if (size == 1) | |||
| return; | |||
| const size_t scratchSize = 16 + sizeof (Complex<float>) * (size_t) size; | |||
| const size_t scratchSize = 16 + (size_t) size * sizeof (Complex<float>); | |||
| if (scratchSize < maxFFTScratchSpaceToAlloca) | |||
| { | |||
| @@ -150,7 +150,7 @@ struct FFTFallback : public FFT::Instance | |||
| if (size == 1) | |||
| return; | |||
| const size_t scratchSize = 16 + sizeof (Complex<float>) * (size_t) size; | |||
| const size_t scratchSize = 16 + (size_t) size * sizeof (Complex<float>); | |||
| if (scratchSize < maxFFTScratchSpaceToAlloca) | |||
| { | |||
| @@ -316,7 +316,7 @@ struct FFTFallback : public FFT::Instance | |||
| default: jassertfalse; break; | |||
| } | |||
| auto* scratch = static_cast<Complex<float>*> (alloca (sizeof (Complex<float>) * (size_t) factor.radix)); | |||
| auto* scratch = static_cast<Complex<float>*> (alloca ((size_t) factor.radix * sizeof (Complex<float>))); | |||
| for (int i = 0; i < factor.length; ++i) | |||
| { | |||
| @@ -843,7 +843,7 @@ void FFT::performFrequencyOnlyForwardTransform (float* inputOutputData) const no | |||
| for (auto i = 0; i < size; ++i) | |||
| inputOutputData[i] = std::abs (out[i]); | |||
| zeromem (&inputOutputData[size], sizeof (float) * static_cast<size_t> (size)); | |||
| zeromem (&inputOutputData[size], static_cast<size_t> (size) * sizeof (float)); | |||
| } | |||
| } // namespace dsp | |||
| @@ -101,7 +101,7 @@ public: | |||
| Array<size_t> getSize() const noexcept { return { rows, columns }; } | |||
| /** Fills the contents of the matrix with zeroes. */ | |||
| void clear() noexcept { zeromem (data.begin(), sizeof (ElementType) * (size_t) data.size()); } | |||
| void clear() noexcept { zeromem (data.begin(), (size_t) data.size() * sizeof (ElementType)); } | |||
| //============================================================================== | |||
| /** Swaps the contents of two rows in the matrix and returns a reference to itself. */ | |||
| @@ -51,13 +51,6 @@ public: | |||
| @param source the ChangeBroadcaster that triggered the callback. | |||
| */ | |||
| virtual void changeListenerCallback (ChangeBroadcaster* source) = 0; | |||
| //============================================================================== | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // This method's signature has changed to take a ChangeBroadcaster parameter - please update your code! | |||
| private: virtual int changeListenerCallback (void*) { return 0; } | |||
| #endif | |||
| }; | |||
| } // namespace juce | |||
| @@ -188,7 +188,7 @@ namespace LinuxErrorHandling | |||
| saction.sa_handler = keyboardBreakSignalHandler; | |||
| saction.sa_mask = maskSet; | |||
| saction.sa_flags = 0; | |||
| sigaction (SIGINT, &saction, 0); | |||
| sigaction (SIGINT, &saction, nullptr); | |||
| } | |||
| } | |||
| @@ -51,9 +51,14 @@ namespace jpeglibNamespace | |||
| #endif | |||
| #endif | |||
| #if JUCE_GCC && __GNUC__ > 5 | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wshift-negative-value" | |||
| #pragma GCC diagnostic ignored "-Wconversion" | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #if __GNUC__ > 5 | |||
| #pragma GCC diagnostic ignored "-Wshift-negative-value" | |||
| #endif | |||
| #endif | |||
| #define JPEG_INTERNALS | |||
| @@ -133,7 +138,7 @@ namespace jpeglibNamespace | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #if JUCE_GCC && __GNUC__ > 5 | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| #else | |||
| @@ -74,6 +74,12 @@ namespace pnglibNamespace | |||
| #endif | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic push | |||
| #pragma GCC diagnostic ignored "-Wsign-conversion" | |||
| #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
| #endif | |||
| #undef check | |||
| using std::abs; | |||
| #define NO_DUMMY_DECL | |||
| @@ -294,6 +300,11 @@ namespace pnglibNamespace | |||
| #if JUCE_CLANG | |||
| #pragma clang diagnostic pop | |||
| #endif | |||
| #if JUCE_GCC | |||
| #pragma GCC diagnostic pop | |||
| #endif | |||
| #else | |||
| extern "C" | |||
| { | |||
| @@ -358,7 +369,7 @@ namespace PNGHelpers | |||
| png_get_IHDR (pngReadStruct, pngInfoStruct, | |||
| &width, &height, | |||
| &bitDepth, &colorType, | |||
| &interlaceType, 0, 0); | |||
| &interlaceType, nullptr, nullptr); | |||
| if (bitDepth == 16) | |||
| png_set_strip_16 (pngReadStruct); | |||
| @@ -472,16 +483,16 @@ namespace PNGHelpers | |||
| static Image readImage (InputStream& in) | |||
| { | |||
| if (png_structp pngReadStruct = png_create_read_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0)) | |||
| if (png_structp pngReadStruct = png_create_read_struct (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr)) | |||
| { | |||
| if (png_infop pngInfoStruct = png_create_info_struct (pngReadStruct)) | |||
| { | |||
| Image image (readImage (in, pngReadStruct, pngInfoStruct)); | |||
| png_destroy_read_struct (&pngReadStruct, &pngInfoStruct, 0); | |||
| png_destroy_read_struct (&pngReadStruct, &pngInfoStruct, nullptr); | |||
| return image; | |||
| } | |||
| png_destroy_read_struct (&pngReadStruct, 0, 0); | |||
| png_destroy_read_struct (&pngReadStruct, nullptr, nullptr); | |||
| } | |||
| return Image(); | |||
| @@ -40,7 +40,7 @@ struct FTLibWrapper : public ReferenceCountedObject | |||
| ~FTLibWrapper() | |||
| { | |||
| if (library != 0) | |||
| if (library != nullptr) | |||
| FT_Done_FreeType (library); | |||
| } | |||
| @@ -71,7 +71,7 @@ struct FTFaceWrapper : public ReferenceCountedObject | |||
| ~FTFaceWrapper() | |||
| { | |||
| if (face != 0) | |||
| if (face != nullptr) | |||
| FT_Done_Face (face); | |||
| } | |||
| @@ -244,7 +244,7 @@ private: | |||
| { | |||
| FTFaceWrapper face (library, file, faceIndex); | |||
| if (face.face != 0) | |||
| if (face.face != nullptr) | |||
| { | |||
| if (faceIndex == 0) | |||
| numFaces = (int) face.face->num_faces; | |||
| @@ -393,13 +393,6 @@ public: | |||
| virtual void drawDrawableButton (Graphics&, DrawableButton&, | |||
| bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0; | |||
| private: | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // These method have been deprecated: see their replacements above. | |||
| virtual int getTextButtonFont (TextButton&) { return 0; } | |||
| virtual int changeTextButtonWidthToFitText (TextButton&, int) { return 0; } | |||
| #endif | |||
| }; | |||
| // This method's parameters have changed - see the new version. | |||
| @@ -112,14 +112,16 @@ protected: | |||
| void paintButton (Graphics&, bool, bool) override; | |||
| private: | |||
| //============================================================================== | |||
| using Button::clicked; | |||
| Font getFontToUse() const; | |||
| //============================================================================== | |||
| URL url; | |||
| Font font; | |||
| bool resizeFont; | |||
| Justification justification; | |||
| Font getFontToUse() const; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HyperlinkButton) | |||
| }; | |||
| @@ -38,6 +38,8 @@ struct ModalComponentManager::ModalItem : public ComponentMovementWatcher | |||
| void componentMovedOrResized (bool, bool) override {} | |||
| using ComponentMovementWatcher::componentMovedOrResized; | |||
| void componentPeerChanged() override | |||
| { | |||
| componentVisibilityChanged(); | |||
| @@ -49,6 +51,8 @@ struct ModalComponentManager::ModalItem : public ComponentMovementWatcher | |||
| cancel(); | |||
| } | |||
| using ComponentMovementWatcher::componentVisibilityChanged; | |||
| void componentBeingDeleted (Component& comp) override | |||
| { | |||
| ComponentMovementWatcher::componentBeingDeleted (comp); | |||
| @@ -47,6 +47,8 @@ public: | |||
| owner.moveScrollbarInSteps ((direction == 1 || direction == 2) ? 1 : -1); | |||
| } | |||
| using Button::clicked; | |||
| int direction; | |||
| private: | |||
| @@ -128,6 +128,7 @@ protected: | |||
| ExtraComponentPlacement extraCompPlacement = afterText; | |||
| private: | |||
| using Button::clicked; | |||
| void calcAreas (Rectangle<int>&, Rectangle<int>&) const; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TabBarButton) | |||
| @@ -334,11 +334,6 @@ private: | |||
| void updateVisibleArea(); | |||
| void deleteOrRemoveContentComp(); | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // If you get an error here, it's because this method's parameters have changed! See the new definition above.. | |||
| virtual int visibleAreaChanged (int, int, int, int) { return 0; } | |||
| #endif | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Viewport) | |||
| }; | |||
| @@ -246,8 +246,6 @@ private: | |||
| virtual int dragOperationEnded() { return 0; } | |||
| #endif | |||
| JUCE_DEPRECATED_WITH_BODY (virtual bool shouldDropFilesWhenDraggedExternally (const String&, Component*, StringArray&, bool&), { return false; }) | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DragAndDropContainer) | |||
| }; | |||
| @@ -136,18 +136,6 @@ public: | |||
| image will not be shown when the cursor is over this target. | |||
| */ | |||
| virtual bool shouldDrawDragImageWhenOver(); | |||
| //============================================================================== | |||
| private: | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // The parameters for these methods have changed - please update your code! | |||
| virtual void isInterestedInDragSource (const String&, Component*) {} | |||
| virtual int itemDragEnter (const String&, Component*, int, int) { return 0; } | |||
| virtual int itemDragMove (const String&, Component*, int, int) { return 0; } | |||
| virtual int itemDragExit (const String&, Component*) { return 0; } | |||
| virtual int itemDropped (const String&, Component*, int, int) { return 0; } | |||
| #endif | |||
| }; | |||
| } // namespace juce | |||
| @@ -167,14 +167,6 @@ public: | |||
| values greater than 1.0 mean it should be enlarged. | |||
| */ | |||
| virtual void mouseMagnify (const MouseEvent& event, float scaleFactor); | |||
| private: | |||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | |||
| // This is just here to cause a compile error in old code that hasn't been | |||
| // updated to use the new version of this method. | |||
| virtual int mouseWheelMove (const MouseEvent&, float, float) { return 0; } | |||
| #endif | |||
| }; | |||
| } // namespace juce | |||
| @@ -478,11 +478,15 @@ public: | |||
| return relativePosition + (getScreenPosition().toFloat() / scale); | |||
| } | |||
| using ComponentPeer::localToGlobal; | |||
| Point<float> globalToLocal (Point<float> screenPosition) override | |||
| { | |||
| return screenPosition - (getScreenPosition().toFloat() / scale); | |||
| } | |||
| using ComponentPeer::globalToLocal; | |||
| void setMinimised (bool /*shouldBeMinimised*/) override | |||
| { | |||
| // n/a | |||
| @@ -194,7 +194,9 @@ public: | |||
| Rectangle<int> getBounds() const override { return getBounds (! isSharedWindow); } | |||
| Rectangle<int> getBounds (bool global) const; | |||
| Point<float> localToGlobal (Point<float> relativePosition) override; | |||
| using ComponentPeer::localToGlobal; | |||
| Point<float> globalToLocal (Point<float> screenPosition) override; | |||
| using ComponentPeer::globalToLocal; | |||
| void setAlpha (float newAlpha) override; | |||
| void setMinimised (bool) override {} | |||
| bool isMinimised() const override { return false; } | |||
| @@ -219,13 +219,13 @@ namespace XSHMHelpers | |||
| zerostruct (segmentInfo); | |||
| if (auto* xImage = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)), | |||
| 24, ZPixmap, 0, &segmentInfo, 50, 50)) | |||
| 24, ZPixmap, nullptr, &segmentInfo, 50, 50)) | |||
| { | |||
| if ((segmentInfo.shmid = shmget (IPC_PRIVATE, | |||
| (size_t) (xImage->bytes_per_line * xImage->height), | |||
| IPC_CREAT | 0777)) >= 0) | |||
| { | |||
| segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, 0, 0); | |||
| segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, nullptr, 0); | |||
| if (segmentInfo.shmaddr != (void*) -1) | |||
| { | |||
| @@ -248,7 +248,7 @@ namespace XSHMHelpers | |||
| shmdt (segmentInfo.shmaddr); | |||
| } | |||
| shmctl (segmentInfo.shmid, IPC_RMID, 0); | |||
| shmctl (segmentInfo.shmid, IPC_RMID, nullptr); | |||
| XSetErrorHandler (oldHandler); | |||
| if (trappedErrorCode != 0) | |||
| @@ -515,7 +515,7 @@ public: | |||
| segmentInfo.shmaddr = (char *) -1; | |||
| segmentInfo.readOnly = False; | |||
| xImage = XShmCreateImage (display, visual, imageDepth, ZPixmap, 0, | |||
| xImage = XShmCreateImage (display, visual, imageDepth, ZPixmap, nullptr, | |||
| &segmentInfo, (unsigned int) w, (unsigned int) h); | |||
| if (xImage != nullptr) | |||
| @@ -526,7 +526,7 @@ public: | |||
| { | |||
| if (segmentInfo.shmid != -1) | |||
| { | |||
| segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, 0, 0); | |||
| segmentInfo.shmaddr = (char*) shmat (segmentInfo.shmid, nullptr, 0); | |||
| if (segmentInfo.shmaddr != (void*) -1) | |||
| { | |||
| @@ -542,7 +542,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| shmctl (segmentInfo.shmid, IPC_RMID, 0); | |||
| shmctl (segmentInfo.shmid, IPC_RMID, nullptr); | |||
| } | |||
| } | |||
| } | |||
| @@ -610,7 +610,7 @@ public: | |||
| XDestroyImage (xImage); | |||
| shmdt (segmentInfo.shmaddr); | |||
| shmctl (segmentInfo.shmid, IPC_RMID, 0); | |||
| shmctl (segmentInfo.shmid, IPC_RMID, nullptr); | |||
| } | |||
| else | |||
| #endif | |||
| @@ -989,7 +989,7 @@ namespace PixmapHelpers | |||
| Pixmap pixmap = XCreatePixmap (display, DefaultRootWindow (display), | |||
| width, height, 24); | |||
| GC gc = XCreateGC (display, pixmap, 0, 0); | |||
| GC gc = XCreateGC (display, pixmap, 0, nullptr); | |||
| XPutImage (display, pixmap, gc, ximage, 0, 0, 0, 0, width, height); | |||
| XFreeGC (display, gc); | |||
| @@ -1252,11 +1252,15 @@ public: | |||
| return relativePosition + bounds.getPosition().toFloat(); | |||
| } | |||
| using ComponentPeer::localToGlobal; | |||
| Point<float> globalToLocal (Point<float> screenPosition) override | |||
| { | |||
| return screenPosition - bounds.getPosition().toFloat(); | |||
| } | |||
| using ComponentPeer::globalToLocal; | |||
| void setAlpha (float /* newAlpha */) override | |||
| { | |||
| //xxx todo! | |||
| @@ -1662,9 +1666,9 @@ public: | |||
| ScopedXLock xlock (display); | |||
| updateKeyStates ((int) keyEvent.keycode, true); | |||
| String oldLocale (::setlocale (LC_ALL, 0)); | |||
| String oldLocale (::setlocale (LC_ALL, nullptr)); | |||
| ::setlocale (LC_ALL, ""); | |||
| XLookupString (&keyEvent, utf8, sizeof (utf8), &sym, 0); | |||
| XLookupString (&keyEvent, utf8, sizeof (utf8), &sym, nullptr); | |||
| if (oldLocale.isNotEmpty()) | |||
| ::setlocale (LC_ALL, oldLocale.toRawUTF8()); | |||
| @@ -2230,7 +2234,7 @@ private: | |||
| XShmSegmentInfo segmentinfo; | |||
| auto testImage = XShmCreateImage (display, DefaultVisual (display, DefaultScreen (display)), | |||
| 24, ZPixmap, 0, &segmentinfo, 64, 64); | |||
| 24, ZPixmap, nullptr, &segmentinfo, 64, 64); | |||
| useARGBImagesForRendering = (testImage->bits_per_pixel == 32); | |||
| XDestroyImage (testImage); | |||
| @@ -3180,12 +3184,12 @@ private: | |||
| for (;;) | |||
| { | |||
| GetXProperty prop (display, evt.xany.window, evt.xselection.property, | |||
| dropData.getSize() / 4, 65536, false, AnyPropertyType); | |||
| (long) (dropData.getSize() / 4), 65536, false, AnyPropertyType); | |||
| if (! prop.success) | |||
| break; | |||
| dropData.append (prop.data, prop.numItems * (size_t) prop.actualFormat / 8); | |||
| dropData.append (prop.data, (size_t) (prop.actualFormat / 8) * prop.numItems); | |||
| if (prop.bytesLeft <= 0) | |||
| break; | |||
| @@ -3337,7 +3341,7 @@ private: | |||
| void initialisePointerMap() | |||
| { | |||
| const int numButtons = XGetPointerMapping (display, 0, 0); | |||
| const int numButtons = XGetPointerMapping (display, nullptr, 0); | |||
| pointerMap[2] = pointerMap[3] = pointerMap[4] = Keys::NoButton; | |||
| if (numButtons == 2) | |||
| @@ -317,11 +317,15 @@ public: | |||
| return relativePosition + getBounds (true).getPosition().toFloat(); | |||
| } | |||
| using ComponentPeer::localToGlobal; | |||
| Point<float> globalToLocal (Point<float> screenPosition) override | |||
| { | |||
| return screenPosition - getBounds (true).getPosition().toFloat(); | |||
| } | |||
| using ComponentPeer::globalToLocal; | |||
| void setAlpha (float newAlpha) override | |||
| { | |||
| if (isSharedWindow) | |||