Browse Source

Fix warnings when building in C++20 mode

tags/2021-05-28
reuk 5 years ago
parent
commit
586ab8927d
9 changed files with 24 additions and 16 deletions
  1. +4
    -2
      examples/Plugins/InterAppAudioEffectPluginDemo.h
  2. +2
    -4
      examples/Plugins/SamplerPluginDemo.h
  3. +4
    -3
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  4. +3
    -1
      modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm
  5. +1
    -1
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  6. +1
    -1
      modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp
  7. +2
    -2
      modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  8. +6
    -1
      modules/juce_gui_basics/components/juce_Component.cpp
  9. +1
    -1
      modules/juce_gui_basics/layout/juce_ScrollBar.cpp

+ 4
- 2
examples/Plugins/InterAppAudioEffectPluginDemo.h View File

@@ -176,6 +176,8 @@ public:
return true;
}
using AudioProcessor::processBlock;
void processBlock (AudioBuffer<float>& buffer, MidiBuffer&) override
{
float gain = *parameters.getRawParameterValue ("gain");
@@ -423,8 +425,8 @@ private:
//==============================================================================
bool transportControllable()
{
auto playHead = iaaEffectProcessor.getPlayHead();
return playHead != nullptr && playHead->canControlTransport();
auto processorPlayHead = iaaEffectProcessor.getPlayHead();
return processorPlayHead != nullptr && processorPlayHead->canControlTransport();
}
//==============================================================================


+ 2
- 4
examples/Plugins/SamplerPluginDemo.h View File

@@ -2344,7 +2344,7 @@ public:
std::vector<std::unique_ptr<MPESamplerVoice>> newVoices;
};
numberOfVoices = std::min (maxVoices, numberOfVoices);
numberOfVoices = std::min ((int) maxVoices, numberOfVoices);
auto loadedSamplerSound = samplerSound;
std::vector<std::unique_ptr<MPESamplerVoice>> newSamplerVoices;
newSamplerVoices.reserve ((size_t) numberOfVoices);
@@ -2595,12 +2595,10 @@ private:
// with the real state of the processor.
SpinLock commandQueueMutex;
static constexpr auto maxVoices { 20 };
enum { maxVoices = 20 };
// This is used for visualising the current playback position of each voice.
std::array<std::atomic<float>, maxVoices> playbackPositions;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SamplerAudioProcessor)
};
const int SamplerAudioProcessor::maxVoices;

+ 4
- 3
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -47,7 +47,8 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wshorten-64-to-32",
"-Wzero-as-null-pointer-constant",
"-Wnullable-to-nonnull-conversion",
"-Wgnu-zero-variadic-macro-arguments",
"-Wformat-pedantic")
"-Wformat-pedantic",
"-Wdeprecated-anon-enum-enum-conversion")
#include "../utility/juce_IncludeSystemHeaders.h"
@@ -354,7 +355,7 @@ public:
}
}
err = (busNr == (requestedNumBus - 1) ? noErr : kAudioUnitErr_FormatNotSupported);
err = (busNr == (requestedNumBus - 1) ? (OSStatus) noErr : (OSStatus) kAudioUnitErr_FormatNotSupported);
}
// was there an error?
@@ -1902,7 +1903,7 @@ private:
return (scope != kAudioUnitScope_Input
&& scope != kAudioUnitScope_Output)
? kAudioUnitErr_InvalidScope : noErr;
? (OSStatus) kAudioUnitErr_InvalidScope : (OSStatus) noErr;
}
OSStatus elementToBusIdx (AudioUnitScope scope, AudioUnitElement element, bool& isInput, int& busIdx) noexcept


+ 3
- 1
modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm View File

@@ -46,7 +46,9 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wparentheses",
"-Wnullable-to-nonnull-conversion",
"-Wignored-qualifiers",
"-Wfour-char-constants",
"-Wmissing-prototypes")
"-Wmissing-prototypes",
"-Wdeprecated-anon-enum-enum-conversion",
"-Wambiguous-reversed-operator")
// From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole
// set of functions with rather generic names. However, we still need a couple


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

@@ -758,7 +758,7 @@ public:
zerostruct (stream); // (can't use "= { 0 }" on this object because it's typedef'ed as a C struct)
stream.mSampleRate = sampleRate;
stream.mFormatID = kAudioFormatLinearPCM;
stream.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved | kAudioFormatFlagsNativeEndian;
stream.mFormatFlags = (int) kAudioFormatFlagsNativeFloatPacked | (int) kAudioFormatFlagIsNonInterleaved | (int) kAudioFormatFlagsNativeEndian;
stream.mFramesPerPacket = 1;
stream.mBytesPerPacket = 4;
stream.mBytesPerFrame = 4;


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

@@ -162,7 +162,7 @@ private:
return;
unnormalisedValue = newValue;
listeners.call ([=] (Listener& l) { l.parameterChanged (parameter.paramID, unnormalisedValue); });
listeners.call ([this] (Listener& l) { l.parameterChanged (parameter.paramID, unnormalisedValue); });
listenersNeedCalling = false;
needsUpdate = true;
}


+ 2
- 2
modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm View File

@@ -171,9 +171,9 @@ private:
static CGBitmapInfo getCGImageFlags (const Image::PixelFormat& format)
{
#if JUCE_BIG_ENDIAN
return format == Image::ARGB ? (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big) : kCGBitmapByteOrderDefault;
return format == Image::ARGB ? ((uint32_t) kCGImageAlphaPremultipliedFirst | (uint32_t) kCGBitmapByteOrder32Big) : kCGBitmapByteOrderDefault;
#else
return format == Image::ARGB ? (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little) : kCGBitmapByteOrderDefault;
return format == Image::ARGB ? ((uint32_t) kCGImageAlphaPremultipliedFirst | (uint32_t) kCGBitmapByteOrder32Little) : kCGBitmapByteOrderDefault;
#endif
}


+ 6
- 1
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -1181,7 +1181,12 @@ void Component::sendMovedResizedMessages (bool wasMoved, bool wasResized)
parentComponent->childBoundsChanged (this);
if (! checker.shouldBailOut())
componentListeners.callChecked (checker, [=] (ComponentListener& l) { l.componentMovedOrResized (*this, wasMoved, wasResized); });
{
componentListeners.callChecked (checker, [this, wasMoved, wasResized] (ComponentListener& l)
{
l.componentMovedOrResized (*this, wasMoved, wasResized);
});
}
}
void Component::setSize (int w, int h) { setBounds (getX(), getY(), w, h); }


+ 1
- 1
modules/juce_gui_basics/layout/juce_ScrollBar.cpp View File

@@ -173,7 +173,7 @@ void ScrollBar::removeListener (Listener* listener)
void ScrollBar::handleAsyncUpdate()
{
auto start = visibleRange.getStart(); // (need to use a temp variable for VC7 compatibility)
listeners.call ([=] (Listener& l) { l.scrollBarMoved (this, start); });
listeners.call ([this, start] (Listener& l) { l.scrollBarMoved (this, start); });
}
//==============================================================================


Loading…
Cancel
Save