From b7536ca94b5200be825843ce3ca45bbfa3c4ed25 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 18 Apr 2014 23:39:12 +0200 Subject: [PATCH] zzogl: gcc warning fix Let's hope variadic macro work on visual cmake: reenable various warning. With previous fixes it just a matter of a couple of warnings --- cmake/BuildParameters.cmake | 7 ++++++- plugins/GSdx/CMakeLists.txt | 5 +++-- plugins/zzogl-pg/opengl/Linux/Conf.cpp | 14 +++++++++++++- plugins/zzogl-pg/opengl/Regs.cpp | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 3df23ba056..babff484c4 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -91,7 +91,12 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") #------------------------------------------------------------------------------- # Set some default compiler flags #------------------------------------------------------------------------------- -set(DEFAULT_WARNINGS "-Wno-write-strings -Wno-format -Wno-unused-parameter -Wno-unused-value -Wstrict-aliasing -Wno-unused-function -Wno-attributes -Wno-unused-result -Wno-missing-field-initializers -Wno-unused-local-typedefs -Wno-parentheses") +#set(DEFAULT_WARNINGS "-Wno-write-strings -Wno-format -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-parentheses") +# -Wno-attributes: "always_inline function might not be inlinable" <= real spam (thousand of warnings!!!) +# -Wstrict-aliasing: to fix one day aliasing issue +# -Wno-missing-field-initializers: standard allow to init only the begin of struct/array in static init. Just a silly warning. +# -Wno-unused-function: warn for function not used in release build +set(DEFAULT_WARNINGS "-Wno-attributes -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-function") set(HARDEING_OPT "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security") set(DEFAULT_GCC_FLAG "-m32 -msse -msse2 -march=i686 -pthread ${DEFAULT_WARNINGS} ${HARDEING_OPT}") if(CMAKE_BUILD_TYPE MATCHES "Debug|Devel") diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 891eec669b..128240da95 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -15,9 +15,10 @@ set(CommonFlags -mpreferred-stack-boundary=2 -mfpmath=sse #-Wstrict-aliasing # Allow to track strict aliasing issue. - -Wunused-variable -std=c++0x -fno-strict-aliasing + -Wno-unknown-pragmas + -Wno-parentheses ) set(OptimizationFlags @@ -32,7 +33,7 @@ endif(CMAKE_BUILD_TYPE STREQUAL Debug) # Devel - Build if(CMAKE_BUILD_TYPE STREQUAL Devel) - add_definitions(${CommonFlags} ${OptimizationFlags} -D_DEVEL -g -W) + add_definitions(${CommonFlags} ${OptimizationFlags} -D_DEVEL -g) endif(CMAKE_BUILD_TYPE STREQUAL Devel) # Release - Build diff --git a/plugins/zzogl-pg/opengl/Linux/Conf.cpp b/plugins/zzogl-pg/opengl/Linux/Conf.cpp index c783aa0052..e3d62c589f 100644 --- a/plugins/zzogl-pg/opengl/Linux/Conf.cpp +++ b/plugins/zzogl-pg/opengl/Linux/Conf.cpp @@ -81,19 +81,31 @@ void LoadConfig() } err = fscanf(f, "interlace = %hhx\n", &conf.interlace); - + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "mrtdepth = %hhx\n", &conf.mrtdepth); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "zzoptions = %x\n", &conf.zz_options._u32); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "options = %x\n", &conf.hacks._u32); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "bilinear = %hhx\n", &conf.bilinear); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "aliasing = %hhx\n", &conf.aa); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "width = %x\n", &conf.width); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "height = %x\n", &conf.height); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "x = %x\n", &conf.x); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "y = %x\n", &conf.y); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "log = %x\n", &conf.log); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "skipdraw = %x\n", &conf.SkipDraw); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); err = fscanf(f, "disablehacks = %x\n", &conf.disableHacks); + if (err != 1) ZZLog::Error_Log("Failed to read zzogl option"); fclose(f); // turn off all hacks by default diff --git a/plugins/zzogl-pg/opengl/Regs.cpp b/plugins/zzogl-pg/opengl/Regs.cpp index 9df70fd612..ec091879e7 100644 --- a/plugins/zzogl-pg/opengl/Regs.cpp +++ b/plugins/zzogl-pg/opengl/Regs.cpp @@ -74,7 +74,7 @@ u32 s_uClampData[2] = {0, }; #ifdef SPAM_UNUSED_REGISTERS #define REG_LOG ZZLog::Error_Log #else -#define REG_LOG 0 && +#define REG_LOG(exp, ...) ((void)0) #endif void __gifCall GIFPackedRegHandlerNull(const u32* data)