1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed some more Linux compiler warnings

This commit is contained in:
Tom Poole 2019-06-05 09:35:52 +01:00
parent 67e6bc65a9
commit 8b5bc69582
7 changed files with 41 additions and 16 deletions

View file

@ -304,11 +304,11 @@ struct AudioUnitHelpers
}
}
template <int numLayouts>
template <size_t numLayouts>
static bool isLayoutSupported (const AudioProcessor& processor,
bool isInput, int busIdx,
int numChannels,
const short (&channelLayoutList) [(size_t) numLayouts][2],
const short (&channelLayoutList) [numLayouts][2],
bool hasLayoutMap = true)
{
if (const AudioProcessor::Bus* bus = processor.getBus (isInput, busIdx))

View file

@ -115,8 +115,8 @@ protected:
AudioPluginInstance() = default;
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:
void assertOnceOnDeprecatedMethodUse() const noexcept;

View file

@ -763,8 +763,8 @@ public:
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));
}
@ -780,9 +780,9 @@ public:
}
@endcode
*/
template <int numLayouts>
template <size_t numLayouts>
BusesLayout getNextBestLayoutInLayoutList (const BusesLayout& layouts,
const short (&channelLayoutList) [(size_t) numLayouts][2])
const short (&channelLayoutList) [numLayouts][2])
{
return getNextBestLayoutInList (layouts, layoutListToArray (channelLayoutList));
}
@ -1421,8 +1421,8 @@ private:
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;

View file

@ -315,7 +315,7 @@ struct LambdaThread : public Thread
void run() override
{
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;

View file

@ -309,7 +309,18 @@ namespace juce
#elif JUCE_LINUX
#include "native/juce_linux_X11.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"
#if JUCE_GCC
#pragma GCC diagnostic pop
#endif
#include "native/juce_linux_FileChooser.cpp"
#elif JUCE_ANDROID

View file

@ -101,14 +101,17 @@
#include <fcntl.h>
#include <sys/wait.h>
#if JUCE_GCC && __GNUC__ > 7
#if JUCE_GCC
#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
#include <gtk/gtk.h>
#if JUCE_GCC && __GNUC__ > 7
#if JUCE_GCC
#pragma GCC diagnostic pop
#endif
@ -172,10 +175,21 @@
//==============================================================================
#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
#include "native/juce_linux_X11_WebBrowserComponent.cpp"
#endif
#if JUCE_GCC
#pragma GCC diagnostic pop
#endif
#include "native/juce_linux_X11_SystemTrayIcon.cpp"
//==============================================================================

View file

@ -612,7 +612,7 @@ private:
int result = 0;
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)
break;