summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/clist.cpp8
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp160
-rw-r--r--protocols/IRCG/src/input.cpp72
-rw-r--r--protocols/IRCG/src/irclib.cpp118
-rw-r--r--protocols/IRCG/src/ircproto.cpp52
-rw-r--r--protocols/IRCG/src/main.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp46
-rw-r--r--protocols/IRCG/src/output.cpp6
-rw-r--r--protocols/IRCG/src/scripting.cpp8
-rw-r--r--protocols/IRCG/src/services.cpp28
-rw-r--r--protocols/IRCG/src/tools.cpp32
-rw-r--r--protocols/IRCG/src/userinfo.cpp6
-rw-r--r--protocols/IRCG/src/windows.cpp36
13 files changed, 287 insertions, 287 deletions
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index 1b5cf219c1..8409c501e7 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -29,14 +29,14 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas
char szService[256];
bool bFlag = false;
- CONTACT usertemp = { name, NULL, NULL, false, false, true };
+ CONTACT usertemp = { name, nullptr, nullptr, false, false, true };
MCONTACT hc = CList_FindContact(&usertemp);
if (hc && db_get_b(hc, "CList", "NotOnList", 0) == 0 && db_get_b(hc, "CList", "Hidden", 0) == 0)
bFlag = true;
CMStringW contactname = name; contactname += DCCSTRING;
- CONTACT user = { contactname, NULL, NULL, false, false, true };
+ CONTACT user = { contactname, nullptr, nullptr, false, false, true };
hContact = CList_AddContact(&user, false, false);
setByte(hContact, "DCC", 1);
@@ -82,7 +82,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas
MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline)
{
- if (user->name == NULL)
+ if (user->name == nullptr)
return 0;
MCONTACT hContact = CList_FindContact(user);
@@ -198,7 +198,7 @@ MCONTACT CIrcProto::CList_FindContact(CONTACT *user)
hContact_temp = hContact;
}
}
- else if (wcschr(user->name, ' ') == 0) {
+ else if (wcschr(user->name, ' ') == nullptr) {
if ((DBDefault && !mir_wstrcmpi(DBDefault, user->name) || DBNick && !mir_wstrcmpi(DBNick, user->name) ||
DBWildcard && WCCmp(DBWildcard, lowercasename))
&& (WCCmp(DBUser, user->user) && WCCmp(DBHost, user->host))) {
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index a7d5974d56..5601a07dfc 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -30,7 +30,7 @@ using namespace irc;
VOID CALLBACK IdentTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
{
CIrcProto *ppro = GetTimerOwner(idEvent);
- if (ppro == NULL)
+ if (ppro == nullptr)
return;
ppro->KillChatTimer(ppro->IdentTimer);
@@ -44,7 +44,7 @@ VOID CALLBACK IdentTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
{
CIrcProto *ppro = GetTimerOwner(idEvent);
- if (ppro == NULL)
+ if (ppro == nullptr)
return;
ppro->KillChatTimer(ppro->InitTimer);
@@ -61,7 +61,7 @@ VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
{
CIrcProto *ppro = GetTimerOwner(idEvent);
- if (ppro == NULL)
+ if (ppro == nullptr)
return;
if (!ppro->m_sendKeepAlive || (ppro->m_iStatus == ID_STATUS_OFFLINE || ppro->m_iStatus == ID_STATUS_CONNECTING)) {
@@ -73,7 +73,7 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (!ppro->m_info.sServerName.IsEmpty())
mir_snwprintf(temp2, L"PING %s", ppro->m_info.sServerName.c_str());
else
- mir_snwprintf(temp2, L"PING %u", time(0));
+ mir_snwprintf(temp2, L"PING %u", time(nullptr));
if (ppro->IsConnected())
ppro->SendIrcMessage(temp2, false);
@@ -82,7 +82,7 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
{
CIrcProto *ppro = GetTimerOwner(idEvent);
- if (ppro == NULL)
+ if (ppro == nullptr)
return;
if (!ppro->m_channelAwayNotification ||
@@ -126,7 +126,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
{
CIrcProto *ppro = GetTimerOwner(idEvent);
- if (ppro == NULL)
+ if (ppro == nullptr)
return;
if (ppro->m_iStatus == ID_STATUS_OFFLINE || ppro->m_iStatus == ID_STATUS_CONNECTING ||
@@ -164,8 +164,8 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
db_free(&dbv);
DBVARIANT dbv2;
- wchar_t* DBNick = NULL;
- wchar_t* DBWildcard = NULL;
+ wchar_t* DBNick = nullptr;
+ wchar_t* DBWildcard = nullptr;
if (!ppro->getWString(hContact, "Nick", &dbv))
DBNick = dbv.ptszVal;
if (!ppro->getWString(hContact, "UWildcard", &dbv2))
@@ -226,7 +226,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, const wchar_t *msg)
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = (DWORD)time(NULL);
+ dbei.timestamp = (DWORD)time(nullptr);
dbei.flags = DBEF_SENT + DBEF_UTF;
dbei.pBlob = (PBYTE)mir_utf8encodeW(S);
dbei.cbBlob = (DWORD)mir_strlen((char*)dbei.pBlob) + 1;
@@ -242,7 +242,7 @@ void __cdecl CIrcProto::ResolveIPThread(void *di)
{
mir_cslock lock(m_resolve);
- if (ipr != NULL && (ipr->iType == IP_AUTO && mir_strlen(m_myHost) == 0 || ipr->iType == IP_MANUAL)) {
+ if (ipr != nullptr && (ipr->iType == IP_AUTO && mir_strlen(m_myHost) == 0 || ipr->iType == IP_MANUAL)) {
hostent* myhost = gethostbyname(ipr->sAddr);
if (myhost) {
IN_ADDR in;
@@ -361,8 +361,8 @@ bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming && pmsg->prefix.sNick != m_info.sNick) {
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
- DoEvent(GC_EVENT_JOIN, pmsg->parameters[0], pmsg->prefix.sNick, NULL, TranslateT("Normal"), host, NULL, true, false);
- DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[0], pmsg->prefix.sNick, NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
+ DoEvent(GC_EVENT_JOIN, pmsg->parameters[0], pmsg->prefix.sNick, nullptr, TranslateT("Normal"), host, NULL, true, false);
+ DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[0], pmsg->prefix.sNick, nullptr, nullptr, nullptr, ID_STATUS_ONLINE, FALSE, FALSE);
}
else ShowMessage(pmsg);
@@ -373,11 +373,11 @@ bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming) {
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
- DoEvent(GC_EVENT_QUIT, NULL, pmsg->prefix.sNick, pmsg->parameters.getCount() > 0 ? pmsg->parameters[0].c_str() : NULL, NULL, host, NULL, true, false);
+ DoEvent(GC_EVENT_QUIT, nullptr, pmsg->prefix.sNick, pmsg->parameters.getCount() > 0 ? pmsg->parameters[0].c_str() : nullptr, nullptr, host, NULL, true, false);
CONTACT user = { pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, false, false, false };
CList_SetOffline(&user);
if (pmsg->prefix.sNick == m_info.sNick)
- Chat_Control(m_szModuleName, NULL, SESSION_OFFLINE);
+ Chat_Control(m_szModuleName, nullptr, SESSION_OFFLINE);
}
else ShowMessage(pmsg);
@@ -388,7 +388,7 @@ bool CIrcProto::OnIrc_PART(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming) {
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
- DoEvent(GC_EVENT_PART, pmsg->parameters[0], pmsg->prefix.sNick, pmsg->parameters.getCount() > 1 ? pmsg->parameters[1].c_str() : NULL, NULL, host, NULL, true, false);
+ DoEvent(GC_EVENT_PART, pmsg->parameters[0], pmsg->prefix.sNick, pmsg->parameters.getCount() > 1 ? pmsg->parameters[1].c_str() : nullptr, nullptr, host, NULL, true, false);
if (pmsg->prefix.sNick == m_info.sNick) {
CMStringW S = MakeWndID(pmsg->parameters[0]);
Chat_Control(m_szModuleName, S, SESSION_OFFLINE);
@@ -402,7 +402,7 @@ bool CIrcProto::OnIrc_PART(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1)
- DoEvent(GC_EVENT_KICK, pmsg->parameters[0], pmsg->parameters[1], pmsg->parameters.getCount() > 2 ? pmsg->parameters[2].c_str() : NULL, pmsg->prefix.sNick, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_KICK, pmsg->parameters[0], pmsg->parameters[1], pmsg->parameters.getCount() > 2 ? pmsg->parameters[2].c_str() : nullptr, pmsg->prefix.sNick, nullptr, NULL, true, false);
else
ShowMessage(pmsg);
@@ -450,7 +450,7 @@ bool CIrcProto::OnIrc_MODEQUERY(const CIrcMessage* pmsg)
p1++;
}
- AddWindowItemData(pmsg->parameters[1], sLimit.IsEmpty() ? 0 : sLimit.c_str(), pmsg->parameters[2], sPassword.IsEmpty() ? 0 : sPassword.c_str(), 0);
+ AddWindowItemData(pmsg->parameters[1], sLimit.IsEmpty() ? nullptr : sLimit.c_str(), pmsg->parameters[2], sPassword.IsEmpty() ? nullptr : sPassword.c_str(), nullptr);
}
ShowMessage(pmsg);
return true;
@@ -515,7 +515,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
Chat_SetUserInfo(m_szModuleName, windowName, wi);
}
- DoEvent(bAdd ? GC_EVENT_ADDSTATUS : GC_EVENT_REMOVESTATUS, pmsg->parameters[0], pmsg->parameters[iParametercount], pmsg->prefix.sNick, sStatus, NULL, NULL, m_oldStyleModes ? false : true, false);
+ DoEvent(bAdd ? GC_EVENT_ADDSTATUS : GC_EVENT_REMOVESTATUS, pmsg->parameters[0], pmsg->parameters[iParametercount], pmsg->prefix.sNick, sStatus, nullptr, NULL, m_oldStyleModes ? false : true, false);
iParametercount++;
}
}
@@ -537,7 +537,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
sMessage += L" " + pmsg->parameters[i];
- DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0], pmsg->prefix.sNick, sMessage, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0], pmsg->prefix.sNick, sMessage, nullptr, nullptr, NULL, true, false);
}
else if (bContainsValidModes) {
for (int i = iParametercount; i < (int)pmsg->parameters.getCount(); i++)
@@ -545,7 +545,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
wchar_t temp[4000];
mir_snwprintf(temp, TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
- DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0].c_str(), pmsg->prefix.sNick, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0].c_str(), pmsg->prefix.sNick, temp, nullptr, nullptr, NULL, true, false);
}
if (flag)
@@ -559,7 +559,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
sMessage += L" " + pmsg->parameters[i];
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, pmsg->prefix.sNick, sMessage, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, pmsg->prefix.sNick, sMessage, nullptr, nullptr, NULL, true, false);
}
}
else ShowMessage(pmsg);
@@ -578,8 +578,8 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg)
}
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
- DoEvent(GC_EVENT_NICK, NULL, pmsg->prefix.sNick, pmsg->parameters[0], NULL, host, NULL, true, bIsMe);
- Chat_ChangeUserId(m_szModuleName, NULL, pmsg->prefix.sNick, pmsg->parameters[0]);
+ DoEvent(GC_EVENT_NICK, nullptr, pmsg->prefix.sNick, pmsg->parameters[0], nullptr, host, NULL, true, bIsMe);
+ Chat_ChangeUserId(m_szModuleName, nullptr, pmsg->prefix.sNick, pmsg->parameters[0]);
CONTACT user = { pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
@@ -631,7 +631,7 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
}
else S2 = L"";
}
- DoEvent(GC_EVENT_NOTICE, S2.IsEmpty() ? 0 : S2.c_str(), S, pmsg->parameters[1], NULL, S3, NULL, true, false);
+ DoEvent(GC_EVENT_NOTICE, S2.IsEmpty() ? nullptr : S2.c_str(), S, pmsg->parameters[1], nullptr, S3, NULL, true, false);
}
}
else ShowMessage(pmsg);
@@ -704,7 +704,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
MCONTACT hContact = CList_AddContact(&user, false, true);
PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(NULL);
+ pre.timestamp = (DWORD)time(nullptr);
pre.szMessage = mir_utf8encodeW(mess);
setWString(hContact, "User", pmsg->prefix.sUser);
setWString(hContact, "Host", pmsg->prefix.sHost);
@@ -717,7 +717,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
if (!(pmsg->m_bIncoming && m_ignore && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'm'))) {
if (!pmsg->m_bIncoming)
mess.Replace(L"%%", L"%");
- DoEvent(GC_EVENT_MESSAGE, pmsg->parameters[0], pmsg->m_bIncoming ? pmsg->prefix.sNick : m_info.sNick, mess, NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
+ DoEvent(GC_EVENT_MESSAGE, pmsg->parameters[0], pmsg->m_bIncoming ? pmsg->prefix.sNick : m_info.sNick, mess, nullptr, nullptr, NULL, true, pmsg->m_bIncoming ? false : true);
}
return true;
}
@@ -743,7 +743,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
CMStringW temp(FORMAT,
TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"),
pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick, temp, nullptr, nullptr, NULL, true, false);
return true;
}
@@ -783,7 +783,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
if (!pmsg->m_bIncoming)
mess.Replace(L"%%", L"%");
- DoEvent(GC_EVENT_ACTION, pmsg->parameters[0], pmsg->m_bIncoming ? pmsg->prefix.sNick : m_info.sNick, mess, NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
+ DoEvent(GC_EVENT_ACTION, pmsg->parameters[0], pmsg->m_bIncoming ? pmsg->prefix.sNick : m_info.sNick, mess, nullptr, nullptr, NULL, true, pmsg->m_bIncoming ? false : true);
}
}
else if (pmsg->m_bIncoming) {
@@ -801,7 +801,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
wchar_t temp[300];
mir_snwprintf(temp, TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
// incoming VERSION
@@ -810,7 +810,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
wchar_t temp[300];
mir_snwprintf(temp, TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
// incoming SOURCE
@@ -819,7 +819,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
wchar_t temp[300];
mir_snwprintf(temp, TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
// incoming USERINFO
@@ -828,7 +828,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
wchar_t temp[300];
mir_snwprintf(temp, TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
// incoming PING
@@ -837,18 +837,18 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
wchar_t temp[300];
mir_snwprintf(temp, TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
// incoming TIME
else if (pmsg->m_bIncoming && command == L"time") {
wchar_t temp[300];
- time_t tim = time(NULL);
+ time_t tim = time(nullptr);
mir_wstrncpy(temp, _wctime(&tim), 25);
PostIrcMessage(L"/NOTICE %s \001TIME %s\001", pmsg->prefix.sNick.c_str(), temp);
mir_snwprintf(temp, TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
// incoming DCC request... lots of stuff happening here...
@@ -878,7 +878,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
begin = mess.Find(' ', end);
if (begin >= 0) {
CMStringW rest = mess.Mid(begin);
- dwAdr = wcstoul(GetWord(rest, 0), NULL, 10);
+ dwAdr = wcstoul(GetWord(rest, 0), nullptr, 10);
iPort = _wtoi(GetWord(rest, 1));
dwSize = _wtoi64(GetWord(rest, 2));
sToken = GetWord(rest, 3);
@@ -931,7 +931,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
free(p1);
- dwAdr = wcstoul(GetWord(mess, index - (bIsChat ? 2 : 3)), NULL, 10);
+ dwAdr = wcstoul(GetWord(mess, index - (bIsChat ? 2 : 3)), nullptr, 10);
iPort = _wtoi(GetWord(mess, index - (bIsChat ? 1 : 2)));
dwSize = _wtoi64(GetWord(mess, index - 1));
sToken = GetWord(mess, index);
@@ -1027,7 +1027,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
mir_snwprintf(szTemp, TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
if (szTemp[0]) {
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick, szTemp, nullptr, nullptr, NULL, true, false);
return true;
}
@@ -1049,7 +1049,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
mir_snwprintf(szTemp, TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
if (szTemp[0]) {
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick, szTemp, nullptr, nullptr, NULL, true, false);
return true;
}
@@ -1065,7 +1065,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// incoming chat request
if (bIsChat) {
- CONTACT user = { pmsg->prefix.sNick, 0, 0, false, false, true };
+ CONTACT user = { pmsg->prefix.sNick, nullptr, nullptr, false, false, true };
MCONTACT hContact = CList_FindContact(&user);
// check if it should be ignored
@@ -1079,7 +1079,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else {
wchar_t szTemp[512];
mir_snwprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick, szTemp, nullptr, nullptr, NULL, true, false);
}
}
@@ -1163,7 +1163,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_UNICODE;
- pre.timestamp = (DWORD)time(NULL);
+ pre.timestamp = (DWORD)time(nullptr);
pre.fileCount = 1;
pre.files.w = &tszTemp;
pre.lParam = (LPARAM)di;
@@ -1176,7 +1176,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
else if (pmsg->m_bIncoming) {
wchar_t temp[300];
mir_snwprintf(temp, TranslateT("CTCP %s requested by %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, temp, nullptr, nullptr, NULL, true, false);
}
}
@@ -1204,7 +1204,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
if (pmsg->m_bIncoming && command == L"ping") {
SetActiveWindow(m_whoisDlg->GetHwnd());
- int s = (int)time(0) - (int)_wtol(GetWordAddress(mess, 1));
+ int s = (int)time(nullptr) - (int)_wtol(GetWordAddress(mess, 1));
wchar_t szTmp[30];
if (s == 1)
mir_snwprintf(szTmp, TranslateT("%u second"), s);
@@ -1219,13 +1219,13 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
//... else show the reply in the current window
if (pmsg->m_bIncoming && command == L"ping") {
- int s = (int)time(0) - (int)_wtol(GetWordAddress(mess, 1));
+ int s = (int)time(nullptr) - (int)_wtol(GetWordAddress(mess, 1));
mir_snwprintf(szTemp, TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
}
else {
mir_snwprintf(szTemp, TranslateT("CTCP %s reply from %s: %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str(), GetWordAddress(mess, 1));
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
}
}
@@ -1316,17 +1316,17 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
else
btOwnMode = 0;
}
- gce.time = gce.bIsMe ? time(0) : 0;
+ gce.time = gce.bIsMe ? time(nullptr) : 0;
Chat_Event(&gce);
- DoEvent(GC_EVENT_SETCONTACTSTATUS, sChanName, sTemp, NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
+ DoEvent(GC_EVENT_SETCONTACTSTATUS, sChanName, sTemp, nullptr, nullptr, nullptr, ID_STATUS_ONLINE, FALSE, FALSE);
// fix for networks like freshirc where they allow more than one prefix
if (PrefixToStatus(sTemp2[0]) != pwszNormal) {
sTemp2.Delete(0, 1);
sStat = PrefixToStatus(sTemp2[0]);
while (sStat != pwszNormal) {
- DoEvent(GC_EVENT_ADDSTATUS, sID, sTemp, L"system", sStat, NULL, NULL, false, false, 0);
+ DoEvent(GC_EVENT_ADDSTATUS, sID, sTemp, L"system", sStat, nullptr, NULL, false, false, 0);
sTemp2.Delete(0, 1);
sStat = PrefixToStatus(sTemp2[0]);
}
@@ -1343,16 +1343,16 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
if (!wi)
wi = new CHANNELINFO;
wi->OwnMode = btOwnMode;
- wi->pszLimit = 0;
- wi->pszMode = 0;
- wi->pszPassword = 0;
- wi->pszTopic = 0;
+ wi->pszLimit = nullptr;
+ wi->pszMode = nullptr;
+ wi->pszPassword = nullptr;
+ wi->pszTopic = nullptr;
wi->codepage = getCodepage();
Chat_SetUserInfo(m_szModuleName, sID, wi);
if (!sTopic.IsEmpty() && !mir_wstrcmpi(GetWord(sTopic, 0), sChanName)) {
- DoEvent(GC_EVENT_TOPIC, sChanName, sTopicName.IsEmpty() ? NULL : sTopicName.c_str(), GetWordAddress(sTopic, 1), NULL, sTopicTime.IsEmpty() ? NULL : sTopicTime.c_str(), NULL, true, false);
- AddWindowItemData(sChanName, 0, 0, 0, GetWordAddress(sTopic, 1));
+ DoEvent(GC_EVENT_TOPIC, sChanName, sTopicName.IsEmpty() ? nullptr : sTopicName.c_str(), GetWordAddress(sTopic, 1), nullptr, sTopicTime.IsEmpty() ? nullptr : sTopicTime.c_str(), NULL, true, false);
+ AddWindowItemData(sChanName, nullptr, nullptr, nullptr, GetWordAddress(sTopic, 1));
sTopic = L"";
sTopicName = L"";
sTopicTime = L"";
@@ -1414,7 +1414,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_INITIALTOPIC(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 2) {
- AddWindowItemData(pmsg->parameters[1], 0, 0, 0, pmsg->parameters[2]);
+ AddWindowItemData(pmsg->parameters[1], nullptr, nullptr, nullptr, pmsg->parameters[2]);
sTopic = pmsg->parameters[1] + L" " + pmsg->parameters[2];
sTopicName = L"";
sTopicTime = L"";
@@ -1440,8 +1440,8 @@ bool CIrcProto::OnIrc_INITIALTOPICNAME(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_TOPIC(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 1 && pmsg->m_bIncoming) {
- DoEvent(GC_EVENT_TOPIC, pmsg->parameters[0], pmsg->prefix.sNick, pmsg->parameters[1], NULL, sTopicTime.IsEmpty() ? NULL : sTopicTime.c_str(), NULL, true, false);
- AddWindowItemData(pmsg->parameters[0], 0, 0, 0, pmsg->parameters[1]);
+ DoEvent(GC_EVENT_TOPIC, pmsg->parameters[0], pmsg->prefix.sNick, pmsg->parameters[1], nullptr, sTopicTime.IsEmpty() ? nullptr : sTopicTime.c_str(), NULL, true, false);
+ AddWindowItemData(pmsg->parameters[0], nullptr, nullptr, nullptr, pmsg->parameters[1]);
}
ShowMessage(pmsg);
return true;
@@ -1450,7 +1450,7 @@ bool CIrcProto::OnIrc_TOPIC(const CIrcMessage* pmsg)
static void __stdcall sttShowDlgList(void* param)
{
CIrcProto *ppro = (CIrcProto*)param;
- if (ppro->m_listDlg == NULL) {
+ if (ppro->m_listDlg == nullptr) {
ppro->m_listDlg = new CListDlg(ppro);
ppro->m_listDlg->Show();
}
@@ -1490,7 +1490,7 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
wchar_t* find = wcsstr(temp, L"[+");
wchar_t* find2 = wcsstr(temp, L"]");
wchar_t* save = temp;
- if (find == temp && find2 != NULL && find + 8 >= find2) {
+ if (find == temp && find2 != nullptr && find + 8 >= find2) {
temp = wcsstr(temp, L"]");
if (mir_wstrlen(temp) > 1) {
temp++;
@@ -1607,7 +1607,7 @@ static void __stdcall sttShowWhoisWnd(void* param)
{
CIrcMessage* pmsg = (CIrcMessage*)param;
CIrcProto *ppro = (CIrcProto*)pmsg->m_proto;
- if (ppro->m_whoisDlg == NULL) {
+ if (ppro->m_whoisDlg == nullptr) {
ppro->m_whoisDlg = new CWhoisDlg(ppro);
ppro->m_whoisDlg->Show();
}
@@ -1661,7 +1661,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1 && m_manualWhoisCount < 1) {
- CONTACT user = { pmsg->parameters[1], NULL, NULL, false, false, true };
+ CONTACT user = { pmsg->parameters[1], nullptr, nullptr, false, false, true };
MCONTACT hContact = CList_FindContact(&user);
if (hContact)
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)WhoisAwayReply.c_str());
@@ -1736,7 +1736,7 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg)
if (m_whoisDlg)
m_whoisDlg->ShowMessageNoUser(pmsg);
- CONTACT user = { pmsg->parameters[1], NULL, NULL, false, false, false };
+ CONTACT user = { pmsg->parameters[1], nullptr, nullptr, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact) {
AddOutgoingMessageToDB(hContact, (CMStringW)L"> " + pmsg->parameters[2] + (CMStringW)L": " + pmsg->parameters[1]);
@@ -1770,7 +1770,7 @@ static void __stdcall sttShowNickWnd(void* param)
{
CIrcMessage* pmsg = (CIrcMessage*)param;
CIrcProto *ppro = pmsg->m_proto;
- if (ppro->m_nickDlg == NULL) {
+ if (ppro->m_nickDlg == nullptr) {
ppro->m_nickDlg = new CNickDlg(ppro);
ppro->m_nickDlg->Show();
}
@@ -1890,9 +1890,9 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
if (GetWord(m_whoReply, 3)[0] == 'G') {
S += User;
S += L"\t";
- DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1], User, NULL, NULL, NULL, ID_STATUS_AWAY, FALSE, FALSE);
+ DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1], User, nullptr, nullptr, nullptr, ID_STATUS_AWAY, FALSE, FALSE);
}
- else DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1], User, NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
+ else DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1], User, nullptr, nullptr, nullptr, ID_STATUS_ONLINE, FALSE, FALSE);
CMStringW SS = GetWordAddress(m_whoReply, 4);
if (SS.IsEmpty())
@@ -1901,7 +1901,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
User = GetWord(m_whoReply, 0);
}
- Chat_SetStatusEx(m_szModuleName, pmsg->parameters[1], GC_SSE_TABDELIMITED, S.IsEmpty() ? NULL : S.c_str());
+ Chat_SetStatusEx(m_szModuleName, pmsg->parameters[1], GC_SSE_TABDELIMITED, S.IsEmpty() ? nullptr : S.c_str());
return true;
}
@@ -1909,7 +1909,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
ptrW UserList(mir_wstrdup(m_whoReply));
const wchar_t* p1 = UserList;
m_whoReply = L"";
- CONTACT ccUser = { pmsg->parameters[1], NULL, NULL, false, true, false };
+ CONTACT ccUser = { pmsg->parameters[1], nullptr, nullptr, false, true, false };
MCONTACT hContact = CList_FindContact(&ccUser);
if (hContact && getByte(hContact, "AdvancedMode", 0) == 1) {
@@ -2012,7 +2012,7 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming) {
command = GetNextUserhostReason(1);
if (!command.IsEmpty() && command != L"U" && pmsg->parameters.getCount() > 1) {
- CONTACT finduser = { NULL, NULL, NULL, false, false, false };
+ CONTACT finduser = { nullptr, nullptr, nullptr, false, false, false };
int awaystatus = 0;
CMStringW sTemp;
CMStringW host;
@@ -2124,7 +2124,7 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
// Post message
if (!mess.IsEmpty())
- PostIrcMessageWnd(NULL, NULL, mess);
+ PostIrcMessageWnd(nullptr, NULL, mess);
}
// Status-check post-processing: make buddies in ckeck-list offline
@@ -2251,9 +2251,9 @@ void CIrcProto::OnIrcDisconnected()
CMStringW sDisconn = L"\035\002";
sDisconn += TranslateT("*Disconnected*");
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, sDisconn, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, sDisconn, nullptr, nullptr, NULL, true, false);
- Chat_Control(m_szModuleName, NULL, SESSION_OFFLINE);
+ Chat_Control(m_szModuleName, nullptr, SESSION_OFFLINE);
if (!Miranda_IsTerminated())
CList_SetAllOffline(m_disconnectDCCChats);
@@ -2291,9 +2291,9 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
bPerformDone = true;
nickflag = true;
- Menu_ModifyItem(hMenuJoin, NULL, INVALID_HANDLE_VALUE, 0);
- Menu_ModifyItem(hMenuList, NULL, INVALID_HANDLE_VALUE, 0);
- Menu_ModifyItem(hMenuNick, NULL, INVALID_HANDLE_VALUE, 0);
+ Menu_ModifyItem(hMenuJoin, nullptr, INVALID_HANDLE_VALUE, 0);
+ Menu_ModifyItem(hMenuList, nullptr, INVALID_HANDLE_VALUE, 0);
+ Menu_ModifyItem(hMenuNick, nullptr, INVALID_HANDLE_VALUE, 0);
int Temp = m_iStatus;
m_iStatus = ID_STATUS_ONLINE;
@@ -2341,7 +2341,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
static void __cdecl AwayWarningThread(LPVOID)
{
Thread_SetName("IRC: AwayWarningThread");
- MessageBox(NULL, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
+ MessageBox(nullptr, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
}
int CIrcProto::DoPerform(const char* event)
@@ -2352,9 +2352,9 @@ int CIrcProto::DoPerform(const char* event)
DBVARIANT dbv;
if (!getWString(sSetting, &dbv)) {
if (!my_strstri(dbv.ptszVal, L"/away"))
- PostIrcMessageWnd(NULL, NULL, dbv.ptszVal);
+ PostIrcMessageWnd(nullptr, NULL, dbv.ptszVal);
else
- mir_forkthread(AwayWarningThread, NULL);
+ mir_forkthread(AwayWarningThread, nullptr);
db_free(&dbv);
return 1;
}
@@ -2374,7 +2374,7 @@ int CIrcProto::IsIgnored(CMStringW user, char type)
if (type == 0 && !mir_wstrcmpi(user, C.mask))
return i + 1;
- bool bUserContainsWild = (wcschr(user, '*') != NULL || wcschr(user, '?') != NULL);
+ bool bUserContainsWild = (wcschr(user, '*') != nullptr || wcschr(user, '?') != nullptr);
if (!bUserContainsWild && WCCmp(C.mask, user) ||
bUserContainsWild && !mir_wstrcmpi(user, C.mask)) {
if (C.flags.IsEmpty() || C.flags[0] != '+')
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp
index 84df4d72a5..6d0e79c5bf 100644
--- a/protocols/IRCG/src/input.cpp
+++ b/protocols/IRCG/src/input.cpp
@@ -108,7 +108,7 @@ CMStringW CIrcProto::DoAlias(const wchar_t *text, wchar_t *window)
if (p3)
p3 += 2;
}
- if (p3 != NULL) {
+ if (p3 != nullptr) {
hasAlias = true;
const wchar_t* p4 = wcsstr(p3, L"\r\n");
if (!p4)
@@ -195,7 +195,7 @@ CMStringW CIrcProto::DoIdentifiers(CMStringW text, const wchar_t*)
static void __stdcall sttSetTimerOn(void* _pro)
{
CIrcProto *ppro = (CIrcProto*)_pro;
- ppro->DoEvent(GC_EVENT_INFORMATION, NULL, ppro->m_info.sNick.c_str(), TranslateT("The buddy check function is enabled"), NULL, NULL, NULL, true, false);
+ ppro->DoEvent(GC_EVENT_INFORMATION, nullptr, ppro->m_info.sNick.c_str(), TranslateT("The buddy check function is enabled"), nullptr, nullptr, NULL, true, false);
ppro->SetChatTimer(ppro->OnlineNotifTimer, 500, OnlineNotifTimerProc);
if (ppro->m_channelAwayNotification)
ppro->SetChatTimer(ppro->OnlineNotifTimer3, 1500, OnlineNotifTimerProc3);
@@ -204,7 +204,7 @@ static void __stdcall sttSetTimerOn(void* _pro)
static void __stdcall sttSetTimerOff(void* _pro)
{
CIrcProto *ppro = (CIrcProto*)_pro;
- ppro->DoEvent(GC_EVENT_INFORMATION, NULL, ppro->m_info.sNick.c_str(), TranslateT("The buddy check function is disabled"), NULL, NULL, NULL, true, false);
+ ppro->DoEvent(GC_EVENT_INFORMATION, nullptr, ppro->m_info.sNick.c_str(), TranslateT("The buddy check function is disabled"), nullptr, nullptr, NULL, true, false);
ppro->KillChatTimer(ppro->OnlineNotifTimer);
ppro->KillChatTimer(ppro->OnlineNotifTimer3);
}
@@ -230,7 +230,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (swscanf(one.c_str(), L"%d", &ms) == 1 && ms > 0 && ms <= 4000)
Sleep(ms);
else
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Incorrect parameters. Usage: /sleep [ms], ms should be greater than 0 and less than 4000."), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Incorrect parameters. Usage: /sleep [ms], ms should be greater than 0 and less than 4000."), nullptr, nullptr, NULL, true, false);
}
return true;
}
@@ -258,19 +258,19 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
wchar_t temp[500];
if (one.IsEmpty()) {
if (m_ignore)
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is enabled"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Ignore system is enabled"), nullptr, nullptr, NULL, true, false);
else
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), nullptr, nullptr, NULL, true, false);
return true;
}
if (!mir_wstrcmpi(one.c_str(), L"on")) {
m_ignore = 1;
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is enabled"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Ignore system is enabled"), nullptr, nullptr, NULL, true, false);
return true;
}
if (!mir_wstrcmpi(one.c_str(), L"off")) {
m_ignore = 0;
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), nullptr, nullptr, NULL, true, false);
return true;
}
if (!wcschr(one.c_str(), '!') && !wcschr(one.c_str(), '@'))
@@ -301,7 +301,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
AddIgnore(one.c_str(), IgnoreFlags.c_str(), szNetwork.c_str());
mir_snwprintf(temp, TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), szNetwork.c_str(), IgnoreFlags.c_str());
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), temp, nullptr, nullptr, NULL, true, false);
}
return true;
}
@@ -315,7 +315,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
mir_snwprintf(temp, TranslateT("%s is not ignored now"), one.c_str());
else
mir_snwprintf(temp, TranslateT("%s was not ignored"), one.c_str());
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), temp, nullptr, nullptr, NULL, true, false);
return true;
}
@@ -367,7 +367,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (!Chat_GetInfo(&gci))
mir_snwprintf(szTemp, L"users: %u", gci.iCount);
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
return true;
}
@@ -377,11 +377,11 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (!mir_wstrcmpi(one.c_str(), L"on")) {
bEcho = TRUE;
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Outgoing commands are shown"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Outgoing commands are shown"), nullptr, nullptr, NULL, true, false);
}
if (!mir_wstrcmpi(one.c_str(), L"off")) {
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Outgoing commands are not shown"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("Outgoing commands are not shown"), nullptr, nullptr, NULL, true, false);
bEcho = FALSE;
}
@@ -391,9 +391,9 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (command == L"/buddycheck") {
if (one.IsEmpty()) {
if ((m_autoOnlineNotification && !bTempDisableCheck) || bTempForceCheck)
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The buddy check function is enabled"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("The buddy check function is enabled"), nullptr, nullptr, NULL, true, false);
else
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The buddy check function is disabled"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("The buddy check function is disabled"), nullptr, nullptr, NULL, true, false);
return true;
}
if (!mir_wstrcmpi(one.c_str(), L"on")) {
@@ -412,11 +412,11 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
m_iTempCheckTime = 10;
if (m_iTempCheckTime == 0)
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The time interval for the buddy check function is now at default setting"), NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("The time interval for the buddy check function is now at default setting"), nullptr, nullptr, NULL, true, false);
else {
wchar_t temp[200];
mir_snwprintf(temp, TranslateT("The time interval for the buddy check function is now %u seconds"), m_iTempCheckTime);
- DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), temp, nullptr, nullptr, NULL, true, false);
}
}
return true;
@@ -432,7 +432,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (command == L"/channelmanager") {
if (window && !hContact && IsChannel(window)) {
if (IsConnected()) {
- if (m_managerDlg != NULL) {
+ if (m_managerDlg != nullptr) {
SetActiveWindow(m_managerDlg->GetHwnd());
m_managerDlg->Close();
}
@@ -477,7 +477,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
}
if (command == L"/list") {
- if (m_listDlg == NULL) {
+ if (m_listDlg == nullptr) {
m_listDlg = new CListDlg(this);
m_listDlg->Show();
}
@@ -486,7 +486,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
int minutes2 = (int)m_noOfChannels / 9000;
CMStringW szMsg(FORMAT, TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
- if (m_noOfChannels < 4000 || (m_noOfChannels >= 4000 && MessageBox(NULL, szMsg, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
+ if (m_noOfChannels < 4000 || (m_noOfChannels >= 4000 && MessageBox(nullptr, szMsg, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
ListView_DeleteAllItems(GetDlgItem(m_listDlg->GetHwnd(), IDC_INFO_LISTVIEW));
PostIrcMessage(L"/lusers");
return false;
@@ -511,7 +511,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
CMStringW S = L"/ME " + DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
S.Replace(L"%", L"%%");
- Chat_SendUserMessage(m_szModuleName, NULL, S);
+ Chat_SendUserMessage(m_szModuleName, nullptr, S);
return true;
}
@@ -521,7 +521,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
CMStringW S = DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
S.Replace(L"%", L"%%");
- Chat_SendUserMessage(m_szModuleName, NULL, S);
+ Chat_SendUserMessage(m_szModuleName, nullptr, S);
return true;
}
@@ -540,7 +540,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (one.IsEmpty() || IsChannel(one.c_str()))
return true;
- CONTACT user = { one, NULL, NULL, false, false, false };
+ CONTACT user = { one, nullptr, nullptr, false, false, false };
MCONTACT hContact2 = CList_AddContact(&user, false, false);
if (hContact2) {
if (getByte(hContact, "AdvancedMode", 0) == 0)
@@ -585,7 +585,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
// if it is not dcc or if it is dcc and a local ip exist
if (mir_wstrcmpi(two.c_str(), L"dcc") != 0 || ulAdr) {
if (mir_wstrcmpi(two.c_str(), L"ping") == 0)
- mir_snwprintf(szTemp, L"/PRIVMSG %s \001%s %u\001", one.c_str(), two.c_str(), time(0));
+ mir_snwprintf(szTemp, L"/PRIVMSG %s \001%s %u\001", one.c_str(), two.c_str(), time(nullptr));
else
mir_snwprintf(szTemp, L"/PRIVMSG %s \001%s\001", one.c_str(), GetWordAddress(text.c_str(), 2));
PostIrcMessageWnd(window, hContact, szTemp);
@@ -593,7 +593,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (mir_wstrcmpi(two.c_str(), L"dcc") != 0) {
mir_snwprintf(szTemp, TranslateT("CTCP %s request sent to %s"), two.c_str(), one.c_str());
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
}
return true;
@@ -613,7 +613,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
if (ulAdr) {
- CONTACT user = { two, NULL, NULL, false, false, true };
+ CONTACT user = { two, nullptr, nullptr, false, false, true };
MCONTACT ccNew = CList_AddContact(&user, false, false);
if (ccNew) {
CMStringW s;
@@ -641,14 +641,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
wchar_t* pp[2];
wchar_t* p = (wchar_t*)temp.c_str();
pp[0] = p;
- pp[1] = NULL;
+ pp[1] = nullptr;
CallService(MS_FILE_SENDSPECIFICFILEST, ccNew, (LPARAM)pp);
}
}
}
else {
mir_snwprintf(szTemp, TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
}
return true;
}
@@ -664,7 +664,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (ulAdr) {
CMStringW contact = two; contact += DCCSTRING;
- CONTACT user = { contact, NULL, NULL, false, false, true };
+ CONTACT user = { contact, nullptr, nullptr, false, false, true };
MCONTACT ccNew = CList_AddContact(&user, false, false);
setByte(ccNew, "DCC", 1);
@@ -687,16 +687,16 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo
if (iPort != 0) {
PostIrcMessage(L"/CTCP %s DCC CHAT chat %u %u", two.c_str(), ulAdr, iPort);
mir_snwprintf(szTemp, TranslateT("DCC CHAT request sent to %s"), two.c_str(), one.c_str());
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
}
else {
mir_snwprintf(szTemp, TranslateT("DCC ERROR: Unable to bind port"));
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
}
}
else {
mir_snwprintf(szTemp, TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
}
}
return true;
@@ -723,9 +723,9 @@ static void __stdcall DoInputRequestAliasApcStub(void* _par)
CIrcProto *ppro = param->ppro;
wchar_t* str = param->str;
- wchar_t* infotext = NULL;
- wchar_t* title = NULL;
- wchar_t* defaulttext = NULL;
+ wchar_t* infotext = nullptr;
+ wchar_t* title = nullptr;
+ wchar_t* defaulttext = nullptr;
CMStringW command = (wchar_t*)str;
wchar_t* p = wcsstr((wchar_t*)str, L"%question");
if (p[9] == '=' && p[10] == '\"') {
@@ -788,7 +788,7 @@ bool CIrcProto::PostIrcMessage(const wchar_t* fmt, ...)
mir_vsnwprintf(szBuf, _countof(szBuf), fmt, marker);
va_end(marker);
- return PostIrcMessageWnd(NULL, NULL, szBuf);
+ return PostIrcMessageWnd(nullptr, NULL, szBuf);
}
bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wchar_t *szBuf)
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index e621777293..1fe7a849f1 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -165,7 +165,7 @@ end_of_prefix:
int CIrcProto::getCodepage() const
{
- return (con != NULL) ? codepage : CP_ACP;
+ return (con != nullptr) ? codepage : CP_ACP;
}
void CIrcProto::SendIrcMessage(const wchar_t* msg, bool bNotify, int cp)
@@ -199,19 +199,19 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
ncon.szHost = info.sServer.c_str();
ncon.wPort = info.iPort;
con = Netlib_OpenConnection(m_hNetlibUser, &ncon);
- if (con == NULL) {
+ if (con == nullptr) {
wchar_t szTemp[300];
mir_snwprintf(szTemp, L"\0035%s \002%s\002 (%S: %u).", TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
return false;
}
FindLocalIP(con); // get the local ip used for filetransfers etc
if (info.m_iSSL > 0) {
- if (!Netlib_StartSsl(con, 0) && info.m_iSSL == 2) {
+ if (!Netlib_StartSsl(con, nullptr) && info.m_iSSL == 2) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
m_info.Reset();
return false;
}
@@ -225,7 +225,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
m_info = info;
// start receiving messages from host
- ForkThread(&CIrcProto::ThreadProc, NULL);
+ ForkThread(&CIrcProto::ThreadProc, nullptr);
Sleep(100);
if (info.sPassword.GetLength())
NLSend("PASS %s\r\n", info.sPassword.c_str());
@@ -242,14 +242,14 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
HostName = L"host";
NLSend(L"USER %s %s %s :%s\r\n", userID.c_str(), HostName.c_str(), L"server", info.sFullName.c_str());
- return con != NULL;
+ return con != nullptr;
}
void CIrcProto::Disconnect(void)
{
static const DWORD dwServerTimeout = 5 * 1000;
- if (con == NULL)
+ if (con == nullptr)
return;
KillIdent();
@@ -326,7 +326,7 @@ void CIrcProto::KillIdent()
{
if (hBindPort) {
HANDLE hPort = hBindPort;
- hBindPort = NULL;
+ hBindPort = nullptr;
Netlib_CloseHandle(hPort);
}
}
@@ -342,7 +342,7 @@ void CIrcProto::createMessageFromPchar(const char* p)
{
wchar_t* ptszMsg;
if (codepage != CP_UTF8 && m_utfAutodetect) {
- if (mir_utf8decodecp(NEWSTR_ALLOCA(p), codepage, &ptszMsg) == NULL)
+ if (mir_utf8decodecp(NEWSTR_ALLOCA(p), codepage, &ptszMsg) == nullptr)
ptszMsg = mir_a2u_cp(p, codepage);
}
else ptszMsg = mir_a2u_cp(p, codepage);
@@ -428,11 +428,11 @@ void CIrcProto::DoReceive()
if (con) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
// notify monitor objects that the connection has been closed
- Notify(NULL);
+ Notify(nullptr);
}
void __cdecl CIrcProto::ThreadProc(void*)
@@ -490,7 +490,7 @@ CDccSession* CIrcProto::FindDCCSession(MCONTACT hContact)
if (m_dcc_chats[i]->di->hContact == hContact)
return m_dcc_chats[i];
- return 0;
+ return nullptr;
}
CDccSession* CIrcProto::FindDCCSession(DCCINFO *pdci)
@@ -501,7 +501,7 @@ CDccSession* CIrcProto::FindDCCSession(DCCINFO *pdci)
if (m_dcc_xfers[i]->di == pdci)
return m_dcc_xfers[i];
- return 0;
+ return nullptr;
}
CDccSession* CIrcProto::FindDCCSendByPort(int iPort)
@@ -514,7 +514,7 @@ CDccSession* CIrcProto::FindDCCSendByPort(int iPort)
return p;
}
- return 0;
+ return nullptr;
}
CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const wchar_t* szName)
@@ -533,7 +533,7 @@ CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const wchar_t* szNam
}
}
- return 0;
+ return nullptr;
}
CDccSession* CIrcProto::FindPassiveDCCSend(int iToken)
@@ -544,7 +544,7 @@ CDccSession* CIrcProto::FindPassiveDCCSend(int iToken)
if (m_dcc_xfers[i]->iToken == iToken)
return m_dcc_xfers[i];
- return 0;
+ return nullptr;
}
CDccSession* CIrcProto::FindPassiveDCCRecv(CMStringW sName, CMStringW sToken)
@@ -557,7 +557,7 @@ CDccSession* CIrcProto::FindPassiveDCCRecv(CMStringW sName, CMStringW sToken)
return p;
}
- return 0;
+ return nullptr;
}
void CIrcProto::DisconnectAllDCCSessions(bool Shutdown)
@@ -575,13 +575,13 @@ void CIrcProto::CheckDCCTimeout(void)
for (int i = 0; i < m_dcc_chats.getCount(); i++) {
CDccSession* p = m_dcc_chats[i];
- if (time(0) > p->tLastActivity + DCCCHATTIMEOUT)
+ if (time(nullptr) > p->tLastActivity + DCCCHATTIMEOUT)
p->Disconnect();
}
for (int j = 0; j < m_dcc_xfers.getCount(); j++) {
CDccSession* p = m_dcc_xfers[j];
- if (time(0) > p->tLastActivity + DCCSENDTIMEOUT)
+ if (time(nullptr) > p->tLastActivity + DCCSENDTIMEOUT)
p->Disconnect();
}
}
@@ -652,7 +652,7 @@ void CIrcSessionInfo::Reset()
void CIrcProto::OnIrcMessage(const CIrcMessage* pmsg)
{
- if (pmsg != NULL) {
+ if (pmsg != nullptr) {
PfnIrcMessageHandler pfn = FindMethod(pmsg->sCommand.c_str());
if (pfn) {
// call member function. if it returns 'false',
@@ -668,9 +668,9 @@ void CIrcProto::OnIrcMessage(const CIrcMessage* pmsg)
PfnIrcMessageHandler CIrcProto::FindMethod(const wchar_t* lpszName)
{
- CIrcHandler temp(lpszName, NULL);
+ CIrcHandler temp(lpszName, nullptr);
CIrcHandler* p = m_handlers.find(&temp);
- return (p == NULL) ? NULL : p->m_handler;
+ return (p == nullptr) ? nullptr : p->m_handler;
}
////////////////////////////////////////////////////////////////////
@@ -696,7 +696,7 @@ unsigned long ConvertIPToInteger(char* IP)
IN_ADDR in;
IN_ADDR intemp;
- if (IP == 0 || mir_strlen(IP) == 0)
+ if (IP == nullptr || mir_strlen(IP) == 0)
return 0;
intemp.S_un.S_addr = inet_addr(IP);
@@ -713,17 +713,17 @@ unsigned long ConvertIPToInteger(char* IP)
// initialize basic stuff needed for the dcc objects, also start a timer for checking the status of connections (timeouts)
CDccSession::CDccSession(CIrcProto* _pro, DCCINFO *pdci) :
m_proto(_pro),
- NewFileName(0),
+ NewFileName(nullptr),
dwWhatNeedsDoing(0),
tLastPercentageUpdate(0),
dwTotal(0),
iGlobalToken(),
dwResumePos(0),
- hEvent(0),
- con(0),
- hBindPort(0)
+ hEvent(nullptr),
+ con(nullptr),
+ hBindPort(nullptr)
{
- tLastActivity = time(0);
+ tLastActivity = time(nullptr);
di = pdci; // Setup values passed to the constructor
@@ -731,7 +731,7 @@ CDccSession::CDccSession(CIrcProto* _pro, DCCINFO *pdci) :
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
if (di->iType == DCC_SEND && di->bSender == false)
- hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
if (nDcc == 0)
m_proto->SetChatTimer(m_proto->DCCTimer, 20 * 1000, DCCTimerProc);
@@ -770,10 +770,10 @@ CDccSession::~CDccSession() // destroy all that needs destroying
if (di->iType == DCC_SEND)
m_proto->RemoveDCCSession(di);
- if (hEvent != NULL) {
+ if (hEvent != nullptr) {
SetEvent(hEvent);
CloseHandle(hEvent);
- hEvent = NULL;
+ hEvent = nullptr;
}
delete di;
@@ -788,7 +788,7 @@ CDccSession::~CDccSession() // destroy all that needs destroying
int CDccSession::NLSend(const unsigned char* buf, int cbBuf)
{
- tLastActivity = time(0);
+ tLastActivity = time(nullptr);
if (con)
return Netlib_Send(con, (const char*)buf, cbBuf, di->iType == DCC_CHAT ? MSG_DUMPASTEXT : MSG_NODUMP);
@@ -803,7 +803,7 @@ int CDccSession::NLReceive(const unsigned char* buf, int cbBuf)
if (con)
n = Netlib_Recv(con, (char*)buf, cbBuf, di->iType == DCC_CHAT ? MSG_DUMPASTEXT : MSG_NODUMP);
- tLastActivity = time(0);
+ tLastActivity = time(nullptr);
return n;
}
@@ -855,7 +855,7 @@ int CDccSession::SetupConnection()
// Set up stuff needed for the filetransfer dialog (if it is a filetransfer)
if (di->iType == DCC_SEND) {
file[0] = (wchar_t*)di->sFileAndPath.c_str();
- file[1] = 0;
+ file[1] = nullptr;
pfts.tszCurrentFile = (wchar_t*)di->sFileAndPath.c_str();
pfts.tszWorkingDir = (wchar_t*)di->sPath.c_str();
@@ -868,7 +868,7 @@ int CDccSession::SetupConnection()
pfts.ptszFiles = file;
pfts.totalProgress = 0;
pfts.currentFileProgress = 0;
- pfts.currentFileTime = (unsigned long)time(0);
+ pfts.currentFileTime = (unsigned long)time(nullptr);
}
// create a listening socket for outgoing chat/send requests. The remote computer connects to this computer. Used for both chat and filetransfer.
@@ -878,7 +878,7 @@ int CDccSession::SetupConnection()
nb.pExtra = this;
hBindPort = Netlib_BindPort(m_proto->hNetlibDCC, &nb);
- if (hBindPort == NULL) {
+ if (hBindPort == nullptr) {
delete this; // dcc objects destroy themselves when the connection has been closed or failed for some reasson.
return 0;
}
@@ -929,7 +929,7 @@ int CDccSession::SetupConnection()
pfts.currentFileSize = pfts.totalBytes;
delete[] NewFileName;
- NewFileName = NULL;
+ NewFileName = nullptr;
}
break;
@@ -955,8 +955,8 @@ int CDccSession::SetupConnection()
nb.pExtra = this;
hBindPort = Netlib_BindPort(m_proto->hNetlibDCC, &nb);
- if (hBindPort == NULL) {
- m_proto->DoEvent(GC_EVENT_INFORMATION, 0, m_proto->m_info.sNick.c_str(), LPGENW("DCC ERROR: Unable to bind local port for passive file transfer"), NULL, NULL, NULL, true, false);
+ if (hBindPort == nullptr) {
+ m_proto->DoEvent(GC_EVENT_INFORMATION, nullptr, m_proto->m_info.sNick.c_str(), LPGENW("DCC ERROR: Unable to bind local port for passive file transfer"), nullptr, nullptr, NULL, true, false);
delete this; // dcc objects destroy themselves when the connection has been closed or failed for some reasson.
return 0;
}
@@ -994,7 +994,7 @@ int CDccSession::SetupConnection()
}
// if for some reason the plugin has failed to connect to the remote computer the object is destroyed.
- if (con == NULL) {
+ if (con == nullptr) {
delete this;
return FALSE; // failed to connect
}
@@ -1006,14 +1006,14 @@ int CDccSession::SetupConnection()
// spawn a new thread to handle receiving/sending of data for the new chat/filetransfer connection to the remote computer
mir_forkthread(ThreadProc, this);
- return con != NULL;
+ return con != nullptr;
}
// called by netlib for incoming connections on a listening socket (chat/filetransfer)
int CDccSession::IncomingConnection(HNETLIBCONN hConnection, DWORD dwIP)
{
con = hConnection;
- if (con == NULL) {
+ if (con == nullptr) {
delete this;
return false; // failed to connect
}
@@ -1039,7 +1039,7 @@ void __cdecl CDccSession::ThreadProc(void *pparam)
// the connection to) can connect and not evil IRCopers with haxxored IRCDs
if (pThis->hBindPort) {
Netlib_CloseHandle(pThis->hBindPort);
- pThis->hBindPort = NULL;
+ pThis->hBindPort = nullptr;
}
if (pThis->di->iType == DCC_CHAT)
@@ -1089,7 +1089,7 @@ void CDccSession::DoSendFile()
// initial ack to set the 'percentage-ready meter' to the correct value
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
- tLastActivity = time(0);
+ tLastActivity = time(nullptr);
// create a packet receiver to handle receiving ack's from the remote computer.
HANDLE hPackrcver = Netlib_CreatePacketReceiver(con, sizeof(DWORD));
@@ -1160,8 +1160,8 @@ void CDccSession::DoSendFile()
}
// update the filetransfer dialog's 'percentage-ready meter' once per second only to save cpu
- if (tLastPercentageUpdate < time(0)) {
- tLastPercentageUpdate = time(0);
+ if (tLastPercentageUpdate < time(nullptr)) {
+ tLastPercentageUpdate = time(nullptr);
pfts.totalProgress = dwTotal;
pfts.currentFileProgress = dwTotal;
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
@@ -1170,7 +1170,7 @@ void CDccSession::DoSendFile()
// close the connection once the whole file has been sent an completely ack'ed
if (dwLastAck >= di->dwSize) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
}
@@ -1178,11 +1178,11 @@ void CDccSession::DoSendFile()
// need to close the connection if it isn't allready
if (con) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
// ack the progress one final time
- tLastActivity = time(0);
+ tLastActivity = time(nullptr);
pfts.totalProgress = dwTotal;
pfts.currentFileProgress = dwTotal;
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
@@ -1193,7 +1193,7 @@ void CDccSession::DoSendFile()
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (void *)di, 0);
if (con) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
}
}
@@ -1257,8 +1257,8 @@ void CDccSession::DoReceiveFile()
// sets the 'last update time' to check for timed out connections, and also make sure we only
// ack the 'percentage-ready meter' only once a second to save CPU.
- if (tLastPercentageUpdate < time(0)) {
- tLastPercentageUpdate = time(0);
+ if (tLastPercentageUpdate < time(nullptr)) {
+ tLastPercentageUpdate = time(nullptr);
pfts.totalProgress = dwTotal;
pfts.currentFileProgress = dwTotal;
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_DATA, (void *)di, (LPARAM)&pfts);
@@ -1267,7 +1267,7 @@ void CDccSession::DoReceiveFile()
// if file size is known and everything is received then disconnect
if (di->dwSize && di->dwSize == dwTotal) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
}
// receiving loop broken locally or by remote computer, just some cleaning up left....
@@ -1281,7 +1281,7 @@ void CDccSession::DoReceiveFile()
ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (void *)di, 0);
if (con) { // file not possible to open for writing so we ack FAILURE and close the handle
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
}
@@ -1328,7 +1328,7 @@ void CDccSession::DoChatReceive()
if (*pStart) {
// send it off to some messaging module
PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(NULL);
+ pre.timestamp = (DWORD)time(nullptr);
pre.szMessage = pStart;
ProtoChainRecvMsg(di->hContact, &pre);
}
@@ -1350,14 +1350,14 @@ int CDccSession::Disconnect()
{
if (hBindPort) {
Netlib_CloseHandle(hBindPort);
- hBindPort = NULL;
+ hBindPort = nullptr;
}
// if 'con' exists it is cuz a connection exists.
// Terminating 'con' will cause any spawned threads to die and then the object will destroy itself.
if (con) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
else delete this; // if 'con' do not exist (no connection made so far from the object) the object is destroyed
@@ -1400,7 +1400,7 @@ void DoIdent(HNETLIBCONN hConnection, DWORD, void* extra)
LBL_Parse:
char* EOLPos = strstr(szBuf, "\r\n");
- if (EOLPos == NULL)
+ if (EOLPos == nullptr)
continue;
EOLPos[0] = EOLPos[1] = '\0';
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 85ea258941..5ce755d6cb 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -39,7 +39,7 @@ CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) :
vUserhostReasons(10),
vWhoInProgress(10)
{
- m_evWndCreate = ::CreateEvent(NULL, FALSE, FALSE, NULL);
+ m_evWndCreate = ::CreateEvent(nullptr, FALSE, FALSE, nullptr);
CreateProtoService(PS_GETMYAWAYMSG, &CIrcProto::GetMyAwayMsg);
@@ -140,11 +140,11 @@ CIrcProto::~CIrcProto()
{
if (con) {
Netlib_CloseHandle(con);
- con = NULL;
+ con = nullptr;
}
- Netlib_CloseHandle(m_hNetlibUser); m_hNetlibUser = NULL;
- Netlib_CloseHandle(hNetlibDCC); hNetlibDCC = NULL;
+ Netlib_CloseHandle(m_hNetlibUser); m_hNetlibUser = nullptr;
+ Netlib_CloseHandle(hNetlibDCC); hNetlibDCC = nullptr;
mir_free(m_alias);
@@ -210,9 +210,9 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
mir_snwprintf(szTemp, L"%%miranda_path%%\\Plugins\\%S_perform.ini", m_szModuleName);
wchar_t *szLoadFileName = Utils_ReplaceVarsW(szTemp);
char* pszPerformData = IrcLoadFile(szLoadFileName);
- if (pszPerformData != NULL) {
+ if (pszPerformData != nullptr) {
char *p1 = pszPerformData, *p2 = pszPerformData;
- while ((p1 = strstr(p2, "NETWORK: ")) != NULL) {
+ while ((p1 = strstr(p2, "NETWORK: ")) != nullptr) {
p1 += 9;
p2 = strchr(p1, '\n');
CMStringA sNetwork(p1, int(p2 - p1 - 1));
@@ -284,7 +284,7 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
wchar_t *id = psr->id.w ? psr->id.w : psr->nick.w;
id = psr->flags & PSR_UNICODE ? mir_wstrdup((wchar_t*)id) : mir_a2u((char*)id);
- CONTACT user = { id, NULL, NULL, true, false, false };
+ CONTACT user = { id, nullptr, nullptr, true, false, false };
MCONTACT hContact = CList_AddContact(&user, true, false);
if (hContact) {
@@ -487,7 +487,7 @@ HANDLE __cdecl CIrcProto::SearchBasic(const wchar_t* szId)
}
}
- return 0;
+ return nullptr;
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -495,14 +495,14 @@ HANDLE __cdecl CIrcProto::SearchBasic(const wchar_t* szId)
HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFiles)
{
- DCCINFO* dci = NULL;
+ DCCINFO* dci = nullptr;
int iPort = 0;
int index = 0;
unsigned __int64 size = 0;
// do not send to channels :-P
if (isChatRoom(hContact))
- return 0;
+ return nullptr;
// stop if it is an active type filetransfer and the user's IP is not known
unsigned long ulAdr = 0;
@@ -512,8 +512,8 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t**
ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
if (!m_DCCPassive && !ulAdr) {
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), TranslateT("DCC ERROR: Unable to automatically resolve external IP"), NULL, NULL, NULL, true, false);
- return 0;
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("DCC ERROR: Unable to automatically resolve external IP"), nullptr, nullptr, NULL, true, false);
+ return nullptr;
}
if (ppszFiles[index]) {
@@ -529,8 +529,8 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t**
}
if (size == 0) {
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), TranslateT("DCC ERROR: No valid files specified"), NULL, NULL, NULL, true, false);
- return 0;
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), TranslateT("DCC ERROR: No valid files specified"), nullptr, nullptr, NULL, true, false);
+ return nullptr;
}
DBVARIANT dbv;
@@ -579,7 +579,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t**
mir_snwprintf(szTemp,
TranslateT("DCC reversed file transfer request sent to %s [%s]"),
dci->sContactName.c_str(), sFileCorrect.c_str());
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
if (m_sendNotice) {
mir_snwprintf(szTemp,
@@ -598,7 +598,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t**
mir_snwprintf(szTemp,
TranslateT("DCC file transfer request sent to %s [%s]"),
dci->sContactName.c_str(), sFileCorrect.c_str());
- DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(), szTemp, nullptr, nullptr, NULL, true, false);
if (m_sendNotice) {
mir_snwprintf(szTemp,
@@ -607,8 +607,8 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t**
PostIrcMessage(szTemp);
}
}
- else DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(),
- TranslateT("DCC ERROR: Unable to bind local port"), NULL, NULL, NULL, true, false);
+ else DoEvent(GC_EVENT_INFORMATION, nullptr, m_info.sNick.c_str(),
+ TranslateT("DCC ERROR: Unable to bind local port"), nullptr, nullptr, NULL, true, false);
}
// fix for sending multiple files
@@ -626,7 +626,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t**
if (dci)
return dci;
- return NULL;
+ return nullptr;
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -645,13 +645,13 @@ struct TFakeAckParam
void __cdecl CIrcProto::AckMessageFail(void *info)
{
Thread_SetName("IRC: AckMessageFail");
- ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online"));
+ ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)Translate("The protocol is not online"));
}
void __cdecl CIrcProto::AckMessageFailDcc(void *info)
{
Thread_SetName("IRC: AckMessageFailDcc");
- ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active"));
+ ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)Translate("The dcc chat connection is not active"));
}
void __cdecl CIrcProto::AckMessageSuccess(void *info)
@@ -678,7 +678,7 @@ int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
wchar_t *result;
mir_utf8decode(NEWSTR_ALLOCA(pszSrc), &result);
- PostIrcMessageWnd(NULL, hContact, result);
+ PostIrcMessageWnd(nullptr, hContact, result);
mir_free(result);
int seq = InterlockedIncrement(&g_msgid);
@@ -698,7 +698,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal)
{
if (iNewStatus != ID_STATUS_OFFLINE && !m_network[0]) {
if (m_nick[0] && !m_disableDefaultServer) {
- if (m_quickDlg == NULL) {
+ if (m_quickDlg == nullptr) {
m_quickDlg = new CQuickDlg(this);
m_quickComboSelection = m_serverComboSelection + 1;
m_quickDlg->Show();
@@ -767,7 +767,7 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact)
int i = getWord(hContact, "Status", ID_STATUS_OFFLINE);
if (i != ID_STATUS_AWAY) {
db_free(&dbv);
- return 0;
+ return nullptr;
}
CMStringW S = L"WHOIS ";
S += dbv.ptszVal;
@@ -793,8 +793,8 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const wchar_t* msg)
default:
CMStringW newStatus = msg;
newStatus.Replace(L"\r\n", L" ");
- if (m_statusMessage.IsEmpty() || msg == NULL || m_statusMessage != newStatus) {
- if (msg == NULL || *msg == 0)
+ if (m_statusMessage.IsEmpty() || msg == nullptr || m_statusMessage != newStatus) {
+ if (msg == nullptr || *msg == 0)
m_statusMessage = STR_AWAYMESSAGE;
else
m_statusMessage = newStatus;
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp
index 4629c9fa31..8ca2aa485d 100644
--- a/protocols/IRCG/src/main.cpp
+++ b/protocols/IRCG/src/main.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
CHAT_MANAGER *pci;
CLIST_INTERFACE *pcli;
-HINSTANCE hInst = NULL;
+HINSTANCE hInst = nullptr;
int hLangpack;
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index d0df6b7b72..749df2f0e8 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include <win2k.h>
-static const CIrcProto* pZero = NULL;
+static const CIrcProto* pZero = nullptr;
void CIrcProto::ReadSettings(TDbSetting* sets, int count)
{
@@ -56,7 +56,7 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count)
if (p->size != -1)
*ptr = 0;
else
- *(char**)ptr = NULL;
+ *(char**)ptr = nullptr;
}
break;
case DBVT_WCHAR:
@@ -71,7 +71,7 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count)
}
else {
if (p->size != -1) {
- if (p->defStr == NULL)
+ if (p->defStr == nullptr)
*ptr = 0;
else
mir_wstrncpy((wchar_t*)ptr, p->defStr, (int)p->size);
@@ -213,7 +213,7 @@ HICON LoadIconEx(int iconId, bool big)
if (iconList[i].defIconID == iconId)
return IcoLib_GetIconByHandle(iconList[i].hIcolib, big);
- return NULL;
+ return nullptr;
}
HANDLE GetIconHandle(int iconId)
@@ -222,7 +222,7 @@ HANDLE GetIconHandle(int iconId)
if (iconList[i].defIconID == iconId)
return iconList[i].hIcolib;
- return NULL;
+ return nullptr;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -383,7 +383,7 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto>
int iItem = m_owner->m_serverCombo.AddStringA(pData->m_name, (LPARAM)pData);
m_owner->m_serverCombo.SetCurSel(iItem);
- m_owner->OnServerCombo(NULL);
+ m_owner->OnServerCombo(nullptr);
m_owner->m_serverlistModified = true;
Close();
@@ -607,7 +607,7 @@ void CConnectPrefsDlg::OnDeleteServer(CCtrlButton*)
if (i >= m_serverCombo.GetCount())
i--;
m_serverCombo.SetCurSel(i);
- OnServerCombo(NULL);
+ OnServerCombo(nullptr);
SendMessage(GetParent(m_hwnd), PSM_CHANGED, 0, 0);
m_serverlistModified = true;
}
@@ -750,7 +750,7 @@ void CConnectPrefsDlg::OnApply()
if (j != CB_ERR && j != 0) {
for (int index2 = 0; index2 < j; index2++) {
pData = (SERVER_INFO*)m_serverCombo.GetItemData(index2);
- if (pData == NULL || (INT_PTR)pData == CB_ERR)
+ if (pData == nullptr || (INT_PTR)pData == CB_ERR)
continue;
char TextLine[512];
@@ -761,7 +761,7 @@ void CConnectPrefsDlg::OnApply()
db_set_s(NULL, SERVERSMODULE, pData->m_name, TextLine);
// combobox might contain new items
- if (g_servers.find(pData) == NULL)
+ if (g_servers.find(pData) == nullptr)
g_servers.insert(pData);
}
}
@@ -1036,7 +1036,7 @@ void COtherPrefsDlg::OnInitDialog()
}
m_performCombo.SetCurSel(0);
- OnPerformCombo(NULL);
+ OnPerformCombo(nullptr);
m_autodetect.SetState(m_proto->m_utfAutodetect);
}
@@ -1049,7 +1049,7 @@ void COtherPrefsDlg::OnPerformCombo(CCtrlData*)
{
int i = m_performCombo.GetCurSel();
PERFORM_INFO* pPerf = (PERFORM_INFO*)m_performCombo.GetItemData(i);
- if (pPerf == 0)
+ if (pPerf == nullptr)
m_pertormEdit.SetTextA("");
else
m_pertormEdit.SetText(pPerf->mText.c_str());
@@ -1089,12 +1089,12 @@ void COtherPrefsDlg::OnAdd(CCtrlButton*)
wchar_t* temp = m_pertormEdit.GetText();
if (my_strstri(temp, L"/away"))
- MessageBox(NULL, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
+ MessageBox(nullptr, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
else {
int i = m_performCombo.GetCurSel();
if (i != CB_ERR) {
PERFORM_INFO* pPerf = (PERFORM_INFO*)m_performCombo.GetItemData(i);
- if (pPerf != NULL)
+ if (pPerf != nullptr)
pPerf->mText = temp;
m_add.Disable();
@@ -1109,7 +1109,7 @@ void COtherPrefsDlg::OnDelete(CCtrlButton*)
int i = m_performCombo.GetCurSel();
if (i != CB_ERR) {
PERFORM_INFO* pPerf = (PERFORM_INFO*)m_performCombo.GetItemData(i);
- if (pPerf != NULL) {
+ if (pPerf != nullptr) {
pPerf->mText = L"";
m_pertormEdit.SetTextA("");
m_delete.Disable();
@@ -1126,7 +1126,7 @@ void COtherPrefsDlg::OnDestroy()
if (i != CB_ERR && i != 0) {
for (int index = 0; index < i; index++) {
PERFORM_INFO* pPerf = (PERFORM_INFO*)m_performCombo.GetItemData(index);
- if ((INT_PTR)pPerf != CB_ERR && pPerf != NULL)
+ if ((INT_PTR)pPerf != CB_ERR && pPerf != nullptr)
delete pPerf;
}
}
@@ -1147,7 +1147,7 @@ void COtherPrefsDlg::OnApply()
m_proto->m_perform = m_perform.GetState();
m_proto->m_scriptingEnabled = m_scripting.GetState();
if (m_add.Enabled())
- OnAdd(NULL);
+ OnAdd(nullptr);
if (m_performlistModified) {
int count = m_performCombo.GetCount();
@@ -1190,7 +1190,7 @@ CAddIgnoreDlg::CAddIgnoreDlg(CIrcProto* _pro, const wchar_t* mask, CIgnorePrefsD
{
m_hwndParent = _owner->GetHwnd();
- if (mask == NULL)
+ if (mask == nullptr)
szOldMask[0] = 0;
else
wcsncpy(szOldMask, mask, _countof(szOldMask));
@@ -1316,7 +1316,7 @@ void CIrcProto::InitIgnore(void)
mir_snwprintf(szTemp, L"%%miranda_path%%\\Plugins\\%S_ignore.ini", m_szModuleName);
wchar_t *szLoadFileName = Utils_ReplaceVarsW(szTemp);
char* pszIgnoreData = IrcLoadFile(szLoadFileName);
- if (pszIgnoreData != NULL) {
+ if (pszIgnoreData != nullptr) {
char *p1 = pszIgnoreData;
while (*p1 != '\0') {
while (*p1 == '\r' || *p1 == '\n')
@@ -1429,7 +1429,7 @@ void CIgnorePrefsDlg::OnInitDialog()
lvC.iSubItem = index;
lvC.cx = COLUMNS_SIZES[index];
- wchar_t* text = NULL;
+ wchar_t* text = nullptr;
switch (index) {
case 0: text = TranslateT("Ignore mask"); break;
case 1: text = TranslateT("Flags"); break;
@@ -1476,7 +1476,7 @@ void CIgnorePrefsDlg::OnIgnoreChat(CCtrlData*)
void CIgnorePrefsDlg::OnAdd(CCtrlButton*)
{
- CAddIgnoreDlg *dlg = new CAddIgnoreDlg(m_proto, NULL, this);
+ CAddIgnoreDlg *dlg = new CAddIgnoreDlg(m_proto, nullptr, this);
dlg->Show();
SetWindowText(dlg->GetHwnd(), TranslateT("Add ignore"));
m_add.Disable();
@@ -1550,7 +1550,7 @@ void CIgnorePrefsDlg::OnApply()
void CIgnorePrefsDlg::OnDestroy()
{
- m_proto->m_ignoreDlg = NULL;
+ m_proto->m_ignoreDlg = nullptr;
m_proto->m_ignoreItems.destroy();
int i = m_list.GetItemCount();
@@ -1697,7 +1697,7 @@ void CIrcProto::InitPrefs(void)
m_mySpecifiedHostIP[0] = 0;
- if (m_alias == NULL)
+ if (m_alias == nullptr)
m_alias = mir_wstrdup(L"/op /mode ## +ooo $1 $2 $3\r\n/dop /mode ## -ooo $1 $2 $3\r\n/voice /mode ## +vvv $1 $2 $3\r\n/dvoice /mode ## -vvv $1 $2 $3\r\n/j /join #$1 $2-\r\n/p /part ## $1-\r\n/w /whois $1\r\n/k /kick ## $1 $2-\r\n/q /query $1\r\n/logon /log on ##\r\n/logoff /log off ##\r\n/save /log buffer $1\r\n/slap /me slaps $1 around a bit with a large trout");
m_quickComboSelection = getDword("QuickComboSelection", m_serverComboSelection + 1);
@@ -1819,7 +1819,7 @@ INT_PTR CIrcProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
static void sttImportIni(const wchar_t* szIniFile)
{
FILE* serverFile = _wfopen(szIniFile, L"r");
- if (serverFile == NULL)
+ if (serverFile == nullptr)
return;
char buf1[500], buf2[200];
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp
index 9eb5181e91..a1a95b346c 100644
--- a/protocols/IRCG/src/output.cpp
+++ b/protocols/IRCG/src/output.cpp
@@ -142,17 +142,17 @@ BOOL CIrcProto::ShowMessage(const CIrcMessage* pmsg)
if ((iTemp > 400 || iTemp < 500) && pmsg->sCommand[0] == '4' //all error messages
|| pmsg->sCommand == L"303" //ISON command
|| pmsg->sCommand == L"INVITE"
- || ((pmsg->sCommand == L"NOTICE") && ((pmsg->parameters.getCount() > 2) ? (wcsstr(pmsg->parameters[1].c_str(), L"\001") == NULL) : false)) // CTCP answers should go to m_network Log window!
+ || ((pmsg->sCommand == L"NOTICE") && ((pmsg->parameters.getCount() > 2) ? (wcsstr(pmsg->parameters[1].c_str(), L"\001") == nullptr) : false)) // CTCP answers should go to m_network Log window!
|| pmsg->sCommand == L"515") //chanserv error
{
- DoEvent(GC_EVENT_INFORMATION, NULL, pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
+ DoEvent(GC_EVENT_INFORMATION, nullptr, pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), nullptr, nullptr, NULL, true, pmsg->m_bIncoming ? false : true);
return TRUE;
}
if (m_useServer) {
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW,
(pmsg->m_bIncoming) ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(),
- mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
+ mess.c_str(), nullptr, nullptr, NULL, true, pmsg->m_bIncoming ? false : true);
return true;
}
return false;
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index d510422a84..ee3c57ab90 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -82,23 +82,23 @@ INT_PTR __cdecl CIrcProto::Scripting_InsertGuiOut(WPARAM, LPARAM lParam)
if (gch->ptszText)
gchook->ptszText = wcsdup(gch->ptszText);
else
- gchook->ptszText = NULL;
+ gchook->ptszText = nullptr;
if (gch->ptszUID)
gchook->ptszUID = wcsdup(gch->ptszUID);
else
- gchook->ptszUID = NULL;
+ gchook->ptszUID = nullptr;
if (gch->ptszID) {
CMStringW S = MakeWndID(gch->ptszID);
gchook->ptszID = wcsdup(S.c_str());
}
- else gchook->ptszID = NULL;
+ else gchook->ptszID = nullptr;
if (gch->pszModule)
gchook->pszModule = _strdup(gch->pszModule);
else
- gchook->pszModule = NULL;
+ gchook->pszModule = nullptr;
mir_forkthread(GuiOutThread, gchook);
return 0;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 144b98f9bb..d7c9228f97 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -67,14 +67,14 @@ static HGENMENU hUMenuChanSettings, hUMenuWhois, hUMenuDisconnect, hUMenuIgnore;
static CIrcProto* IrcGetInstanceByHContact(MCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
- if (szProto == NULL)
- return NULL;
+ if (szProto == nullptr)
+ return nullptr;
for (int i = 0; i < g_Instances.getCount(); i++)
if (!mir_strcmp(szProto, g_Instances[i]->m_szModuleName))
return g_Instances[i];
- return NULL;
+ return nullptr;
}
static INT_PTR IrcMenuChanSettings(WPARAM wParam, LPARAM lParam)
@@ -293,7 +293,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM)
DBVARIANT dbv;
if (!getWString(hContact, "Nick", &dbv)) {
if (!isChatRoom(hContact)) {
- char* host = NULL;
+ char* host = nullptr;
DBVARIANT dbv1;
if (!getString(hContact, "Host", &dbv1))
host = dbv1.pszVal;
@@ -529,7 +529,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
TranslateT("Please enter your authentication code"), TranslateT("Authenticate nick"));
break;
case 7: // nickserv drop nick
- if (MessageBox(0, TranslateT("Are you sure you want to unregister your current nick?"), TranslateT("Delete nick"),
+ if (MessageBox(nullptr, TranslateT("Are you sure you want to unregister your current nick?"), TranslateT("Delete nick"),
MB_ICONERROR + MB_YESNO + MB_DEFBUTTON2) == IDYES)
PostIrcMessage(L"/nickserv DROP");
break;
@@ -818,7 +818,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam)
}
if (gcmi->Type == MENU_ON_NICKLIST) {
- CONTACT user = { (wchar_t*)gcmi->pszUID, NULL, NULL, false, false, false };
+ CONTACT user = { (wchar_t*)gcmi->pszUID, nullptr, nullptr, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
BOOL bIsInList = (hContact && db_get_b(hContact, "CList", "NotOnList", 0) == 0);
@@ -832,12 +832,12 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam)
nickItems[23].bDisabled = ulAdr == 0 ? TRUE : FALSE; // DCC submenu
CHANNELINFO *wi = (CHANNELINFO *)Chat_GetUserInfo(m_szModuleName, gcmi->pszID);
- BOOL bServOwner = strchr(sUserModes.c_str(), 'q') == NULL ? FALSE : TRUE;
- BOOL bServAdmin = strchr(sUserModes.c_str(), 'a') == NULL ? FALSE : TRUE;
+ BOOL bServOwner = strchr(sUserModes.c_str(), 'q') == nullptr ? FALSE : TRUE;
+ BOOL bServAdmin = strchr(sUserModes.c_str(), 'a') == nullptr ? FALSE : TRUE;
BOOL bOwner = bServOwner ? ((wi->OwnMode >> 4) & 01) : FALSE;
BOOL bAdmin = bServAdmin ? ((wi->OwnMode >> 3) & 01) : FALSE;
- BOOL bOp = strchr(sUserModes.c_str(), 'o') == NULL ? FALSE : ((wi->OwnMode >> 2) & 01);
- BOOL bHalfop = strchr(sUserModes.c_str(), 'h') == NULL ? FALSE : ((wi->OwnMode >> 1) & 01);
+ BOOL bOp = strchr(sUserModes.c_str(), 'o') == nullptr ? FALSE : ((wi->OwnMode >> 2) & 01);
+ BOOL bHalfop = strchr(sUserModes.c_str(), 'h') == nullptr ? FALSE : ((wi->OwnMode >> 1) & 01);
BOOL bForceEnable = GetAsyncKeyState(VK_CONTROL);
@@ -975,7 +975,7 @@ void __cdecl CIrcProto::ConnectServerThread(void*)
else {
Temp = m_iDesiredStatus;
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK);
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)Temp, ID_STATUS_OFFLINE);
Sleep(100);
}
@@ -1019,14 +1019,14 @@ void CIrcProto::ConnectToServer(void)
sChannelModes = "btnimklps";
if (!m_bConnectThreadRunning)
- ForkThread(&CIrcProto::ConnectServerThread, 0);
+ ForkThread(&CIrcProto::ConnectServerThread, nullptr);
else if (m_bConnectRequested < 1)
InterlockedIncrement((long *)&m_bConnectRequested);
wchar_t szTemp[300];
mir_snwprintf(szTemp, L"\033%s \002%s\002 (%S: %u)",
TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
- DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
+ DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, nullptr, szTemp, nullptr, nullptr, NULL, true, false);
}
void CIrcProto::DisconnectFromServer(void)
@@ -1035,7 +1035,7 @@ void CIrcProto::DisconnectFromServer(void)
DoPerform("Event: Disconnect");
Chat_Terminate(m_szModuleName, nullptr);
- ForkThread(&CIrcProto::DisconnectServerThread, 0);
+ ForkThread(&CIrcProto::DisconnectServerThread, nullptr);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index 2ae539db46..78434b4cf8 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -53,7 +53,7 @@ CMStringW __stdcall GetWord(const wchar_t* text, int index)
{
if (text && *text) {
wchar_t* p1 = (wchar_t*)text;
- wchar_t* p2 = NULL;
+ wchar_t* p2 = nullptr;
while (*p1 == ' ')
p1++;
@@ -122,10 +122,10 @@ void __stdcall RemoveLinebreaks(CMStringW &Message)
char* __stdcall IrcLoadFile(wchar_t* szPath)
{
- char * szContainer = NULL;
+ char * szContainer = nullptr;
DWORD dwSiz = 0;
FILE *hFile = _wfopen(szPath, L"rb");
- if (hFile != NULL) {
+ if (hFile != nullptr) {
fseek(hFile, 0, SEEK_END); // seek to end
dwSiz = ftell(hFile); // size
fseek(hFile, 0, SEEK_SET); // seek back to original pos
@@ -136,15 +136,15 @@ char* __stdcall IrcLoadFile(wchar_t* szPath)
return szContainer;
}
- return 0;
+ return nullptr;
}
int __stdcall WCCmp(const wchar_t* wild, const wchar_t* string)
{
- if (wild == NULL || !mir_wstrlen(wild) || string == NULL || !mir_wstrlen(string))
+ if (wild == nullptr || !mir_wstrlen(wild) || string == nullptr || !mir_wstrlen(string))
return 1;
- const wchar_t *cp = NULL, *mp = NULL;
+ const wchar_t *cp = nullptr, *mp = nullptr;
while ((*string) && (*wild != '*')) {
if ((*wild != *string) && (*wild != '?'))
return 0;
@@ -186,7 +186,7 @@ CMStringA __stdcall GetWord(const char* text, int index)
{
if (text && text[0]) {
char* p1 = (char*)text;
- char* p2 = NULL;
+ char* p2 = nullptr;
while (*p1 == ' ')
p1++;
@@ -228,7 +228,7 @@ wchar_t* __stdcall my_strstri(const wchar_t* s1, const wchar_t* s2)
if (!s2[k + 1])
return (wchar_t*)(s1 + i);
- return NULL;
+ return nullptr;
}
wchar_t* __stdcall DoColorCodes(const wchar_t* text, bool bStrip, bool bReplacePercent)
@@ -389,7 +389,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t*
if (pszText)
sText = DoColorCodes(pszText, FALSE, TRUE);
- GCEVENT gce = { m_szModuleName, NULL, iEvent };
+ GCEVENT gce = { m_szModuleName, nullptr, iEvent };
if (pszWindow) {
if (mir_wstrcmpi(pszWindow, SERVERWINDOW))
sID = pszWindow + (CMStringW)L" - " + m_info.sNetwork;
@@ -397,7 +397,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t*
sID = pszWindow;
gce.ptszID = (wchar_t*)sID.c_str();
}
- else gce.ptszID = NULL;
+ else gce.ptszID = nullptr;
gce.ptszStatus = pszStatus;
gce.dwFlags = (bAddToLog) ? GCEF_ADDTOLOG : 0;
@@ -406,14 +406,14 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t* pszWindow, const wchar_t*
if (iEvent == GC_EVENT_TOPIC)
gce.ptszUserInfo = pszUserInfo;
else
- gce.ptszUserInfo = m_showAddresses ? pszUserInfo : NULL;
+ gce.ptszUserInfo = m_showAddresses ? pszUserInfo : nullptr;
if (!sText.IsEmpty())
gce.ptszText = sText.c_str();
gce.dwItemData = dwItemData;
if (timestamp == 1)
- gce.time = time(NULL);
+ gce.time = time(nullptr);
else
gce.time = timestamp;
gce.bIsMe = bIsMe;
@@ -487,9 +487,9 @@ CIrcProto* GetTimerOwner(UINT_PTR nIDEvent)
{
mir_cslock lck(timers_cs);
- TimerPair temp(NULL, nIDEvent);
+ TimerPair temp(nullptr, nIDEvent);
int idx = timers.getIndex(&temp);
- return (idx == -1) ? NULL : timers[idx].ppro;
+ return (idx == -1) ? nullptr : timers[idx].ppro;
}
void CIrcProto::SetChatTimer(UINT_PTR &nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc)
@@ -497,7 +497,7 @@ void CIrcProto::SetChatTimer(UINT_PTR &nIDEvent, UINT uElapse, TIMERPROC lpTimer
if (nIDEvent)
KillChatTimer(nIDEvent);
- nIDEvent = SetTimer(NULL, NULL, uElapse, lpTimerFunc);
+ nIDEvent = SetTimer(nullptr, NULL, uElapse, lpTimerFunc);
mir_cslock lck(timers_cs);
timers.insert(new TimerPair(this, nIDEvent));
@@ -515,7 +515,7 @@ void CIrcProto::KillChatTimer(UINT_PTR &nIDEvent)
timers.remove(idx);
}
- KillTimer(NULL, nIDEvent);
+ KillTimer(nullptr, nIDEvent);
nIDEvent = NULL;
}
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp
index 2813f65edc..faa5809241 100644
--- a/protocols/IRCG/src/userinfo.cpp
+++ b/protocols/IRCG/src/userinfo.cpp
@@ -45,7 +45,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
UserDetailsDlgProcParam *p = (UserDetailsDlgProcParam*)GetWindowLongPtr(m_hwnd, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
- p = new UserDetailsDlgProcParam(NULL, lParam);
+ p = new UserDetailsDlgProcParam(nullptr, lParam);
SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LPARAM)p);
break;
@@ -107,7 +107,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_WILDCARD)) == 0 ||
GetWindowTextLength(GetDlgItem(m_hwnd, IDC_USER)) == 0 ||
GetWindowTextLength(GetDlgItem(m_hwnd, IDC_HOST)) == 0) {
- MessageBox(NULL, TranslateW(STR_ERROR2), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateW(STR_ERROR2), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
return FALSE;
}
@@ -118,7 +118,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
S += dbv.ptszVal;
S += L")";
if ((mir_wstrlen(temp) < 4 && mir_wstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
- MessageBox(NULL, TranslateW(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateW(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
db_free(&dbv);
return FALSE;
}
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index 8c19b06bd8..9b91719ad3 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -104,7 +104,7 @@ void CWhoisDlg::OnDestroy()
SendDlgItemMessage(m_hwnd, IDC_CAPTION, WM_SETFONT, SendDlgItemMessage(m_hwnd, IDOK, WM_GETFONT, 0, 0), 0);
DeleteObject(hFont2);
- m_proto->m_whoisDlg = NULL;
+ m_proto->m_whoisDlg = nullptr;
}
void CWhoisDlg::OnGo(CCtrlButton*)
@@ -126,7 +126,7 @@ void CWhoisDlg::OnPing(CCtrlButton*)
wchar_t szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
- m_proto->PostIrcMessage(L"/PRIVMSG %s \001PING %u\001", szTemp, time(0));
+ m_proto->PostIrcMessage(L"/PRIVMSG %s \001PING %u\001", szTemp, time(nullptr));
}
void CWhoisDlg::OnUserInfo(CCtrlButton*)
@@ -175,7 +175,7 @@ void CWhoisDlg::ShowMessage(const CIrcMessage* pmsg)
if (IsIconic(m_hwnd))
ShowWindow(m_hwnd, SW_SHOWNORMAL);
SendMessage(m_hwnd, WM_SETREDRAW, TRUE, 0);
- InvalidateRect(m_hwnd, NULL, TRUE);
+ InvalidateRect(m_hwnd, nullptr, TRUE);
}
void CWhoisDlg::ShowMessageNoUser(const CIrcMessage *pmsg)
@@ -223,7 +223,7 @@ void CNickDlg::OnInitDialog()
void CNickDlg::OnDestroy()
{
CCoolIrcDlg::OnDestroy();
- m_proto->m_nickDlg = NULL;
+ m_proto->m_nickDlg = nullptr;
}
void CNickDlg::OnOk(CCtrlButton*)
@@ -327,7 +327,7 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
// Match the text?
wchar_t* t = wcsstr(lvm.pszText, strFilterText);
- if (t == NULL) { // If no, then Check if in the topics
+ if (t == nullptr) { // If no, then Check if in the topics
m_list.GetItem(&lvm);
// Match the text?
@@ -393,7 +393,7 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
void CListDlg::OnChange(CCtrlBase *ctrl)
{
if (ctrl->GetCtrlId() == IDC_FILTER_STRING)
- m_timer = ::SetTimer(m_hwnd, LIST_TIMER, 200, NULL);
+ m_timer = ::SetTimer(m_hwnd, LIST_TIMER, 200, nullptr);
}
void CListDlg::OnDestroy()
@@ -401,7 +401,7 @@ void CListDlg::OnDestroy()
if (m_timer)
::KillTimer(m_hwnd, m_timer);
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "channelList_");
- m_proto->m_listDlg = NULL;
+ m_proto->m_listDlg = nullptr;
}
struct ListViewSortParam
@@ -518,7 +518,7 @@ void CJoinDlg::OnInitDialog()
void CJoinDlg::OnDestroy()
{
CCoolIrcDlg::OnDestroy();
- m_proto->m_joinDlg = NULL;
+ m_proto->m_joinDlg = nullptr;
}
void CJoinDlg::OnOk(CCtrlButton*)
@@ -599,7 +599,7 @@ void CQuickDlg::OnInitDialog()
if (m_proto->m_quickComboSelection != -1) {
m_serverCombo.SetCurSel(m_proto->m_quickComboSelection);
- OnServerCombo(NULL);
+ OnServerCombo(nullptr);
}
else EnableWindow(GetDlgItem(m_hwnd, IDOK), false);
}
@@ -609,7 +609,7 @@ void CQuickDlg::OnDestroy()
CCoolIrcDlg::OnDestroy();
delete m_si;
- m_proto->m_quickDlg = NULL;
+ m_proto->m_quickDlg = nullptr;
}
void CQuickDlg::OnOk(CCtrlButton*)
@@ -705,7 +705,7 @@ CQuestionDlg::CQuestionDlg(CIrcProto *_pro, CManagerDlg *owner)
m_Ok(this, IDOK),
m_owner(owner)
{
- if (owner != NULL)
+ if (owner != nullptr)
m_hwndParent = owner->GetHwnd();
m_Ok.OnClick = Callback(this, &CQuestionDlg::OnOk);
}
@@ -736,7 +736,7 @@ void CQuestionDlg::OnOk(CCtrlButton*)
wchar_t *text = wcsstr(m, L"%question");
wchar_t *p1 = text;
- wchar_t *p2 = NULL;
+ wchar_t *p2 = nullptr;
if (p1) {
p1 += 9;
if (*p1 == '=' && p1[1] == '\"') {
@@ -759,7 +759,7 @@ void CQuestionDlg::OnOk(CCtrlButton*)
CMStringW S('\0', j + 2);
GetDlgItemText(m_hwnd, IDC_HIDDENEDIT, S.GetBuffer(), j + 1);
S.Replace(text, l);
- m_proto->PostIrcMessageWnd(NULL, NULL, S);
+ m_proto->PostIrcMessageWnd(nullptr, NULL, S);
delete[]m;
delete[]l;
@@ -893,7 +893,7 @@ void CManagerDlg::OnInitDialog()
void CManagerDlg::OnClose()
{
if (m_applyModes.Enabled() || m_applyTopic.Enabled()) {
- int i = MessageBox(NULL, TranslateT("You have not applied all changes!\n\nApply before exiting?"), TranslateT("IRC warning"), MB_YESNOCANCEL | MB_ICONWARNING | MB_DEFBUTTON3);
+ int i = MessageBox(nullptr, TranslateT("You have not applied all changes!\n\nApply before exiting?"), TranslateT("IRC warning"), MB_YESNOCANCEL | MB_ICONWARNING | MB_DEFBUTTON3);
if (i == IDCANCEL) {
m_lresult = TRUE;
return;
@@ -901,9 +901,9 @@ void CManagerDlg::OnClose()
if (i == IDYES) {
if (m_applyModes.Enabled())
- OnApplyModes(NULL);
+ OnApplyModes(nullptr);
if (m_applyTopic.Enabled())
- OnApplyTopic(NULL);
+ OnApplyTopic(nullptr);
}
}
@@ -934,7 +934,7 @@ void CManagerDlg::OnClose()
void CManagerDlg::OnDestroy()
{
CCoolIrcDlg::OnDestroy();
- m_proto->m_managerDlg = NULL;
+ m_proto->m_managerDlg = nullptr;
}
void CManagerDlg::OnAdd(CCtrlButton*)
@@ -1054,7 +1054,7 @@ void CManagerDlg::OnRemove(CCtrlButton*)
void CManagerDlg::OnListDblClick(CCtrlListBox*)
{
- OnEdit(NULL);
+ OnEdit(nullptr);
}
void CManagerDlg::OnChangeList(CCtrlListBox*)