diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-03 16:02:14 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-03 16:02:14 +0200 |
commit | 3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a (patch) | |
tree | 412a28ef6a572efc7039df1c363bf47a3dec4b19 /plugins/NewAwaySysMod/src | |
parent | 9a6f750a482d1d1ebf4281bb7bf8133e547ad438 (diff) |
mir_forkThread<typename> - stronger typizatioin for thread function parameter
Diffstat (limited to 'plugins/NewAwaySysMod/src')
-rw-r--r-- | plugins/NewAwaySysMod/src/Client.cpp | 2 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/MsgEventAdded.cpp | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 661385e298..975db0e8cd 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -71,7 +71,7 @@ void InitUpdateMsgs() }
else if (!g_hUpdateMsgsThread && UpdateMsgs) {
g_hTerminateUpdateMsgsThread = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- g_hUpdateMsgsThread = (HANDLE)mir_forkthread(UpdateMsgsThreadProc, nullptr);
+ g_hUpdateMsgsThread = mir_forkthread(UpdateMsgsThreadProc);
}
}
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 266437ea13..f86c1d6e00 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -48,11 +48,10 @@ public: };
// _ad must be allocated using "new CAutoreplyData()"
-void __cdecl AutoreplyDelayThread(void *_ad)
+void __cdecl AutoreplyDelayThread(CAutoreplyData *ad)
{
Thread_SetName("NewAwaySysMod: AutoreplyDelayThread");
- CAutoreplyData *ad = (CAutoreplyData*)_ad;
_ASSERT(ad && ad->hContact && ad->Reply.GetLen());
char *szProto = GetContactProto(ad->hContact);
if (!szProto) {
@@ -69,7 +68,7 @@ void __cdecl AutoreplyDelayThread(void *_ad) dbeo.eventType = EVENTTYPE_MESSAGE;
dbeo.flags = DBEF_SENT | DBEF_UTF;
dbeo.szModule = szProto;
- dbeo.timestamp = time(nullptr);
+ dbeo.timestamp = time(0);
dbeo.cbBlob = ReplyLen;
dbeo.pBlob = (PBYTE)(char*)pszReply;
@@ -114,7 +113,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) if (dbei->flags & DBEF_SENT || (dbei->eventType != EVENTTYPE_MESSAGE && dbei->eventType != EVENTTYPE_URL && dbei->eventType != EVENTTYPE_FILE))
return 0;
- if (time(nullptr) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
+ if (time(0) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
return 0;
char *szProto = GetContactProto(hContact);
@@ -133,7 +132,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) return 0;
// remove outdated events first
- DWORD CurTime = time(nullptr);
+ DWORD CurTime = time(0);
int i;
for (i = MetacontactEvents.GetSize() - 1; i >= 0; i--)
if (CurTime - MetacontactEvents[i].timestamp > MAX_REPLY_TIMEDIFF)
@@ -155,7 +154,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) // ugly workaround for metacontacts, part i; store all metacontacts' events to a temporary array, so we'll be able to get the 'source' protocol when subcontact event happens later. we need the protocol to get its status and per-status settings properly
if (!mir_strcmp(szProto, META_PROTO)) {
// remove outdated events first
- DWORD CurTime = time(nullptr);
+ DWORD CurTime = time(0);
for (int i = MetacontactEvents.GetSize() - 1; i >= 0; i--)
if (CurTime - MetacontactEvents[i].timestamp > MAX_REPLY_TIMEDIFF)
MetacontactEvents.RemoveElem(i);
@@ -232,7 +231,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam) if (Reply.GetLen()) {
CAutoreplyData *ad = new CAutoreplyData(hContact, Reply);
- mir_forkthread(AutoreplyDelayThread, ad);
+ mir_forkThread<CAutoreplyData>(AutoreplyDelayThread, ad);
}
return 0;
}
|