From 3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 3 May 2018 16:02:14 +0200 Subject: mir_forkThread - stronger typizatioin for thread function parameter --- plugins/AvatarHistory/src/AvatarDlg.cpp | 10 ++++------ plugins/AvatarHistory/src/AvatarHistory.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins/AvatarHistory/src') diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 987d5cf803..ed1bd5761b 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -64,10 +64,9 @@ public: wchar_t *filelink; }; -static void __cdecl AvatarDialogThread(void *param) +static void __cdecl AvatarDialogThread(AvatarDialogData *data) { - struct AvatarDialogData* data = (struct AvatarDialogData*)param; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_AVATARDLG), data->parent, AvatarDlgProc, (LPARAM)param); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_AVATARDLG), data->parent, AvatarDlgProc, (LPARAM)data); } int OpenAvatarDialog(MCONTACT hContact, char* fn) @@ -79,15 +78,14 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn) return 0; } - struct AvatarDialogData *avdlg = (struct AvatarDialogData*)malloc(sizeof(struct AvatarDialogData)); - memset(avdlg, 0, sizeof(struct AvatarDialogData)); + AvatarDialogData *avdlg = (AvatarDialogData*)calloc(1, sizeof(AvatarDialogData)); avdlg->hContact = hContact; if (fn == nullptr) avdlg->fn[0] = '\0'; else MultiByteToWideChar(CP_ACP, 0, fn, -1, avdlg->fn, _countof(avdlg->fn)); - mir_forkthread(AvatarDialogThread, (void*)avdlg); + mir_forkThread(AvatarDialogThread, avdlg); return 0; } diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 476171afdd..371e873281 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -215,7 +215,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) DBEVENTINFO dbei = {}; dbei.szModule = GetContactProto(hContact); dbei.flags = DBEF_READ | DBEF_UTF; - dbei.timestamp = (DWORD)time(nullptr); + dbei.timestamp = (DWORD)time(0); dbei.eventType = EVENTTYPE_AVATAR_CHANGE; dbei.cbBlob = (DWORD)mir_strlen(blob) + 1; dbei.pBlob = blob; -- cgit v1.2.3