diff --git a/CMakeLists.txt b/CMakeLists.txt index ee3ca672f..97b1566ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,10 +98,15 @@ include(BuildParameters) include(SearchForStuff) include(SelectPcsx2Plugins) +# Must be done after SearchForStuff +write_svnrev_h() + # add additional project-wide include directories include_directories(${PROJECT_SOURCE_DIR}/common/include ${PROJECT_SOURCE_DIR}/common/include/Utilities ${PROJECT_SOURCE_DIR}/common/include/x86emitter + # File generated by Cmake + ${CMAKE_BINARY_DIR}/common/include # WORKAROUND Some issue with multiarch on Debian/Ubuntu /usr/include/i386-linux-gnu ) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 9a38f61d8..98711129a 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") +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_GCC_FLAG "-m32 -msse -msse2 -march=i686 -pthread ${DEFAULT_WARNINGS}") set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof") diff --git a/cmake/Pcsx2Utils.cmake b/cmake/Pcsx2Utils.cmake index 92fb26677..cc2b16e5c 100644 --- a/cmake/Pcsx2Utils.cmake +++ b/cmake/Pcsx2Utils.cmake @@ -36,3 +36,17 @@ function(detectOperatingSystem) set(Windows TRUE PARENT_SCOPE) endif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") endfunction(detectOperatingSystem) + +function(write_svnrev_h) + # you must have both svn client executable and a source that contains svn metadata + if(Subversion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn") + # execute subversion + Subversion_WC_INFO(${CMAKE_SOURCE_DIR} tmpvar) + + # write svnrev.h + file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${tmpvar_WC_REVISION} \n#define SVN_MODS 0") + else() + # write svnrev.h + file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV 0 \n#define SVN_MODS 0") + endif() +endfunction() diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 05e68d083..cb16d294a 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -12,7 +12,6 @@ set(CommonFlags # Disable this optimization for the moment -fno-omit-frame-pointer # END GCC-4.6 - -DLINUX_PRINT_SVN_NUMBER -pthread -fvisibility=hidden -fno-guess-branch-probability @@ -102,18 +101,6 @@ if(PACKAGE_MODE) set(Output pcsx2) endif(PACKAGE_MODE) -# you must have both svn client executable and a source that contains svn metadata -if(Subversion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn") - # execute subversion - Subversion_WC_INFO(${CMAKE_SOURCE_DIR} tmpvar) - - # write svnrev.h - file(WRITE ${CMAKE_BINARY_DIR}/pcsx2/svnrev.h "#define SVN_REV ${tmpvar_WC_REVISION} \n#define SVN_MODS 0") -else(Subversion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn") - # write svnrev.h - file(WRITE ${CMAKE_BINARY_DIR}/pcsx2/svnrev.h "#define SVN_REV 0 \n#define SVN_MODS 0") -endif(Subversion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn") - # Main pcsx2 source set(pcsx2Sources Cache.cpp @@ -649,7 +636,6 @@ endif(MacOSX) include_directories(. gui x86 - ${CMAKE_BINARY_DIR}/pcsx2 ${CMAKE_BINARY_DIR}/pcsx2/gui ) diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index e188643f5..45580cbba 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -748,7 +748,7 @@ void eeMemoryReserve::Reset() // Dynarec versions of VUs vu0_micro_mem = vtlb_RegisterHandlerTempl1(vuMicro,0); vu1_micro_mem = vtlb_RegisterHandlerTempl1(vuMicro,1); - vu1_data_mem = (1||THREAD_VU1) ? vtlb_RegisterHandlerTempl1(vuData,1) : NULL; + vu1_data_mem = (1||THREAD_VU1) ? vtlb_RegisterHandlerTempl1(vuData,1) : 0; ////////////////////////////////////////////////////////////////////////////////////////// // IOP's "secret" Hardware Register mapping, accessible from the EE (and meant for use diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp index 5a76a0aa8..a1f3760c5 100644 --- a/pcsx2/PluginManager.cpp +++ b/pcsx2/PluginManager.cpp @@ -26,9 +26,7 @@ #include "Utilities/ScopedPtr.h" #include "Utilities/pxStreams.h" -#if _MSC_VER || defined(LINUX_PRINT_SVN_NUMBER) -# include "svnrev.h" -#endif +#include "svnrev.h" SysPluginBindings SysPlugins; diff --git a/pcsx2/PrecompiledHeader.h b/pcsx2/PrecompiledHeader.h index 9d728ebec..f955a84d6 100644 --- a/pcsx2/PrecompiledHeader.h +++ b/pcsx2/PrecompiledHeader.h @@ -92,16 +92,6 @@ typedef FnType_Void* Fnptr_Void; // Compiler/OS specific macros and defines // -------------------------------------------------------------------------------------- -// Linux isn't set up for svn version numbers yet. -#if defined(__LINUX__) && !defined(LINUX_PRINT_SVN_NUMBER) -#if !defined(SVN_REV) -# define SVN_REV 0 -#endif -#if !defined(SVN_MODS) -# define SVN_MODS 0 -#endif -#endif - #if defined(_MSC_VER) # define strnicmp _strnicmp diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 2e51abc24..fa1180db8 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -150,9 +150,7 @@ void SysOutOfMemory_EmergencyResponse(uptr blocksize) } -#if _MSC_VER || defined(LINUX_PRINT_SVN_NUMBER) -# include "svnrev.h" -#endif +#include "svnrev.h" const Pcsx2Config EmuConfig; diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index a014a32e3..485bde582 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -24,9 +24,7 @@ #include -#if _MSC_VER || defined(LINUX_PRINT_SVN_NUMBER) -# include "svnrev.h" -#endif +#include "svnrev.h" // ------------------------------------------------------------------------ wxMenu* MainEmuFrame::MakeStatesSubMenu( int baseid, int loadBackupId ) const diff --git a/pcsx2/gui/MemoryCardFile.cpp b/pcsx2/gui/MemoryCardFile.cpp index a5908934a..aff0cee17 100644 --- a/pcsx2/gui/MemoryCardFile.cpp +++ b/pcsx2/gui/MemoryCardFile.cpp @@ -29,9 +29,7 @@ struct Component_FileMcd; #include "System.h" #include "AppConfig.h" -#if _MSC_VER || defined(LINUX_PRINT_SVN_NUMBER) -# include "svnrev.h" -#endif +#include "svnrev.h" #include diff --git a/pcsx2/x86/BaseblockEx.h b/pcsx2/x86/BaseblockEx.h index 89ccec31e..58aeb8143 100644 --- a/pcsx2/x86/BaseblockEx.h +++ b/pcsx2/x86/BaseblockEx.h @@ -164,7 +164,7 @@ protected: public: BaseBlocks() : - recompiler( NULL ) + recompiler(0) , blocks(0) { blocks.reserve(0x4000); diff --git a/plugins/CDVDiso/src/CDVDisop.cpp b/plugins/CDVDiso/src/CDVDisop.cpp index 8b77d3c6f..d32cc72ce 100644 --- a/plugins/CDVDiso/src/CDVDisop.cpp +++ b/plugins/CDVDiso/src/CDVDisop.cpp @@ -322,7 +322,7 @@ EXPORT_C_(s32) CDVDgetTOC(void* toc) if (layer1start != -2 && iso->blocks >= 0x300000) { - int off = iso->blockofs; + //int off = iso->blockofs; // dual sided tocBuff[ 0] = 0x24; diff --git a/plugins/CDVDnull/CDVD.cpp b/plugins/CDVDnull/CDVD.cpp index fd31c47a6..9275b0c36 100644 --- a/plugins/CDVDnull/CDVD.cpp +++ b/plugins/CDVDnull/CDVD.cpp @@ -16,9 +16,7 @@ #include #include "CDVD.h" -#ifdef _MSC_VER -# include "svnrev.h" -#endif +#include "svnrev.h" static char libraryName[256]; @@ -28,12 +26,8 @@ const unsigned char build = 6; EXPORT_C_(char*) PS2EgetLibName() { -#ifdef _MSC_VER - sprintf_s( libraryName, "CDVDnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "CDVDnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; -#else - return "CDVDnull Driver"; -#endif } EXPORT_C_(u32) PS2EgetLibType() diff --git a/plugins/FWnull/FW.cpp b/plugins/FWnull/FW.cpp index 8a1ca92fd..08b643b6e 100644 --- a/plugins/FWnull/FW.cpp +++ b/plugins/FWnull/FW.cpp @@ -21,9 +21,7 @@ using namespace std; #include "FW.h" -#ifdef _MSC_VER -# include "svnrev.h" -#endif +#include "svnrev.h" const u8 version = PS2E_FW_VERSION; const u8 revision = 0; @@ -65,12 +63,8 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { -#ifdef _MSC_VER - sprintf_s( libraryName, "FWnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "FWnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; -#else - return "FWnull Driver"; -#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) @@ -131,7 +125,6 @@ void PHYWrite() void PHYRead() { u8 reg = (PHYACC >> 24) & 0xf; - u8 data = (PHYACC >> 16) & 0xff; PHYACC &= ~0x80000000; diff --git a/plugins/GSdx/GPUState.cpp b/plugins/GSdx/GPUState.cpp index 8ffcf711c..93c7e32b1 100644 --- a/plugins/GSdx/GPUState.cpp +++ b/plugins/GSdx/GPUState.cpp @@ -27,7 +27,7 @@ GPUState::GPUState() { memset(m_status, 0, sizeof(m_status)); - for(int i = 0; i < countof(m_fpGPUStatusCommandHandlers); i++) + for(uint32 i = 0; i < countof(m_fpGPUStatusCommandHandlers); i++) { m_fpGPUStatusCommandHandlers[i] = &GPUState::SCH_Null; } diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 707030af6..deef8427e 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -69,7 +69,9 @@ static int s_renderer = -1; static bool s_framelimit = true; static bool s_vsync = false; static bool s_exclusive = true; +#ifdef _WINDOWS static bool s_isgsopen2 = false; // boolean to remove some stuff from the config panel in new PCSX2's/ +#endif EXPORT_C_(uint32) PS2EgetLibType() { @@ -439,7 +441,7 @@ EXPORT_C_(int) GSopen(void** dsp, char* title, int mt) XCloseDisplay(display); */ - int renderer; + int renderer = 0; // Legacy GUI expects to acquire vsync from the configuration files. @@ -1456,8 +1458,6 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer) fread(regs, 0x2000, 1, fp); - long start = ftell(fp); - GSvsync(1); struct Packet {uint8 type, param; uint32 size, addr; vector buff;}; diff --git a/plugins/GSdx/GSCrc.cpp b/plugins/GSdx/GSCrc.cpp index 54356966f..51560e55f 100644 --- a/plugins/GSdx/GSCrc.cpp +++ b/plugins/GSdx/GSCrc.cpp @@ -531,7 +531,7 @@ CRC::Game CRC::Lookup(uint32 crc) printf( "GSdx: CrcHacksExclusions: %s\n", exclusions.c_str() ); int crcDups = 0; - for(int i = 0; i < countof(m_games); i++) + for(uint32 i = 0; i < countof(m_games); i++) { if( !IsCrcExcluded( exclusions, m_games[i].crc ) ){ if(m_map[m_games[i].crc]){ diff --git a/plugins/GSdx/GSDevice.cpp b/plugins/GSdx/GSDevice.cpp index 37f7bcdd3..93c77e3e0 100644 --- a/plugins/GSdx/GSDevice.cpp +++ b/plugins/GSdx/GSDevice.cpp @@ -226,7 +226,7 @@ void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVec { GSTexture* tex[2] = {NULL, NULL}; - for(int i = 0; i < countof(tex); i++) + for(uint32 i = 0; i < countof(tex); i++) { if(st[i] != NULL) { @@ -236,7 +236,7 @@ void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVec DoMerge(tex, sr, m_merge, dr, slbg, mmod, c); - for(int i = 0; i < countof(tex); i++) + for(uint32 i = 0; i < countof(tex); i++) { if(tex[i] != st[i]) { diff --git a/plugins/GSdx/GSLocalMemory.cpp b/plugins/GSdx/GSLocalMemory.cpp index fc122d13e..d835a6a62 100644 --- a/plugins/GSdx/GSLocalMemory.cpp +++ b/plugins/GSdx/GSLocalMemory.cpp @@ -116,89 +116,89 @@ GSLocalMemory::GSLocalMemory() } } - for(int x = 0; x < countof(rowOffset32); x++) + for(uint32 x = 0; x < countof(rowOffset32); x++) { rowOffset32[x] = (int)PixelAddress32(x & 0x7ff, 0, 0, 32) - (int)PixelAddress32(0, 0, 0, 32); } - for(int x = 0; x < countof(rowOffset32Z); x++) + for(uint32 x = 0; x < countof(rowOffset32Z); x++) { rowOffset32Z[x] = (int)PixelAddress32Z(x & 0x7ff, 0, 0, 32) - (int)PixelAddress32Z(0, 0, 0, 32); } - for(int x = 0; x < countof(rowOffset16); x++) + for(uint32 x = 0; x < countof(rowOffset16); x++) { rowOffset16[x] = (int)PixelAddress16(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16(0, 0, 0, 32); } - for(int x = 0; x < countof(rowOffset16S); x++) + for(uint32 x = 0; x < countof(rowOffset16S); x++) { rowOffset16S[x] = (int)PixelAddress16S(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16S(0, 0, 0, 32); } - for(int x = 0; x < countof(rowOffset16Z); x++) + for(uint32 x = 0; x < countof(rowOffset16Z); x++) { rowOffset16Z[x] = (int)PixelAddress16Z(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16Z(0, 0, 0, 32); } - for(int x = 0; x < countof(rowOffset16SZ); x++) + for(uint32 x = 0; x < countof(rowOffset16SZ); x++) { rowOffset16SZ[x] = (int)PixelAddress16SZ(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16SZ(0, 0, 0, 32); } - for(int x = 0; x < countof(rowOffset8[0]); x++) + for(uint32 x = 0; x < countof(rowOffset8[0]); x++) { rowOffset8[0][x] = (int)PixelAddress8(x & 0x7ff, 0, 0, 32) - (int)PixelAddress8(0, 0, 0, 32); rowOffset8[1][x] = (int)PixelAddress8(x & 0x7ff, 2, 0, 32) - (int)PixelAddress8(0, 2, 0, 32); } - for(int x = 0; x < countof(rowOffset4[0]); x++) + for(uint32 x = 0; x < countof(rowOffset4[0]); x++) { rowOffset4[0][x] = (int)PixelAddress4(x & 0x7ff, 0, 0, 32) - (int)PixelAddress4(0, 0, 0, 32); rowOffset4[1][x] = (int)PixelAddress4(x & 0x7ff, 2, 0, 32) - (int)PixelAddress4(0, 2, 0, 32); } - for(int x = 0; x < countof(blockOffset32); x++) + for(uint32 x = 0; x < countof(blockOffset32); x++) { blockOffset32[x] = (short)((int)BlockNumber32(x << 3, 0, 0, 32) - (int)BlockNumber32(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset32Z); x++) + for(uint32 x = 0; x < countof(blockOffset32Z); x++) { blockOffset32Z[x] = (short)((int)BlockNumber32Z(x << 3, 0, 0, 32) - (int)BlockNumber32Z(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset16); x++) + for(uint32 x = 0; x < countof(blockOffset16); x++) { blockOffset16[x] = (short)((int)BlockNumber16(x << 3, 0, 0, 32) - (int)BlockNumber16(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset16S); x++) + for(uint32 x = 0; x < countof(blockOffset16S); x++) { blockOffset16S[x] = (short)((int)BlockNumber16S(x << 3, 0, 0, 32) - (int)BlockNumber16S(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset16Z); x++) + for(uint32 x = 0; x < countof(blockOffset16Z); x++) { blockOffset16Z[x] = (short)((int)BlockNumber16Z(x << 3, 0, 0, 32) - (int)BlockNumber16Z(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset16SZ); x++) + for(uint32 x = 0; x < countof(blockOffset16SZ); x++) { blockOffset16SZ[x] = (short)((int)BlockNumber16SZ(x << 3, 0, 0, 32) - (int)BlockNumber16SZ(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset8); x++) + for(uint32 x = 0; x < countof(blockOffset8); x++) { blockOffset8[x] = (short)((int)BlockNumber8(x << 3, 0, 0, 32) - (int)BlockNumber8(0, 0, 0, 32)); } - for(int x = 0; x < countof(blockOffset4); x++) + for(uint32 x = 0; x < countof(blockOffset4); x++) { blockOffset4[x] = (short)((int)BlockNumber4(x << 3, 0, 0, 32) - (int)BlockNumber4(0, 0, 0, 32)); } - for(int i = 0; i < countof(m_psm); i++) + for(uint32 i = 0; i < countof(m_psm); i++) { m_psm[i].pa = &GSLocalMemory::PixelAddress32; m_psm[i].bn = &GSLocalMemory::BlockNumber32; @@ -408,7 +408,7 @@ GSLocalMemory::GSLocalMemory() m_psm[PSM_PSMT8].pal = m_psm[PSM_PSMT8H].pal = 256; m_psm[PSM_PSMT4].pal = m_psm[PSM_PSMT4HL].pal = m_psm[PSM_PSMT4HH].pal = 16; - for(int i = 0; i < countof(m_psm); i++) m_psm[i].fmt = 3; + for(uint32 i = 0; i < countof(m_psm); i++) m_psm[i].fmt = 3; m_psm[PSM_PSMCT32].fmt = m_psm[PSM_PSMZ32].fmt = 0; m_psm[PSM_PSMCT24].fmt = m_psm[PSM_PSMZ24].fmt = 1; m_psm[PSM_PSMCT16].fmt = m_psm[PSM_PSMZ16].fmt = 2; diff --git a/plugins/GSdx/GSPerfMon.cpp b/plugins/GSdx/GSPerfMon.cpp index adec72658..7cf130bce 100644 --- a/plugins/GSdx/GSPerfMon.cpp +++ b/plugins/GSdx/GSPerfMon.cpp @@ -58,7 +58,7 @@ void GSPerfMon::Update() { if(m_count > 0) { - for(int i = 0; i < countof(m_counters); i++) + for(uint32 i = 0; i < countof(m_counters); i++) { m_stats[i] = m_counters[i] / m_count; } diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 2c9174162..7ef21577c 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -554,7 +554,6 @@ bool GSRendererHW::OI_GodOfWar2(GSTexture* rt, GSTexture* ds, GSTextureCache::So bool GSRendererHW::OI_SimpsonsGame(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t) { uint32 FBP = m_context->FRAME.Block(); - uint32 FBW = m_context->FRAME.FBW; uint32 FPSM = m_context->FRAME.PSM; if((FBP == 0x01500 || FBP == 0x01800) && FPSM == PSM_PSMZ24) //0x1800 pal, 0x1500 ntsc @@ -636,7 +635,6 @@ bool GSRendererHW::OI_SpidermanWoS(GSTexture* rt, GSTexture* ds, GSTextureCache: bool GSRendererHW::OI_TyTasmanianTiger(GSTexture* rt, GSTexture* ds, GSTextureCache::Source* t) { uint32 FBP = m_context->FRAME.Block(); - uint32 FBW = m_context->FRAME.FBW; uint32 FPSM = m_context->FRAME.PSM; if((FBP == 0x02800 || FBP == 0x02BC0) && FPSM == PSM_PSMCT24) //0x2800 pal, 0x2bc0 ntsc diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 06627fc5d..954a19112 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -178,7 +178,7 @@ void GSRendererOGL::SetupIA() dev->IASetIndexBuffer(m_index.buff, m_index.tail); - GLenum t; + GLenum t = 0; switch(m_vt.m_primclass) { diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index ee7e31b93..f5bc169de 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -64,7 +64,7 @@ GSRendererSW::~GSRendererSW() { delete m_tc; - for(int i = 0; i < countof(m_texture); i++) + for(uint32 i = 0; i < countof(m_texture); i++) { delete m_texture[i]; } @@ -219,7 +219,7 @@ void GSRendererSW::VSync(int field) void GSRendererSW::ResetDevice() { - for(int i = 0; i < countof(m_texture); i++) + for(uint32 i = 0; i < countof(m_texture); i++) { delete m_texture[i]; @@ -445,7 +445,7 @@ void GSRendererSW::Draw() { int n = GSUtil::GetVertexCount(PRIM->PRIM); - for(int i = 0, j = 0; i < m_index.tail; i += n, j++) + for(uint32 i = 0, j = 0; i < m_index.tail; i += n, j++) { for(int k = 0; k < n; k++) { diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 9831fa530..563fde997 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -1177,7 +1177,7 @@ void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0, const GSO } } - for(int i = 0; i < countof(m_pages); i++) + for(uint32 i = 0; i < countof(m_pages); i++) { if(uint32 p = m_pages[i]) { diff --git a/plugins/GSdx/GSTextureOGL.cpp b/plugins/GSdx/GSTextureOGL.cpp index 7036d96be..8a8e7b565 100644 --- a/plugins/GSdx/GSTextureOGL.cpp +++ b/plugins/GSdx/GSTextureOGL.cpp @@ -192,8 +192,8 @@ bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch) EnableUnit(4); // pitch is in byte wherease GL_UNPACK_ROW_LENGTH is in pixel - GLenum format; - GLenum type; + GLenum format = GL_RGBA; + GLenum type = GL_UNSIGNED_BYTE; switch (m_format) { case GL_RGBA8: glPixelStorei(GL_UNPACK_ALIGNMENT, 4); diff --git a/plugins/PadNull/Pad.cpp b/plugins/PadNull/Pad.cpp index f514c33a7..3fe8f9518 100644 --- a/plugins/PadNull/Pad.cpp +++ b/plugins/PadNull/Pad.cpp @@ -18,9 +18,7 @@ #include #include using namespace std; -#ifdef _MSC_VER -# include "svnrev.h" -#endif +#include "svnrev.h" #include "Pad.h" const u8 version = PS2E_PAD_VERSION; @@ -43,13 +41,8 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { -#ifdef _MSC_VER - sprintf_s( libraryName, "Padnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "Padnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; -#else - return "Padnull Driver"; -#endif - } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/USBnull/USB.cpp b/plugins/USBnull/USB.cpp index 81d670370..e83e3cfac 100644 --- a/plugins/USBnull/USB.cpp +++ b/plugins/USBnull/USB.cpp @@ -16,9 +16,7 @@ #include #include using namespace std; -#ifdef _MSC_VER -# include "svnrev.h" -#endif +#include "svnrev.h" #include "USB.h" string s_strIniPath="inis"; string s_strLogPath="logs"; @@ -59,12 +57,8 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { -#ifdef _MSC_VER - sprintf_s( libraryName, "USBnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "USBnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; -#else - return "USBnull Driver"; -#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/dev9null/DEV9.cpp b/plugins/dev9null/DEV9.cpp index 5a04074a8..b5ba577ef 100644 --- a/plugins/dev9null/DEV9.cpp +++ b/plugins/dev9null/DEV9.cpp @@ -31,9 +31,7 @@ using namespace std; #include "DEV9.h" -#ifdef _MSC_VER -# include "svnrev.h" -#endif +#include "svnrev.h" const unsigned char version = PS2E_DEV9_VERSION; const unsigned char revision = 0; @@ -76,12 +74,8 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { -#ifdef _MSC_VER - sprintf_s( libraryName, "DEV9null Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "DEV9null Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; -#else - return "DEV9null Driver"; -#endif } EXPORT_C_(u32) PS2EgetLibVersion2(u32 type) diff --git a/plugins/onepad/Linux/dialog.cpp b/plugins/onepad/Linux/dialog.cpp index 66378a983..1592b88b9 100644 --- a/plugins/onepad/Linux/dialog.cpp +++ b/plugins/onepad/Linux/dialog.cpp @@ -412,8 +412,8 @@ void joy_changed(GtkComboBox *box, gpointer user_data) // 3 : use new joy with fresh key binding // unassign every joystick with this pad - for (int i = 0; i < 2; ++i) - if (joyid == conf->get_joyid(i)) conf->set_joyid(i, -1); + for (u32 i = 0; i < 2; ++i) + if (joyid == (int)conf->get_joyid(i)) conf->set_joyid(i, -1); conf->set_joyid(current_pad, joyid); } diff --git a/plugins/onepad/onepad.cpp b/plugins/onepad/onepad.cpp index 8db36a23a..3aee008c5 100644 --- a/plugins/onepad/onepad.cpp +++ b/plugins/onepad/onepad.cpp @@ -26,12 +26,10 @@ #include #include "onepad.h" - -#ifndef _WIN32 - -#include -#else #include "svnrev.h" + +#ifdef __LINUX__ +#include #endif PADconf* conf; @@ -133,48 +131,27 @@ static int padVibF[2][4]; static void InitLibraryName() { -#ifdef _WIN32 -# ifdef PUBLIC +#ifdef PUBLIC // Public Release! // Output a simplified string that's just our name: strcpy(libraryName, "OnePAD"); -# elif defined( SVN_REV_UNKNOWN ) - - // Unknown revision. - // Output a name that includes devbuild status but not - // subversion revision tags: - - strcpy(libraryName, "OnePAD" -# ifdef PCSX2_DEBUG - "-Debug" -# endif - ); -# else +#else // Use TortoiseSVN's SubWCRev utility's output // to label the specific revision: - sprintf_s(libraryName, "OnePAD r%d%s" -# ifdef PCSX2_DEBUG + snprintf(libraryName, 255, "OnePAD r%d%s" +# ifdef PCSX2_DEBUG "-Debug" -# else +# else "-Dev" -# endif +# endif , SVN_REV, SVN_MODS ? "m" : "" ); -# endif -#else -// I'll fix up SVN support later. --arcum42 - - strcpy(libraryName, "OnePAD" -# ifdef PCSX2_DEBUG - "-Debug" -# endif - ); #endif } diff --git a/plugins/spu2-x/src/Mixer.cpp b/plugins/spu2-x/src/Mixer.cpp index 94fe70db3..2ad77d762 100644 --- a/plugins/spu2-x/src/Mixer.cpp +++ b/plugins/spu2-x/src/Mixer.cpp @@ -561,7 +561,7 @@ static __forceinline StereoOut32 MixVoice( uint coreidx, uint voiceidx ) { UpdatePitch( coreidx, voiceidx ); - s32 Value; + s32 Value = 0; if( vc.Noise ) Value = GetNoiseValues( thiscore, voiceidx ); @@ -619,8 +619,8 @@ static __forceinline StereoOut32 MixVoice( uint coreidx, uint voiceidx ) // Continue processing voice, even if it's "off". Or else we miss interrupts! (Fatal Frame engine died because of this.) if (NEVER_SKIP_VOICES || (*GetMemPtr(vc.NextA & 0xFFFF8) >> 8 & 3) != 3 || vc.LoopStartA != (vc.NextA & ~7) // not in a tight loop - || Cores[0].IRQEnable && (Cores[0].IRQA & ~7) == vc.LoopStartA // or should be interrupting regularly - || Cores[1].IRQEnable && (Cores[1].IRQA & ~7) == vc.LoopStartA + || (Cores[0].IRQEnable && (Cores[0].IRQA & ~7) == vc.LoopStartA) // or should be interrupting regularly + || (Cores[1].IRQEnable && (Cores[1].IRQA & ~7) == vc.LoopStartA) || !(thiscore.Regs.ENDX & 1 << voiceidx)) // or isn't currently flagged as having passed the endpoint { UpdatePitch(coreidx, voiceidx); diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index 60147e158..80b5d09b8 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -20,10 +20,7 @@ #include "Dma.h" #include "Dialogs.h" -#ifdef _MSC_VER -# include "svnrev.h" -#endif - +#include "svnrev.h" // PCSX2 expects ASNI, not unicode, so this MUST always be char... static char libraryName[256]; @@ -87,7 +84,7 @@ static void InitLibraryName() // Use TortoiseSVN's SubWCRev utility's output // to label the specific revision: - sprintf_s( libraryName, "SPU2-X r%d%s" + snprintf( libraryName, 255, "SPU2-X r%d%s" #ifdef DEBUG_FAST "-Debug" #elif defined( PCSX2_DEBUG ) @@ -105,7 +102,7 @@ static void InitLibraryName() } -static bool cpu_detected = false; +//static bool cpu_detected = false; static bool CheckSSE() { @@ -519,8 +516,6 @@ EXPORT_C_(void) SPU2setClockPtr(u32 *ptr) cyclePtr = ptr; } -static bool numpad_plus = false, numpad_plus_old = false; - #ifdef DEBUG_KEYS static u32 lastTicks; static bool lState[6]; diff --git a/plugins/spu2-x/src/ReadInput.cpp b/plugins/spu2-x/src/ReadInput.cpp index 16b8a4a26..9326a9700 100644 --- a/plugins/spu2-x/src/ReadInput.cpp +++ b/plugins/spu2-x/src/ReadInput.cpp @@ -134,7 +134,7 @@ StereoOut32 V_Core::ReadInput() InputPosRead++; - if (AutoDMACtrl & Index + 1 && (InputPosRead == 0x100 || InputPosRead == 0x200)) + if (AutoDMACtrl & (Index + 1) && (InputPosRead == 0x100 || InputPosRead == 0x200)) { #ifdef ENABLE_NEW_IOPDMA_SPU2 // WARNING: Assumes this to be in the same thread as the dmas diff --git a/plugins/spu2-x/src/SndOut_Portaudio.cpp b/plugins/spu2-x/src/SndOut_Portaudio.cpp index d9b572c3c..f95f08170 100644 --- a/plugins/spu2-x/src/SndOut_Portaudio.cpp +++ b/plugins/spu2-x/src/SndOut_Portaudio.cpp @@ -178,7 +178,6 @@ public: void* infoPtr = NULL; const PaDeviceInfo * devinfo = Pa_GetDeviceInfo(deviceIndex); - const PaHostApiInfo * apiinfo = Pa_GetHostApiInfo(devinfo->hostApi); int speakers; switch(numSpeakers) // speakers = (numSpeakers + 1) *2; ? diff --git a/plugins/spu2-x/src/Timestretcher.cpp b/plugins/spu2-x/src/Timestretcher.cpp index b7742aa37..dad23a936 100644 --- a/plugins/spu2-x/src/Timestretcher.cpp +++ b/plugins/spu2-x/src/Timestretcher.cpp @@ -426,8 +426,6 @@ static void CvtPacketToInt( StereoOut32* srcdest, uint size ) void SndBuffer::timeStretchWrite() { - bool progress = false; - // data prediction helps keep the tempo adjustments more accurate. // The timestretcher returns packets in belated "clump" form. // Meaning that most of the time we'll get nothing back, and then @@ -448,7 +446,6 @@ void SndBuffer::timeStretchWrite() CvtPacketToInt( sndTempBuffer, tempProgress ); _WriteSamples( sndTempBuffer, tempProgress ); - progress = true; } #ifdef SPU2X_USE_OLD_STRETCHER diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index 092da9afc..f56d0c6ad 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -185,7 +185,7 @@ EXPORT_C_(void) GSsetGameCRC(int crc, int options) if (CRCValueChanged && (crc != 0)) { - for (int i = 0; i < GAME_INFO_INDEX; i++) + for (u32 i = 0; i < GAME_INFO_INDEX; i++) { if (crc_game_list[i].crc == crc) { @@ -680,8 +680,6 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) fread(regs, 0x2000, 1, fp); - long start = ftell(fp); - GSvsync(1); list packets; @@ -769,7 +767,7 @@ EXPORT_C_(void) GSReplay(char* lpszCmdLine) switch(p->param) { //case 0: GSgifTransfer1((u32*)&p->buff[0], p->addr); break; - case 0: _GSgifTransfer<0>(&p->buff[0], p->real_size); break; + case 0: _GSgifTransfer<0>((u32*)&p->buff[0], p->real_size); break; case 1: GSgifTransfer2((u32*)&p->buff[0], p->real_size); break; case 2: GSgifTransfer3((u32*)&p->buff[0], p->real_size); break; case 3: GSgifTransfer((u32*)&p->buff[0], p->real_size); break; diff --git a/plugins/zzogl-pg/opengl/ZZMemoryTargets.cpp b/plugins/zzogl-pg/opengl/ZZMemoryTargets.cpp index f30893eb2..174f1c97c 100644 --- a/plugins/zzogl-pg/opengl/ZZMemoryTargets.cpp +++ b/plugins/zzogl-pg/opengl/ZZMemoryTargets.cpp @@ -243,7 +243,7 @@ CMemoryTarget* CMemoryTargetMngr::SearchExistTarget(int start, int end, int clut return NULL; } -CMemoryTarget* CMemoryTargetMngr::ClearedTargetsSearch(int fmt, int widthmult, int channels, int height) +CMemoryTarget* CMemoryTargetMngr::ClearedTargetsSearch(u32 fmt, int widthmult, int channels, int height) { CMemoryTarget* targ = NULL; diff --git a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp index b74165091..1bdcd78c1 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp @@ -832,7 +832,7 @@ inline void AfterRendererAutoresetTargets() int total = 0; - for (int i = 0; i < ArraySize(s_nResolveCounts); ++i) total += s_nResolveCounts[i]; + for (u32 i = 0; i < ArraySize(s_nResolveCounts); ++i) total += s_nResolveCounts[i]; if (total / ArraySize(s_nResolveCounts) > 3) { diff --git a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp index ea17bf8c1..3ed001892 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp @@ -566,7 +566,7 @@ bool ZZCreate(int _width, int _height) if (!vb_buffer_allocated) { glGenBuffers((GLsizei)ArraySize(g_vboBuffers), g_vboBuffers); - for (int i = 0; i < ArraySize(g_vboBuffers); ++i) + for (u32 i = 0; i < ArraySize(g_vboBuffers); ++i) { glBindBuffer(GL_ARRAY_BUFFER, g_vboBuffers[i]); glBufferData(GL_ARRAY_BUFFER, 0x100*sizeof(VertexGPU), NULL, GL_STREAM_DRAW); @@ -809,7 +809,7 @@ void ZZDestroy() if (pvs != NULL) { - for (int i = 0; i < ArraySize(pvs); ++i) + for (u32 i = 0; i < ArraySize(pvs); ++i) { SAFE_RELEASE_PROG(pvs[i]); } @@ -817,7 +817,7 @@ void ZZDestroy() if (ppsRegular != NULL) { - for (int i = 0; i < ArraySize(ppsRegular); ++i) + for (u32 i = 0; i < ArraySize(ppsRegular); ++i) { SAFE_RELEASE_PROG(ppsRegular[i].prog); } @@ -825,7 +825,7 @@ void ZZDestroy() if (ppsTexture != NULL) { - for (int i = 0; i < ArraySize(ppsTexture); ++i) + for (u32 i = 0; i < ArraySize(ppsTexture); ++i) { SAFE_RELEASE_PROG(ppsTexture[i].prog); } diff --git a/plugins/zzogl-pg/opengl/targets.h b/plugins/zzogl-pg/opengl/targets.h index 37a7f11c2..4da8f7de7 100644 --- a/plugins/zzogl-pg/opengl/targets.h +++ b/plugins/zzogl-pg/opengl/targets.h @@ -328,7 +328,7 @@ class CMemoryTargetMngr CMemoryTarget* GetMemoryTarget(const tex0Info& tex0, int forcevalidate); // pcbp is pointer to start of clut CMemoryTarget* SearchExistTarget(int start, int end, int clutsize, const tex0Info& tex0, int forcevalidate); - CMemoryTarget* ClearedTargetsSearch(int fmt, int widthmult, int channels, int height); + CMemoryTarget* ClearedTargetsSearch(u32 fmt, int widthmult, int channels, int height); int CompareTarget(list::iterator& it, const tex0Info& tex0, int clutsize); void Destroy(); // destroy all targs