diff options
| author | j4ck.fr0st <j4ck.fr0st@gmail.com> | 2010-02-21 18:55:00 +0000 |
|---|---|---|
| committer | j4ck.fr0st <j4ck.fr0st@gmail.com> | 2010-02-21 18:55:00 +0000 |
| commit | fdd635d273ff6ba6553bab34478ce2a93fdeb830 (patch) | |
| tree | 1520b74b9d66713ff9e63df8cc1ba09ea77c76e9 /Source/Core | |
| parent | f7f11211a1270d34f36a2507a00f25fbbfd7f203 (diff) | |
Warning cleanup, mainly shadowed variables, const/non-const and ctor initialization order
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5098 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/DSPCore/Src/disassemble.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DebuggerUICommon/Src/MemoryView.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/DebuggerWX/Src/JitWindow.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DebuggerWX/Src/MemoryWindow.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/GameListCtrl.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Main.cpp | 1 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp | 6 |
14 files changed, 29 insertions, 31 deletions
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<CallstackEntry> &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<std::string> 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<std::string>&FilesList, u32 *_numFiles, u32 *_sizeFiles)
+void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector<std::string>& FileList, u32 *_numFiles, u32 *_sizeFiles)
{
std::vector<std::string> Directories;
*_numFiles = *_sizeFiles = 0;
@@ -546,7 +546,7 @@ void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector<std::string>& 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<std::string>& }
else
{
- FilesList.push_back(FST_Temp.children.at(j).physicalName);
+ FileList.push_back(FST_Temp.children.at(j).physicalName);
}
}
}
|
