Browse Source

Fixed some more Linux compiler warnings

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
8b5bc69582
7 changed files with 41 additions and 16 deletions
  1. +2
    -2
      modules/juce_audio_processors/format_types/juce_AU_Shared.h
  2. +2
    -2
      modules/juce_audio_processors/processors/juce_AudioPluginInstance.h
  3. +6
    -6
      modules/juce_audio_processors/processors/juce_AudioProcessor.h
  4. +1
    -1
      modules/juce_core/threads/juce_Thread.cpp
  5. +11
    -0
      modules/juce_gui_basics/juce_gui_basics.cpp
  6. +18
    -4
      modules/juce_gui_extra/juce_gui_extra.cpp
  7. +1
    -1
      modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp

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

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


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

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


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

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


+ 1
- 1
modules/juce_core/threads/juce_Thread.cpp View File

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


+ 11
- 0
modules/juce_gui_basics/juce_gui_basics.cpp View File

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


+ 18
- 4
modules/juce_gui_extra/juce_gui_extra.cpp View File

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


+ 1
- 1
modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp View File

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


Loading…
Cancel
Save