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
@@ -31,8 +31,10 @@ static const char *special_reg_names[] = {
"PC", "LR", "CTR", "CR", "FPSCR", "MSR", "SRR0", "SRR1", "Exceptions", "Int Mask", "Int Cause",
};
static u32 GetSpecialRegValue(int reg) {
switch (reg) {
static u32 GetSpecialRegValue(int reg)
{
switch (reg)
{
case 0: return PowerPC::ppcState.pc;
case 1: return PowerPC::ppcState.spr[SPR_LR];
case 2: return PowerPC::ppcState.spr[SPR_CTR];
@@ -50,8 +52,10 @@ static u32 GetSpecialRegValue(int reg) {
wxString CRegTable::GetValue(int row, int col)
{
if (row < 32) {
switch (col) {
if (row < 32)
{
switch (col)
{
case 0: return StrToWxStr(GetGPRName(row));
case 1: return wxString::Format(wxT("%08x"), GPR(row));
case 2: return StrToWxStr(GetFPRName(row));
@@ -59,20 +63,26 @@ wxString CRegTable::GetValue(int row, int col)
case 4: return wxString::Format(wxT("%016llx"), riPS1(row));
default: return wxEmptyString;
}
} else {
if (row - 32 < NUM_SPECIALS) {
switch (col) {
}
else
{
if (row - 32 < NUM_SPECIALS)
{
switch (col)
{
case 0: return StrToWxStr(special_reg_names[row - 32]);
case 1: return wxString::Format(wxT("%08x"), GetSpecialRegValue(row - 32));
default: return wxEmptyString;
}
}
}
}
return wxEmptyString;
return wxEmptyString;
}
static void SetSpecialRegValue(int reg, u32 value) {
switch (reg) {
static void SetSpecialRegValue(int reg, u32 value)
{
switch (reg)
{
case 0: PowerPC::ppcState.pc = value; break;
case 1: PowerPC::ppcState.spr[SPR_LR] = value; break;
case 2: PowerPC::ppcState.spr[SPR_CTR] = value; break;
@@ -94,15 +104,19 @@ void CRegTable::SetValue(int row, int col, const wxString& strNewVal)
u32 newVal = 0;
if (TryParse(WxStrToStr(strNewVal), &newVal))
{
if (row < 32) {
if (row < 32)
{
if (col == 1)
GPR(row) = newVal;
else if (col == 3)
riPS0(row) = newVal;
else if (col == 4)
riPS1(row) = newVal;
} else {
if ((row - 32 < NUM_SPECIALS) && (col == 1)) {
}
else
{
if ((row - 32 < NUM_SPECIALS) && (col == 1))
{
SetSpecialRegValue(row - 32, newVal);
}
}
@@ -135,7 +149,8 @@ wxGridCellAttr *CRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind)
attr->SetBackgroundColour(wxColour(wxT("#FFFFFF"))); //wxWHITE
attr->SetFont(DebuggerFont);
switch (col) {
switch (col)
{
case 1:
attr->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER);
break;
@@ -149,11 +164,13 @@ wxGridCellAttr *CRegTable::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind)
}
bool red = false;
switch (col) {
switch (col)
{
case 1: red = row < 32 ? m_CachedRegHasChanged[row] : m_CachedSpecialRegHasChanged[row-32]; break;
case 3:
case 4: red = row < 32 ? m_CachedFRegHasChanged[row][col-3] : false; break;
}
attr->SetTextColour(red ? wxColor(wxT("#FF0000")) : wxColor(wxT("#000000")));
attr->IncRef();
return attr;