From 27a4bc5a3967d58031cba1229b605edb3339c888 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 14 Apr 2014 20:14:05 +0200 Subject: [PATCH] pcsx2: sign compare mismatch 2/3 --- pcsx2/DebugTools/DisassemblyManager.cpp | 2 +- pcsx2/gui/Debugger/BreakpointWindow.cpp | 2 +- pcsx2/gui/Debugger/CtrlDisassemblyView.cpp | 10 +++++----- pcsx2/x86/iCore.cpp | 2 +- pcsx2/x86/iCore.h | 4 ++-- pcsx2/x86/ix86-32/iCore-32.cpp | 4 ++-- pcsx2/x86/sVU_zerorec.cpp | 4 ++-- plugins/zzogl-pg/opengl/GSmain.cpp | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pcsx2/DebugTools/DisassemblyManager.cpp b/pcsx2/DebugTools/DisassemblyManager.cpp index e5cae071f4..0be7f6003e 100644 --- a/pcsx2/DebugTools/DisassemblyManager.cpp +++ b/pcsx2/DebugTools/DisassemblyManager.cpp @@ -174,7 +174,7 @@ void DisassemblyManager::analyze(u32 address, u32 size = 1024) u32 next = symbolMap.GetNextSymbolAddress(address,ST_ALL); - if ((next % 4) && next != -1) + if ((next % 4) && next != 0xFFFFFFFF) { u32 alignedNext = next & ~3; diff --git a/pcsx2/gui/Debugger/BreakpointWindow.cpp b/pcsx2/gui/Debugger/BreakpointWindow.cpp index 4a22ffc73f..6f9155db3e 100644 --- a/pcsx2/gui/Debugger/BreakpointWindow.cpp +++ b/pcsx2/gui/Debugger/BreakpointWindow.cpp @@ -161,7 +161,7 @@ void BreakpointWindow::setDefaultValues() checkLog->Enable(memory); wchar_t str[64]; - if (address != -1) + if (address != 0xFFFFFFFF) { swprintf(str,64,L"0x%08X",address); editAddress->SetLabel(str); diff --git a/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp b/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp index 2435aab159..e954dc49ac 100644 --- a/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp +++ b/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp @@ -521,7 +521,7 @@ void CtrlDisassemblyView::onPopupClick(wxCommandEvent& evt) case ID_DISASM_RENAMEFUNCTION: { u32 funcBegin = symbolMap.GetFunctionStart(curAddress); - if (funcBegin != -1) + if (funcBegin != 0xFFFFFFFF) { wxString newName = wxGetTextFromUser(L"Enter the new function name",L"New function name", wxString(symbolMap.GetLabelString(funcBegin).c_str(),wxConvUTF8),this); @@ -543,10 +543,10 @@ void CtrlDisassemblyView::onPopupClick(wxCommandEvent& evt) case ID_DISASM_REMOVEFUNCTION: { u32 funcBegin = symbolMap.GetFunctionStart(curAddress); - if (funcBegin != -1) + if (funcBegin != 0xFFFFFFFF) { u32 prevBegin = symbolMap.GetFunctionStart(funcBegin-1); - if (prevBegin != -1) + if (prevBegin != 0xFFFFFFFF) { u32 expandedSize = symbolMap.GetFunctionSize(prevBegin)+symbolMap.GetFunctionSize(funcBegin); symbolMap.SetFunctionSize(prevBegin,expandedSize); @@ -570,7 +570,7 @@ void CtrlDisassemblyView::onPopupClick(wxCommandEvent& evt) case ID_DISASM_ADDFUNCTION: { u32 prevBegin = symbolMap.GetFunctionStart(curAddress); - if (prevBegin != -1) + if (prevBegin != 0xFFFFFFFF) { if (prevBegin == curAddress) { @@ -832,7 +832,7 @@ void CtrlDisassemblyView::updateStatusBarText() } else if (line.type == DISTYPE_DATA) { u32 start = symbolMap.GetDataStart(curAddress); - if (start == -1) + if (start == 0xFFFFFFFF) start = curAddress; u32 diff = curAddress-start; diff --git a/pcsx2/x86/iCore.cpp b/pcsx2/x86/iCore.cpp index 777965b32a..f9bd5718e5 100644 --- a/pcsx2/x86/iCore.cpp +++ b/pcsx2/x86/iCore.cpp @@ -755,7 +755,7 @@ void _deleteFPtoXMMreg(int reg, int flush) } } -void _freeXMMreg(int xmmreg) +void _freeXMMreg(u32 xmmreg) { pxAssert( xmmreg < iREGCNT_XMM ); diff --git a/pcsx2/x86/iCore.h b/pcsx2/x86/iCore.h index fb1623d59a..561192b8e0 100644 --- a/pcsx2/x86/iCore.h +++ b/pcsx2/x86/iCore.h @@ -177,7 +177,7 @@ void _deleteVFtoXMMreg(int reg, int vu, int flush); //void _deleteACCtoXMMreg(int vu, int flush); void _deleteGPRtoXMMreg(int reg, int flush); void _deleteFPtoXMMreg(int reg, int flush); -void _freeXMMreg(int xmmreg); +void _freeXMMreg(u32 xmmreg); //void _moveXMMreg(int xmmreg); // instead of freeing, moves it to a diff location void _flushXMMregs(); u8 _hasFreeXMMreg(); @@ -307,7 +307,7 @@ void _addNeededMMXreg(int reg); int _checkMMXreg(int reg, int mode); void _clearNeededMMXregs(); void _deleteMMXreg(int reg, int flush); -void _freeMMXreg(int mmxreg); +void _freeMMXreg(u32 mmxreg); void _moveMMXreg(int mmxreg); // instead of freeing, moves it to a diff location void _flushMMXregs(); u8 _hasFreeMMXreg(); diff --git a/pcsx2/x86/ix86-32/iCore-32.cpp b/pcsx2/x86/ix86-32/iCore-32.cpp index faa6908a27..26ed6a14db 100644 --- a/pcsx2/x86/ix86-32/iCore-32.cpp +++ b/pcsx2/x86/ix86-32/iCore-32.cpp @@ -435,7 +435,7 @@ void _deleteX86reg(int type, int reg, int flush) void _freeX86reg(int x86reg) { - pxAssert( x86reg >= 0 && x86reg < iREGCNT_GPR ); + pxAssert( x86reg >= 0 && x86reg < (int)iREGCNT_GPR ); if( x86regs[x86reg].inuse && (x86regs[x86reg].mode&MODE_WRITE) ) { x86regs[x86reg].mode &= ~MODE_WRITE; @@ -760,7 +760,7 @@ u8 _hasFreeMMXreg() return 0; } -void _freeMMXreg(int mmxreg) +void _freeMMXreg(u32 mmxreg) { pxAssert( mmxreg < iREGCNT_MMX ); if (!mmxregs[mmxreg].inuse) return; diff --git a/pcsx2/x86/sVU_zerorec.cpp b/pcsx2/x86/sVU_zerorec.cpp index 4a68c38b21..eeda23fc48 100644 --- a/pcsx2/x86/sVU_zerorec.cpp +++ b/pcsx2/x86/sVU_zerorec.cpp @@ -3040,7 +3040,7 @@ void VuBaseBlock::Recompile() if (!x86regs[s_JumpX86].inuse) { pxAssert(x86regs[s_JumpX86].type == X86TYPE_VUJUMP); - s_JumpX86 = 0xffffffff; // notify to jump from g_recWriteback + s_JumpX86 = -1; // notify to jump from g_recWriteback } } @@ -3113,7 +3113,7 @@ void VuBaseBlock::Recompile() SuperVUTestVU0Condition(0); - if (s_JumpX86 == 0xffffffff) + if (s_JumpX86 == -1) JMP32M((uptr)&g_recWriteback); else JMPR(s_JumpX86); diff --git a/plugins/zzogl-pg/opengl/GSmain.cpp b/plugins/zzogl-pg/opengl/GSmain.cpp index f56d0c6ade..9e7c80bd33 100644 --- a/plugins/zzogl-pg/opengl/GSmain.cpp +++ b/plugins/zzogl-pg/opengl/GSmain.cpp @@ -187,7 +187,7 @@ EXPORT_C_(void) GSsetGameCRC(int crc, int options) { for (u32 i = 0; i < GAME_INFO_INDEX; i++) { - if (crc_game_list[i].crc == crc) + if (crc_game_list[i].crc == (u32)crc) { ZZLog::WriteLn("Found CRC[%x] in crc game list.", crc);