From 73d4e73a3dbf4254328620d74a393ad97733824e Mon Sep 17 00:00:00 2001 From: tpoole Date: Thu, 6 Jul 2017 17:17:52 +0100 Subject: [PATCH] UnitTestRunner: Fixed some build warnings on Linux --- extras/UnitTestRunner/Builds/LinuxMakefile/Makefile | 4 ++-- extras/UnitTestRunner/UnitTestRunner.jucer | 12 ++++++------ .../juce_gui_basics/misc/juce_JUCESplashScreen.cpp | 2 ++ .../native/juce_linux_X11_Windowing.cpp | 4 ++-- modules/juce_opengl/juce_opengl.cpp | 1 + modules/juce_opengl/native/juce_OpenGL_linux_X11.h | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/extras/UnitTestRunner/Builds/LinuxMakefile/Makefile b/extras/UnitTestRunner/Builds/LinuxMakefile/Makefile index 803c7b51a8..f0697a167a 100644 --- a/extras/UnitTestRunner/Builds/LinuxMakefile/Makefile +++ b/extras/UnitTestRunner/Builds/LinuxMakefile/Makefile @@ -37,7 +37,7 @@ ifeq ($(CONFIG),Debug) JUCE_CPPFLAGS_CONSOLEAPP := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 JUCE_TARGET_CONSOLEAPP := UnitTestRunner - JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 $(CFLAGS) + JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 -Wall -Werror $(CFLAGS) JUCE_CXXFLAGS += $(CXXFLAGS) $(JUCE_CFLAGS) -std=c++11 $(CXXFLAGS) JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) -L/usr/X11R6/lib/ $(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -lGL -ldl -lpthread -lrt $(LDFLAGS) @@ -58,7 +58,7 @@ ifeq ($(CONFIG),Release) JUCE_CPPFLAGS_CONSOLEAPP := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 JUCE_TARGET_CONSOLEAPP := UnitTestRunner - JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -O3 $(CFLAGS) + JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -O3 -Wall -Werror $(CFLAGS) JUCE_CXXFLAGS += $(CXXFLAGS) $(JUCE_CFLAGS) -std=c++11 $(CXXFLAGS) JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/ $(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -lGL -ldl -lpthread -lrt $(LDFLAGS) diff --git a/extras/UnitTestRunner/UnitTestRunner.jucer b/extras/UnitTestRunner/UnitTestRunner.jucer index 21b86ff3d8..554a9430d2 100644 --- a/extras/UnitTestRunner/UnitTestRunner.jucer +++ b/extras/UnitTestRunner/UnitTestRunner.jucer @@ -27,7 +27,6 @@ - @@ -37,9 +36,10 @@ + - + @@ -54,7 +54,6 @@ - @@ -64,6 +63,7 @@ + @@ -76,7 +76,6 @@ warningsAreErrors="1"/> - @@ -93,6 +92,7 @@ + @@ -105,7 +105,6 @@ wholeProgramOptimisation="1"/> - @@ -122,6 +121,7 @@ + @@ -143,7 +143,7 @@ - + diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp index b0b4ee9be2..103266104a 100644 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp +++ b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp @@ -227,6 +227,8 @@ JUCESplashScreen::JUCESplashScreen (Component& parent) appUsageReported = true; } } + #else + ignoreUnused (appUsageReported); #endif #if JUCE_DISPLAY_SPLASH_SCREEN diff --git a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp index 895843b79a..8c2d1bcd94 100644 --- a/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp @@ -2216,7 +2216,7 @@ public: auto mapIndex = (uint32) (buttonPressEvent.button - Button1); - if (mapIndex < numElementsInArray (pointerMap)) + if (mapIndex < (uint32) numElementsInArray (pointerMap)) { switch (pointerMap[mapIndex]) { @@ -2241,7 +2241,7 @@ public: auto mapIndex = (uint32) (buttonRelEvent.button - Button1); - if (mapIndex < numElementsInArray (pointerMap)) + if (mapIndex < (uint32) numElementsInArray (pointerMap)) { switch (pointerMap[mapIndex]) { diff --git a/modules/juce_opengl/juce_opengl.cpp b/modules/juce_opengl/juce_opengl.cpp index 7fa7abdf2b..593931b3d8 100644 --- a/modules/juce_opengl/juce_opengl.cpp +++ b/modules/juce_opengl/juce_opengl.cpp @@ -191,6 +191,7 @@ static bool checkPeerIsValid (OpenGLContext* context) } } #else + ignoreUnused (peer); return true; #endif } diff --git a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h index c65f358058..dc287b947d 100644 --- a/modules/juce_opengl/native/juce_OpenGL_linux_X11.h +++ b/modules/juce_opengl/native/juce_OpenGL_linux_X11.h @@ -241,7 +241,7 @@ bool OpenGLHelpers::isContextActive() { ScopedXDisplay xDisplay; - if (auto display = xDisplay.display) + if (xDisplay.display) { ScopedXLock xlock (xDisplay.display); return glXGetCurrentContext() != 0;