Browse Source

Fixed some GCC compiler warnings and removed deprecated functions

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
16dd26649a
100 changed files with 363 additions and 258 deletions
  1. +1
    -1
      examples/Assets/AudioLiveScrollingDisplay.h
  2. +1
    -1
      examples/Audio/AudioLatencyDemo.h
  3. +2
    -0
      examples/Audio/AudioSynthesiserDemo.h
  4. +2
    -0
      examples/Audio/MPEDemo.h
  5. +1
    -1
      examples/BLOCKS/BlocksMonitorDemo.h
  6. +2
    -0
      examples/BLOCKS/BlocksSynthDemo.h
  7. +2
    -0
      examples/DemoRunner/Source/UI/SettingsContent.h
  8. +2
    -0
      examples/GUI/WidgetsDemo.h
  9. +2
    -0
      examples/Plugins/AudioPluginDemo.h
  10. +6
    -0
      extras/AudioPluginHost/Source/Filters/InternalFilters.cpp
  11. +2
    -0
      extras/Projucer/Source/CodeEditor/jucer_LiveBuildCodeEditor.h
  12. +2
    -0
      extras/Projucer/Source/LiveBuildEngine/UI/jucer_ComponentListComponent.h
  13. +2
    -0
      extras/Projucer/Source/Project/UI/jucer_ContentViewComponents.h
  14. +2
    -0
      extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.cpp
  15. +0
    -1
      extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h
  16. +2
    -0
      extras/Projucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h
  17. +3
    -1
      modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp
  18. +2
    -2
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
  19. +0
    -5
      modules/juce_audio_basics/synthesisers/juce_Synthesiser.h
  20. +1
    -1
      modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
  21. +1
    -1
      modules/juce_audio_devices/native/juce_android_Oboe.cpp
  22. +2
    -2
      modules/juce_audio_devices/native/juce_linux_ALSA.cpp
  23. +5
    -5
      modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp
  24. +3
    -1
      modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  25. +1
    -0
      modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h
  26. +1
    -1
      modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp
  27. +1
    -0
      modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h
  28. +13
    -2
      modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
  29. +2
    -0
      modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h
  30. +1
    -0
      modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h
  31. +22
    -21
      modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp
  32. +1
    -0
      modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h
  33. +6
    -3
      modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
  34. +1
    -0
      modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h
  35. +4
    -2
      modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  36. +1
    -0
      modules/juce_audio_formats/codecs/juce_WavAudioFormat.h
  37. +1
    -0
      modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h
  38. +2
    -2
      modules/juce_audio_formats/format/juce_AudioFormatReader.cpp
  39. +1
    -1
      modules/juce_audio_formats/format/juce_AudioFormatReader.h
  40. +1
    -0
      modules/juce_audio_formats/format/juce_AudioSubsectionReader.h
  41. +1
    -0
      modules/juce_audio_formats/sampler/juce_Sampler.h
  42. +1
    -1
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  43. +23
    -13
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  44. +1
    -1
      modules/juce_audio_processors/format_types/juce_AU_Shared.h
  45. +1
    -1
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  46. +29
    -27
      modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp
  47. +2
    -2
      modules/juce_audio_processors/format_types/juce_VSTCommon.h
  48. +2
    -2
      modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h
  49. +29
    -13
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  50. +1
    -1
      modules/juce_audio_processors/processors/juce_AudioPluginInstance.h
  51. +3
    -3
      modules/juce_audio_processors/processors/juce_AudioProcessor.h
  52. +1
    -0
      modules/juce_audio_processors/processors/juce_AudioProcessorParameterGroup.cpp
  53. +1
    -0
      modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp
  54. +2
    -0
      modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp
  55. +4
    -4
      modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp
  56. +1
    -1
      modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h
  57. +4
    -4
      modules/juce_blocks_basics/protocol/juce_BitPackingUtilities.h
  58. +3
    -3
      modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp
  59. +3
    -3
      modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp
  60. +3
    -3
      modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp
  61. +8
    -7
      modules/juce_box2d/juce_box2d.cpp
  62. +16
    -8
      modules/juce_box2d/juce_box2d.h
  63. +2
    -2
      modules/juce_core/containers/juce_ArrayBase.h
  64. +3
    -3
      modules/juce_core/maths/juce_BigInteger.cpp
  65. +1
    -1
      modules/juce_core/maths/juce_MathsFunctions.h
  66. +1
    -1
      modules/juce_core/memory/juce_MemoryBlock.cpp
  67. +1
    -1
      modules/juce_core/native/juce_linux_Files.cpp
  68. +1
    -1
      modules/juce_core/native/juce_linux_SystemStats.cpp
  69. +2
    -2
      modules/juce_core/native/juce_posix_SharedCode.h
  70. +1
    -1
      modules/juce_core/system/juce_TargetPlatform.h
  71. +3
    -3
      modules/juce_core/text/juce_CharacterFunctions.h
  72. +2
    -2
      modules/juce_core/text/juce_String.cpp
  73. +1
    -1
      modules/juce_core/text/juce_StringArray.cpp
  74. +1
    -1
      modules/juce_core/xml/juce_XmlDocument.cpp
  75. +12
    -0
      modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
  76. +10
    -10
      modules/juce_core/zip/juce_ZipFile.cpp
  77. +1
    -1
      modules/juce_cryptography/hashing/juce_SHA256.cpp
  78. +2
    -2
      modules/juce_cryptography/hashing/juce_Whirlpool.cpp
  79. +1
    -1
      modules/juce_dsp/containers/juce_SIMDRegister_Impl.h
  80. +1
    -1
      modules/juce_dsp/containers/juce_SIMDRegister_test.cpp
  81. +4
    -4
      modules/juce_dsp/frequency/juce_FFT.cpp
  82. +1
    -1
      modules/juce_dsp/maths/juce_Matrix.h
  83. +0
    -7
      modules/juce_events/broadcasters/juce_ChangeListener.h
  84. +1
    -1
      modules/juce_events/native/juce_linux_Messaging.cpp
  85. +8
    -3
      modules/juce_graphics/image_formats/juce_JPEGLoader.cpp
  86. +15
    -4
      modules/juce_graphics/image_formats/juce_PNGLoader.cpp
  87. +3
    -3
      modules/juce_graphics/native/juce_freetype_Fonts.cpp
  88. +0
    -7
      modules/juce_gui_basics/buttons/juce_Button.h
  89. +4
    -2
      modules/juce_gui_basics/buttons/juce_HyperlinkButton.h
  90. +4
    -0
      modules/juce_gui_basics/components/juce_ModalComponentManager.cpp
  91. +2
    -0
      modules/juce_gui_basics/layout/juce_ScrollBar.cpp
  92. +1
    -0
      modules/juce_gui_basics/layout/juce_TabbedButtonBar.h
  93. +0
    -5
      modules/juce_gui_basics/layout/juce_Viewport.h
  94. +0
    -2
      modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h
  95. +0
    -12
      modules/juce_gui_basics/mouse/juce_DragAndDropTarget.h
  96. +0
    -8
      modules/juce_gui_basics/mouse/juce_MouseListener.h
  97. +4
    -0
      modules/juce_gui_basics/native/juce_android_Windowing.cpp
  98. +2
    -0
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  99. +18
    -14
      modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp
  100. +4
    -0
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm

+ 1
- 1
examples/Assets/AudioLiveScrollingDisplay.h View File

@@ -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)


+ 1
- 1
examples/Audio/AudioLatencyDemo.h View File

@@ -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));
}
}


+ 2
- 0
examples/Audio/AudioSynthesiserDemo.h View File

@@ -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;
};


+ 2
- 0
examples/Audio/MPEDemo.h View File

@@ -828,6 +828,8 @@ public:
}
}
using MPESynthesiserVoice::renderNextBlock;
private:
//==============================================================================
float getNextSample() noexcept


+ 1
- 1
examples/BLOCKS/BlocksMonitorDemo.h View File

@@ -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;


+ 2
- 0
examples/BLOCKS/BlocksSynthDemo.h View File

@@ -108,6 +108,8 @@ public:
}
}
using SynthesiserVoice::renderNextBlock;
/** Returns the next sample */
double getSample()
{


+ 2
- 0
examples/DemoRunner/Source/UI/SettingsContent.h View File

@@ -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();


+ 2
- 0
examples/GUI/WidgetsDemo.h View File

@@ -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))


+ 2
- 0
examples/Plugins/AudioPluginDemo.h View File

@@ -160,6 +160,8 @@ public:
}
}
using SynthesiserVoice::renderNextBlock;
private:
double currentAngle = 0.0;
double angleDelta = 0.0;


+ 6
- 0
extras/AudioPluginHost/Source/Filters/InternalFilters.cpp View File

@@ -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;
};


+ 2
- 0
extras/Projucer/Source/CodeEditor/jucer_LiveBuildCodeEditor.h View File

@@ -201,6 +201,8 @@ private:
if (auto* l = findParentComponentOfClass<LaunchClassOverlayComponent>())
l->launch();
}
using Button::clicked;
};
void launch()


+ 2
- 0
extras/Projucer/Source/LiveBuildEngine/UI/jucer_ComponentListComponent.h View File

@@ -242,6 +242,8 @@ private:
classItem.launchEditor();
}
using Button::clicked;
const ClassItem& classItem;
bool isShowCode;
};


+ 2
- 0
extras/Projucer/Source/Project/UI/jucer_ContentViewComponents.h View File

@@ -185,6 +185,8 @@ public:
CallOutBox::launchAsynchronously (w, getScreenBounds(), nullptr);
}
using Button::clicked;
void setInfoToDisplay (const String& infoToDisplay)
{
if (infoToDisplay.isNotEmpty())


+ 2
- 0
extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.cpp View File

@@ -49,6 +49,8 @@ struct SlidingPanelComponent::DotButton : public Button
owner.goToTab (index);
}
using Button::clicked;
SlidingPanelComponent& owner;
int index;
};


+ 0
- 1
extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h View File

@@ -53,7 +53,6 @@ public:
/** Animates the window to the desired tab. */
void goToTab (int targetTabIndex);
//==============================================================================
/** @internal */
void resized() override;


+ 2
- 0
extras/Projucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h View File

@@ -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;


+ 3
- 1
modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp View File

@@ -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);


+ 2
- 2
modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h View File

@@ -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());


+ 0
- 5
modules/juce_audio_basics/synthesisers/juce_Synthesiser.h View File

@@ -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)
};


+ 1
- 1
modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp View File

@@ -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)


+ 1
- 1
modules/juce_audio_devices/native/juce_android_Oboe.cpp View File

@@ -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));
}
}


+ 2
- 2
modules/juce_audio_devices/native/juce_linux_ALSA.cpp View File

@@ -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));
}
}


+ 5
- 5
modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp View File

@@ -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));
}
}


+ 3
- 1
modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -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;


+ 1
- 0
modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h View File

@@ -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)


+ 1
- 1
modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp View File

@@ -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());


+ 1
- 0
modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h View File

@@ -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)


+ 13
- 2
modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp View File

@@ -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;


+ 2
- 0
modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h View File

@@ -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)
};


+ 1
- 0
modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h View File

@@ -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;


+ 22
- 21
modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp View File

@@ -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;


+ 1
- 0
modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h View File

@@ -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


+ 6
- 3
modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp View File

@@ -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;


+ 1
- 0
modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h View File

@@ -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)


+ 4
- 2
modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp View File

@@ -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


+ 1
- 0
modules/juce_audio_formats/codecs/juce_WavAudioFormat.h View File

@@ -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.


+ 1
- 0
modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h View File

@@ -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


+ 2
- 2
modules/juce_audio_formats/format/juce_AudioFormatReader.cpp View File

@@ -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);


+ 1
- 1
modules/juce_audio_formats/format/juce_AudioFormatReader.h View File

@@ -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;
}


+ 1
- 0
modules/juce_audio_formats/format/juce_AudioSubsectionReader.h View File

@@ -73,6 +73,7 @@ public:
void readMaxLevels (int64 startSample, int64 numSamples,
Range<float>* results, int numChannelsToRead) override;
using AudioFormatReader::readMaxLevels;
private:
//==============================================================================


+ 1
- 0
modules/juce_audio_formats/sampler/juce_Sampler.h View File

@@ -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:
//==============================================================================


+ 1
- 1
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -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;


+ 23
- 13
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -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;


+ 1
- 1
modules/juce_audio_processors/format_types/juce_AU_Shared.h View File

@@ -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))


+ 1
- 1
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -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++);
}
}


+ 29
- 27
modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp View File

@@ -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;


+ 2
- 2
modules/juce_audio_processors/format_types/juce_VSTCommon.h View File

@@ -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();


+ 2
- 2
modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h View File

@@ -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);


+ 29
- 13
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -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 (&micro, 0);
gettimeofday (&micro, 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;


+ 1
- 1
modules/juce_audio_processors/processors/juce_AudioPluginInstance.h View File

@@ -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;


+ 3
- 3
modules/juce_audio_processors/processors/juce_AudioProcessor.h View File

@@ -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;


+ 1
- 0
modules/juce_audio_processors/processors/juce_AudioProcessorParameterGroup.cpp View File

@@ -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; }


+ 1
- 0
modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp View File

@@ -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 {}; }


+ 2
- 0
modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp View File

@@ -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(),


+ 4
- 4
modules/juce_audio_utils/players/juce_AudioProcessorPlayer.cpp View File

@@ -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;
}
}


+ 1
- 1
modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h View File

@@ -583,7 +583,7 @@ struct Runner
//==============================================================================
/** */
uint8 allMemory[((programAndHeapSpace + stackAndGlobalsSpace) + 3) & ~3];
uint8 allMemory[(size_t) (((programAndHeapSpace + stackAndGlobalsSpace) + 3) & ~3)];
/** */
Program program;


+ 4
- 4
modules/juce_blocks_basics/protocol/juce_BitPackingUtilities.h View File

@@ -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;
}


+ 3
- 3
modules/juce_blocks_basics/topology/internal/juce_BlockImplementation.cpp View File

@@ -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


+ 3
- 3
modules/juce_blocks_basics/visualisers/juce_BitmapLEDProgram.cpp View File

@@ -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


+ 3
- 3
modules/juce_blocks_basics/visualisers/juce_DrumPadLEDProgram.cpp View File

@@ -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));


+ 8
- 7
modules/juce_box2d/juce_box2d.cpp View File

@@ -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

+ 16
- 8
modules/juce_box2d/juce_box2d.h View File

@@ -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


+ 2
- 2
modules/juce_core/containers/juce_ArrayBase.h View File

@@ -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));


+ 3
- 3
modules/juce_core/maths/juce_BigInteger.cpp View File

@@ -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);


+ 1
- 1
modules/juce_core/maths/juce_MathsFunctions.h View File

@@ -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; }
//==============================================================================


+ 1
- 1
modules/juce_core/memory/juce_MemoryBlock.cpp View File

@@ -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;


+ 1
- 1
modules/juce_core/native/juce_linux_Files.cpp View File

@@ -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();


+ 1
- 1
modules/juce_core/native/juce_linux_SystemStats.cpp View File

@@ -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


+ 2
- 2
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -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);


+ 1
- 1
modules/juce_core/system/juce_TargetPlatform.h View File

@@ -183,7 +183,7 @@
//==============================================================================
// Compiler type macros.
#ifdef __clang__
#if defined (__clang__)
#define JUCE_CLANG 1
#elif defined (__GNUC__)


+ 3
- 3
modules/juce_core/text/juce_CharacterFunctions.h View File

@@ -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)


+ 2
- 2
modules/juce_core/text/juce_String.cpp View File

@@ -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;


+ 1
- 1
modules/juce_core/text/juce_StringArray.cpp View File

@@ -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);


+ 1
- 1
modules/juce_core/xml/juce_XmlDocument.cpp View File

@@ -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);
}


+ 12
- 0
modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp View File

@@ -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


+ 10
- 10
modules/juce_core/zip/juce_ZipFile.cpp View File

@@ -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);
}
}
}


+ 1
- 1
modules/juce_cryptography/hashing/juce_SHA256.cpp View File

@@ -137,7 +137,7 @@ public:
break;
}
numBytesToRead -= sizeof (buffer);
numBytesToRead -= (int64) sizeof (buffer);
processFullBlock (buffer);
}


+ 2
- 2
modules/juce_cryptography/hashing/juce_Whirlpool.cpp View File

@@ -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;


+ 1
- 1
modules/juce_dsp/containers/juce_SIMDRegister_Impl.h View File

@@ -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)


+ 1
- 1
modules/juce_dsp/containers/juce_SIMDRegister_test.cpp View File

@@ -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);


+ 4
- 4
modules/juce_dsp/frequency/juce_FFT.cpp View File

@@ -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


+ 1
- 1
modules/juce_dsp/maths/juce_Matrix.h View File

@@ -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. */


+ 0
- 7
modules/juce_events/broadcasters/juce_ChangeListener.h View File

@@ -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

+ 1
- 1
modules/juce_events/native/juce_linux_Messaging.cpp View File

@@ -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);
}
}


+ 8
- 3
modules/juce_graphics/image_formats/juce_JPEGLoader.cpp View File

@@ -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


+ 15
- 4
modules/juce_graphics/image_formats/juce_PNGLoader.cpp View File

@@ -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();


+ 3
- 3
modules/juce_graphics/native/juce_freetype_Fonts.cpp View File

@@ -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;


+ 0
- 7
modules/juce_gui_basics/buttons/juce_Button.h View File

@@ -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.


+ 4
- 2
modules/juce_gui_basics/buttons/juce_HyperlinkButton.h View File

@@ -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)
};


+ 4
- 0
modules/juce_gui_basics/components/juce_ModalComponentManager.cpp View File

@@ -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);


+ 2
- 0
modules/juce_gui_basics/layout/juce_ScrollBar.cpp View File

@@ -47,6 +47,8 @@ public:
owner.moveScrollbarInSteps ((direction == 1 || direction == 2) ? 1 : -1);
}
using Button::clicked;
int direction;
private:


+ 1
- 0
modules/juce_gui_basics/layout/juce_TabbedButtonBar.h View File

@@ -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)


+ 0
- 5
modules/juce_gui_basics/layout/juce_Viewport.h View File

@@ -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)
};


+ 0
- 2
modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h View File

@@ -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)
};


+ 0
- 12
modules/juce_gui_basics/mouse/juce_DragAndDropTarget.h View File

@@ -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

+ 0
- 8
modules/juce_gui_basics/mouse/juce_MouseListener.h View File

@@ -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

+ 4
- 0
modules/juce_gui_basics/native/juce_android_Windowing.cpp View File

@@ -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


+ 2
- 0
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -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; }


+ 18
- 14
modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp View File

@@ -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)


+ 4
- 0
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -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)


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save