diff --git a/Source/Core/Core/Src/ARDecrypt.h b/Source/Core/Core/Src/ARDecrypt.h index c5b9f04206..5a9fcbce88 100644 --- a/Source/Core/Core/Src/ARDecrypt.h +++ b/Source/Core/Core/Src/ARDecrypt.h @@ -27,10 +27,8 @@ namespace ActionReplay { -extern int total; -extern const char *filter; - void DecryptARCode(std::vector vCodes, std::vector &ops); + } //namespace #endif //_ARDECRYPT_H_ diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp index e957d54ad1..d7bddf1d38 100644 --- a/Source/Core/Core/Src/ActionReplay.cpp +++ b/Source/Core/Core/Src/ActionReplay.cpp @@ -20,7 +20,7 @@ // Will never be able to support some AR codes - specifically those that patch the running // Action Replay engine itself - yes they do exist!!! // Action Replay actually is a small virtual machine with a limited number of commands. -// It probably is Turning complete - but what does that matter when AR codes can write +// It probably is Turing complete - but what does that matter when AR codes can write // actual PowerPC code... // ----------------------------------------------------------------------------------------- diff --git a/Source/Core/Core/Src/Boot/Boot_DOL.cpp b/Source/Core/Core/Src/Boot/Boot_DOL.cpp index 1f7578ff85..0c6f52d92f 100644 --- a/Source/Core/Core/Src/Boot/Boot_DOL.cpp +++ b/Source/Core/Core/Src/Boot/Boot_DOL.cpp @@ -38,7 +38,7 @@ CDolLoader::CDolLoader(const char* _szFilename) fclose(pStream); m_bInit = Initialize(tmpBuffer, (u32)size); - delete [] tmpBuffer; + delete[] tmpBuffer; } bool CDolLoader::Initialize(u8* _pBuffer, u32 _Size) diff --git a/Source/Core/Core/Src/Boot/Boot_ELF.cpp b/Source/Core/Core/Src/Boot/Boot_ELF.cpp index ba1fe4c5b0..6ede52e482 100644 --- a/Source/Core/Core/Src/Boot/Boot_ELF.cpp +++ b/Source/Core/Core/Src/Boot/Boot_ELF.cpp @@ -37,7 +37,7 @@ bool CBoot::IsElfWii(const char *filename) ElfReader reader(mem); // TODO: Find a more reliable way to distinguish. bool isWii = reader.GetEntryPoint() >= 0x80004000; - delete [] mem; + delete[] mem; return isWii; } @@ -66,7 +66,7 @@ bool CBoot::Boot_ELF(const char *filename) } PC = reader.GetEntryPoint(); - delete []mem; + delete[] mem; return true; } diff --git a/Source/Core/Core/Src/Debugger/Dump.cpp b/Source/Core/Core/Src/Debugger/Dump.cpp index 73e28b9aec..52685f8676 100644 --- a/Source/Core/Core/Src/Debugger/Dump.cpp +++ b/Source/Core/Core/Src/Debugger/Dump.cpp @@ -42,7 +42,7 @@ CDump::~CDump(void) { if (m_pData != NULL) { - delete [] m_pData; + delete[] m_pData; m_pData = NULL; } } diff --git a/Source/Core/Core/Src/DolLoader.h b/Source/Core/Core/Src/DolLoader.h index ae5bd6de56..a4db3acff0 100644 --- a/Source/Core/Core/Src/DolLoader.h +++ b/Source/Core/Core/Src/DolLoader.h @@ -58,7 +58,7 @@ public: for (size_t num=0; num %s\n", strings[i]); free(strings); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index bd5858a220..a2129d4aa6 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -386,15 +386,15 @@ void Jit64::SingleStep() #endif } -void Jit64::Trace(PPCAnalyst::CodeBuffer *code_buffer, u32 em_address) +void Jit64::Trace(PPCAnalyst::CodeBuffer *code_buf, u32 em_address) { - char reg[50] = ""; char regs[500] = ""; char fregs[750] = ""; #ifdef JIT_LOG_GPR for (int i = 0; i < 32; i++) { + char reg[50]; sprintf(reg, "r%02d: %08x ", i, PowerPC::ppcState.gpr[i]); strncat(regs, reg, 500); } @@ -403,11 +403,12 @@ void Jit64::Trace(PPCAnalyst::CodeBuffer *code_buffer, u32 em_address) #ifdef JIT_LOG_FPR for (int i = 0; i < 32; i++) { + char reg[50]; sprintf(reg, "f%02d: %016x ", i, riPS0(i)); strncat(fregs, reg, 750); } #endif - const PPCAnalyst::CodeOp &op = code_buffer->codebuffer[0]; + const PPCAnalyst::CodeOp &op = code_buf->codebuffer[0]; char ppcInst[256]; DisassembleGekko(op.inst.hex, em_address, ppcInst, 256); @@ -442,13 +443,13 @@ void STACKALIGN Jit64::Jit(u32 em_address) } -const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitBlock *b) +const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlock *b) { - int blockSize = code_buffer->GetSize(); + int blockSize = code_buf->GetSize(); #ifdef JIT_SINGLESTEP blockSize = 1; - Trace(code_buffer, em_address); + Trace(code_buf, em_address); #endif if (em_address == 0) @@ -464,9 +465,9 @@ const u8* Jit64::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. - u32 nextPC = PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buffer, blockSize); + u32 nextPC = PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buf, blockSize); - PPCAnalyst::CodeOp *ops = code_buffer->codebuffer; + PPCAnalyst::CodeOp *ops = code_buf->codebuffer; const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr b->checkedEntry = start; @@ -591,7 +592,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitB b->originalSize = size; #ifdef JIT_LOG_X86 - LogGeneratedX86(size, code_buffer, normalEntry, b); + LogGeneratedX86(size, code_buf, normalEntry, b); #endif return normalEntry; diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp index ebb47c5ebb..478488809c 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp @@ -363,28 +363,29 @@ void JitIL::SingleStep() #endif } -void JitIL::Trace(PPCAnalyst::CodeBuffer *code_buffer, u32 em_address) +void JitIL::Trace(PPCAnalyst::CodeBuffer *code_buf, u32 em_address) { - char reg[50] = ""; char regs[500] = ""; char fregs[750] = ""; #ifdef JIT_LOG_GPR - for (int i = 0; i < 32; i++) + for (unsigned int i = 0; i < 32; i++) { + char reg[50]; sprintf(reg, "r%02d: %08x ", i, PowerPC::ppcState.gpr[i]); strncat(regs, reg, 500); } #endif #ifdef JIT_LOG_FPR - for (int i = 0; i < 32; i++) + for (unsigned int i = 0; i < 32; i++) { + char reg[50]; sprintf(reg, "f%02d: %016x ", i, riPS0(i)); strncat(fregs, reg, 750); } #endif - const PPCAnalyst::CodeOp &op = code_buffer->codebuffer[0]; + const PPCAnalyst::CodeOp &op = code_buf->codebuffer[0]; char ppcInst[256]; DisassembleGekko(op.inst.hex, em_address, ppcInst, 256); @@ -418,13 +419,13 @@ 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 *code_buf, JitBlock *b) { - int blockSize = code_buffer->GetSize(); + int blockSize = code_buf->GetSize(); #ifdef JIT_SINGLESTEP blockSize = 1; - Trace(code_buffer, em_address); + Trace(code_buf, em_address); #endif if (em_address == 0) @@ -439,8 +440,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. - b->exitAddress[0] = PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buffer, blockSize); - PPCAnalyst::CodeOp *ops = code_buffer->codebuffer; + b->exitAddress[0] = PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buf, blockSize); + PPCAnalyst::CodeOp *ops = code_buf->codebuffer; const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr b->checkedEntry = start; @@ -510,7 +511,7 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitB b->originalSize = size; #ifdef JIT_LOG_X86 - LogGeneratedX86(size, code_buffer, normalEntry, b); + LogGeneratedX86(size, code_buf, normalEntry, b); #endif return normalEntry; diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 1e45665aaf..d45832cc12 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -107,17 +107,17 @@ bool JitBlock::ContainsAddress(u32 em_address) void JitBlockCache::Shutdown() { - delete [] blocks; - delete [] blockCodePointers; + delete[] blocks; + delete[] blockCodePointers; #ifdef JIT_UNLIMITED_ICACHE if (iCache != 0) - delete [] iCache; + delete[] iCache; iCache = 0; if (iCacheEx != 0) - delete [] iCacheEx; + delete[] iCacheEx; iCacheEx = 0; if (iCacheVMEM != 0) - delete [] iCacheVMEM; + delete[] iCacheVMEM; iCacheVMEM = 0; #endif blocks = 0; diff --git a/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp index cd023efb76..9f55b72202 100644 --- a/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/Src/PowerPC/PPCAnalyst.cpp @@ -53,7 +53,7 @@ CodeBuffer::CodeBuffer(int size) CodeBuffer::~CodeBuffer() { - delete [] codebuffer; + delete[] codebuffer; } void AnalyzeFunction2(Symbol &func); diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index b7c7591148..4f285b28ea 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -139,7 +139,7 @@ void SaveBufferStateCallback(u64 userdata, int cyclesLate) sz = (size_t)ptr; if (*cur_buffer) - delete [] (*cur_buffer); + delete[] (*cur_buffer); *cur_buffer = new u8[sz]; ptr = *cur_buffer; @@ -174,7 +174,7 @@ THREAD_RETURN CompressAndDumpState(void *pArgs) if (f == NULL) { Core::DisplayMessage("Could not save state", 2000); - delete []buffer; + delete[] buffer; return 0; } @@ -213,7 +213,7 @@ THREAD_RETURN CompressAndDumpState(void *pArgs) } fclose(f); - delete []buffer; + delete[] buffer; Core::DisplayMessage(StringFromFormat("Saved State to %s", filename.c_str()).c_str(), 2000); @@ -322,7 +322,7 @@ void LoadStateCallback(u64 userdata, int cyclesLate) PanicAlert("Internal LZO Error - decompression failed (%d) (%d, %d) \n" "Try loading the state again", res, i, new_len); fclose(f); - delete [] buffer; + delete[] buffer; return; } @@ -353,7 +353,7 @@ void LoadStateCallback(u64 userdata, int cyclesLate) else Core::DisplayMessage("Unable to Load : Can't load state from other revisions !", 4000); - delete [] buffer; + delete[] buffer; } void State_Init() diff --git a/Source/Core/DebuggerWX/Src/MemoryCheckDlg.cpp b/Source/Core/DebuggerWX/Src/MemoryCheckDlg.cpp index 6fa9cb3ecc..dbf6764609 100644 --- a/Source/Core/DebuggerWX/Src/MemoryCheckDlg.cpp +++ b/Source/Core/DebuggerWX/Src/MemoryCheckDlg.cpp @@ -53,17 +53,17 @@ void MemoryCheckDlg::CreateGUIControls() m_pWriteFlag = new wxCheckBox(this, ID_WRITE_FLAG, wxT("Write"), wxPoint(336,16), wxSize(57,17), 0, wxDefaultValidator, wxT("WxCheckBox1")); - wxStaticBox* WxStaticBox2 = new wxStaticBox(this, ID_WXSTATICBOX2, wxT("Break On"), wxPoint(328,0), wxSize(73,57)); + new wxStaticBox(this, ID_WXSTATICBOX2, wxT("Break On"), wxPoint(328,0), wxSize(73,57)); - wxStaticText* WxStaticText2 = new wxStaticText(this, ID_WXSTATICTEXT2, wxT("End"), wxPoint(168,24), wxDefaultSize, 0, wxT("WxStaticText2")); + new wxStaticText(this, ID_WXSTATICTEXT2, wxT("End"), wxPoint(168,24), wxDefaultSize, 0, wxT("WxStaticText2")); - wxStaticText* WxStaticText1 = new wxStaticText(this, ID_WXSTATICTEXT1, wxT("Start"), wxPoint(8,24), wxDefaultSize, 0, wxT("WxStaticText1")); + new wxStaticText(this, ID_WXSTATICTEXT1, wxT("Start"), wxPoint(8,24), wxDefaultSize, 0, wxT("WxStaticText1")); m_pEditStartAddress = new wxTextCtrl(this, ID_EDIT_START_ADDR, wxT("80000000"), wxPoint(40,24), wxSize(109,20), 0, wxDefaultValidator, wxT("WxEdit1")); m_pEditEndAddress = new wxTextCtrl(this, ID_EDIT_END_ADDRESS, wxT("80000000"), wxPoint(200,24), wxSize(109,20), 0, wxDefaultValidator, wxT("WxEdit2")); - wxStaticBox* WxStaticBox1 = new wxStaticBox(this, ID_WXSTATICBOX1, wxT("Address Range"), wxPoint(0,0), wxSize(321,57)); + new wxStaticBox(this, ID_WXSTATICBOX1, wxT("Address Range"), wxPoint(0,0), wxSize(321,57)); } void MemoryCheckDlg::OnClose(wxCloseEvent& /*event*/) diff --git a/Source/Core/DolphinWX/Src/NetEvent.cpp b/Source/Core/DolphinWX/Src/NetEvent.cpp index 8665b6f6ae..8ded2dd5b5 100644 --- a/Source/Core/DolphinWX/Src/NetEvent.cpp +++ b/Source/Core/DolphinWX/Src/NetEvent.cpp @@ -141,9 +141,9 @@ void ClientSide::OnClientData(unsigned char data) m_data_received = true; #ifdef NET_DEBUG - char sent[64]; - sprintf(sent, "Received Values: 0x%08x : 0x%08x \n", m_netvalues[0][0], m_netvalues[0][1]); - Event->AppendText(wxString::FromAscii(sent)); + char msgbuf[64]; + sprintf(msgbuf, "Received Values: 0x%08x : 0x%08x \n", m_netvalues[0][0], m_netvalues[0][1]); + Event->AppendText(wxString::FromAscii(msgbuf)); #endif break; } @@ -276,9 +276,9 @@ void ServerSide::OnServerData(int sock, unsigned char data) m_data_received = true; #ifdef NET_DEBUG - char sent[64]; - sprintf(sent, "Received Values: 0x%08x : 0x%08x \n", m_netvalues[sock][0], m_netvalues[sock][1]); - Event->AppendText(wxString::FromAscii(sent)); + char msgbuf[64]; + sprintf(msgbuf, "Received Values: 0x%08x : 0x%08x \n", m_netvalues[sock][0], m_netvalues[sock][1]); + Event->AppendText(wxString::FromAscii(msgbuf)); #endif break; }