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/MirLua/Modules/m_schedule/src/main.cpp | 24 ++++++++++++------------ plugins/MirLua/src/m_message.cpp | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/MirLua') diff --git a/plugins/MirLua/Modules/m_schedule/src/main.cpp b/plugins/MirLua/Modules/m_schedule/src/main.cpp index fd6820ea9f..0e7fc3c92c 100644 --- a/plugins/MirLua/Modules/m_schedule/src/main.cpp +++ b/plugins/MirLua/Modules/m_schedule/src/main.cpp @@ -24,7 +24,7 @@ struct ScheduleTask ScheduleTask() { - timestamp = time(nullptr); + timestamp = time(0); interval = 0; repeat = false; } @@ -63,7 +63,7 @@ void ExecuteTaskThread(void *arg) { mir_cslock lock(threadLock); - time_t now = time(nullptr); + time_t now = time(0); if (task->timestamp + task->interval >= now) task->timestamp += task->interval; else @@ -87,7 +87,7 @@ wait: WaitForSingleObject(hScheduleEvent, waitTime); if (Miranda_IsTerminated()) return; - time_t now = time(nullptr); + time_t now = time(0); if (task->timestamp > now) { waitTime = (task->timestamp - now) * 1000; @@ -165,7 +165,7 @@ static int fluent_Do(lua_State *L) ScheduleTask *task = *(ScheduleTask**)lua_touserdata(L, lua_upvalueindex(1)); - time_t now = time(nullptr); + time_t now = time(0); if (task->timestamp < now) { if (task->interval == 0) @@ -323,7 +323,7 @@ static int fluent_Week(lua_State *L) static int fluent_Monday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(1 - ti->tm_wday); @@ -339,7 +339,7 @@ static int fluent_Monday(lua_State *L) static int fluent_Tuesday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(2 - ti->tm_wday); @@ -355,7 +355,7 @@ static int fluent_Tuesday(lua_State *L) static int fluent_Wednesday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(3 - ti->tm_wday); @@ -371,7 +371,7 @@ static int fluent_Wednesday(lua_State *L) static int fluent_Thursday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(4 - ti->tm_wday); @@ -387,7 +387,7 @@ static int fluent_Thursday(lua_State *L) static int fluent_Friday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(5 - ti->tm_wday); @@ -403,7 +403,7 @@ static int fluent_Friday(lua_State *L) static int fluent_Saturday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(6 - ti->tm_wday); @@ -419,7 +419,7 @@ static int fluent_Saturday(lua_State *L) static int fluent_Sunday(lua_State *L) { - time_t timestamp = time(nullptr); + time_t timestamp = time(0); struct tm *ti = localtime(×tamp); ti->tm_mday += abs(-ti->tm_wday); @@ -446,7 +446,7 @@ static int schedule_At(lua_State *L) { ScheduleTask **task = (ScheduleTask**)lua_newuserdata(L, sizeof(ScheduleTask)); *task = new ScheduleTask(); - (*task)->timestamp = luaM_opttimestamp(L, 1, time(nullptr)); + (*task)->timestamp = luaM_opttimestamp(L, 1, time(0)); lua_newtable(L); lua_newtable(L); diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index e382616954..b35b4dd67d 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -36,7 +36,7 @@ static int message_Send(lua_State *L) else if ((res = ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message)) != ACKRESULT_FAILED) { DBEVENTINFO dbei = {}; dbei.szModule = MODULE; - dbei.timestamp = time(nullptr); + dbei.timestamp = time(0); dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (DWORD)mir_strlen(message); dbei.pBlob = (PBYTE)mir_strdup(message); -- cgit v1.2.3