Remove all tab/space mismatches from the DolphinWX project (at least 99%. I promise!)

Also fix up the dangling else's. Shit just looks incredibly ugly in terms of actual structure in the code.

I took the liberty of adding comments in FifoPlayerDlg.cpp, LogConfigWindow.cpp, LogWindow.cpp, and FrameAui.cpp to better explain some things.

If any comments are wrong, don't hesitate to complain.
This commit is contained in:
Lioncash
2013-04-08 01:16:50 -04:00
parent 5b2d9a7d9f
commit 1db10b139c
36 changed files with 584 additions and 295 deletions

View File

@ -62,20 +62,20 @@ END_EVENT_TABLE()
CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
wxWindow* parent, wxWindowID Id)
: wxControl(parent, Id),
debugger(debuginterface),
debugger(debuginterface),
symbol_db(symboldb),
plain(false),
curAddress(debuginterface->getPC()),
align(debuginterface->getInstructionSize(0)),
rowHeight(13),
selection(0),
oldSelection(0),
selectionChanged(false),
selecting(false),
hasFocus(false),
showHex(false),
lx(-1),
ly(-1)
rowHeight(13),
selection(0),
oldSelection(0),
selectionChanged(false),
selecting(false),
hasFocus(false),
showHex(false),
lx(-1),
ly(-1)
{
}
@ -104,7 +104,9 @@ void CCodeView::OnMouseDown(wxMouseEvent& event)
Refresh();
}
else
{
ToggleBreakpoint(YToAddress(y));
}
event.Skip(true);
}
@ -133,7 +135,9 @@ void CCodeView::OnMouseMove(wxMouseEvent& event)
Refresh();
}
else
{
OnMouseDown(event);
}
}
event.Skip(true);
@ -176,14 +180,17 @@ u32 CCodeView::AddrToBranch(u32 addr)
void CCodeView::InsertBlrNop(int Blr)
{
// Check if this address has been modified
int find = -1;
int find = -1;
for(u32 i = 0; i < BlrList.size(); i++)
{
if(BlrList.at(i).Address == selection)
{ find = i; break; }
{
find = i;
break;
}
}
// Save the old value
// Save the old value
if (find >= 0)
{
debugger->writeExtraMemory(0, BlrList.at(find).OldValue, selection);
@ -196,11 +203,11 @@ void CCodeView::InsertBlrNop(int Blr)
Temp.OldValue = debugger->readMemory(selection);
BlrList.push_back(Temp);
if (Blr == 0)
debugger->insertBLR(selection, 0x4e800020);
debugger->insertBLR(selection, 0x4e800020);
else
debugger->insertBLR(selection, 0x60000000);
debugger->insertBLR(selection, 0x60000000);
}
Refresh();
Refresh();
}
void CCodeView::OnPopupMenu(wxCommandEvent& event)
@ -211,14 +218,14 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
switch (event.GetId())
{
case IDM_GOTOINMEMVIEW:
// CMemoryDlg::Goto(selection);
break;
case IDM_GOTOINMEMVIEW:
// CMemoryDlg::Goto(selection);
break;
#if wxUSE_CLIPBOARD
case IDM_COPYADDRESS:
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
break;
case IDM_COPYADDRESS:
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%08x"), selection)));
break;
case IDM_COPYCODE:
{
@ -228,13 +235,13 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
}
break;
case IDM_COPYHEX:
{
char temp[24];
sprintf(temp, "%08x", debugger->readInstruction(selection));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
case IDM_COPYHEX:
{
char temp[24];
sprintf(temp, "%08x", debugger->readInstruction(selection));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
case IDM_COPYFUNCTION:
@ -259,11 +266,11 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
break;
#endif
case IDM_RUNTOHERE:
debugger->setBreakpoint(selection);
debugger->runToBreakpoint();
Refresh();
break;
case IDM_RUNTOHERE:
debugger->setBreakpoint(selection);
debugger->runToBreakpoint();
Refresh();
break;
// Insert blr or restore old value
case IDM_INSERTBLR:
@ -275,9 +282,9 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
Refresh();
break;
case IDM_JITRESULTS:
case IDM_JITRESULTS:
debugger->showJitResults(selection);
break;
break;
case IDM_FOLLOWBRANCH:
{
@ -366,7 +373,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
dc.GetTextExtent(_T("0WJyq"),&w,&h);
if (h > rowHeight)
rowHeight = h;
rowHeight = h;
dc.GetTextExtent(_T("W"),&w,&h);
int charWidth = w;
@ -507,7 +514,8 @@ void CCodeView::OnPaint(wxPaintEvent& event)
strcpy(desc, debugger->getDescription(address).c_str());
}
if (!plain) {
if (!plain)
{
dc.SetTextForeground(_T("#0000FF")); // blue
//char temp[256];
@ -535,11 +543,11 @@ void CCodeView::OnPaint(wxPaintEvent& event)
for (int i = 0; i < numBranches; i++)
{
int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8;
_MoveTo(x-2, branches[i].src);
int x = 17 + 49 * charWidth + (branches[i].srcAddr % 9) * 8;
_MoveTo(x-2, branches[i].src);
if (branches[i].dst < rc.height + 400 && branches[i].dst > -400)
{
{
_LineTo(dc, x+2, branches[i].src);
_LineTo(dc, x+2, branches[i].dst);
_LineTo(dc, x-4, branches[i].dst);
@ -547,7 +555,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
_MoveTo(x, branches[i].dst - 4);
_LineTo(dc, x-4, branches[i].dst);
_LineTo(dc, x+1, branches[i].dst+5);
}
}
//else
//{
// This can be re-enabled when there is a scrollbar or