Code cleanups, warning fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5326 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2010-04-11 11:16:57 +00:00
parent 58f7de09dd
commit a4515490ce
18 changed files with 60 additions and 60 deletions

View File

@ -27,10 +27,8 @@
namespace ActionReplay
{
extern int total;
extern const char *filter;
void DecryptARCode(std::vector<std::string> vCodes, std::vector<AREntry> &ops);
} //namespace
#endif //_ARDECRYPT_H_

View File

@ -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...
// -----------------------------------------------------------------------------------------

View File

@ -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)

View File

@ -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;
}

View File

@ -42,7 +42,7 @@ CDump::~CDump(void)
{
if (m_pData != NULL)
{
delete [] m_pData;
delete[] m_pData;
m_pData = NULL;
}
}

View File

@ -58,7 +58,7 @@ public:
for (size_t num=0; num<m_dolheader.textSize[i]; num++)
CMemory::Write_U8(pTemp[num], m_dolheader.textAddress[i] + num);
delete [] pTemp;
delete[] pTemp;
}
}
@ -75,7 +75,7 @@ public:
for (size_t num=0; num<m_dolheader.dataSize[i]; num++)
CMemory::Write_U8(pTemp[num], m_dolheader.dataAddress[i] + num);
delete [] pTemp;
delete[] pTemp;
}
}

View File

@ -170,7 +170,7 @@ void CEXIMemoryCard::Flush(bool exiting)
CEXIMemoryCard::~CEXIMemoryCard()
{
Flush(true);
delete [] memory_card_content;
delete[] memory_card_content;
memory_card_content = NULL;
if(flushThread)
{

View File

@ -108,10 +108,10 @@ void Write16(const u16 _iValue, const u32 _iAddress)
void Write32(const u32 _iValue, const u32 _iAddress)
{
#ifdef _DEBUG
float floatvalue = *(float*)&_iValue;
//#ifdef _DEBUG
// float floatvalue = *(float*)&_iValue;
// LOG(GPFIFO, "GPFIFO #%x: 0x%08x / %f",ProcessorInterface::Fifo_CPUWritePointer+m_gatherPipeCount, _iValue, floatvalue);
#endif
//#endif
*(u32*)(&m_gatherPipe[m_gatherPipeCount]) = Common::swap32(_iValue);
m_gatherPipeCount += 4;
CheckGatherPipe();

View File

@ -299,7 +299,7 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
Addr += 9; // owner attribs, permission
u8 Attribs = Memory::Read_U8(Addr);
INFO_LOG(WII_IPC_FILEIO, "FS: CREATE_DIR %s", DirName.c_str());
INFO_LOG(WII_IPC_FILEIO, "FS: CREATE_DIR %s, OwnerID %#x, GroupID %#x, Attributes %#x", DirName.c_str(), OwnerID, GroupID, Attribs);
DirName += DIR_SEP;
File::CreateFullPath(DirName.c_str());

View File

@ -366,7 +366,7 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
rwFail = 1;
}
delete [] buffer;
delete[] buffer;
}
}
Memory::Write_U32(0x900, _BufferOut);
@ -401,7 +401,7 @@ u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInS
rwFail = 1;
}
delete [] buffer;
delete[] buffer;
}
}
Memory::Write_U32(0x900, _BufferOut);

View File

@ -165,7 +165,7 @@ void print_trace(const char * msg)
size = backtrace(array, 100);
strings = backtrace_symbols(array, size);
printf("%s Obtained %u stack frames.\n", msg, size);
printf("%s Obtained %u stack frames.\n", msg, (unsigned int)size);
for (i = 0; i < size; i++)
printf("--> %s\n", strings[i]);
free(strings);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -53,7 +53,7 @@ CodeBuffer::CodeBuffer(int size)
CodeBuffer::~CodeBuffer()
{
delete [] codebuffer;
delete[] codebuffer;
}
void AnalyzeFunction2(Symbol &func);

View File

@ -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()

View File

@ -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*/)

View File

@ -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;
}