From 5306b1347229111010739dbef7f12455b3806f04 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sun, 30 Oct 2011 00:32:22 +0000 Subject: [PATCH] More work on the compiler warnings. Removed the warning flags that are now set by default. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4949 96395faa-99c1-11dd-bbfe-3dabce05a288 --- bin/portable.ini | 1 + cmake/BuildParameters.cmake | 13 +++++++++---- common/include/PS2Eext.h | 6 ++++-- pcsx2/CMakeLists.txt | 7 +------ plugins/CDVDiso/src/CMakeLists.txt | 1 - plugins/CDVDiso/src/Linux/Linux.cpp | 2 +- plugins/CDVDnull/CMakeLists.txt | 1 - plugins/FWnull/CMakeLists.txt | 1 - plugins/GSdx/CMakeLists.txt | 8 +------- plugins/GSnull/CMakeLists.txt | 1 - plugins/GSnull/Registers.h | 6 +++--- plugins/PadNull/CMakeLists.txt | 1 - plugins/SPU2null/CMakeLists.txt | 1 - plugins/USBnull/CMakeLists.txt | 1 - plugins/dev9null/CMakeLists.txt | 1 - plugins/onepad/CMakeLists.txt | 1 - plugins/spu2-x/src/CMakeLists.txt | 1 - plugins/zerospu2/CMakeLists.txt | 2 -- plugins/zzogl-pg/opengl/CMakeLists.txt | 1 - plugins/zzogl-pg/opengl/GSmain.cpp | 2 -- 20 files changed, 20 insertions(+), 38 deletions(-) diff --git a/bin/portable.ini b/bin/portable.ini index e69de29bb2..ccb32ee0b2 100644 --- a/bin/portable.ini +++ b/bin/portable.ini @@ -0,0 +1 @@ +RunWizard=0 diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 733df9a105..e12d55ba20 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -1,15 +1,18 @@ ### Select the build type # Use Release/Devel/Debug : -DCMAKE_BUILD_TYPE=Release|Devel|Debug -# Enable/disable the stipping : -DCMAKE_BUILD_STRIP=TRUE|FALSE +# Enable/disable the stripping : -DCMAKE_BUILD_STRIP=TRUE|FALSE + ### Force the choice of 3rd party library in pcsx2 over system libraries # Use all internal lib: -DFORCE_INTERNAL_ALL=TRUE # Use soundtouch internal lib: -DFORCE_INTERNAL_SOUNDTOUCH=TRUE # Use zlib internal lib: -DFORCE_INTERNAL_ZLIB=TRUE # Use sdl1.3 internal lib: -DFORCE_INTERNAL_SDL=TRUE # Not supported yet + ### GCC optimization options # control C flags : -DUSER_CMAKE_C_FLAGS="cflags" # control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags" # control link flags : -DUSER_CMAKE_LD_FLAGS="ldflags" + ### Packaging options # Installation path : -DPACKAGE_MODE=TRUE(follow FHS)|FALSE(local bin/) # Plugin installation path : -DPLUGIN_DIR="/usr/lib/pcsx2" @@ -104,9 +107,11 @@ set(CMAKE_SHARED_LIBRARY_C_FLAGS "") set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") #------------------------------------------------------------------------------- -# Set some default compiler flag +# Set some default compiler flags #------------------------------------------------------------------------------- -set(DEFAULT_GCC_FLAG "-m32 -msse -msse2 -march=i686 -pthread -Wno-write-strings -Wno-invalid-offsetof") +set(DEFAULT_WARNINGS "-Wno-write-strings -Wno-format -Wno-unused-parameter -Wno-unused-value -Wstrict-aliasing") +set(DEFAULT_GCC_FLAG "-m32 -msse -msse2 -march=i686 -pthread ${DEFAULT_WARNINGS}") +set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof") #------------------------------------------------------------------------------- # Allow user to set some default flags @@ -146,7 +151,7 @@ if(DEFINED USER_CMAKE_CXX_FLAGS) string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS) endif(DEFINED USER_CMAKE_CXX_FLAGS) # Use some default machine flags -string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_GCC_FLAG}" CMAKE_CXX_FLAGS) +string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS) #------------------------------------------------------------------------------- # Default package option diff --git a/common/include/PS2Eext.h b/common/include/PS2Eext.h index e6d6fedcb5..6a6c3dcce2 100644 --- a/common/include/PS2Eext.h +++ b/common/include/PS2Eext.h @@ -144,18 +144,20 @@ struct PluginConf int ReadInt(const std::string& item, int defval) { int value = defval; + int err = 0; std::string buf = item + " = %d\n"; - if (ConfFile) fscanf(ConfFile, buf.c_str(), &value); + if (ConfFile) err=fscanf(ConfFile, buf.c_str(), &value); return value; } void WriteInt(std::string item, int value) { + int err = 0; std::string buf = item + " = %d\n"; - if (ConfFile) fprintf(ConfFile, buf.c_str(), value); + if (ConfFile) err=fprintf(ConfFile, buf.c_str(), value); } }; diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index fdb04ff933..4d456e3a81 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -20,12 +20,7 @@ set(CommonFlags -fno-tree-dse -fno-strict-aliasing -Wstrict-aliasing # Allow to track strict aliasing issue. - -pipe - -Wno-format - -Wno-unused-parameter - -Wno-unused-value - -Wno-unused-variable - -Wno-write-strings) + -pipe) # set warning flags set(DebugFlags diff --git a/plugins/CDVDiso/src/CMakeLists.txt b/plugins/CDVDiso/src/CMakeLists.txt index 2c51e22e42..edb6f1ca5c 100644 --- a/plugins/CDVDiso/src/CMakeLists.txt +++ b/plugins/CDVDiso/src/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output CDVDiso) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/CDVDiso/src/Linux/Linux.cpp b/plugins/CDVDiso/src/Linux/Linux.cpp index 0f9926dde1..334481a1eb 100644 --- a/plugins/CDVDiso/src/Linux/Linux.cpp +++ b/plugins/CDVDiso/src/Linux/Linux.cpp @@ -61,7 +61,7 @@ void OnCompress(GtkButton *button, gpointer user_data) u8 cdbuff[10*2352]; char Zfile[256]; const char *tmp; - int ret; + int ret = 0; isoFile *src; isoFile *dst; diff --git a/plugins/CDVDnull/CMakeLists.txt b/plugins/CDVDnull/CMakeLists.txt index da6386da17..10d245b5ad 100644 --- a/plugins/CDVDnull/CMakeLists.txt +++ b/plugins/CDVDnull/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output CDVDnull) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/FWnull/CMakeLists.txt b/plugins/FWnull/CMakeLists.txt index 156885337e..4e3c93d110 100644 --- a/plugins/FWnull/CMakeLists.txt +++ b/plugins/FWnull/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output FWnull-0.7.0) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 6159b763a7..46254d9bc8 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -11,17 +11,11 @@ set(Output GSdx-0.1.16) set(CommonFlags -D_LINUX - -pthread -fno-operator-names -mpreferred-stack-boundary=2 -mfpmath=sse - -Wstrict-aliasing # Allow to track strict aliasing issue. - -Wno-format - -Wno-unused-parameter - -Wno-unused-value + #-Wstrict-aliasing # Allow to track strict aliasing issue. -Wunused-variable - -Wno-invalid-offsetof - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/GSnull/CMakeLists.txt b/plugins/GSnull/CMakeLists.txt index ae1597410a..ea00dc1d52 100644 --- a/plugins/GSnull/CMakeLists.txt +++ b/plugins/GSnull/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output GSnull) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/GSnull/Registers.h b/plugins/GSnull/Registers.h index bb60cf085a..ed81b2fe3e 100644 --- a/plugins/GSnull/Registers.h +++ b/plugins/GSnull/Registers.h @@ -614,8 +614,8 @@ REG64_(GIFReg, ALPHA) u32 _PAD2:24; REG_END2 // opaque => output will be Cs/As - __forceinline bool IsOpaque() const {return (A == B || C == 2 && FIX == 0) && D == 0 || (A == 0 && B == D && C == 2 && FIX == 0x80);} - __forceinline bool IsOpaque(int amin, int amax) const {return (A == B || amax == 0) && D == 0 || A == 0 && B == D && amin == 0x80 && amax == 0x80;} + //__forceinline bool IsOpaque() const {return (A == B || C == 2 && FIX == 0) && D == 0 || (A == 0 && B == D && C == 2 && FIX == 0x80);} + //__forceinline bool IsOpaque(int amin, int amax) const {return (A == B || amax == 0) && D == 0 || A == 0 && B == D && amin == 0x80 && amax == 0x80;} REG_END2 REG64_(GIFReg, BITBLTBUF) @@ -896,7 +896,7 @@ union }; }; REG_END2 - __forceinline bool IsRepeating() {return ((u32)1 << TW) > (TBW << 6);} + //__forceinline bool IsRepeating() {return ((u32)1 << TW) > (TBW << 6);} REG_END2 REG64_(GIFReg, TEX1) diff --git a/plugins/PadNull/CMakeLists.txt b/plugins/PadNull/CMakeLists.txt index 2127a0d882..6c454922a4 100644 --- a/plugins/PadNull/CMakeLists.txt +++ b/plugins/PadNull/CMakeLists.txt @@ -11,7 +11,6 @@ set(Output PADnull) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/SPU2null/CMakeLists.txt b/plugins/SPU2null/CMakeLists.txt index fb4aed1abc..8c1c1eb6e1 100644 --- a/plugins/SPU2null/CMakeLists.txt +++ b/plugins/SPU2null/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output SPU2null) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt index 474faad1d8..cec09e425e 100644 --- a/plugins/USBnull/CMakeLists.txt +++ b/plugins/USBnull/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output USBnull-0.7.0) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt index cb4516eea5..e21929d0fa 100644 --- a/plugins/dev9null/CMakeLists.txt +++ b/plugins/dev9null/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output dev9null-0.5.0) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt index 27bc278c8d..12247e384c 100644 --- a/plugins/onepad/CMakeLists.txt +++ b/plugins/onepad/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output onepad-1.1.0) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index 327822fd93..8395a9a88b 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -12,7 +12,6 @@ set(Output spu2x-2.0.0) set(CommonFlags -fvisibility=hidden -Wall - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/zerospu2/CMakeLists.txt b/plugins/zerospu2/CMakeLists.txt index 6e9040d20e..3bc60c0e82 100644 --- a/plugins/zerospu2/CMakeLists.txt +++ b/plugins/zerospu2/CMakeLists.txt @@ -11,8 +11,6 @@ set(Output zerospu2) set(CommonFlags -Wall - -msse2 - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index fc8dba32aa..1218f46a52 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -19,7 +19,6 @@ set(CommonFlags -Wno-unused-parameter -Wno-unused-value -Wunused-variable - -Wno-write-strings ) set(OptimizationFlags diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 39582596f8..80798d9cae 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -312,8 +312,6 @@ EXPORT_C_(s32) GSopen2( void* pDsp, u32 flags ) { FUNCLOG - bool err; - g_GSMultiThreaded = true; ZZLog::WriteLn("Calling GSopen2.");