diff options
author | George Hazan <ghazan@miranda.im> | 2021-03-28 20:38:45 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-03-28 20:38:45 +0300 |
commit | 0eee94c3a780e0e9f87b26145b557a99e84d25e0 (patch) | |
tree | 58287520f0c2284550764d5f66bbf0b7e5ded155 /src/core/stdfile | |
parent | 96171674a3c346419d490705d4e3b4e53d2f8ae4 (diff) |
21 years after Win2k release we don't need win2k.h - everything we need is included into minimum Windows SDK 7.1
Diffstat (limited to 'src/core/stdfile')
-rw-r--r-- | src/core/stdfile/src/fileexistsdlg.cpp | 27 | ||||
-rw-r--r-- | src/core/stdfile/src/filexferdlg.cpp | 6 | ||||
-rw-r--r-- | src/core/stdfile/src/stdafx.h | 1 |
3 files changed, 17 insertions, 17 deletions
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 <sys/types.h>
#include <sys/stat.h>
-#include <win2k.h>
#include <newpluginapi.h>
#include <m_system.h>
#include <m_database.h>
|