summaryrefslogtreecommitdiff
path: root/plugins/AvatarHistory
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AvatarHistory')
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp10
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp2
2 files changed, 5 insertions, 7 deletions
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<AvatarDialogData>(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;