From e3cefc7b6ca803e3f87dbadae54a110332778490 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Jul 2012 22:41:06 +0000 Subject: - first of the /Core standard plugins; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@778 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/srfile/file.cpp | 46 ++++++------- src/modules/srfile/file.h | 10 +-- src/modules/srfile/fileexistsdlg.cpp | 80 +++++++++++----------- src/modules/srfile/fileopts.cpp | 18 ++--- src/modules/srfile/filerecvdlg.cpp | 70 ++++++++++---------- src/modules/srfile/filesenddlg.cpp | 36 +++++----- src/modules/srfile/filexferdlg.cpp | 124 +++++++++++++++++------------------ src/modules/srfile/ftmanager.cpp | 20 +++--- 8 files changed, 202 insertions(+), 202 deletions(-) (limited to 'src/modules/srfile') diff --git a/src/modules/srfile/file.cpp b/src/modules/srfile/file.cpp index b398294c8d..4e1db5c651 100644 --- a/src/modules/srfile/file.cpp +++ b/src/modules/srfile/file.cpp @@ -31,8 +31,8 @@ static HANDLE hSRFileMenuItem; static INT_PTR SendFileCommand(WPARAM wParam, LPARAM) { struct FileSendData fsd; - fsd.hContact=(HANDLE)wParam; - fsd.ppFiles=NULL; + fsd.hContact = (HANDLE)wParam; + fsd.ppFiles = NULL; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd); return 0; } @@ -40,7 +40,7 @@ static INT_PTR SendFileCommand(WPARAM wParam, LPARAM) static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam) { FileSendData fsd; - fsd.hContact=(HANDLE)wParam; + fsd.hContact = (HANDLE)wParam; char** ppFiles = (char**)lParam; int count = 0; @@ -53,7 +53,7 @@ static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam) fsd.ppFiles[ count ] = NULL; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd); - for (int j=0; j < count; j++) + for (int j = 0; j < count; j++) mir_free((void*)fsd.ppFiles[j]); return 0; } @@ -61,8 +61,8 @@ static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam) static INT_PTR SendSpecificFilesT(WPARAM wParam, LPARAM lParam) { FileSendData fsd; - fsd.hContact=(HANDLE)wParam; - fsd.ppFiles=(const TCHAR**)lParam; + fsd.hContact = (HANDLE)wParam; + fsd.ppFiles = (const TCHAR**)lParam; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd); return 0; } @@ -85,7 +85,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam) void PushFileEvent(HANDLE hContact, HANDLE hdbe, LPARAM lParam) { - CLISTEVENT cle={0}; + CLISTEVENT cle = {0}; cle.cbSize = sizeof(cle); cle.hContact = hContact; cle.hDbEvent = hdbe; @@ -110,7 +110,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) { DWORD dwSignature; - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = {0}; dbei.cbSize = sizeof(dbei); dbei.cbBlob = sizeof(DWORD); dbei.pBlob = (PBYTE)&dwSignature; @@ -125,7 +125,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValue, TCHAR *szOutput, int cbOutput) { HKEY hKey; - DWORD cbOut=cbOutput; + DWORD cbOut = cbOutput; if (RegOpenKeyEx(hKeyBase, szSubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS) return 0; @@ -142,13 +142,13 @@ int SRFile_GetRegValue(HKEY hKeyBase, const TCHAR *szSubKey, const TCHAR *szValu void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed) { if ( !unitsOverride) { - if (size<1000) unitsOverride=UNITS_BYTES; - else if (size<100*1024) unitsOverride=UNITS_KBPOINT1; - else if (size<1024*1024) unitsOverride=UNITS_KBPOINT0; - else if (size<1024*1024*1024) unitsOverride=UNITS_MBPOINT2; - else unitsOverride=UNITS_GBPOINT3; + if (size<1000) unitsOverride = UNITS_BYTES; + else if (size<100*1024) unitsOverride = UNITS_KBPOINT1; + else if (size<1024*1024) unitsOverride = UNITS_KBPOINT0; + else if (size<1024*1024*1024) unitsOverride = UNITS_MBPOINT2; + else unitsOverride = UNITS_GBPOINT3; } - if (unitsUsed) *unitsUsed=unitsOverride; + if (unitsUsed) *unitsUsed = unitsOverride; switch(unitsOverride) { case UNITS_BYTES: mir_sntprintf(szOut, cchOut, _T("%u%s%s"), (int)size, appendUnits?_T(" "):_T(""), appendUnits?TranslateT("bytes"):_T("")); break; case UNITS_KBPOINT1: mir_sntprintf(szOut, cchOut, _T("%.1lf%s"), size/1024.0, appendUnits?_T(" KB"):_T("")); break; @@ -190,7 +190,7 @@ void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts) void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src) { - *dest=*src; + *dest = *src; if (src->tszCurrentFile) dest->tszCurrentFile = PFTS_StringToTchar(src->flags, src->tszCurrentFile); if (src->ptszFiles) { dest->ptszFiles = (TCHAR**)mir_alloc(sizeof(TCHAR*)*src->totalFiles); @@ -258,21 +258,21 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void) { - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = {0}; HANDLE hDbEvent, hContact; - dbei.cbSize=sizeof(dbei); - hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + dbei.cbSize = sizeof(dbei); + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); while (hContact) { - hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0); + hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0); while (hDbEvent) { - dbei.cbBlob=0; + dbei.cbBlob = 0; CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei); if ( !(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_FILE) CallService(MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDbEvent); - hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0); + hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0); } - hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); } } diff --git a/src/modules/srfile/file.h b/src/modules/srfile/file.h index b152812467..d814e99ab4 100644 --- a/src/modules/srfile/file.h +++ b/src/modules/srfile/file.h @@ -66,11 +66,11 @@ struct FileDlgData { }; //file.c -#define UNITS_BYTES 1 // 0<=size<1000: "%d bytes" -#define UNITS_KBPOINT1 2 // 1000<=size<100*1024: "%.1f KB" -#define UNITS_KBPOINT0 3 // 100*1024<=size<1024*1024: "%d KB" -#define UNITS_MBPOINT2 4 // 1024*1024<=size: "%.2f MB" -#define UNITS_GBPOINT3 5 // 1024*1024*1024<=size: "%.3f GB" +#define UNITS_BYTES 1 // 0 <= size<1000: "%d bytes" +#define UNITS_KBPOINT1 2 // 1000 <= size<100*1024: "%.1f KB" +#define UNITS_KBPOINT0 3 // 100*1024 <= size<1024*1024: "%d KB" +#define UNITS_MBPOINT2 4 // 1024*1024 <= size: "%.2f MB" +#define UNITS_GBPOINT3 5 // 1024*1024*1024 <= size: "%.3f GB" void GetSensiblyFormattedSize(__int64 size, TCHAR *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed); void FreeFilesMatrix(TCHAR ***files); //loving that triple indirection diff --git a/src/modules/srfile/fileexistsdlg.cpp b/src/modules/srfile/fileexistsdlg.cpp index 70ad5613b0..3388b692fb 100644 --- a/src/modules/srfile/fileexistsdlg.cpp +++ b/src/modules/srfile/fileexistsdlg.cpp @@ -33,9 +33,9 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime) SYSTEMTIME st; char szTime[64], szDate[64], szOutput[128]; - liFiletime.QuadPart=(BIGI(11644473600)+(__int64)unixTime)*10000000; - filetime.dwHighDateTime=liFiletime.HighPart; - filetime.dwLowDateTime=liFiletime.LowPart; + liFiletime.QuadPart = (BIGI(11644473600)+(__int64)unixTime)*10000000; + filetime.dwHighDateTime = liFiletime.HighPart; + filetime.dwLowDateTime = liFiletime.LowPart; FileTimeToSystemTime(&filetime, &st); GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, szTime, SIZEOF(szTime)); GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szDate, SIZEOF(szDate)); @@ -61,41 +61,41 @@ static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd, ITEMIDLIST *pidl, *pidlNext, *pidlFilename; IShellFolder *pFileFolder; - for (pidl=pCurrentIdl;;) { - pidlNext=(ITEMIDLIST*)((PBYTE)pidl+pidl->mkid.cb); + for (pidl = pCurrentIdl;;) { + pidlNext = (ITEMIDLIST*)((PBYTE)pidl+pidl->mkid.cb); if (pidlNext->mkid.cb == 0) { pidlFilename = (ITEMIDLIST*)CoTaskMemAlloc(pidl->mkid.cb+sizeof(pidl->mkid.cb)); CopyMemory(pidlFilename, pidl, pidl->mkid.cb+sizeof(pidl->mkid.cb)); - pidl->mkid.cb=0; + pidl->mkid.cb = 0; break; } - pidl=pidlNext; + pidl = pidlNext; } if (pDesktopFolder->BindToObject(pCurrentIdl, NULL, IID_IShellFolder, (void**)&pFileFolder) == NOERROR) { IContextMenu *pContextMenu; if (pFileFolder->GetUIObjectOf(NULL, 1, (LPCITEMIDLIST*)&pidlFilename, IID_IContextMenu, NULL, (void**)&pContextMenu) == NOERROR) { switch(cmd) { case C_PROPERTIES: - { CMINVOKECOMMANDINFO ici={0}; - ici.cbSize=sizeof(ici); - ici.hwnd=hwnd; - ici.lpVerb="properties"; - ici.nShow=SW_SHOW; + { CMINVOKECOMMANDINFO ici = {0}; + ici.cbSize = sizeof(ici); + ici.hwnd = hwnd; + ici.lpVerb = "properties"; + ici.nShow = SW_SHOW; pContextMenu->InvokeCommand(&ici); break; } case C_CONTEXTMENU: { HMENU hMenu; - hMenu=CreatePopupMenu(); + hMenu = CreatePopupMenu(); if (SUCCEEDED(pContextMenu->QueryContextMenu(hMenu, 0, 1000, 65535, (GetKeyState(VK_SHIFT)&0x8000?CMF_EXTENDEDVERBS:0)|CMF_NORMAL))) { int cmd; - cmd=TrackPopupMenu(hMenu, TPM_RETURNCMD, ptCursor->x, ptCursor->y, 0, hwnd, NULL); + cmd = TrackPopupMenu(hMenu, TPM_RETURNCMD, ptCursor->x, ptCursor->y, 0, hwnd, NULL); if (cmd) { - CMINVOKECOMMANDINFO ici={0}; - ici.cbSize=sizeof(ici); - ici.hwnd=hwnd; - ici.lpVerb=MAKEINTRESOURCEA(cmd-1000); - ici.nShow=SW_SHOW; + CMINVOKECOMMANDINFO ici = {0}; + ici.cbSize = sizeof(ici); + ici.hwnd = hwnd; + ici.lpVerb = MAKEINTRESOURCEA(cmd-1000); + ici.nShow = SW_SHOW; pContextMenu->InvokeCommand(&ici); } } @@ -126,7 +126,7 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; case WM_RBUTTONUP: { POINT pt; - pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam); + pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam); ClientToScreen(hwnd, &pt); DoAnnoyingShellCommand(hwnd, pft->tszCurrentFile, C_CONTEXTMENU, &pt); return 0; @@ -159,7 +159,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) lstrcpyn(szExtension, pszExtension+1, SIZEOF(szExtension)); else { pszExtension = _T("."); - szExtension[0]='\0'; + szExtension[0] = '\0'; } CharUpper(szExtension); if (fileInfo.szTypeName[0] == '\0') @@ -167,7 +167,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) SetDlgItemText(info->hwndDlg, IDC_EXISTINGTYPE, fileInfo.szTypeName); SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName); SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0); - szIconFile[0]='\0'; + szIconFile[0] = '\0'; if ( !lstrcmp(szExtension, _T("EXE"))) SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("2"), szIconFile, SIZEOF(szIconFile)); else { @@ -177,12 +177,12 @@ void __cdecl LoadIconsAndTypesThread(void* param) if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, SIZEOF(szIconFile))) { if (_tcsstr(szIconFile, _T("%1"))) SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, SIZEOF(szIconFile)); - else szIconFile[0]='\0'; + else szIconFile[0] = '\0'; } } } if (szIconFile[0]) { TCHAR *pszComma = _tcsrchr(szIconFile, ','); - int iconIndex = (pszComma == NULL) ? 0 :_ttoi(pszComma+1); *pszComma='\0'; + int iconIndex = (pszComma == NULL) ? 0 :_ttoi(pszComma+1); *pszComma = '\0'; HICON hIcon = ExtractIcon(hInst, szIconFile, iconIndex); if (hIcon) fileInfo.hIcon = hIcon; @@ -197,7 +197,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM { PROTOFILETRANSFERSTATUS *fts; - fts=(PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + fts = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch(msg) { case WM_INITDIALOG: { @@ -210,7 +210,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetPropA(hwndDlg, "Miranda.ParentWnd", dat->hwndParent); TranslateDialogDefault(hwndDlg); - fts=(PROTOFILETRANSFERSTATUS*)mir_alloc(sizeof(PROTOFILETRANSFERSTATUS)); + fts = (PROTOFILETRANSFERSTATUS*)mir_alloc(sizeof(PROTOFILETRANSFERSTATUS)); CopyProtoFileTransferStatus(fts, dat->fts); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)fts); SetDlgItemText(hwndDlg, IDC_FILENAME, fts->tszCurrentFile); @@ -218,20 +218,20 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM GetSensiblyFormattedSize(fts->currentFileSize, szSize, SIZEOF(szSize), 0, 1, NULL); SetDlgItemText(hwndDlg, IDC_NEWSIZE, szSize); - pfnIconWindowProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc); + pfnIconWindowProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc); - hwndFocus=GetDlgItem(hwndDlg, IDC_RESUME); + hwndFocus = GetDlgItem(hwndDlg, IDC_RESUME); if (_tstati64(fts->tszCurrentFile, &statbuf) == 0) { SetControlToUnixTime(hwndDlg, IDC_EXISTINGDATE, statbuf.st_mtime); GetSensiblyFormattedSize(statbuf.st_size, szSize, SIZEOF(szSize), 0, 1, NULL); SetDlgItemText(hwndDlg, IDC_EXISTINGSIZE, szSize); if (statbuf.st_size>(int)fts->currentFileSize) { EnableWindow(GetDlgItem(hwndDlg, IDC_RESUME), FALSE); - hwndFocus=GetDlgItem(hwndDlg, IDC_OVERWRITE); + hwndFocus = GetDlgItem(hwndDlg, IDC_OVERWRITE); } } loadiconsstartinfo *lisi = (loadiconsstartinfo*)mir_alloc(sizeof(loadiconsstartinfo)); - lisi->hwndDlg=hwndDlg; + lisi->hwndDlg = hwndDlg; lisi->szFilename = mir_tstrdup(fts->tszCurrentFile); //can be a little slow, so why not? forkthread(LoadIconsAndTypesThread, 0, lisi); @@ -241,7 +241,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } case WM_COMMAND: { - PROTOFILERESUME pfr={0}; + PROTOFILERESUME pfr = {0}; switch(LOWORD(wParam)) { case IDC_OPENFILE: ShellExecute(hwndDlg, NULL, fts->tszCurrentFile, NULL, NULL, SW_SHOW); @@ -261,16 +261,16 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DoAnnoyingShellCommand(hwndDlg, fts->tszCurrentFile, C_PROPERTIES, NULL); return FALSE; case IDC_RESUME: - pfr.action=FILERESUME_RESUME; + pfr.action = FILERESUME_RESUME; break; case IDC_RESUMEALL: - pfr.action=FILERESUME_RESUMEALL; + pfr.action = FILERESUME_RESUMEALL; break; case IDC_OVERWRITE: - pfr.action=FILERESUME_OVERWRITE; + pfr.action = FILERESUME_OVERWRITE; break; case IDC_OVERWRITEALL: - pfr.action=FILERESUME_OVERWRITEALL; + pfr.action = FILERESUME_OVERWRITEALL; break; case IDC_AUTORENAME: @@ -279,7 +279,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_SAVEAS: { - OPENFILENAME ofn={0}; + OPENFILENAME ofn = {0}; TCHAR filter[512], *pfilter; TCHAR str[MAX_PATH]; @@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM pfilter = filter + _tcslen(filter) + 1; _tcscpy(pfilter, _T("*")); pfilter = pfilter + _tcslen(pfilter) + 1; - *pfilter='\0'; + *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = str; ofn.nMaxFile = SIZEOF(str); @@ -305,16 +305,16 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break; } case IDC_SKIP: - pfr.action=FILERESUME_SKIP; + pfr.action = FILERESUME_SKIP; break; case IDCANCEL: - pfr.action=FILERESUME_CANCEL; + pfr.action = FILERESUME_CANCEL; break; default: return FALSE; } { PROTOFILERESUME *pfrCopy; - pfrCopy=(PROTOFILERESUME*)mir_alloc(sizeof(pfr)); + pfrCopy = (PROTOFILERESUME*)mir_alloc(sizeof(pfr)); CopyMemory(pfrCopy, &pfr, sizeof(pfr)); PostMessage((HWND)GetPropA(hwndDlg, "Miranda.ParentWnd"), M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfrCopy); DestroyWindow(hwndDlg); diff --git a/src/modules/srfile/fileopts.cpp b/src/modules/srfile/fileopts.cpp index b8c8c0133a..2aec9fa5a1 100644 --- a/src/modules/srfile/fileopts.cpp +++ b/src/modules/srfile/fileopts.cpp @@ -35,17 +35,17 @@ struct virusscannerinfo { const TCHAR *szCommandLine; }; -static const struct virusscannerinfo virusScanners[]={ +static const struct virusscannerinfo virusScanners[] = { {_T("Network Associates/McAfee VirusScan"), _T("SOFTWARE\\McAfee\\VirusScan"), _T("Scan32EXE"), _T("\"%s\" %%f /nosplash /comp /autoscan /autoexit /noboot")}, {_T("Dr Solomon's VirusScan (Network Associates)"), _T("SOFTWARE\\Network Associates\\TVD\\VirusScan\\AVConsol\\General"), _T("szScannerExe"), _T("\"%s\" %%f /uinone /noboot /comp /prompt /autoexit")}, {_T("Norton AntiVirus"), _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Navw32.exe"), NULL, _T("\"%s\" %%f /b- /m- /s+ /noresults")}, - {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display=progress /exit")}, - {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display=progress /exit")}, + {_T("Computer Associates/Inoculate IT"), _T("Software\\Antivirus"), _T("ImageFilename"), _T("\"%s\" %%f /display = progress /exit")}, + {_T("Computer Associates eTrust"), _T("SOFTWARE\\ComputerAssociates\\Anti-Virus\\Resident"), _T("VetPath"), _T("\"%s\" %%f /display = progress /exit")}, {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\Components\\101"), _T("EXEName"), _T("\"%s\" /S /Q %%f")}, {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV8"), _T("\"%savp.exe\" SCAN %%f")}, {_T("Kaspersky Anti-Virus"), _T("SOFTWARE\\KasperskyLab\\SetupFolders"), _T("KAV9"), _T("\"%savp.exe\" SCAN %%f")}, - {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE=2 /PATH=\"%%f\"")}, - {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action=clean \"%%f\"")}, + {_T("AntiVir PersonalEdition Classic"), _T("SOFTWARE\\Avira\\AntiVir PersonalEdition Classic"), _T("Path"), _T("\"%savscan.exe\" /GUIMODE = 2 /PATH = \"%%f\"")}, + {_T("ESET NOD32 Antivirus"), _T("SOFTWARE\\ESET\\ESET Security\\CurrentVersion\\Info"), _T("InstallDir"), _T("\"%secls.exe\" /log-all /aind /no-boots /adware /sfx /unsafe /unwanted /heur /adv-heur /action = clean \"%%f\"")}, }; #define M_UPDATEENABLING (WM_USER+100) @@ -86,7 +86,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int i, iItem; for (i=0; i < SIZEOF(virusScanners); i++) { if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[i].szExeRegPath, virusScanners[i].szExeRegValue, szScanExe, SIZEOF(szScanExe))) { - iItem=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName); + iItem = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_ADDSTRING, 0, (LPARAM)virusScanners[i].szProductName); SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_SETITEMDATA, iItem, i); } } @@ -118,7 +118,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L return TRUE; } case M_UPDATEENABLING: - { int on=!IsDlgButtonChecked(hwndDlg, IDC_NOSCANNER); + { int on = !IsDlgButtonChecked(hwndDlg, IDC_NOSCANNER); EnableWindow(GetDlgItem(hwndDlg, IDC_ST_CMDLINE), on); EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINE), on); EnableWindow(GetDlgItem(hwndDlg, IDC_SCANCMDLINEBROWSE), on); @@ -129,9 +129,9 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_SCANCMDLINESELCHANGE: { TCHAR str[512]; TCHAR szScanExe[MAX_PATH]; - int iScanner=SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0); + int iScanner = SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCURSEL, 0, 0), 0); if (iScanner >= SIZEOF(virusScanners) || iScanner<0) break; - str[0]='\0'; + str[0] = '\0'; if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[iScanner].szExeRegPath, virusScanners[iScanner].szExeRegValue, szScanExe, SIZEOF(szScanExe))) mir_sntprintf(str, SIZEOF(str), virusScanners[iScanner].szCommandLine, szScanExe); SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str); diff --git a/src/modules/srfile/filerecvdlg.cpp b/src/modules/srfile/filerecvdlg.cpp index 7249291b6d..93ba691266 100644 --- a/src/modules/srfile/filerecvdlg.cpp +++ b/src/modules/srfile/filerecvdlg.cpp @@ -37,10 +37,10 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi TCHAR *pszLastBackslash; lstrcpyn(szExistingDir, szTestDir, cchExistingDir); - while ((dwAttributes=GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) { - pszLastBackslash=_tcsrchr(szExistingDir, '\\'); - if (pszLastBackslash == NULL) {*szExistingDir='\0'; break;} - *pszLastBackslash='\0'; + while ((dwAttributes = GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) { + pszLastBackslash = _tcsrchr(szExistingDir, '\\'); + if (pszLastBackslash == NULL) {*szExistingDir = '\0'; break;} + *pszLastBackslash = '\0'; } if (szExistingDir[0] == '\0') GetCurrentDirectory(cchExistingDir, szExistingDir); } @@ -50,7 +50,7 @@ void RemoveInvalidFilenameChars(TCHAR *tszString) { size_t i; if (tszString) { - for (i=_tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1) + for (i = _tcscspn(tszString, InvalidFilenameChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidFilenameChars)+1) if (tszString[i] >= 0) tszString[i] = _T('_'); } @@ -61,7 +61,7 @@ void RemoveInvalidPathChars(TCHAR *tszString) { size_t i; if (tszString) { - for (i=_tcscspn(tszString, InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidPathChars)+1) + for (i = _tcscspn(tszString, InvalidPathChars); tszString[i]; i+=_tcscspn(tszString+i+1, InvalidPathChars)+1) if (tszString[i] >= 0) tszString[i] = _T('_'); } @@ -84,17 +84,17 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p int BrowseForFolder(HWND hwnd, TCHAR *szPath) { - BROWSEINFO bi={0}; + BROWSEINFO bi = {0}; LPITEMIDLIST pidlResult; - bi.hwndOwner=hwnd; - bi.pszDisplayName=szPath; - bi.lpszTitle=TranslateT("Select Folder"); - bi.ulFlags=BIF_NEWDIALOGSTYLE|BIF_EDITBOX|BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI - bi.lpfn=BrowseCallbackProc; - bi.lParam=(LPARAM)szPath; + bi.hwndOwner = hwnd; + bi.pszDisplayName = szPath; + bi.lpszTitle = TranslateT("Select Folder"); + bi.ulFlags = BIF_NEWDIALOGSTYLE|BIF_EDITBOX|BIF_RETURNONLYFSDIRS; // Use this combo instead of BIF_USENEWUI + bi.lpfn = BrowseCallbackProc; + bi.lParam = (LPARAM)szPath; - pidlResult=SHBrowseForFolder(&bi); + pidlResult = SHBrowseForFolder(&bi); if (pidlResult) { SHGetPathFromIDList(pidlResult, szPath); lstrcat(szPath, _T("\\")); @@ -103,7 +103,7 @@ int BrowseForFolder(HWND hwnd, TCHAR *szPath) return pidlResult != NULL; } -static REPLACEVARSARRAY sttVarsToReplace[] = +static REPLACEVARSARRAY sttVarsToReplace[] = { { (TCHAR*)"///", (TCHAR*)"//" }, { (TCHAR*)"//", (TCHAR*)"/" }, @@ -149,13 +149,13 @@ void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL if (hContact) { REPLACEVARSDATA dat = { 0 }; REPLACEVARSARRAY rvaVarsToReplace[4]; - rvaVarsToReplace[0].lptzKey = _T("nick"); + rvaVarsToReplace[0].lptzKey = _T("nick"); rvaVarsToReplace[0].lptzValue = mir_tstrdup((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); - rvaVarsToReplace[1].lptzKey = _T("userid"); + rvaVarsToReplace[1].lptzKey = _T("userid"); rvaVarsToReplace[1].lptzValue = GetContactID(hContact); - rvaVarsToReplace[2].lptzKey = _T("proto"); + rvaVarsToReplace[2].lptzKey = _T("proto"); rvaVarsToReplace[2].lptzValue = mir_a2t((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)); - rvaVarsToReplace[3].lptzKey = NULL; + rvaVarsToReplace[3].lptzKey = NULL; rvaVarsToReplace[3].lptzValue = NULL; for (int i=0; i < (SIZEOF(rvaVarsToReplace)-1);i++) RemoveInvalidFilenameChars(rvaVarsToReplace[i].lptzValue); @@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l { struct FileDlgData *dat; - dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + dat = (struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: { TCHAR *contactName; @@ -213,7 +213,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TranslateDialogDefault(hwndDlg); - dat=(struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData)); + dat = (struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); dat->hContact = cle->hContact; dat->hDbEvent = cle->hDbEvent; @@ -250,13 +250,13 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CallService(MS_DB_EVENT_MARKREAD, (WPARAM)dat->hContact, (LPARAM)dat->hDbEvent); { - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = {0}; TCHAR datetimestr[64]; char buf[540]; - dbei.cbSize=sizeof(dbei); - dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0); - dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob); + dbei.cbSize = sizeof(dbei); + dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)dat->hDbEvent, 0); + dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); CallService(MS_DB_EVENT_GET, (WPARAM)dat->hDbEvent, (LPARAM)&dbei); dat->fs = cle->lParam ? (HANDLE)cle->lParam : (HANDLE)*(PDWORD)dbei.pBlob; lstrcpynA(buf, (char*)dbei.pBlob+4, min(dbei.cbBlob+1, SIZEOF(buf))); @@ -322,15 +322,15 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); case WM_DRAWITEM: - { LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam; + { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) { char *szProto; - szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); if (szProto) { HICON hIcon; - hIcon=(HICON)CallProtoServiceInt(NULL,szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0); + hIcon = (HICON)CallProtoServiceInt(NULL,szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0); if (hIcon) { DrawIconEx(dis->hDC, dis->rcItem.left, dis->rcItem.top, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL); DestroyIcon(hIcon); @@ -363,7 +363,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l char idstr[32]; int i; DBVARIANT dbv; - for (i=MAX_MRU_DIRS-2;i>=0;i--) { + for (i = MAX_MRU_DIRS-2;i>=0;i--) { mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i); if (DBGetContactSettingTString(NULL, "SRFile", idstr, &dbv)) continue; mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i+1); @@ -393,16 +393,16 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDCANCEL: if (dat->fs) CallContactService(dat->hContact, PSS_FILEDENYT, (WPARAM)dat->fs, (LPARAM)TranslateT("Cancelled")); - dat->fs=NULL; /* the protocol will free the handle */ + dat->fs = NULL; /* the protocol will free the handle */ DestroyWindow(hwndDlg); break; case IDC_ADD: - { ADDCONTACTSTRUCT acs={0}; + { ADDCONTACTSTRUCT acs = {0}; - acs.handle=dat->hContact; - acs.handleType=HANDLE_CONTACT; - acs.szProto=""; + acs.handle = dat->hContact; + acs.handleType = HANDLE_CONTACT; + acs.szProto = ""; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); if ( !DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE); @@ -411,7 +411,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_USERMENU: { RECT rc; - HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0); + HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0); GetWindowRect((HWND)lParam, &rc); TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL); DestroyMenu(hMenu); diff --git a/src/modules/srfile/filesenddlg.cpp b/src/modules/srfile/filesenddlg.cpp index 92875ddbdb..7614d38a4e 100644 --- a/src/modules/srfile/filesenddlg.cpp +++ b/src/modules/srfile/filesenddlg.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static void SetFileListAndSizeControls(HWND hwndDlg, struct FileDlgData *dat) { - int fileCount=0, dirCount=0, totalSize=0, i; + int fileCount = 0, dirCount = 0, totalSize = 0, i; struct _stat statbuf; TCHAR str[64]; @@ -145,7 +145,7 @@ void __cdecl ChooseFilesThread(void* param) else { OPENFILENAME ofn = {0}; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; - ofn.hwndOwner = hwndDlg; + ofn.hwndOwner = hwndDlg; lstrcpy(filter, TranslateT("All Files")); lstrcat(filter, _T(" (*)")); pfilter = filter + lstrlen(filter)+1; @@ -193,23 +193,23 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l { struct FileDlgData *dat; - dat=(struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + dat = (struct FileDlgData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: { - struct FileSendData *fsd=(struct FileSendData*)lParam; + struct FileSendData *fsd = (struct FileSendData*)lParam; - dat=(struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData)); + dat = (struct FileDlgData*)mir_calloc(sizeof(struct FileDlgData)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); - dat->hContact=fsd->hContact; - dat->send=1; - dat->hPreshutdownEvent=HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN); - dat->fs=NULL; - dat->dwTicks=GetTickCount(); + dat->hContact = fsd->hContact; + dat->send = 1; + dat->hPreshutdownEvent = HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN); + dat->fs = NULL; + dat->dwTicks = GetTickCount(); TranslateDialogDefault(hwndDlg); EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0); - OldSendEditProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc); + OldSendEditProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSG), GWLP_WNDPROC, (LONG_PTR)SendEditSubclassProc); Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE); Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View User's Details")); @@ -220,11 +220,11 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (fsd->ppFiles != NULL && fsd->ppFiles[0] != NULL) { int totalCount, i; - for (totalCount=0;fsd->ppFiles[totalCount];totalCount++); + for (totalCount = 0;fsd->ppFiles[totalCount];totalCount++); dat->files = (TCHAR**)mir_alloc(sizeof(TCHAR*)*(totalCount+1)); // Leaks for (i=0;ifiles[i] = mir_tstrdup(fsd->ppFiles[i]); - dat->files[totalCount]=NULL; + dat->files[totalCount] = NULL; SetFileListAndSizeControls(hwndDlg, dat); } { @@ -232,7 +232,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TCHAR* contactName = cli.pfnGetContactDisplayName(dat->hContact, 0); SetDlgItemText(hwndDlg, IDC_TO, contactName); - szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); if (szProto) { CONTACTINFO ci; int hasName = 0; @@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (fsd->ppFiles == NULL) { EnableWindow(hwndDlg, FALSE); - dat->closeIfFileChooseCancelled=1; + dat->closeIfFileChooseCancelled = 1; PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_CHOOSE, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDC_CHOOSE)); } return TRUE; @@ -275,11 +275,11 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case WM_DRAWITEM: { - LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam; + LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) { char *szProto; - szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); if (szProto) { HICON hIcon = (HICON)CallProtoServiceInt(NULL,szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0); if (hIcon) { @@ -327,7 +327,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_USERMENU: { RECT rc; - HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0); + HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0); GetWindowRect((HWND)lParam, &rc); TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL); DestroyMenu(hMenu); diff --git a/src/modules/srfile/filexferdlg.cpp b/src/modules/srfile/filexferdlg.cpp index 99eed2c3d9..3648e2306e 100644 --- a/src/modules/srfile/filexferdlg.cpp +++ b/src/modules/srfile/filexferdlg.cpp @@ -86,8 +86,8 @@ void FillSendData(FileDlgData* dat, DBEVENTINFO& dbei) dbei.flags |= DBEF_UTF; dbei.cbBlob = sizeof(DWORD) + lstrlenA(szFileNames)+lstrlenA(szMsg)+2; - dbei.pBlob=(PBYTE)mir_alloc(dbei.cbBlob); - *(PDWORD)dbei.pBlob=0; + dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); + *(PDWORD)dbei.pBlob = 0; lstrcpyA((char*)dbei.pBlob+sizeof(DWORD), szFileNames); lstrcpyA((char*)dbei.pBlob+sizeof(DWORD)+lstrlenA(szFileNames)+1, szMsg); @@ -98,7 +98,7 @@ void FillSendData(FileDlgData* dat, DBEVENTINFO& dbei) static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) { PROCESS_INFORMATION pi; - STARTUPINFO si={0}; + STARTUPINFO si = {0}; DBVARIANT dbv; TCHAR szCmdLine[768]; @@ -107,7 +107,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) if (dbv.ptszVal[0]) { TCHAR *pszReplace; - si.cb=sizeof(si); + si.cb = sizeof(si); pszReplace = _tcsstr(dbv.ptszVal, _T("%f")); if (pszReplace) { @@ -163,7 +163,7 @@ static void SetFilenameControls(HWND hwndDlg, struct FileDlgData *dat, PROTOFILE lstrcpyn(msg, cli.pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg)); HICON hIcon = LoadSkinIcon(SKINICON_OTHER_DOWNARROW); dat->hIcon = CopyIcon(hIcon); - IconLib_ReleaseIcon(hIcon, NULL); + IcoLib_ReleaseIcon(hIcon, NULL); } mir_free(fnbuf); @@ -239,38 +239,38 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TranslateDialogDefault(hwndDlg); dat = (FileDlgData*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); - dat->hNotifyEvent=HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_RECVEVENT); + dat->hNotifyEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_RECVEVENT); dat->transferStatus.currentFileNumber = -1; if (dat->send) { - dat->fs=(HANDLE)CallContactService(dat->hContact, PSS_FILET, (WPARAM)dat->szMsg, (LPARAM)dat->files); + dat->fs = (HANDLE)CallContactService(dat->hContact, PSS_FILET, (WPARAM)dat->szMsg, (LPARAM)dat->files); SetFtStatus(hwndDlg, LPGENT("Request sent, waiting for acceptance..."), FTS_TEXT); SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1); - dat->waitingForAcceptance=1; + dat->waitingForAcceptance = 1; // hide "open" button since it may cause potential access violations... ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFILE), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_OPENFOLDER), SW_HIDE); } else { //recv CreateDirectoryTreeT(dat->szSavePath); - dat->fs=(HANDLE)CallContactService(dat->hContact, PSS_FILEALLOWT, (WPARAM)dat->fs, (LPARAM)dat->szSavePath); + dat->fs = (HANDLE)CallContactService(dat->hContact, PSS_FILEALLOWT, (WPARAM)dat->fs, (LPARAM)dat->szSavePath); dat->transferStatus.tszWorkingDir = mir_tstrdup(dat->szSavePath); - if (DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour=FILERESUME_ASK; - else dat->resumeBehaviour=DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK); + if (DBGetContactSettingByte(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK; + else dat->resumeBehaviour = DBGetContactSettingByte(NULL, "SRFile", "IfExists", FILERESUME_ASK); SetFtStatus(hwndDlg, LPGENT("Waiting for connection..."), FTS_TEXT); } { /* check we actually got an fs handle back from the protocol */ if ( !dat->fs) { SetFtStatus(hwndDlg, LPGENT("Unable to initiate transfer."), FTS_TEXT); - dat->waitingForAcceptance=0; + dat->waitingForAcceptance = 0; } } { LOGFONT lf; HFONT hFont; - hFont=(HFONT)SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_GETFONT, 0, 0); + hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_GETFONT, 0, 0); GetObject(hFont, sizeof(lf), &lf); - lf.lfWeight=FW_BOLD; - hFont=CreateFontIndirect(&lf); + lf.lfWeight = FW_BOLD; + hFont = CreateFontIndirect(&lf); SendDlgItemMessage(hwndDlg, IDC_CONTACTNAME, WM_SETFONT, (WPARAM)hFont, 0); } @@ -301,7 +301,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; case WM_TIMER: MoveMemory(dat->bytesRecvedHistory+1, dat->bytesRecvedHistory, sizeof(dat->bytesRecvedHistory)-sizeof(dat->bytesRecvedHistory[0])); - dat->bytesRecvedHistory[0]=dat->transferStatus.totalProgress; + dat->bytesRecvedHistory[0] = dat->transferStatus.totalProgress; if (dat->bytesRecvedHistorySize < SIZEOF(dat->bytesRecvedHistory)) dat->bytesRecvedHistorySize++; @@ -320,7 +320,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &st, NULL, szTime, SIZEOF(szTime)); } if (dat->bytesRecvedHistory[0] != dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]) { - li.QuadPart=BIGI(10000000)*(dat->transferStatus.totalBytes-dat->transferStatus.totalProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]); + li.QuadPart = BIGI(10000000)*(dat->transferStatus.totalBytes-dat->transferStatus.totalProgress)*dat->bytesRecvedHistorySize/(dat->bytesRecvedHistory[0]-dat->bytesRecvedHistory[dat->bytesRecvedHistorySize-1]); ft.dwHighDateTime = li.HighPart; ft.dwLowDateTime = li.LowPart; FileTimeToSystemTime(&ft, &st); GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &st, NULL, szTime, SIZEOF(szTime)); @@ -359,7 +359,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case IDC_CONTACT: { RECT rc; - HMENU hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0); + HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)dat->hContact, 0); GetWindowRect((HWND)lParam, &rc); TrackPopupMenu(hMenu, 0, rc.left, rc.bottom, 0, hwndDlg, NULL); DestroyMenu(hMenu); @@ -400,7 +400,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR else files = dat->files; else - files=dat->files; + files = dat->files; hMenu = CreatePopupMenu(); AppendMenu(hMenu, MF_STRING, 1, TranslateT("Open folder")); @@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR limit = dat->transferStatus.currentFileNumber; // Loop over all transfered files and add them to the menu - for (i = 0; i < limit; i++) { + for (i=0; i < limit; i++) { pszFilename = _tcsrchr(files[i], '\\'); if (pszFilename == NULL) pszFilename = files[i]; @@ -429,10 +429,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR pszNewFileName = (TCHAR*)mir_alloc(cbFileNameLen*2*sizeof(TCHAR)); TCHAR *p = pszNewFileName; - for (size_t pszlen=0; pszlen < cbFileNameLen; pszlen++) { - *p++ = pszFilename[pszlen]; + for (size_t pszlen = 0; pszlen < cbFileNameLen; pszlen++) { + *p++=pszFilename[pszlen]; if (pszFilename[pszlen] == '&') - *p++ = '&'; + *p++='&'; } *p = '\0'; AppendMenu(hMenu, MF_STRING, i+10, pszNewFileName); @@ -467,33 +467,33 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } break; case M_FILEEXISTSDLGREPLY: - { PROTOFILERESUME *pfr=(PROTOFILERESUME*)lParam; - TCHAR *szOriginalFilename=(TCHAR*)wParam; - char *szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); + { PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam; + TCHAR *szOriginalFilename = (TCHAR*)wParam; + char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0); EnableWindow(hwndDlg, TRUE); switch(pfr->action) { case FILERESUME_CANCEL: if (dat->fs) CallContactService(dat->hContact, PSS_FILECANCEL, (WPARAM)dat->fs, 0); - dat->fs=NULL; + dat->fs = NULL; mir_free(szOriginalFilename); if (pfr->szFilename) mir_free((char*)pfr->szFilename); mir_free(pfr); return 0; case FILERESUME_RESUMEALL: case FILERESUME_OVERWRITEALL: - dat->resumeBehaviour=pfr->action; + dat->resumeBehaviour = pfr->action; pfr->action&=~FILERESUMEF_ALL; break; case FILERESUME_RENAMEALL: - pfr->action=FILERESUME_RENAME; + pfr->action = FILERESUME_RENAME; { TCHAR *pszExtension, *pszFilename; int i; - if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename=szOriginalFilename; - if ((pszExtension = _tcsrchr(pszFilename+1, '.')) == NULL) pszExtension=pszFilename+lstrlen(pszFilename); + if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename; + if ((pszExtension = _tcsrchr(pszFilename+1, '.')) == NULL) pszExtension = pszFilename+lstrlen(pszFilename); if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename); pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*((pszExtension-szOriginalFilename)+21+lstrlen(pszExtension))); - for (i=1;;i++) { + for (i = 1;;i++) { _stprintf((TCHAR*)pfr->szFilename, _T("%.*s (%u)%s"), pszExtension-szOriginalFilename, szOriginalFilename, i, pszExtension); if (_taccess(pfr->szFilename, 0) != 0) break; @@ -508,14 +508,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break; } case HM_RECVEVENT: - { ACKDATA *ack=(ACKDATA*)lParam; + { ACKDATA *ack = (ACKDATA*)lParam; if (ack->hProcess != dat->fs) break; /* icq abuses this sometimes */ if (ack->hContact != dat->hContact) break; if (ack->type != ACKTYPE_FILE) break; if (dat->waitingForAcceptance) { SetTimer(hwndDlg, 1, 1000, NULL); - dat->waitingForAcceptance=0; + dat->waitingForAcceptance = 0; } switch(ack->result) { case ACKRESULT_SENTREQUEST: SetFtStatus(hwndDlg, LPGENT("Decision sent"), FTS_TEXT); break; @@ -534,7 +534,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR PostMessage(hwndDlg, M_VIRUSSCANDONE, dat->transferStatus.currentFileNumber, 0); else { virusscanthreadstartinfo *vstsi; - vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo)); + vstsi = (struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo)); vstsi->hwndReply = hwndDlg; vstsi->szFile = mir_tstrdup(dat->files[dat->transferStatus.currentFileNumber]); vstsi->returnCode = dat->transferStatus.currentFileNumber; @@ -561,7 +561,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } else { PROTOFILERESUME *pfr; - pfr=(PROTOFILERESUME*)mir_alloc(sizeof(PROTOFILERESUME)); + pfr = (PROTOFILERESUME*)mir_alloc(sizeof(PROTOFILERESUME)); pfr->action = dat->resumeBehaviour; pfr->szFilename = NULL; PostMessage(hwndDlg, M_FILEEXISTSDLGREPLY, (WPARAM)mir_tstrdup(fts->tszCurrentFile), (LPARAM)pfr); @@ -571,12 +571,12 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } case ACKRESULT_DATA: { - PROTOFILETRANSFERSTATUS *fts=(PROTOFILETRANSFERSTATUS*)ack->lParam; + PROTOFILETRANSFERSTATUS *fts = (PROTOFILETRANSFERSTATUS*)ack->lParam; TCHAR str[64], str2[64], szSizeDone[32], szSizeTotal[32];//, *contactName; int units; if (dat->fileVirusScanned == NULL) - dat->fileVirusScanned=(int*)mir_calloc(sizeof(int) * fts->totalFiles); + dat->fileVirusScanned = (int*)mir_calloc(sizeof(int) * fts->totalFiles); // This needs to be here - otherwise we get holes in the files array if ( !dat->send) { @@ -632,31 +632,31 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetDlgItemText(hwndDlg, IDCANCEL, TranslateT("Close")); if (dat->hNotifyEvent) UnhookEvent(dat->hNotifyEvent); - dat->hNotifyEvent=NULL; + dat->hNotifyEvent = NULL; if (ack->result == ACKRESULT_DENIED) { - dat->fs=NULL; /* protocol will free structure */ + dat->fs = NULL; /* protocol will free structure */ SkinPlaySound("FileDenied"); SetFtStatus(hwndDlg, LPGENT("File transfer denied"), FTS_TEXT); } else if (ack->result == ACKRESULT_FAILED) { - dat->fs=NULL; /* protocol will free structure */ + dat->fs = NULL; /* protocol will free structure */ SkinPlaySound("FileFailed"); SetFtStatus(hwndDlg, LPGENT("File transfer failed"), FTS_TEXT); } else { SkinPlaySound("FileDone"); if (dat->send) { - dat->fs=NULL; /* protocol will free structure */ + dat->fs = NULL; /* protocol will free structure */ SetFtStatus(hwndDlg, LPGENT("Transfer completed."), FTS_TEXT); - DBEVENTINFO dbei={0}; + DBEVENTINFO dbei = {0}; FillSendData(dat, dbei); CallService(MS_DB_EVENT_ADD, (WPARAM)dat->hContact, (LPARAM)&dbei); if (dbei.pBlob) mir_free(dbei.pBlob); - dat->files=NULL; //protocol library frees this + dat->files = NULL; //protocol library frees this } else { SetFtStatus(hwndDlg, @@ -665,17 +665,17 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR LPGENT("Transfer completed, open folder."), FTS_OPEN); - int useScanner=DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE); + int useScanner = DBGetContactSettingByte(NULL, "SRFile", "UseScanner", VIRUSSCAN_DISABLE); if (useScanner != VIRUSSCAN_DISABLE) { struct virusscanthreadstartinfo *vstsi; - vstsi=(struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo)); - vstsi->hwndReply=hwndDlg; + vstsi = (struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo)); + vstsi->hwndReply = hwndDlg; if (useScanner == VIRUSSCAN_DURINGDL) { - vstsi->returnCode=dat->transferStatus.currentFileNumber; + vstsi->returnCode = dat->transferStatus.currentFileNumber; if (GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY) { PostMessage(hwndDlg, M_VIRUSSCANDONE, vstsi->returnCode, 0); mir_free(vstsi); - vstsi=NULL; + vstsi = NULL; } else vstsi->szFile = mir_tstrdup(dat->files[dat->transferStatus.currentFileNumber]); } @@ -687,9 +687,9 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (vstsi) forkthread((void (*)(void*))RunVirusScannerThread, 0, vstsi); } - else dat->fs=NULL; /* protocol will free structure */ + else dat->fs = NULL; /* protocol will free structure */ - dat->transferStatus.currentFileNumber=dat->transferStatus.totalFiles; + dat->transferStatus.currentFileNumber = dat->transferStatus.totalFiles; } // else dat->send } // else ack->result @@ -701,29 +701,29 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } // switch ack->result } break; // case HM_RECVEVENT case M_VIRUSSCANDONE: - { int done=1, i; + { int done = 1, i; if ((int)wParam == -1) { - for (i=0;itransferStatus.totalFiles;i++) dat->fileVirusScanned[i]=1; + for (i=0;itransferStatus.totalFiles;i++) dat->fileVirusScanned[i] = 1; } else { - dat->fileVirusScanned[wParam]=1; - for (i=0;itransferStatus.totalFiles;i++) if ( !dat->fileVirusScanned[i]) {done=0; break;} + dat->fileVirusScanned[wParam] = 1; + for (i=0;itransferStatus.totalFiles;i++) if ( !dat->fileVirusScanned[i]) {done = 0; break;} } if (done) { - dat->fs=NULL; /* protocol will free structure */ + dat->fs = NULL; /* protocol will free structure */ SetFtStatus(hwndDlg, LPGENT("Transfer and virus scan complete"), FTS_TEXT); } break; } case WM_SIZE: { - UTILRESIZEDIALOG urd={0}; - urd.cbSize=sizeof(urd); - urd.hwndDlg=hwndDlg; - urd.hInstance=hInst; - urd.lpTemplate=MAKEINTRESOURCEA(IDD_FILETRANSFERINFO); - urd.pfnResizer=FileTransferDlgResizer; + UTILRESIZEDIALOG urd = {0}; + urd.cbSize = sizeof(urd); + urd.hwndDlg = hwndDlg; + urd.hInstance = hInst; + urd.lpTemplate = MAKEINTRESOURCEA(IDD_FILETRANSFERINFO); + urd.pfnResizer = FileTransferDlgResizer; CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd); RedrawWindow(GetDlgItem(hwndDlg, IDC_ALLTRANSFERRED), NULL, NULL, RDW_INVALIDATE|RDW_NOERASE); diff --git a/src/modules/srfile/ftmanager.cpp b/src/modules/srfile/ftmanager.cpp index 7e0dcfc9cc..567e038fc6 100644 --- a/src/modules/srfile/ftmanager.cpp +++ b/src/modules/srfile/ftmanager.cpp @@ -78,7 +78,7 @@ static void LayoutTransfers(HWND hwnd, struct TFtPageData *dat) hdwp = BeginDeferWindowPos(dat->wnds->realCount); top -= dat->scrollPos; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) { int height = dat->wnds->items[i]->rc.bottom - dat->wnds->items[i]->rc.top; hdwp = DeferWindowPos(hdwp, dat->wnds->items[i]->hwnd, NULL, 0, top, rc.right, height, SWP_NOZORDER); @@ -138,7 +138,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_FT_RESIZE: { int i; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) if (dat->wnds->items[i]->hwnd == (HWND)lParam) { GetWindowRect(dat->wnds->items[i]->hwnd, &dat->wnds->items[i]->rc); @@ -151,7 +151,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_FT_REMOVE: { int i; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) if (dat->wnds->items[i]->hwnd == (HWND)lParam) { mir_free(dat->wnds->items[i]); @@ -165,7 +165,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_FT_COMPLETED: { //wParam: { ACKRESULT_SUCCESS | ACKRESULT_FAILED | ACKRESULT_DENIED } dat->runningCount--; - int i = 0; + int i=0; while (i < dat->wnds->realCount) { // no error when canceling (WM_FT_REMOVE is send first, check if hwnd is still registered) @@ -187,7 +187,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_FT_CLEANUP: { int i; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) SendMessage(dat->wnds->items[i]->hwnd, WM_FT_CLEANUP, wParam, lParam); break; } @@ -205,7 +205,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA { int i, nScrollLines = 0; SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, (void*)&nScrollLines, 0); - for (i = 0; i < (nScrollLines + 1) / 2; i++) + for (i=0; i < (nScrollLines + 1) / 2; i++) SendMessage(hwnd, WM_VSCROLL, (zDelta < 0) ? SB_LINEDOWN : SB_LINEUP, 0); } @@ -250,7 +250,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case M_PRESHUTDOWN: { int i; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) PostMessage(dat->wnds->items[i]->hwnd, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), 0); break; } @@ -258,7 +258,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA case WM_DESTROY: { int i; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) mir_free(dat->wnds->items[i]); List_Destroy((SortedList *)dat->wnds); mir_free(dat->wnds); @@ -270,7 +270,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA { int i; TFtProgressData * prg = (TFtProgressData *)wParam; - for (i = 0; i < dat->wnds->realCount; ++i) + for (i=0; i < dat->wnds->realCount; ++i) { struct FileDlgData *trdat = (struct FileDlgData *)GetWindowLongPtr(dat->wnds->items[i]->hwnd, GWLP_USERDATA); if (trdat->transferStatus.totalBytes && trdat->fs && !trdat->send && (trdat->transferStatus.totalBytes == trdat->transferStatus.totalProgress)) @@ -327,7 +327,7 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // Utils_RestoreWindowPosition(hwnd, NULL, "SRFile", "FtMgrDlg_"); SAVEWINDOWPOS swp; - swp.hwnd=hwnd; swp.hContact=NULL; swp.szModule="SRFile"; swp.szNamePrefix="FtMgrDlg_"; + swp.hwnd = hwnd; swp.hContact = NULL; swp.szModule = "SRFile"; swp.szNamePrefix = "FtMgrDlg_"; CallService(MS_UTILS_RESTOREWINDOWPOSITION, RWPF_NOACTIVATE, (LPARAM)&swp); // Fall through to setup initial placement -- cgit v1.2.3