From 0eee94c3a780e0e9f87b26145b557a99e84d25e0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 28 Mar 2021 20:38:45 +0300 Subject: 21 years after Win2k release we don't need win2k.h - everything we need is included into minimum Windows SDK 7.1 --- src/core/stdautoaway/src/stdafx.h | 1 - src/core/stdaway/src/stdafx.h | 1 - src/core/stdclist/src/stdafx.h | 1 - src/core/stdcrypt/src/stdafx.h | 1 - src/core/stdemail/src/stdafx.h | 1 - src/core/stdfile/src/fileexistsdlg.cpp | 27 ++++++++++++++------------- src/core/stdfile/src/filexferdlg.cpp | 6 +++--- src/core/stdfile/src/stdafx.h | 1 - src/core/stdmsg/src/stdafx.h | 1 - src/core/stdpopup/src/stdafx.h | 1 - src/core/stduihist/src/stdafx.h | 1 - src/core/stduserinfo/src/stdafx.h | 1 - src/core/stduseronline/src/stdafx.h | 1 - 13 files changed, 17 insertions(+), 27 deletions(-) (limited to 'src/core') diff --git a/src/core/stdautoaway/src/stdafx.h b/src/core/stdautoaway/src/stdafx.h index 32d73b4cb6..841c4d50b9 100644 --- a/src/core/stdautoaway/src/stdafx.h +++ b/src/core/stdautoaway/src/stdafx.h @@ -40,7 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stdaway/src/stdafx.h b/src/core/stdaway/src/stdafx.h index a52a8558f9..f7863b348b 100644 --- a/src/core/stdaway/src/stdafx.h +++ b/src/core/stdaway/src/stdafx.h @@ -40,7 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stdclist/src/stdafx.h b/src/core/stdclist/src/stdafx.h index d76bf0a398..e189b79d12 100644 --- a/src/core/stdclist/src/stdafx.h +++ b/src/core/stdclist/src/stdafx.h @@ -37,7 +37,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stdcrypt/src/stdafx.h b/src/core/stdcrypt/src/stdafx.h index d8e8900434..e97567258a 100644 --- a/src/core/stdcrypt/src/stdafx.h +++ b/src/core/stdcrypt/src/stdafx.h @@ -40,7 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stdemail/src/stdafx.h b/src/core/stdemail/src/stdafx.h index 39afdcfe2f..eac4283c5f 100644 --- a/src/core/stdemail/src/stdafx.h +++ b/src/core/stdemail/src/stdafx.h @@ -40,7 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index 923690c52f..da3037190f 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -31,7 +31,7 @@ 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; + liFiletime.QuadPart = (11644473600ll + (__int64)unixTime) * 10000000; filetime.dwHighDateTime = liFiletime.HighPart; filetime.dwLowDateTime = liFiletime.LowPart; FileTimeToSystemTime(&filetime, &st); @@ -52,7 +52,7 @@ static void DoAnnoyingShellCommand(HWND hwnd, const wchar_t *szFilename, int cmd IShellFolder *pDesktopFolder; if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR) { ITEMIDLIST *pCurrentIdl; - WCHAR* wszFilename = (LPWSTR)szFilename; + WCHAR *wszFilename = (LPWSTR)szFilename; if (pDesktopFolder->ParseDisplayName(nullptr, nullptr, wszFilename, nullptr, &pCurrentIdl, nullptr) == NOERROR) { if (pCurrentIdl->mkid.cb) { @@ -60,18 +60,18 @@ static void DoAnnoyingShellCommand(HWND hwnd, const wchar_t *szFilename, int cmd IShellFolder *pFileFolder; for (pidl = pCurrentIdl;;) { - pidlNext = (ITEMIDLIST*)((PBYTE)pidl + pidl->mkid.cb); + pidlNext = (ITEMIDLIST *)((PBYTE)pidl + pidl->mkid.cb); if (pidlNext->mkid.cb == 0) { - pidlFilename = (ITEMIDLIST*)CoTaskMemAlloc(pidl->mkid.cb + sizeof(pidl->mkid.cb)); + pidlFilename = (ITEMIDLIST *)CoTaskMemAlloc(pidl->mkid.cb + sizeof(pidl->mkid.cb)); memcpy(pidlFilename, pidl, pidl->mkid.cb + sizeof(pidl->mkid.cb)); pidl->mkid.cb = 0; break; } pidl = pidlNext; } - if (pDesktopFolder->BindToObject(pCurrentIdl, nullptr, IID_IShellFolder, (void**)&pFileFolder) == NOERROR) { + if (pDesktopFolder->BindToObject(pCurrentIdl, nullptr, IID_IShellFolder, (void **)&pFileFolder) == NOERROR) { IContextMenu *pContextMenu; - if (pFileFolder->GetUIObjectOf(nullptr, 1, (LPCITEMIDLIST*)&pidlFilename, IID_IContextMenu, nullptr, (void**)&pContextMenu) == NOERROR) { + if (pFileFolder->GetUIObjectOf(nullptr, 1, (LPCITEMIDLIST *)&pidlFilename, IID_IContextMenu, nullptr, (void **)&pContextMenu) == NOERROR) { switch (cmd) { case C_PROPERTIES: { @@ -114,7 +114,7 @@ static void DoAnnoyingShellCommand(HWND hwnd, const wchar_t *szFilename, int cmd static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - PROTOFILETRANSFERSTATUS* pft = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); + PROTOFILETRANSFERSTATUS *pft = (PROTOFILETRANSFERSTATUS *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); switch (msg) { case WM_LBUTTONDBLCLK: @@ -130,14 +130,15 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, IconCtrlSubclassProc, msg, wParam, lParam); } -struct loadiconsstartinfo { +struct loadiconsstartinfo +{ HWND hwndDlg; wchar_t *szFilename; }; -void __cdecl LoadIconsAndTypesThread(void* param) +void __cdecl LoadIconsAndTypesThread(void *param) { - loadiconsstartinfo *info = (loadiconsstartinfo*)param; + loadiconsstartinfo *info = (loadiconsstartinfo *)param; SHFILEINFO fileInfo; if (SHGetFileInfo(info->szFilename, 0, &fileInfo, sizeof(fileInfo), SHGFI_TYPENAME | SHGFI_ICON | SHGFI_LARGEICON)) { @@ -196,7 +197,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - PROTOFILETRANSFERSTATUS *fts = (PROTOFILETRANSFERSTATUS*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + PROTOFILETRANSFERSTATUS *fts = (PROTOFILETRANSFERSTATUS *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); @@ -208,7 +209,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SetPropA(hwndDlg, "Miranda.Preshutdown", HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, M_PRESHUTDOWN)); SetPropA(hwndDlg, "Miranda.ParentWnd", dat->hwndParent); - 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->szCurrentFile.w); @@ -229,7 +230,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM } } - loadiconsstartinfo *lisi = (loadiconsstartinfo*)mir_alloc(sizeof(loadiconsstartinfo)); + loadiconsstartinfo *lisi = (loadiconsstartinfo *)mir_alloc(sizeof(loadiconsstartinfo)); lisi->hwndDlg = hwndDlg; lisi->szFilename = mir_wstrdup(fts->szCurrentFile.w); //can be a little slow, so why not? diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index b3e9137524..cd48520cbe 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -318,13 +318,13 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (dat->bytesRecvedHistory[0] == dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]) mir_wstrcpy(szTime, L"??:??:??"); else { - li.QuadPart = BIGI(10000000)*(dat->transferStatus.currentFileSize - dat->transferStatus.currentFileProgress)*dat->bytesRecvedHistorySize / (dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]); + li.QuadPart = 10000000ll*(dat->transferStatus.currentFileSize - dat->transferStatus.currentFileProgress)*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, _countof(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 = 10000000ll*(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, _countof(szTime)); @@ -598,7 +598,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } const unsigned long lastPos = SendDlgItemMessage(hwndDlg, IDC_ALLFILESPROGRESS, PBM_GETPOS, 0, 0); - const unsigned long nextPos = fts->totalBytes ? (BIGI(100) * fts->totalProgress / fts->totalBytes) : 0; + const unsigned long nextPos = fts->totalBytes ? (100ll * fts->totalProgress / fts->totalBytes) : 0; if (lastPos != nextPos || firstTime) { SendDlgItemMessage(hwndDlg, IDC_ALLFILESPROGRESS, PBM_SETPOS, nextPos, 0); mir_snwprintf(str, L"%u%%", nextPos); diff --git a/src/core/stdfile/src/stdafx.h b/src/core/stdfile/src/stdafx.h index deee782c8c..96c2dce667 100644 --- a/src/core/stdfile/src/stdafx.h +++ b/src/core/stdfile/src/stdafx.h @@ -43,7 +43,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index b0b88384ff..f535f65be1 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -41,7 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h" -#include #include #include #include diff --git a/src/core/stdpopup/src/stdafx.h b/src/core/stdpopup/src/stdafx.h index 9fbddc138a..cbfc804a58 100644 --- a/src/core/stdpopup/src/stdafx.h +++ b/src/core/stdpopup/src/stdafx.h @@ -24,7 +24,6 @@ #include #include #include -#include #include //need this for special renderers diff --git a/src/core/stduihist/src/stdafx.h b/src/core/stduihist/src/stdafx.h index fdbd948dc1..b95dffe789 100644 --- a/src/core/stduihist/src/stdafx.h +++ b/src/core/stduihist/src/stdafx.h @@ -40,7 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h index 627ce29bdb..89ea62be05 100644 --- a/src/core/stduserinfo/src/stdafx.h +++ b/src/core/stduserinfo/src/stdafx.h @@ -41,7 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include diff --git a/src/core/stduseronline/src/stdafx.h b/src/core/stduseronline/src/stdafx.h index 3ebc2cdac7..2eb6a534e8 100644 --- a/src/core/stduseronline/src/stdafx.h +++ b/src/core/stduseronline/src/stdafx.h @@ -40,7 +40,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include #include #include #include -- cgit v1.2.3