summaryrefslogtreecommitdiff
path: root/plugins/Boltun/src/actionQueue.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/Boltun/src/actionQueue.cpp
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Boltun/src/actionQueue.cpp')
-rw-r--r--plugins/Boltun/src/actionQueue.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp
index f45a362dd8..ea9b89d215 100644
--- a/plugins/Boltun/src/actionQueue.cpp
+++ b/plugins/Boltun/src/actionQueue.cpp
@@ -37,7 +37,7 @@ typedef struct _QueueElement {
ActionHandler Handler;
bool Sticky;
int TimeOffset;
- _QueueElement(MCONTACT contact, ActionHandler handler, int timeOffset, const TalkBot::MessageInfo *info = NULL, bool sticky = false)
+ _QueueElement(MCONTACT contact, ActionHandler handler, int timeOffset, const TalkBot::MessageInfo *info = nullptr, bool sticky = false)
:hContact(contact), Handler(handler), TimeOffset(timeOffset), inf(info), Sticky(sticky)
{
}
@@ -66,9 +66,9 @@ VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
void UpdateTimer()
{
if (timerID)
- KillTimer(NULL, timerID);
+ KillTimer(nullptr, timerID);
if (actionQueue.size())
- timerID = SetTimer(NULL, 0, actionQueue.front().TimeOffset, TimerProc);
+ timerID = SetTimer(nullptr, 0, actionQueue.front().TimeOffset, TimerProc);
else
timerID = 0;
}
@@ -94,7 +94,7 @@ static void TimerAnswer(MCONTACT hContact, const TalkBot::MessageInfo* info)
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT;
dbei.szModule = BOLTUN_NAME;
- dbei.timestamp = (DWORD)time(NULL);
+ dbei.timestamp = (DWORD)time(nullptr);
db_event_add(hContact, &dbei);
bot->AnswerGiven(hContact, *info);
@@ -148,7 +148,7 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky =
if (!actionQueue.empty() && actionQueue.front().hContact == hContact)
{
needTimerRearrange = true;
- KillTimer(NULL, timerID);
+ KillTimer(nullptr, timerID);
}
if (!actionQueue.empty())
{
@@ -184,7 +184,7 @@ void DoAnswer(MCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky =
if (actionQueue.empty())
needTimerRearrange = true;
if (thinkTime)
- actionQueue.push_back(QueueElement(hContact, StartTyping, thinkTime, NULL, sticky));
+ actionQueue.push_back(QueueElement(hContact, StartTyping, thinkTime, nullptr, sticky));
actionQueue.push_back(QueueElement(hContact, TimerAnswer, waitTime, info, sticky));
if (needTimerRearrange)
UpdateTimer();