From 4bbfff3cac6d4f435df2de125c96f1f08f44463f Mon Sep 17 00:00:00 2001 From: nakeee Date: Mon, 1 Sep 2008 12:11:08 +0000 Subject: [PATCH] many warning fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@422 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 1 + Source/Core/Common/Src/FileUtil.cpp | 1 + Source/Core/Common/Src/MappedFile.cpp | 8 ++--- Source/Core/Core/Src/Core.cpp | 2 +- Source/Core/Core/Src/CoreTiming.cpp | 2 +- .../Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp | 6 ++-- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 4 +-- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device.h | 4 +-- .../Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 9 ++--- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.h | 10 +++--- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_stm.h | 12 +++---- .../Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 34 +++++-------------- .../Interpreter/Interpreter_FloatingPoint.cpp | 10 +++--- .../Interpreter/Interpreter_Integer.cpp | 14 ++++---- .../Interpreter/Interpreter_LoadStore.cpp | 2 +- .../Interpreter_SystemRegisters.cpp | 10 +++--- .../Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp | 4 +-- Source/Core/Core/Src/PowerPC/PowerPC.cpp | 10 +++--- Source/Core/Core/Src/PowerPC/Profiler.cpp | 2 +- Source/Core/Core/Src/PowerPC/SignatureDB.cpp | 8 ++--- Source/Core/Core/Src/PowerPC/SymbolDB.cpp | 6 ++-- Source/Core/Core/Src/State.cpp | 2 +- Source/Core/DebuggerWX/src/CodeView.cpp | 4 +-- Source/Core/DebuggerWX/src/CodeWindow.cpp | 1 - Source/Core/DebuggerWX/src/MemoryView.cpp | 4 +-- Source/Core/VideoCommon/Src/Fifo.cpp | 24 ++++++------- Source/Core/VideoCommon/Src/Profiler.cpp | 14 ++++---- Source/Core/VideoCommon/Src/Profiler.h | 2 +- .../Core/VideoCommon/Src/TextureDecoder.cpp | 2 +- 29 files changed, 100 insertions(+), 112 deletions(-) diff --git a/SConstruct b/SConstruct index 4338d54f8a..4fe238e467 100644 --- a/SConstruct +++ b/SConstruct @@ -13,6 +13,7 @@ warnings = [ 'pointer-arith', 'packed', 'no-conversion', +# 'error', #'unreachable-code', ] compileFlags = [ diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index bca161268c..f6c6b75710 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -80,5 +80,6 @@ bool File::CreateDir(const std::string &path) return false; #else // TODO: Insert POSIX code here. + return true; #endif } diff --git a/Source/Core/Common/Src/MappedFile.cpp b/Source/Core/Common/Src/MappedFile.cpp index 9142303adc..e22e121722 100644 --- a/Source/Core/Common/Src/MappedFile.cpp +++ b/Source/Core/Common/Src/MappedFile.cpp @@ -158,7 +158,7 @@ void CMappedFile::Close() } -u8* CMappedFile::Lock(u64 offset, u64 size) +u8* CMappedFile::Lock(u64 offset, u64 _size) { #ifdef _WIN32 if (hFile != INVALID_HANDLE_VALUE) @@ -168,9 +168,9 @@ u8* CMappedFile::Lock(u64 offset, u64 size) { u64 realOffset = offset & ~(granularity - 1); s64 difference = offset - realOffset; - u64 fake_size = (difference + size + granularity - 1) & ~(granularity - 1); + u64 fake_size = (difference + _size + granularity - 1) & ~(granularity - 1); #ifdef _WIN32 - u8* realPtr = (u8*)MapViewOfFile(hFileMapping, FILE_MAP_READ, (DWORD)(realOffset >> 32), (DWORD)realOffset, (SIZE_T)(size)); + u8* realPtr = (u8*)MapViewOfFile(hFileMapping, FILE_MAP_READ, (DWORD)(realOffset >> 32), (DWORD)realOffset, (SIZE_T)(_size)); if (realPtr == NULL) { @@ -192,7 +192,7 @@ u8* CMappedFile::Lock(u64 offset, u64 size) //add to map lockMap[fakePtr] = realPtr; #ifndef _WIN32 - sizeMap[fakePtr] = size + difference; + sizeMap[fakePtr] = _size + difference; #endif return(fakePtr); } diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 7772f83ac9..c71058a87b 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -309,7 +309,7 @@ THREAD_RETURN EmuThread(void *pArg) g_pUpdateFPSDisplay("Loading..."); // setup our core, but can't use dynarec if we are compare server - if (_CoreParameter.bUseJIT && !_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient) + if (_CoreParameter.bUseJIT && (!_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient)) PowerPC::SetMode(PowerPC::MODE_JIT); else PowerPC::SetMode(PowerPC::MODE_INTERPRETER); diff --git a/Source/Core/Core/Src/CoreTiming.cpp b/Source/Core/Core/Src/CoreTiming.cpp index a8da759768..5c73e92c62 100644 --- a/Source/Core/Core/Src/CoreTiming.cpp +++ b/Source/Core/Core/Src/CoreTiming.cpp @@ -367,7 +367,7 @@ std::string GetScheduledEventsSummary() text.reserve(1000); while (ptr) { - int t = ptr->type; + unsigned int t = ptr->type; if (t < 0 || t >= event_types.size()) PanicAlert("Invalid event type %i", t); const char *name = event_types[ptr->type].name; diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp index 6a39363236..3e885c34a1 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp @@ -39,11 +39,11 @@ void CEXIMemoryCard::FlushCallback(u64 userdata, int cyclesLate) ptr->Flush(); } -CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rFilename, int card_index) : +CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rFilename, int _card_index) : m_strFilename(_rFilename) { - this->card_index = card_index; - cards[card_index] = this; + this->card_index = _card_index; + cards[_card_index] = this; et_this_card = CoreTiming::RegisterEvent(_rName.c_str(), FlushCallback); nintendo_card_id = 0x00000010; // 16MBit nintendo card diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index f80ec0559d..e9f18535b7 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -209,7 +209,7 @@ void ExecuteCommand(u32 _Address) // HLE - Create a new HLE device std::string DeviceName; Memory::GetString(DeviceName, Memory::Read_U32(_Address + 0xC)); - u32 Mode = Memory::Read_U32(_Address+0x10); + // u32 Mode = Memory::Read_U32(_Address+0x10); u32 DeviceID = GetDeviceIDByName(DeviceName); if (DeviceID == 0) @@ -227,7 +227,7 @@ void ExecuteCommand(u32 _Address) } else { - IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID); + // IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID); // we have already opened this device Memory::Write_U32(-6, _Address + 4); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h index eeaa7d63b5..e9eef9960f 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h @@ -129,8 +129,8 @@ protected: for (u32 i=0; iOpcode); - u16 ogf = HCI_OGF(pMsg->Opcode); + // u16 ocf = HCI_OCF(pMsg->Opcode); + // u16 ogf = HCI_OGF(pMsg->Opcode); _dbg_assert_msg_(USB_HLE_LOG, 0, "Unknown USB_IOCTL_CTRLMSG: 0x%04X (ocf: 0x%x ogf 0x%x)", pMsg->Opcode, ocf, ogf); @@ -821,9 +821,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadLocalFeatures(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input) { - // command parameters - hci_read_stored_link_key_cp* ReadStoredLinkKey = (hci_read_stored_link_key_cp*)_Input; - // reply hci_read_stored_link_key_rp Reply; Reply.status = 0x00; @@ -920,9 +917,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandHostBufferSize(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageTimeOut(u8* _Input) { - // command parameters - hci_write_page_timeout_cp* pWritePageTimeOut = (hci_write_page_timeout_cp*)_Input; - // reply hci_host_buffer_size_rp Reply; Reply.status = 0x00; @@ -946,6 +940,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input) SendEventCommandComplete(HCI_CMD_WRITE_SCAN_ENABLE, &Reply, sizeof(hci_write_scan_enable_rp)); +/* static char Scanning[][128] = { { "HCI_NO_SCAN_ENABLE"}, @@ -953,7 +948,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input) { "HCI_PAGE_SCAN_ENABLE"}, { "HCI_INQUIRY_AND_PAGE_SCAN_ENABLE"}, }; - +*/ LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_SCAN_ENABLE:"); LOG(USB_HLE_LOG, "write:"); LOG(USB_HLE_LOG, " scan_enable: %s", Scanning[pWriteScanEnable->scan_enable]); @@ -961,22 +956,20 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input) { - // command parameters - hci_write_inquiry_mode_cp* pInquiryMode = (hci_write_inquiry_mode_cp*)_Input; - // reply hci_write_inquiry_mode_rp Reply; Reply.status = 0x00; SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_MODE, &Reply, sizeof(hci_write_inquiry_mode_rp)); +/* static char InquiryMode[][128] = { { "Standard Inquiry Result event format (default)" }, { "Inquiry Result format with RSSI" }, { "Inquiry Result with RSSI format or Extended Inquiry Result format" } }; - +*/ LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_INQUIRY_MODE:"); LOG(USB_HLE_LOG, "write:"); LOG(USB_HLE_LOG, " mode: %s", InquiryMode[pInquiryMode->mode]); @@ -984,20 +977,19 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input) { - // command parameters - hci_write_page_scan_type_cp* pWritePageScanType = (hci_write_page_scan_type_cp*)_Input; - // reply hci_write_page_scan_type_rp Reply; Reply.status = 0x00; SendEventCommandComplete(HCI_CMD_WRITE_PAGE_SCAN_TYPE, &Reply, sizeof(hci_write_page_scan_type_rp)); +/* static char PageScanType[][128] = { { "Mandatory: Standard Scan (default)" }, { "Optional: Interlaced Scan" } }; +*/ LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:"); LOG(USB_HLE_LOG, "write:"); @@ -1030,8 +1022,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input) u8 lap[HCI_LAP_SIZE]; memcpy(lap, pInquiry->lap, HCI_LAP_SIZE); - u8 inquiry_length = pInquiry->inquiry_length; - u8 num_responses = pInquiry->num_responses; _dbg_assert_msg_(USB_HLE_LOG, m_State == STATE_NONE, "m_State != NONE"); m_State = STATE_INQUIRY_RESPONSE; @@ -1048,9 +1038,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryScanType(u8* _Input) { - // command parameters - hci_write_inquiry_scan_type_cp* pSetEventFilter = (hci_write_inquiry_scan_type_cp*)_Input; - // reply hci_write_inquiry_scan_type_rp Reply; Reply.status = 0x00; @@ -1157,9 +1144,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandCreateCon(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAcceptCon(u8* _Input) { - // command parameters - hci_accept_con_cp* pAcceptCon = (hci_accept_con_cp*)_Input; - LOG(USB_HLE_LOG, "Command: HCI_CMD_ACCEPT_CON"); LOG(USB_HLE_LOG, "Input:"); LOG(USB_HLE_LOG, " bd: %02x:%02x:%02x:%02x:%02x:%02x", diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index 212369111b..9c18a0bf3c 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -96,7 +96,7 @@ void UpdateFPRF(double value) return; } u64 mantissa = ivalue & 0x000FFFFFFFFFFFFFULL; - int mantissa_top = (int)(mantissa >> 51); + // int mantissa_top = (int)(mantissa >> 51); if (exp == 0 && mantissa) { // Denormalized number. if (sign) { @@ -192,8 +192,8 @@ void fctiwx(UGeckoInstruction _inst) else { value = (u32)(s32)_mm_cvtsd_si32(_mm_set_sd(b)); // obey current rounding mode - double d_value = (double)value; - bool inexact = (d_value != b); +// double d_value = (double)value; +// bool inexact = (d_value != b); // FPSCR.FI = inexact ? 1 : 0; // FPSCR.XX |= FPSCR.FI; // FPSCR.FR = fabs(d_value) > fabs(b); @@ -231,8 +231,8 @@ void fctiwzx(UGeckoInstruction _inst) else { value = (u32)(s32)_mm_cvttsd_si32(_mm_set_sd(b)); // truncate - double d_value = (double)value; - bool inexact = (d_value != b); +// double d_value = (double)value; +// bool inexact = (d_value != b); // FPSCR.FI = inexact ? 1 : 0; // FPSCR.XX |= FPSCR.FI; // FPSCR.FR = 1; //fabs(d_value) > fabs(b); diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp index 7ed9562c0b..4a673be75b 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -234,9 +234,10 @@ void cmp(UGeckoInstruction _inst) { s32 a = (s32)m_GPR[_inst.RA]; s32 b = (s32)m_GPR[_inst.RB]; - int fTemp; - if (a < b) fTemp = 0x8; - else if (a > b) fTemp = 0x4; + int fTemp = 0x8; // a < b + + // if (a < b) fTemp = 0x8; else + if (a > b) fTemp = 0x4; else if (a == b) fTemp = 0x2; if (XER.SO) PanicAlert("cmp getting overflow flag"); // fTemp |= 0x1 SetCRField(_inst.CRFD, fTemp); @@ -246,9 +247,10 @@ void cmpl(UGeckoInstruction _inst) { u32 a = m_GPR[_inst.RA]; u32 b = m_GPR[_inst.RB]; - u32 fTemp; - if (a < b) fTemp = 0x8; - else if (a > b) fTemp = 0x4; + u32 fTemp = 0x8; // a < b + + // if (a < b) fTemp = 0x8;else + if (a > b) fTemp = 0x4; else if (a == b) fTemp = 0x2; if (XER.SO) PanicAlert("cmpl getting overflow flag"); // fTemp |= 0x1; SetCRField(_inst.CRFD, fTemp); diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp index f0613f3e27..bba0762952 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_LoadStore.cpp @@ -631,7 +631,7 @@ void tlbia(UGeckoInstruction _inst) void tlbie(UGeckoInstruction _inst) { // invalid entry - int entry = _inst.RB; + // int entry = _inst.RB; //MessageBox(0,"TLBIE","TLBIE",0); } diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp index 6c1e2dc5b4..3962e08106 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp @@ -354,11 +354,11 @@ void mtspr(UGeckoInstruction _inst) if (HID2.PSE == 0) PanicAlert("WARNING: PSE in HID2 isnt set"); - bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO? - bool LockedCacheEnable = (bool)HID2.LCE; - int DMAQueueLength = HID2.DMAQL; // Ignore - our DMA:s are instantaneous - bool PairedSingleEnable = HID2.PSE; - bool QuantizeEnable = HID2.LSQE; + // bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO? + // bool LockedCacheEnable = (bool)HID2.LCE; + // int DMAQueueLength = HID2.DMAQL; // Ignore - our DMA:s are instantaneous + // bool PairedSingleEnable = HID2.PSE; + // bool QuantizeEnable = HID2.LSQE; //TODO(ector): Protect LC memory if LCE is false. //TODO(ector): Honor PSE. diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index c8e9367682..84296f42f6 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -49,8 +49,8 @@ namespace Jit64 { namespace { - u64 GC_ALIGNED16(temp64); - u32 GC_ALIGNED16(temp32); + // u64 GC_ALIGNED16(temp64); + // u32 GC_ALIGNED16(temp32); } void lbzx(UGeckoInstruction inst) { diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.cpp b/Source/Core/Core/Src/PowerPC/PowerPC.cpp index 997dc8cc7f..11c7c928a3 100644 --- a/Source/Core/Core/Src/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/Src/PowerPC/PowerPC.cpp @@ -85,10 +85,10 @@ namespace PowerPC #ifdef _WIN32 _control87(_PC_53, MCW_PC); #else - unsigned short mode; - asm ("fstcw %0" : : "m" (mode)); - mode = (mode & ~FPU_PREC_MASK) | FPU_PREC_53; - asm ("fldcw %0" : : "m" (mode)); + unsigned short _mode; + asm ("fstcw %0" : : "m" (_mode)); + _mode = (_mode & ~FPU_PREC_MASK) | FPU_PREC_53; + asm ("fldcw %0" : : "m" (_mode)); #endif #else //x64 doesn't need this - fpu is done with SSE @@ -102,7 +102,7 @@ namespace PowerPC Interpreter::Init(); Jit64::Core::Init(); // ... but start as interpreter by default. - mode = MODE_INTERPRETER; + _mode = MODE_INTERPRETER; state = CPU_STEPPING; } diff --git a/Source/Core/Core/Src/PowerPC/Profiler.cpp b/Source/Core/Core/Src/PowerPC/Profiler.cpp index 248f342b85..84d5cc6612 100644 --- a/Source/Core/Core/Src/PowerPC/Profiler.cpp +++ b/Source/Core/Core/Src/PowerPC/Profiler.cpp @@ -60,7 +60,7 @@ void WriteProfileResults(const char *filename) { return; } fprintf(f, "Profile\n"); - for (int i = 0; i < stats.size(); i++) + for (unsigned int i = 0; i < stats.size(); i++) { const Jit64::JitBlock *block = Jit64::GetBlock(stats[i].blockNum); if (block) { diff --git a/Source/Core/Core/Src/PowerPC/SignatureDB.cpp b/Source/Core/Core/Src/PowerPC/SignatureDB.cpp index f7d82e990c..05a7f5db7c 100644 --- a/Source/Core/Core/Src/PowerPC/SignatureDB.cpp +++ b/Source/Core/Core/Src/PowerPC/SignatureDB.cpp @@ -47,10 +47,10 @@ bool SignatureDB::Load(const char *filename) memset(&temp, 0, sizeof(temp)); fread(&temp, sizeof(temp), 1, f); - DBFunc f; - f.name = temp.name; - f.size = temp.size; - database[temp.checkSum] = f; + DBFunc dbf; + dbf.name = temp.name; + dbf.size = temp.size; + database[temp.checkSum] = dbf; } fclose(f); return true; diff --git a/Source/Core/Core/Src/PowerPC/SymbolDB.cpp b/Source/Core/Core/Src/PowerPC/SymbolDB.cpp index 33bae92cea..9817d4ca94 100644 --- a/Source/Core/Core/Src/PowerPC/SymbolDB.cpp +++ b/Source/Core/Core/Src/PowerPC/SymbolDB.cpp @@ -104,9 +104,9 @@ void SymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const char *name, int typ Symbol *SymbolDB::GetSymbolFromAddr(u32 addr) { - XFuncMap::iterator iter = functions.find(addr); - if (iter != functions.end()) - return &iter->second; + XFuncMap::iterator it = functions.find(addr); + if (it != functions.end()) + return &it->second; else { for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); iter++) diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index c32f617792..4723726886 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -191,7 +191,7 @@ void LoadStateCallback(u64 userdata, int cyclesLate) buffer = new u8[sz]; int x; - if (x=fread(buffer, 1, sz, f) != sz) + if ((x = fread(buffer, 1, sz, f)) != sz) PanicAlert("wtf? %d %d", x, sz); } diff --git a/Source/Core/DebuggerWX/src/CodeView.cpp b/Source/Core/DebuggerWX/src/CodeView.cpp index aabe51378d..26e0d10a8e 100644 --- a/Source/Core/DebuggerWX/src/CodeView.cpp +++ b/Source/Core/DebuggerWX/src/CodeView.cpp @@ -395,13 +395,13 @@ void CCodeView::OnPaint(wxPaintEvent& event) if (mojs) { - for (int i = 0; i < 8; i++) + for (int k = 0; k < 8; k++) { bool found = false; for (int j = 0; j < 22; j++) { - if (mojs[i + 2] == "0123456789ABCDEFabcdef"[j]) + if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j]) { found = true; } diff --git a/Source/Core/DebuggerWX/src/CodeWindow.cpp b/Source/Core/DebuggerWX/src/CodeWindow.cpp index e084dfbf6b..b9c78d6e80 100644 --- a/Source/Core/DebuggerWX/src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/src/CodeWindow.cpp @@ -645,7 +645,6 @@ void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event) { - int index = symbols->GetSelection(); } diff --git a/Source/Core/DebuggerWX/src/MemoryView.cpp b/Source/Core/DebuggerWX/src/MemoryView.cpp index 7decb67b80..cec77bb559 100644 --- a/Source/Core/DebuggerWX/src/MemoryView.cpp +++ b/Source/Core/DebuggerWX/src/MemoryView.cpp @@ -311,13 +311,13 @@ void CMemoryView::OnPaint(wxPaintEvent& event) if (mojs) { - for (int i = 0; i < 8; i++) + for (int k = 0; k < 8; k++) { bool found = false; for (int j = 0; j < 22; j++) { - if (mojs[i + 2] == "0123456789ABCDEFabcdef"[j]) + if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j]) { found = true; } diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index d90be40572..d8d3f247da 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -126,47 +126,47 @@ void Video_SendFifoData(u8* _uData) // See Core.cpp for threading idea void Fifo_EnterLoop(const SVideoInitialize &video_initialize) { - SCPFifoStruct &fifo = *video_initialize.pCPFifo; + SCPFifoStruct &_fifo = *video_initialize.pCPFifo; // TODO(ector): Don't peek so often! while (video_initialize.pPeekMessages()) { - if (fifo.CPReadWriteDistance < 1) //fifo.CPLoWatermark) + if (_fifo.CPReadWriteDistance < 1) //fifo.CPLoWatermark) Common::SleepCurrentThread(1); //etc... // check if we are able to run this buffer - if ((fifo.bFF_GPReadEnable) && !(fifo.bFF_BPEnable && fifo.bFF_Breakpoint)) + if ((_fifo.bFF_GPReadEnable) && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint)) { int count = 200; - while(fifo.CPReadWriteDistance > 0 && count) + while(_fifo.CPReadWriteDistance > 0 && count) { // check if we are on a breakpoint - if (fifo.bFF_BPEnable) + if (_fifo.bFF_BPEnable) { - if (fifo.CPReadPointer == fifo.CPBreakpoint) + if (_fifo.CPReadPointer == _fifo.CPBreakpoint) { - fifo.bFF_Breakpoint = 1; + _fifo.bFF_Breakpoint = 1; video_initialize.pUpdateInterrupts(); break; } } // read the data and send it to the VideoPlugin - u8 *uData = video_initialize.pGetMemoryPointer(fifo.CPReadPointer); + u8 *uData = video_initialize.pGetMemoryPointer(_fifo.CPReadPointer); #ifdef _WIN32 EnterCriticalSection(&fifo.sync); #endif - fifo.CPReadPointer += 32; + _fifo.CPReadPointer += 32; Video_SendFifoData(uData); #ifdef _WIN32 - InterlockedExchangeAdd((LONG*)&fifo.CPReadWriteDistance, -32); + InterlockedExchangeAdd((LONG*)&_fifo.CPReadWriteDistance, -32); LeaveCriticalSection(&fifo.sync); #endif // increase the ReadPtr - if (fifo.CPReadPointer >= fifo.CPEnd) + if (_fifo.CPReadPointer >= _fifo.CPEnd) { - fifo.CPReadPointer = fifo.CPBase; + _fifo.CPReadPointer = _fifo.CPBase; //LOG(COMMANDPROCESSOR, "BUFFER LOOP"); } count--; diff --git a/Source/Core/VideoCommon/Src/Profiler.cpp b/Source/Core/VideoCommon/Src/Profiler.cpp index 73223393cc..6a66cdc006 100644 --- a/Source/Core/VideoCommon/Src/Profiler.cpp +++ b/Source/Core/VideoCommon/Src/Profiler.cpp @@ -247,15 +247,15 @@ void DVProfWrite(const char* pfilename, u32 frames) } { - map::iterator it; + map::iterator iter; fprintf(f, "\n\n-------------------------------------------------------------------\n\n"); u64 uTotal[2] = {0}; double fiTotalTime[2]; - for(it = mapAggregateTimes.begin(); it != mapAggregateTimes.end(); ++it) { - uTotal[0] += it->second.uExclusive; - uTotal[1] += it->second.uInclusive; + for(iter = mapAggregateTimes.begin(); iter != mapAggregateTimes.end(); ++iter) { + uTotal[0] += iter->second.uExclusive; + uTotal[1] += iter->second.uInclusive; } fprintf(f, "total times (%d): ex: %Lu ", frames, 1000000*uTotal[0]/(luPerfFreq*(u64)frames)); @@ -265,9 +265,9 @@ void DVProfWrite(const char* pfilename, u32 frames) fiTotalTime[1] = 1.0 / (double)uTotal[1]; // output the combined times - for(it = mapAggregateTimes.begin(); it != mapAggregateTimes.end(); ++it) { - fprintf(f, "%s - ex: %f inc: %f\n", it->first.c_str(), (float)((double)it->second.uExclusive * fiTotalTime[0]), - (float)((double)it->second.uInclusive * fiTotalTime[1])); + for(iter = mapAggregateTimes.begin(); iter != mapAggregateTimes.end(); ++iter) { + fprintf(f, "%s - ex: %f inc: %f\n", iter->first.c_str(), (float)((double)iter->second.uExclusive * fiTotalTime[0]), + (float)((double)iter->second.uInclusive * fiTotalTime[1])); } } diff --git a/Source/Core/VideoCommon/Src/Profiler.h b/Source/Core/VideoCommon/Src/Profiler.h index 29ab1790cc..561ee7aa13 100644 --- a/Source/Core/VideoCommon/Src/Profiler.h +++ b/Source/Core/VideoCommon/Src/Profiler.h @@ -61,7 +61,7 @@ class DVProfileFunc public: u32 dwUserData; __forceinline DVProfileFunc(const char* pname) {} - __forceinline DVProfileFunc(const char* pname, u32 dwUserData) { } + __forceinline DVProfileFunc(const char* pname, u32 _dwUserData) { } ~DVProfileFunc() {} }; diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 1dd2c371fc..a7685f47a1 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -480,7 +480,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in while(*fmt) { int xcnt = 0; - int nchar = sfont_map[*fmt]; + int nchar = sfont_map[(int)*fmt]; const unsigned char *ptr = sfont_raw[nchar]; // each char is up to 9x10