Work around occasional GetI18NCategory() failure in WndProc().

Also fix some variable-shadowing.
This commit is contained in:
aquanull 2013-06-03 20:30:12 +08:00
parent 3cc91a71e1
commit 2708c03f6e
5 changed files with 19 additions and 22 deletions

View File

@ -244,12 +244,12 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam)
const char *mojs=strstr(dis2,"->$");
if (mojs)
{
for (int i=0; i<8; i++)
for (int j=0; j<8; ++j)
{
bool found=false;
for (int j=0; j<22; j++)
for (int k=0; k<22; ++k)
{
if (mojs[i+3]=="0123456789ABCDEFabcdef"[j])
if (mojs[j+3]=="0123456789ABCDEFabcdef"[k])
found=true;
}
if (!found)

View File

@ -201,11 +201,11 @@ void CtrlMemView::onPaint(WPARAM wParam, LPARAM lParam)
sprintf(temp, "%08x %08x %08x %08x ................",
memory[0],memory[1],memory[2],memory[3]);
}
for (int i=0; i<16; i++)
for (int j=0; j<16; ++j)
{
int c = (unsigned char)m[i];
int c = (unsigned char)m[j];
if (c>=32 && c<255)
temp[i+37]=c;
temp[j+37]=c;
}
}
// if (align == 16)

View File

@ -224,11 +224,11 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam)
// Check for any changes in the registers.
if (lastPC != cpu->GetPC())
{
for (int i = 0, n = cpu->GetNumRegsInCategory(0); i < n; ++i)
for (int j = 0, n = cpu->GetNumRegsInCategory(0); j < n; ++j)
{
u32 v = cpu->GetRegValue(0, i);
changedCat0Regs[i] = v != lastCat0Values[i];
lastCat0Values[i] = v;
u32 v = cpu->GetRegValue(0, j);
changedCat0Regs[j] = v != lastCat0Values[j];
lastCat0Values[j] = v;
}
lastPC = cpu->GetPC();
}

View File

@ -155,7 +155,6 @@ BOOL CVFPUDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
int x = column * columnWidth + xStart;
Rectangle(hdc, x, y, x + columnWidth, y+rowHeight);
char temp[256];
temp_len = sprintf_s(temp, "R%i0%i", matrix, column);
TextOut(hdc,x+3,y+2,temp,temp_len);
@ -169,8 +168,6 @@ BOOL CVFPUDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{
float val = mipsr4k.v[column*32+row+matrix*4];
u32 hex = *((u32*)&val);
char temp[256];
int temp_len;
switch (mode)
{
case 0: temp_len = sprintf_s(temp,"%f",val); break;

View File

@ -390,8 +390,6 @@ namespace MainWindow
int wmId, wmEvent;
std::string fn;
I18NCategory *g = GetI18NCategory("Graphics");
switch (message)
{
case WM_CREATE:
@ -415,6 +413,9 @@ namespace MainWindow
return 0;
case WM_COMMAND:
{
I18NCategory *g = GetI18NCategory("Graphics");
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
@ -698,22 +699,21 @@ namespace MainWindow
case ID_EMULATION_SOUND:
g_Config.bEnableSound = !g_Config.bEnableSound;
break;
case ID_HELP_OPENWEBSITE:
case ID_HELP_OPENWEBSITE:
ShellExecute(NULL, "open", "http://www.ppsspp.org/", NULL, NULL, SW_SHOWNORMAL);
break;
break;
case ID_HELP_ABOUT:
case ID_HELP_ABOUT:
DialogManager::EnableAll(FALSE);
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
DialogManager::EnableAll(TRUE);
break;
default:
{
MessageBox(hwndMain,"Unimplemented","Sorry",0);
}
MessageBox(hwndMain,"Unimplemented","Sorry",0);
break;
}
}
break;
case WM_KEYDOWN:
return 0;
@ -1342,7 +1342,7 @@ namespace MainWindow
} else {
int n = 1;
if (buttonCode != -1) {
for (int i = buttonCode >> 8; i > 1; i >>= 1) {
for (int j = buttonCode >> 8; j > 1; j >>= 1) {
n++;
}
snprintf(str, CONTROLS_BUTTONNAME_MAX, "%s",