summaryrefslogtreecommitdiff
path: root/plugins/MirLua
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-03 16:02:14 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-03 16:02:14 +0200
commit3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a (patch)
tree412a28ef6a572efc7039df1c363bf47a3dec4b19 /plugins/MirLua
parent9a6f750a482d1d1ebf4281bb7bf8133e547ad438 (diff)
mir_forkThread<typename> - stronger typizatioin for thread function parameter
Diffstat (limited to 'plugins/MirLua')
-rw-r--r--plugins/MirLua/Modules/m_schedule/src/main.cpp24
-rw-r--r--plugins/MirLua/src/m_message.cpp2
2 files changed, 13 insertions, 13 deletions
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(&timestamp);
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(&timestamp);
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(&timestamp);
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(&timestamp);
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(&timestamp);
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(&timestamp);
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(&timestamp);
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);