Win32 - Memwatch - some code cleanup

This commit is contained in:
adelikat 2009-02-25 00:35:34 +00:00
parent ff32c900bc
commit 1974deb21d
1 changed files with 19 additions and 23 deletions

View File

@ -654,17 +654,14 @@ void CloseMemoryWatch()
//New File //New File
void ClearAllText() void ClearAllText()
{ {
//Ask to save changes first, if necessary
if (fileChanged==true) //If contents have changed if (fileChanged==true) //If contents have changed
{ {
if(MessageBox(hwndMemWatch, "Save Changes?", "Save", MB_YESNO)==IDYES) if(MessageBox(hwndMemWatch, "Save Changes?", "Save", MB_YESNO)==IDYES)
{
SaveMemWatch(); SaveMemWatch();
} }
} //Clear all strings
for(int i=0;i<MWNUM;i++)
int i;
for(i=0;i<MWNUM;i++)
{ {
addresses[i][0] = 0; addresses[i][0] = 0;
labels[i][0] = 0; labels[i][0] = 0;
@ -673,11 +670,10 @@ void ClearAllText()
} }
//Now clear last file used variable (memwLastFilename) //Now clear last file used variable (memwLastFilename)
for (int i=0;i<2048;i++) for (int i=0;i<2048;i++)
{
memwLastFilename[i] = NULL; memwLastFilename[i] = NULL;
}
fileChanged = false;
//A new file, so file has not changed
fileChanged = false;
} }
static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)