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
This commit is contained in:
j4ck.fr0st 2010-02-21 18:55:00 +00:00
parent f7f11211a1
commit fdd635d273
19 changed files with 39 additions and 41 deletions

View File

@ -86,7 +86,6 @@ bool GetCallstack(std::vector<CallstackEntry> &output)
if (!str || strlen(str) == 0 || !strcmp(str, "Invalid")) if (!str || strlen(str) == 0 || !strcmp(str, "Invalid"))
str = "(unknown)"; str = "(unknown)";
CallstackEntry entry;
entry.Name = StringFromFormat(" * %s [ addr = %08x ]\n", str, func - 4); entry.Name = StringFromFormat(" * %s [ addr = %08x ]\n", str, func - 4);
entry.vAddress = func - 4; entry.vAddress = func - 4;
output.push_back(entry); output.push_back(entry);

View File

@ -44,11 +44,11 @@ public:
m_csum = 0; m_csum = 0;
addData(hdr, 3, 1); 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)); addData(data, strlen(data));
} }
@ -65,7 +65,7 @@ public:
addData(m_csum + len - 2); 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--) while (len--)
{ {
@ -305,7 +305,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
{ {
int nr_players = *jvs_io++; int nr_players = *jvs_io++;
int bytes_per_player = *jvs_io++; /* ??? */ int bytes_per_player = *jvs_io++; /* ??? */
int i, j; int j;
msg.addData(1); msg.addData(1);
msg.addData(0); // tilt msg.addData(0); // tilt

View File

@ -454,7 +454,7 @@ void Update()
// if we have a reply to send // if we have a reply to send
u32 _Reply = WII_IPCInterface::DeqReply(); u32 _Reply = WII_IPCInterface::DeqReply();
if (_Reply != NULL) if (_Reply != 0)
{ {
WII_IPCInterface::GenerateReply(_Reply); WII_IPCInterface::GenerateReply(_Reply);
INFO_LOG(WII_IPC_HLE, "<<-- Reply to Command Address: 0x%08x", _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 // If there is a a new command
u32 _Address = WII_IPCInterface::GetAddress(); u32 _Address = WII_IPCInterface::GetAddress();
if (_Address != NULL) if (_Address != 0)
{ {
WII_IPCInterface::GenerateAck(); WII_IPCInterface::GenerateAck();
INFO_LOG(WII_IPC_HLE, "||-- Acknowledge Command Address: 0x%08x", _Address); INFO_LOG(WII_IPC_HLE, "||-- Acknowledge Command Address: 0x%08x", _Address);

View File

@ -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_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "IOCTL_ES_SETUID no in buffer");
_dbg_assert_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 0); _dbg_assert_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 0);
u64 m_TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 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 ); INFO_LOG(WII_IPC_ES, "IOCTL_ES_SETUID titleID: %08x/%08x", (u32)(TitleID>>32), (u32)TitleID);
} }
break; break;

View File

@ -28,10 +28,10 @@
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName) CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName) : IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
, m_Card(NULL)
, m_Status(CARD_NOT_EXIST) , m_Status(CARD_NOT_EXIST)
, m_BlockLength(0) , m_BlockLength(0)
, m_BusWidth(0) , m_BusWidth(0)
, m_Card(NULL)
{} {}
CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0() CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0()

View File

@ -665,7 +665,7 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush
SL2CAP_Options* pOptions; SL2CAP_Options* pOptions;
if (MTU == NULL) MTU = rChannel.MTU; if (MTU == 0) MTU = rChannel.MTU;
pOptions = (SL2CAP_Options*)&Buffer[Offset]; pOptions = (SL2CAP_Options*)&Buffer[Offset];
Offset += sizeof(SL2CAP_Options); Offset += sizeof(SL2CAP_Options);
pOptions->type = 1; pOptions->type = 1;
@ -673,7 +673,7 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush
*(u16*)&Buffer[Offset] = MTU; *(u16*)&Buffer[Offset] = MTU;
Offset += 2; Offset += 2;
if (FlushTimeOut == NULL) FlushTimeOut = rChannel.FlushTimeOut; if (FlushTimeOut == 0) FlushTimeOut = rChannel.FlushTimeOut;
pOptions = (SL2CAP_Options*)&Buffer[Offset]; pOptions = (SL2CAP_Options*)&Buffer[Offset];
Offset += sizeof(SL2CAP_Options); Offset += sizeof(SL2CAP_Options);
pOptions->type = 2; pOptions->type = 2;

View File

@ -373,7 +373,7 @@ void STACKALIGN JitIL::Jit(u32 em_address)
blocks.FinalizeBlock(block_num, jo.enableBlocklink, DoJit(em_address, &code_buffer, b)); 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) if (em_address == 0)
PanicAlert("ERROR : Trying to compile at 0. LR=%08x", LR); 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, //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. //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::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, buffer);
PPCAnalyst::CodeOp *ops = code_buffer->codebuffer; PPCAnalyst::CodeOp *ops = buffer->codebuffer;
const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr
b->checkedEntry = start; b->checkedEntry = start;

View File

@ -97,7 +97,7 @@ char *DSPDisassembler::DisParams(const DSPOPCTemplate& opc, u16 op1, u16 op2, ch
if (j > 0) if (j > 0)
buf += sprintf(buf, ", "); 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; val &= opc.params[j].mask;
if (opc.params[j].lshift < 0) if (opc.params[j].lshift < 0)
val = val << (-opc.params[j].lshift); val = val << (-opc.params[j].lshift);

View File

@ -289,12 +289,12 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
dc.DrawRectangle(0, 0, rc.width, 5+8); dc.DrawRectangle(0, 0, rc.width, 5+8);
// TODO - clean up this freaking mess!!!!! // 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 rowY1 = rc.height / 2 + rowHeight * row - rowHeight / 2;
int rowY2 = rc.height / 2 + rowHeight * i + rowHeight / 2; int rowY2 = rc.height / 2 + rowHeight * row + rowHeight / 2;
wxString temp = wxString::Format(_T("%08x"), address); wxString temp = wxString::Format(_T("%08x"), address);
u32 col = debugger->getColor(address); u32 col = debugger->getColor(address);
@ -309,7 +309,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
} }
else else
{ {
dc.SetPen(i == 0 ? currentPen : nullPen); dc.SetPen(row == 0 ? currentPen : nullPen);
} }
if (address == debugger->getPC()) if (address == debugger->getPC())

View File

@ -181,7 +181,7 @@ void CJitWindow::Compare(u32 em_address)
PPCAnalyst::BlockRegStats fpa; PPCAnalyst::BlockRegStats fpa;
if (PPCAnalyst::Flatten(ppc_addr, &size, &st, &gpa, &fpa, &code_buffer)) 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++) for (int i = 0; i < size; i++)
{ {
const PPCAnalyst::CodeOp &op = code_buffer.codebuffer[i]; const PPCAnalyst::CodeOp &op = code_buffer.codebuffer[i];

View File

@ -400,9 +400,9 @@ void CMemoryWindow::onSearch(wxCommandEvent& event) {
if(k==size){ if(k==size){
//Match was found //Match was found
wxMessageBox(_T("A match was found. Placing viewer at the offset.")); wxMessageBox(_T("A match was found. Placing viewer at the offset."));
wxChar tmpstr[128]={0}; wxChar tmpwxstr[128]={0};
wxSprintf(tmpstr,_T("%08x"),i); wxSprintf(tmpwxstr,_T("%08x"),i);
wxString tmpwx(tmpstr); wxString tmpwx(tmpwxstr);
addrbox->SetValue(tmpwx); addrbox->SetValue(tmpwx);
//memview->curAddress=i; //memview->curAddress=i;
//memview->Refresh(); //memview->Refresh();

View File

@ -562,7 +562,7 @@ void CGameListCtrl::ScanForISOs()
std::vector<std::string> drives = cdio_get_devices(); std::vector<std::string> drives = cdio_get_devices();
GameListItem * Drive[24]; GameListItem * Drive[24];
// Another silly Windows limitation of 24 drive letters // 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()); Drive[i] = new GameListItem(drives[i].c_str());
if (Drive[i]->IsValid()) m_ISOFiles.push_back(*Drive[i]); if (Drive[i]->IsValid()) m_ISOFiles.push_back(*Drive[i]);

View File

@ -300,7 +300,6 @@ bool DolphinApp::OnInit()
chdir(AppSupportDir); chdir(AppSupportDir);
//create all necessary dir in user directory //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_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_GCUSER_IDX))) File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
if (!File::Exists(File::GetUserPath(D_WIISYSCONF_IDX))) File::CreateFullPath(File::GetUserPath(D_WIISYSCONF_IDX)); if (!File::Exists(File::GetUserPath(D_WIISYSCONF_IDX))) File::CreateFullPath(File::GetUserPath(D_WIISYSCONF_IDX));

View File

@ -538,7 +538,7 @@ bool CWiiSaveCrypted::getPaths(bool _export)
return true; 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; std::vector<std::string> Directories;
*_numFiles = *_sizeFiles = 0; *_numFiles = *_sizeFiles = 0;
@ -546,7 +546,7 @@ void CWiiSaveCrypted::ScanForFiles(std::string savDir, std::vector<std::string>&
Directories.push_back(savDir); Directories.push_back(savDir);
for (u32 i = 0; i < Directories.size(); i++) 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::FSTEntry FST_Temp;
File::ScanDirectoryTree(Directories.at(i).c_str(), 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 else
{ {
FilesList.push_back(FST_Temp.children.at(j).physicalName); FileList.push_back(FST_Temp.children.at(j).physicalName);
} }
} }
} }

View File

@ -34,11 +34,11 @@ CUCode_Zelda::CUCode_Zelda(CMailHandler& _rMailHandler, u32 _CRC)
IUCode(_rMailHandler), IUCode(_rMailHandler),
m_CRC(_CRC), m_CRC(_CRC),
m_NumSyncMail(0),
m_bSyncInProgress(false), m_bSyncInProgress(false),
m_MaxVoice(0), m_MaxVoice(0),
m_NumSyncMail(0),
m_NumVoices(0), m_NumVoices(0),
m_bSyncCmdPending(false), m_bSyncCmdPending(false),

View File

@ -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); 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); Decoder21_ReadAudio(PB, PB.Unk36[0], _Buffer);
u32 ACC0 = _Size << 16; ACC0 = _Size << 16;
ACC0 -= PB.Unk36[0] << 16; ACC0 -= PB.Unk36[0] << 16;
PB.raw[0x34 ^ 1] = 0; PB.raw[0x34 ^ 1] = 0;

View File

@ -32,12 +32,12 @@
// Replace the harder to understand -1 with "" for the sake of user friendliness // 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) if (!m_ControlsCreated)
return; return;
if(ToBlank) if(toBlank)
{ {
if (GetButtonText(Id) == wxString(wxT("-1"))) if (GetButtonText(Id) == wxString(wxT("-1")))
SetButtonText(Id, wxString()); SetButtonText(Id, wxString());

View File

@ -160,7 +160,7 @@ namespace Clipper
if (mask != 0) 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 vlist[2][2*6+1];
int *inlist = vlist[0], *outlist = vlist[1]; int *inlist = vlist[0], *outlist = vlist[1];

View File

@ -101,7 +101,7 @@ inline void boxfilterRGBA_to_RGB8(u8 *src, u8 &r, u8 &g, u8 &b)
b = (b16 << 6) / 142; 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; u16 x16 = 0;
@ -117,7 +117,7 @@ inline void boxfilterRGBA_to_x8(u8 *src, u8 &x, int shift)
src += (640 - 3) * 3; 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) 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; 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; u16 x16 = 0;
@ -179,7 +179,7 @@ inline void boxfilterRGB_to_x8(u8 *src, u8 &x, int comp)
src += (640 - 3) * 3; 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) inline void boxfilterRGB_to_xx8(u8 *src, u8 &x1, u8 &x2, int comp1, int comp2)