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/SeenPlugin/src/utils.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'plugins/SeenPlugin/src/utils.cpp') diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 4d0a7a7eb5..efce4f5e25 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -514,12 +514,10 @@ void myPlaySound(MCONTACT hcontact, WORD newStatus, WORD oldStatus) } // will add hContact to queue and will return position; -static void waitThread(void *param) +static void waitThread(logthread_info* infoParam) { Thread_SetName("SeenPlugin: waitThread"); - logthread_info* infoParam = (logthread_info*)param; - WORD prevStatus = db_get_w(infoParam->hContact, S_MOD, "StatusTriger", ID_STATUS_OFFLINE); // I hope in 1.5 second all the needed info will be set @@ -586,7 +584,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) mir_snprintf(str, "OffTime-%s", szProto); DWORD t = db_get_dw(NULL, S_MOD, str, 0); if (!t) - t = time(nullptr); + t = time(0); DBWriteTimeTS(t, hContact); } @@ -613,7 +611,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) if (cws->value.wVal == prevStatus && !db_get_b(hContact, S_MOD, "Offline", 0)) return 0; - DBWriteTimeTS(time(nullptr), hContact); + DBWriteTimeTS(time(0), hContact); if (g_bFileActive) FileWrite(hContact); if (prevStatus != cws->value.wVal) myPlaySound(hContact, cws->value.wVal, prevStatus); @@ -636,7 +634,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) p->hContact = hContact; mir_strncpy(p->sProtoName, cws->szModule, _countof(p->sProtoName)); arContacts.insert(p); - mir_forkthread(waitThread, p); + mir_forkThread(waitThread, p); } p->currStatus = isIdleEvent ? db_get_w(hContact, cws->szModule, "Status", ID_STATUS_OFFLINE) : cws->value.wVal; } @@ -645,11 +643,10 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) return 0; } -static void cleanThread(void *param) +static void cleanThread(logthread_info* infoParam) { Thread_SetName("SeenPlugin: cleanThread"); - logthread_info* infoParam = (logthread_info*)param; char *szProto = infoParam->sProtoName; // I hope in 10 secons all logged-in contacts will be listed @@ -681,7 +678,7 @@ int ModeChange(WPARAM, LPARAM lparam) if (!IsWatchedProtocol(courProtoName) && strncmp(courProtoName, "MetaContacts", 12)) return 0; - DBWriteTimeTS(time(nullptr), NULL); + DBWriteTimeTS(time(0), NULL); WORD isetting = (WORD)ack->lParam; if (isetting < ID_STATUS_OFFLINE) @@ -695,7 +692,7 @@ int ModeChange(WPARAM, LPARAM lparam) info->hContact = 0; info->currStatus = 0; - mir_forkthread(cleanThread, info); + mir_forkThread(cleanThread, info); } } else if ((isetting == ID_STATUS_OFFLINE) && ((UINT_PTR)ack->hProcess > ID_STATUS_OFFLINE)) { -- cgit v1.2.3