diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 98711129a5..d163a73729 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -93,7 +93,7 @@ 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") +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") set(DEFAULT_GCC_FLAG "-m32 -msse -msse2 -march=i686 -pthread ${DEFAULT_WARNINGS}") set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof") diff --git a/common/src/Utilities/CheckedStaticBox.cpp b/common/src/Utilities/CheckedStaticBox.cpp index 200360e72d..8bff060aec 100644 --- a/common/src/Utilities/CheckedStaticBox.cpp +++ b/common/src/Utilities/CheckedStaticBox.cpp @@ -18,8 +18,8 @@ CheckedStaticBox::CheckedStaticBox( wxWindow* parent, int orientation, const wxString& title ) : wxPanelWithHelpers( parent, wxVERTICAL ) - , ThisToggle( *new wxCheckBox( this, wxID_ANY, title, wxPoint( 8, 0 ) ) ) , ThisSizer( *new wxStaticBoxSizer( orientation, this ) ) + , ThisToggle( *new wxCheckBox( this, wxID_ANY, title, wxPoint( 8, 0 ) ) ) { this += ThisToggle; this += ThisSizer | pxExpand; @@ -74,4 +74,4 @@ bool CheckedStaticBox::Enable( bool enable ) } return true; -} \ No newline at end of file +} diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index 0514034208..dfdbfc31ff 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -141,12 +141,11 @@ static uint parseCommandLine( const wxString& filename ) // All of ElfObjects functions. ElfObject::ElfObject(const wxString& srcfile, IsoFile isofile) - : filename( srcfile ) - - , data( wxULongLong(isofile.getLength()).GetLo(), L"ELF headers" ) - , header( *(ELF_HEADER*)data.GetPtr() ) + : data( wxULongLong(isofile.getLength()).GetLo(), L"ELF headers" ) , proghead( NULL ) , secthead( NULL ) + , filename( srcfile ) + , header( *(ELF_HEADER*)data.GetPtr() ) { isCdvd = true; checkElfSize(data.GetSizeInBytes()); @@ -155,11 +154,11 @@ ElfObject::ElfObject(const wxString& srcfile, IsoFile isofile) } ElfObject::ElfObject( const wxString& srcfile, uint hdrsize ) - : filename( srcfile ) - , data( wxULongLong(hdrsize).GetLo(), L"ELF headers" ) - , header( *(ELF_HEADER*)data.GetPtr() ) + : data( wxULongLong(hdrsize).GetLo(), L"ELF headers" ) , proghead( NULL ) , secthead( NULL ) + , filename( srcfile ) + , header( *(ELF_HEADER*)data.GetPtr() ) { isCdvd = false; checkElfSize(data.GetSizeInBytes()); diff --git a/pcsx2/IopBios.cpp b/pcsx2/IopBios.cpp index 93ae835f05..7ffe08f248 100644 --- a/pcsx2/IopBios.cpp +++ b/pcsx2/IopBios.cpp @@ -107,6 +107,8 @@ public: fd = hostfd; } + virtual ~HostFile() {} + static __fi int translate_error(int err) { if (err >= 0) diff --git a/pcsx2/MultipartFileReader.cpp b/pcsx2/MultipartFileReader.cpp index 62a96af4bf..a4c7af8b9c 100644 --- a/pcsx2/MultipartFileReader.cpp +++ b/pcsx2/MultipartFileReader.cpp @@ -150,7 +150,7 @@ void MultipartFileReader::BeginRead(void* pBuffer, uint sector, uint count) { u8* lBuffer = (u8*)pBuffer; - for(int i = GetFirstPart(sector); i < m_numparts; i++) + for(uint i = GetFirstPart(sector); i < m_numparts; i++) { uint num = min(count, m_parts[i].end - sector); @@ -169,7 +169,7 @@ void MultipartFileReader::BeginRead(void* pBuffer, uint sector, uint count) int MultipartFileReader::FinishRead(void) { int ret = 0; - for(int i=0;iSetBlockSize(bytes); uint count = m_parts[i].reader->GetBlockCount(); diff --git a/pcsx2/gui/AppMain.cpp b/pcsx2/gui/AppMain.cpp index 38d65e5542..3e4f4487b5 100644 --- a/pcsx2/gui/AppMain.cpp +++ b/pcsx2/gui/AppMain.cpp @@ -397,7 +397,7 @@ void FramerateManager::Reset() m_initpause = FramerateQueueDepth; m_fpsqueue_writepos = 0; - for( int i=0; iRecentIsoCount ) + , m_firstIdForMenuItems_or_wxID_ANY ( firstIdForMenuItems_or_wxID_ANY ) { m_cursel = 0; m_Separator = NULL; diff --git a/pcsx2/x86/BaseblockEx.h b/pcsx2/x86/BaseblockEx.h index 58aeb81432..963fda0695 100644 --- a/pcsx2/x86/BaseblockEx.h +++ b/pcsx2/x86/BaseblockEx.h @@ -60,8 +60,8 @@ class BaseBlockArray { pxAssert(blocks != NULL); } public: - BaseBlockArray() : _Size(0), - _Reserved(0) + BaseBlockArray() : _Reserved(0), + _Size(0) { } @@ -72,8 +72,8 @@ public: } } - BaseBlockArray (s32 size) : _Size(0), - _Reserved(0) + BaseBlockArray (s32 size) : _Reserved(0), + _Size(0) { if(size > 0) { resize(size); diff --git a/pcsx2/x86/iCore.cpp b/pcsx2/x86/iCore.cpp index c544d4d532..777965b32a 100644 --- a/pcsx2/x86/iCore.cpp +++ b/pcsx2/x86/iCore.cpp @@ -82,7 +82,7 @@ int _getFreeXMMreg() int i, tempi; u32 bestcount = 0x10000; - for (i=0; iregs[xmmregs[i].reg] & EEINST_XMM) ) { @@ -114,7 +114,7 @@ int _getFreeXMMreg() tempi = -1; bestcount = 0xffff; - for (i=0; iregs[xmmregs[i].reg]&EEINST_USED) ) { @@ -913,7 +913,7 @@ void _moveXMMreg(int xmmreg) int i; if( !xmmregs[xmmreg].inuse ) return; - for (i=0; i= maxreg ) continue; @@ -235,14 +235,14 @@ void _flushConstRegs() int _allocX86reg(int x86reg, int type, int reg, int mode) { - int i; + uint i; pxAssertDev( reg >= 0 && reg < 32, "Register index out of bounds." ); pxAssertDev( x86reg != ESP && x86reg != EBP, "Allocation of ESP/EBP is not allowed!" ); // don't alloc EAX and ESP,EBP if MODE_NOFRAME int oldmode = mode; //int noframe = mode & MODE_NOFRAME; - int maxreg = (mode & MODE_8BITREG) ? 4 : iREGCNT_GPR; + uint maxreg = (mode & MODE_8BITREG) ? 4 : iREGCNT_GPR; mode &= ~(MODE_NOFRAME|MODE_8BITREG); int readfromreg = -1; @@ -353,7 +353,7 @@ int _allocX86reg(int x86reg, int type, int reg, int mode) int _checkX86reg(int type, int reg, int mode) { - int i; + uint i; for (i=0; i::iterator it = ranges.begin(); it != ranges.end(); ++it) diff --git a/plugins/GSdx/GPURenderer.h b/plugins/GSdx/GPURenderer.h index 855a1ee3b4..501f48c88f 100644 --- a/plugins/GSdx/GPURenderer.h +++ b/plugins/GSdx/GPURenderer.h @@ -182,9 +182,9 @@ protected: public: GPURendererT(GSDevice* dev) : GPURenderer(dev) + , m_vertices(NULL) , m_count(0) , m_maxcount(0) - , m_vertices(NULL) { } diff --git a/plugins/GSdx/GSCodeBuffer.cpp b/plugins/GSdx/GSCodeBuffer.cpp index 130a690e82..9de0e189b3 100644 --- a/plugins/GSdx/GSCodeBuffer.cpp +++ b/plugins/GSdx/GSCodeBuffer.cpp @@ -23,10 +23,10 @@ #include "GSCodeBuffer.h" GSCodeBuffer::GSCodeBuffer(size_t blocksize) - : m_ptr(NULL) - , m_blocksize(blocksize) + : m_blocksize(blocksize) , m_pos(0) , m_reserved(0) + , m_ptr(NULL) { } diff --git a/plugins/GSdx/GSRasterizer.cpp b/plugins/GSdx/GSRasterizer.cpp index f9d0f45d14..9a1416d784 100644 --- a/plugins/GSdx/GSRasterizer.cpp +++ b/plugins/GSdx/GSRasterizer.cpp @@ -33,10 +33,10 @@ int GSRasterizerData::s_counter = 0; GSRasterizer::GSRasterizer(IDrawScanline* ds, int id, int threads, GSPerfMon* perfmon) - : m_ds(ds) + : m_perfmon(perfmon) + , m_ds(ds) , m_id(id) , m_threads(threads) - , m_perfmon(perfmon) { memset(&m_pixels, 0, sizeof(m_pixels)); diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 8471592e4a..f281580b79 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -26,11 +26,11 @@ #endif GSRenderer::GSRenderer() - : m_wnd(NULL) - , m_dev(NULL) - , m_shader(0) + : m_shader(0) , m_shift_key(false) , m_control_key(false) + , m_wnd(NULL) + , m_dev(NULL) { m_GStitleInfoBuffer[0] = 0; diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 7ef21577c3..963fe0cd68 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -23,12 +23,12 @@ #include "GSRendererHW.h" GSRendererHW::GSRendererHW(GSTextureCache* tc) - : m_tc(tc) - , m_width(1024) + : m_width(1024) , m_height(1024) , m_skip(0) , m_reset(false) , m_upscale_multiplier(1) + , m_tc(tc) { m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1); m_userhacks_skipdraw = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SkipDraw", 0) : 0; diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index acdc51e477..ea4d4d9ce9 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -37,13 +37,13 @@ GSState::GSState() , m_mt(false) , m_irq(NULL) , m_path3hack(0) + , m_q(1.0f) + , m_texflush(true) + , m_vt(this) , m_regs(NULL) , m_crc(0) , m_options(0) , m_frameskip(0) - , m_vt(this) - , m_q(1.0f) - , m_texflush(true) { m_nativeres = !!theApp.GetConfig("nativeres", 1); diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 563fde9979..8cc52a1d2c 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -816,9 +816,9 @@ GSTextureCache::Target* GSTextureCache::CreateTarget(const GIFRegTEX0& TEX0, int GSTextureCache::Surface::Surface(GSRenderer* r, uint8* temp) : m_renderer(r) - , m_temp(temp) , m_texture(NULL) , m_age(0) + , m_temp(temp) { m_TEX0.TBP0 = 0x3fff; } @@ -850,7 +850,7 @@ GSTextureCache::Source::Source(GSRenderer* r, const GIFRegTEX0& TEX0, const GIFR m_clut = (uint32*)_aligned_malloc(256 * sizeof(uint32), 32); - memset(m_clut, 0, sizeof(m_clut)); + memset(m_clut, 0, 256*sizeof(uint32)); m_write.rect = (GSVector4i*)_aligned_malloc(3 * sizeof(GSVector4i), 32); m_write.count = 0; diff --git a/plugins/GSdx/GSThread.h b/plugins/GSdx/GSThread.h index 1ba58459af..0ad7b04a62 100644 --- a/plugins/GSdx/GSThread.h +++ b/plugins/GSdx/GSThread.h @@ -35,6 +35,7 @@ public: virtual void Lock() = 0; virtual bool TryLock() = 0; virtual void Unlock() = 0; + virtual ~IGSLock() {} }; class IGSEvent @@ -42,6 +43,7 @@ class IGSEvent public: virtual void Set() = 0; virtual bool Wait(IGSLock* l) = 0; + virtual ~IGSEvent() {} }; #ifdef _WINDOWS diff --git a/plugins/zzogl-pg/opengl/ZZRenderTargets.cpp b/plugins/zzogl-pg/opengl/ZZRenderTargets.cpp index 04aba8b967..5524eb7e29 100644 --- a/plugins/zzogl-pg/opengl/ZZRenderTargets.cpp +++ b/plugins/zzogl-pg/opengl/ZZRenderTargets.cpp @@ -107,7 +107,7 @@ float4 CRenderTarget::DefaultBitBltTex() //////////////////// // Render Targets // //////////////////// -CRenderTarget::CRenderTarget() : ptex(0), ptexFeedback(0), psys(NULL) +CRenderTarget::CRenderTarget() : psys(NULL), ptex(0), ptexFeedback(0) { FUNCLOG nUpdateTarg = 0; diff --git a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp index 911c9c1575..916adccf46 100644 --- a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp @@ -175,7 +175,7 @@ void ReloadEffects() { #ifdef ZEROGS_DEVBUILD - for (int i = 0; i < ArraySize(ppsTexture); ++i) + for (u32 i = 0; i < ArraySize(ppsTexture); ++i) { SAFE_RELEASE_PROG(ppsTexture[i].prog); }