diff --git a/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp b/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp index 95a3acab5a..3edde92883 100644 --- a/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp +++ b/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp @@ -86,7 +86,6 @@ bool GetCallstack(std::vector &output) if (!str || strlen(str) == 0 || !strcmp(str, "Invalid")) str = "(unknown)"; - CallstackEntry entry; entry.Name = StringFromFormat(" * %s [ addr = %08x ]\n", str, func - 4); entry.vAddress = func - 4; output.push_back(entry); diff --git a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp index 79b40d7bdc..c7e54d681e 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp @@ -44,11 +44,11 @@ public: m_csum = 0; addData(hdr, 3, 1); } - void addData(void *data, size_t len) + void addData(const void *data, size_t len) { - addData((unsigned char*)data, len); + addData((const unsigned char*)data, len); } - void addData(char *data) + void addData(const char *data) { addData(data, strlen(data)); } @@ -65,7 +65,7 @@ public: addData(m_csum + len - 2); } - void addData(unsigned char *dst, size_t len, int sync = 0) + void addData(const unsigned char *dst, size_t len, int sync = 0) { while (len--) { @@ -305,7 +305,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength) { int nr_players = *jvs_io++; int bytes_per_player = *jvs_io++; /* ??? */ - int i, j; + int j; msg.addData(1); msg.addData(0); // tilt 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 fdf06609ca..3f0cc9fae1 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -454,7 +454,7 @@ void Update() // if we have a reply to send u32 _Reply = WII_IPCInterface::DeqReply(); - if (_Reply != NULL) + if (_Reply != 0) { WII_IPCInterface::GenerateReply(_Reply); INFO_LOG(WII_IPC_HLE, "<<-- Reply to Command Address: 0x%08x", _Reply); @@ -463,7 +463,7 @@ void Update() // If there is a a new command u32 _Address = WII_IPCInterface::GetAddress(); - if (_Address != NULL) + if (_Address != 0) { WII_IPCInterface::GenerateAck(); INFO_LOG(WII_IPC_HLE, "||-- Acknowledge Command Address: 0x%08x", _Address); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index 0ea63cb76e..ffc94207e5 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -390,8 +390,8 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "IOCTL_ES_SETUID no in buffer"); _dbg_assert_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 0); - u64 m_TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); - INFO_LOG(WII_IPC_ES, "IOCTL_ES_SETUID titleID: %08x/%08x", (u32)(m_TitleID>>32), (u32)m_TitleID ); + u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); + INFO_LOG(WII_IPC_ES, "IOCTL_ES_SETUID titleID: %08x/%08x", (u32)(TitleID>>32), (u32)TitleID); } break; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp index aadacb97d6..300ccef210 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp @@ -28,10 +28,10 @@ CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName) : IWII_IPC_HLE_Device(_DeviceID, _rDeviceName) - , m_Card(NULL) , m_Status(CARD_NOT_EXIST) , m_BlockLength(0) , m_BusWidth(0) + , m_Card(NULL) {} CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0() diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp index 3c1d6f412e..d66bd09290 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp @@ -665,7 +665,7 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush SL2CAP_Options* pOptions; - if (MTU == NULL) MTU = rChannel.MTU; + if (MTU == 0) MTU = rChannel.MTU; pOptions = (SL2CAP_Options*)&Buffer[Offset]; Offset += sizeof(SL2CAP_Options); pOptions->type = 1; @@ -673,7 +673,7 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush *(u16*)&Buffer[Offset] = MTU; Offset += 2; - if (FlushTimeOut == NULL) FlushTimeOut = rChannel.FlushTimeOut; + if (FlushTimeOut == 0) FlushTimeOut = rChannel.FlushTimeOut; pOptions = (SL2CAP_Options*)&Buffer[Offset]; Offset += sizeof(SL2CAP_Options); pOptions->type = 2; diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp index b35df9b2d4..2806f39be7 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp @@ -373,7 +373,7 @@ void STACKALIGN JitIL::Jit(u32 em_address) blocks.FinalizeBlock(block_num, jo.enableBlocklink, DoJit(em_address, &code_buffer, b)); } -const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitBlock *b) +const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *buffer, JitBlock *b) { if (em_address == 0) PanicAlert("ERROR : Trying to compile at 0. LR=%08x", LR); @@ -387,8 +387,8 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitB //Analyze the block, collect all instructions it is made of (including inlining, //if that is enabled), reorder instructions for optimal performance, and join joinable instructions. - PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buffer); - PPCAnalyst::CodeOp *ops = code_buffer->codebuffer; + PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, buffer); + PPCAnalyst::CodeOp *ops = buffer->codebuffer; const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr b->checkedEntry = start; diff --git a/Source/Core/DSPCore/Src/disassemble.cpp b/Source/Core/DSPCore/Src/disassemble.cpp index 26e3c502e0..5d785f3cf6 100644 --- a/Source/Core/DSPCore/Src/disassemble.cpp +++ b/Source/Core/DSPCore/Src/disassemble.cpp @@ -97,7 +97,7 @@ char *DSPDisassembler::DisParams(const DSPOPCTemplate& opc, u16 op1, u16 op2, ch if (j > 0) buf += sprintf(buf, ", "); - u32 val = (opc.params[j].loc >= 1) ? val = op2 : val = op1; + u32 val = (opc.params[j].loc >= 1) ? op2 : op1; val &= opc.params[j].mask; if (opc.params[j].lshift < 0) val = val << (-opc.params[j].lshift); diff --git a/Source/Core/DebuggerUICommon/Src/MemoryView.cpp b/Source/Core/DebuggerUICommon/Src/MemoryView.cpp index 20bc94074a..43067eab25 100644 --- a/Source/Core/DebuggerUICommon/Src/MemoryView.cpp +++ b/Source/Core/DebuggerUICommon/Src/MemoryView.cpp @@ -289,12 +289,12 @@ void CMemoryView::OnPaint(wxPaintEvent& event) dc.DrawRectangle(0, 0, rc.width, 5+8); // TODO - clean up this freaking mess!!!!! - for (int i = -numRows; i <= numRows; i++) + for (int row = -numRows; row <= numRows; row++) { - unsigned int address = curAddress + i * align; + unsigned int address = curAddress + row * align; - int rowY1 = rc.height / 2 + rowHeight * i - rowHeight / 2; - int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2; + int rowY1 = rc.height / 2 + rowHeight * row - rowHeight / 2; + int rowY2 = rc.height / 2 + rowHeight * row + rowHeight / 2; wxString temp = wxString::Format(_T("%08x"), address); u32 col = debugger->getColor(address); @@ -309,7 +309,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event) } else { - dc.SetPen(i == 0 ? currentPen : nullPen); + dc.SetPen(row == 0 ? currentPen : nullPen); } if (address == debugger->getPC()) diff --git a/Source/Core/DebuggerWX/Src/JitWindow.cpp b/Source/Core/DebuggerWX/Src/JitWindow.cpp index dee445084a..a1b922a0d1 100644 --- a/Source/Core/DebuggerWX/Src/JitWindow.cpp +++ b/Source/Core/DebuggerWX/Src/JitWindow.cpp @@ -181,7 +181,7 @@ void CJitWindow::Compare(u32 em_address) PPCAnalyst::BlockRegStats fpa; if (PPCAnalyst::Flatten(ppc_addr, &size, &st, &gpa, &fpa, &code_buffer)) { - char *sptr = (char*)xDis; + sptr = (char*)xDis; for (int i = 0; i < size; i++) { const PPCAnalyst::CodeOp &op = code_buffer.codebuffer[i]; diff --git a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp index 8e4db3e26d..38fdbba659 100644 --- a/Source/Core/DebuggerWX/Src/MemoryWindow.cpp +++ b/Source/Core/DebuggerWX/Src/MemoryWindow.cpp @@ -400,9 +400,9 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) { if(k==size){ //Match was found wxMessageBox(_T("A match was found. Placing viewer at the offset.")); - wxChar tmpstr[128]={0}; - wxSprintf(tmpstr,_T("%08x"),i); - wxString tmpwx(tmpstr); + wxChar tmpwxstr[128]={0}; + wxSprintf(tmpwxstr,_T("%08x"),i); + wxString tmpwx(tmpwxstr); addrbox->SetValue(tmpwx); //memview->curAddress=i; //memview->Refresh(); diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index d4f78d868d..73e64c4e20 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -562,7 +562,7 @@ void CGameListCtrl::ScanForISOs() std::vector drives = cdio_get_devices(); GameListItem * Drive[24]; // Another silly Windows limitation of 24 drive letters - for (int i = 0; i < drives.size() != NULL && i < 24; i++) + for (int i = 0; i < drives.size() && i < 24; i++) { Drive[i] = new GameListItem(drives[i].c_str()); if (Drive[i]->IsValid()) m_ISOFiles.push_back(*Drive[i]); diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index e560a29381..b871303c50 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -300,7 +300,6 @@ bool DolphinApp::OnInit() chdir(AppSupportDir); //create all necessary dir in user directory - char user_path[500]; if (!File::Exists(File::GetUserPath(D_CONFIG_IDX))) File::CreateDir(File::GetUserPath(D_CONFIG_IDX)); if (!File::Exists(File::GetUserPath(D_GCUSER_IDX))) File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX)); if (!File::Exists(File::GetUserPath(D_WIISYSCONF_IDX))) File::CreateFullPath(File::GetUserPath(D_WIISYSCONF_IDX)); diff --git a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp index eabbad42d6..8650ac12ed 100644 --- a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp +++ b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp @@ -538,7 +538,7 @@ bool CWiiSaveCrypted::getPaths(bool _export) return true; } -void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector&FilesList, u32 *_numFiles, u32 *_sizeFiles) +void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector& FileList, u32 *_numFiles, u32 *_sizeFiles) { std::vector Directories; *_numFiles = *_sizeFiles = 0; @@ -546,7 +546,7 @@ void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector& Directories.push_back(savDir); for (u32 i = 0; i < Directories.size(); i++) { - if (i) FilesList.push_back(Directories.at(i));//add dir to fst + if (i) FileList.push_back(Directories.at(i));//add dir to fst File::FSTEntry FST_Temp; File::ScanDirectoryTree(Directories.at(i).c_str(), FST_Temp); @@ -564,7 +564,7 @@ void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector& } else { - FilesList.push_back(FST_Temp.children.at(j).physicalName); + FileList.push_back(FST_Temp.children.at(j).physicalName); } } } diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp index 75d160023c..ffa8e861ed 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.cpp @@ -34,11 +34,11 @@ CUCode_Zelda::CUCode_Zelda(CMailHandler& _rMailHandler, u32 _CRC) IUCode(_rMailHandler), m_CRC(_CRC), - m_NumSyncMail(0), - m_bSyncInProgress(false), m_MaxVoice(0), + m_NumSyncMail(0), + m_NumVoices(0), m_bSyncCmdPending(false), diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp index 5ff47bef51..3a307a5f1e 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp @@ -426,7 +426,7 @@ void CUCode_Zelda::RenderVoice_Raw(ZeldaVoicePB &PB, s16 *_Buffer, int _Size) ERROR_LOG(DSPHLE, "Raw loop: ReadAudio size = %04x 34:%04x %08x", PB.Unk36[0], PB.raw[0x34 ^ 1], (int)ACC0); Decoder21_ReadAudio(PB, PB.Unk36[0], _Buffer); - u32 ACC0 = _Size << 16; + ACC0 = _Size << 16; ACC0 -= PB.Unk36[0] << 16; PB.raw[0x34 ^ 1] = 0; diff --git a/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp b/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp index f68e09905d..074ada733c 100644 --- a/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_GCPad/Src/ConfigJoypad.cpp @@ -32,12 +32,12 @@ // Replace the harder to understand -1 with "" for the sake of user friendliness -void GCPadConfigDialog::ToBlank(bool ToBlank, int Id) +void GCPadConfigDialog::ToBlank(bool toBlank, int Id) { if (!m_ControlsCreated) return; - if(ToBlank) + if(toBlank) { if (GetButtonText(Id) == wxString(wxT("-1"))) SetButtonText(Id, wxString()); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp index 4fd467a8ca..6b7bdcb5ea 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/Clipper.cpp @@ -160,7 +160,7 @@ namespace Clipper if (mask != 0) { - for(int idx = 0; idx < 3; idx += 3) + for(int i = 0; i < 3; i += 3) { int vlist[2][2*6+1]; int *inlist = vlist[0], *outlist = vlist[1]; diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/TextureEncoder.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/TextureEncoder.cpp index 4e7f00f1da..7fec0b583d 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/TextureEncoder.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/TextureEncoder.cpp @@ -101,7 +101,7 @@ inline void boxfilterRGBA_to_RGB8(u8 *src, u8 &r, u8 &g, u8 &b) b = (b16 << 6) / 142; } -inline void boxfilterRGBA_to_x8(u8 *src, u8 &x, int shift) +inline void boxfilterRGBA_to_x8(u8 *src, u8 &x8, int shift) { u16 x16 = 0; @@ -117,7 +117,7 @@ inline void boxfilterRGBA_to_x8(u8 *src, u8 &x, int shift) src += (640 - 3) * 3; } - x = (x16 << 6) / 142; + x8 = (x16 << 6) / 142; } inline void boxfilterRGBA_to_xx8(u8 *src, u8 &x1, u8 &x2, int shift1, int shift2) @@ -164,7 +164,7 @@ inline void boxfilterRGB_to_RGB8(u8 *src, u8 &r, u8 &g, u8 &b) b = b16 / 9; } -inline void boxfilterRGB_to_x8(u8 *src, u8 &x, int comp) +inline void boxfilterRGB_to_x8(u8 *src, u8 &x8, int comp) { u16 x16 = 0; @@ -179,7 +179,7 @@ inline void boxfilterRGB_to_x8(u8 *src, u8 &x, int comp) src += (640 - 3) * 3; } - x = x16 / 9; + x8 = x16 / 9; } inline void boxfilterRGB_to_xx8(u8 *src, u8 &x1, u8 &x2, int comp1, int comp2)