@@ -304,11 +304,11 @@ struct AudioUnitHelpers | |||||
} | } | ||||
} | } | ||||
template <int numLayouts> | |||||
template <size_t numLayouts> | |||||
static bool isLayoutSupported (const AudioProcessor& processor, | static bool isLayoutSupported (const AudioProcessor& processor, | ||||
bool isInput, int busIdx, | bool isInput, int busIdx, | ||||
int numChannels, | int numChannels, | ||||
const short (&channelLayoutList) [(size_t) numLayouts][2], | |||||
const short (&channelLayoutList) [numLayouts][2], | |||||
bool hasLayoutMap = true) | bool hasLayoutMap = true) | ||||
{ | { | ||||
if (const AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx)) | if (const AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx)) | ||||
@@ -115,8 +115,8 @@ protected: | |||||
AudioPluginInstance() = default; | AudioPluginInstance() = default; | ||||
AudioPluginInstance (const BusesProperties& ioLayouts) : AudioProcessor (ioLayouts) {} | AudioPluginInstance (const BusesProperties& ioLayouts) : AudioProcessor (ioLayouts) {} | ||||
template <int numLayouts> | |||||
AudioPluginInstance (const short channelLayoutList[(size_t) numLayouts][2]) : AudioProcessor (channelLayoutList) {} | |||||
template <size_t numLayouts> | |||||
AudioPluginInstance (const short channelLayoutList[numLayouts][2]) : AudioProcessor (channelLayoutList) {} | |||||
private: | private: | ||||
void assertOnceOnDeprecatedMethodUse() const noexcept; | void assertOnceOnDeprecatedMethodUse() const noexcept; | ||||
@@ -763,8 +763,8 @@ public: | |||||
return containsLayout (layouts, layoutListToArray (channelLayoutList)); | return containsLayout (layouts, layoutListToArray (channelLayoutList)); | ||||
} | } | ||||
template <int numLayouts> | |||||
static bool containsLayout (const BusesLayout& layouts, const short (&channelLayoutList) [(size_t) numLayouts][2]) | |||||
template <size_t numLayouts> | |||||
static bool containsLayout (const BusesLayout& layouts, const short (&channelLayoutList) [numLayouts][2]) | |||||
{ | { | ||||
return containsLayout (layouts, layoutListToArray (channelLayoutList)); | return containsLayout (layouts, layoutListToArray (channelLayoutList)); | ||||
} | } | ||||
@@ -780,9 +780,9 @@ public: | |||||
} | } | ||||
@endcode | @endcode | ||||
*/ | */ | ||||
template <int numLayouts> | |||||
template <size_t numLayouts> | |||||
BusesLayout getNextBestLayoutInLayoutList (const BusesLayout& layouts, | BusesLayout getNextBestLayoutInLayoutList (const BusesLayout& layouts, | ||||
const short (&channelLayoutList) [(size_t) numLayouts][2]) | |||||
const short (&channelLayoutList) [numLayouts][2]) | |||||
{ | { | ||||
return getNextBestLayoutInList (layouts, layoutListToArray (channelLayoutList)); | return getNextBestLayoutInList (layouts, layoutListToArray (channelLayoutList)); | ||||
} | } | ||||
@@ -1421,8 +1421,8 @@ private: | |||||
int16 inChannels = 0, outChannels = 0; | int16 inChannels = 0, outChannels = 0; | ||||
}; | }; | ||||
template <int numLayouts> | |||||
static Array<InOutChannelPair> layoutListToArray (const short (&configuration) [(size_t) numLayouts][2]) | |||||
template <size_t numLayouts> | |||||
static Array<InOutChannelPair> layoutListToArray (const short (&configuration) [numLayouts][2]) | |||||
{ | { | ||||
Array<InOutChannelPair> layouts; | Array<InOutChannelPair> layouts; | ||||
@@ -315,7 +315,7 @@ struct LambdaThread : public Thread | |||||
void run() override | void run() override | ||||
{ | { | ||||
fn(); | fn(); | ||||
fn = {}; // free any objects that the lambda might contain while the thread is still active | |||||
fn = nullptr; // free any objects that the lambda might contain while the thread is still active | |||||
} | } | ||||
std::function<void()> fn; | std::function<void()> fn; | ||||
@@ -309,7 +309,18 @@ namespace juce | |||||
#elif JUCE_LINUX | #elif JUCE_LINUX | ||||
#include "native/juce_linux_X11.cpp" | #include "native/juce_linux_X11.cpp" | ||||
#include "native/juce_linux_X11_Clipboard.cpp" | #include "native/juce_linux_X11_Clipboard.cpp" | ||||
#if JUCE_GCC | |||||
#pragma GCC diagnostic push | |||||
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
#endif | |||||
#include "native/juce_linux_X11_Windowing.cpp" | #include "native/juce_linux_X11_Windowing.cpp" | ||||
#if JUCE_GCC | |||||
#pragma GCC diagnostic pop | |||||
#endif | |||||
#include "native/juce_linux_FileChooser.cpp" | #include "native/juce_linux_FileChooser.cpp" | ||||
#elif JUCE_ANDROID | #elif JUCE_ANDROID | ||||
@@ -101,14 +101,17 @@ | |||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <sys/wait.h> | #include <sys/wait.h> | ||||
#if JUCE_GCC && __GNUC__ > 7 | |||||
#if JUCE_GCC | |||||
#pragma GCC diagnostic push | #pragma GCC diagnostic push | ||||
#pragma GCC diagnostic ignored "-Wparentheses" | |||||
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
#if __GNUC__ > 7 | |||||
#pragma GCC diagnostic ignored "-Wparentheses" | |||||
#endif | |||||
#endif | #endif | ||||
#include <gtk/gtk.h> | #include <gtk/gtk.h> | ||||
#if JUCE_GCC && __GNUC__ > 7 | |||||
#if JUCE_GCC | |||||
#pragma GCC diagnostic pop | #pragma GCC diagnostic pop | ||||
#endif | #endif | ||||
@@ -172,10 +175,21 @@ | |||||
//============================================================================== | //============================================================================== | ||||
#elif JUCE_LINUX | #elif JUCE_LINUX | ||||
#include "native/juce_linux_XEmbedComponent.cpp" | |||||
#if JUCE_GCC | |||||
#pragma GCC diagnostic push | |||||
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||||
#endif | |||||
#include "native/juce_linux_XEmbedComponent.cpp" | |||||
#if JUCE_WEB_BROWSER | #if JUCE_WEB_BROWSER | ||||
#include "native/juce_linux_X11_WebBrowserComponent.cpp" | #include "native/juce_linux_X11_WebBrowserComponent.cpp" | ||||
#endif | #endif | ||||
#if JUCE_GCC | |||||
#pragma GCC diagnostic pop | |||||
#endif | |||||
#include "native/juce_linux_X11_SystemTrayIcon.cpp" | #include "native/juce_linux_X11_SystemTrayIcon.cpp" | ||||
//============================================================================== | //============================================================================== | ||||
@@ -612,7 +612,7 @@ private: | |||||
int result = 0; | int result = 0; | ||||
while (result == 0 || (result < 0 && errno == EINTR)) | while (result == 0 || (result < 0 && errno == EINTR)) | ||||
result = select (max_fd + 1, &set, NULL, NULL, NULL); | |||||
result = select (max_fd + 1, &set, nullptr, nullptr, nullptr); | |||||
if (result < 0) | if (result < 0) | ||||
break; | break; | ||||