summaryrefslogtreecommitdiff
path: root/plugins/NewAwaySysMod/src
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2018-02-24 15:32:06 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2018-02-24 18:20:46 +0100
commit1c0172cca4f1e90679321912e20436a7f42f122d (patch)
tree77a544d2c09332ec176f42ebcf58a40d9c5d2b93 /plugins/NewAwaySysMod/src
parentdff565f40105b20b0e8e4dba1f48ccc9b8e7ff44 (diff)
more nullptr
Diffstat (limited to 'plugins/NewAwaySysMod/src')
-rw-r--r--plugins/NewAwaySysMod/src/AwayOpt.cpp42
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp34
-rw-r--r--plugins/NewAwaySysMod/src/CString.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/CString.h8
-rw-r--r--plugins/NewAwaySysMod/src/Client.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/ContactList.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/ContactList.h4
-rw-r--r--plugins/NewAwaySysMod/src/MsgEventAdded.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/MsgTree.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/Notification.cpp10
-rw-r--r--plugins/NewAwaySysMod/src/Options.cpp22
-rw-r--r--plugins/NewAwaySysMod/src/Options.h92
-rw-r--r--plugins/NewAwaySysMod/src/Properties.cpp40
-rw-r--r--plugins/NewAwaySysMod/src/Properties.h20
-rw-r--r--plugins/NewAwaySysMod/src/ReadAwayMsg.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/Services.cpp14
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp30
-rw-r--r--plugins/NewAwaySysMod/src/TMyArray.h8
-rw-r--r--plugins/NewAwaySysMod/src/stdafx.h6
19 files changed, 177 insertions, 177 deletions
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp
index 3ded4b59c6..0b413d290e 100644
--- a/plugins/NewAwaySysMod/src/AwayOpt.cpp
+++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp
@@ -31,7 +31,7 @@ CIconList g_IconList;
// Set window size and center its controls
void MySetPos(HWND hwndParent)
{
- HWND hWndTab = FindWindowEx(GetParent(hwndParent), NULL, L"SysTabControl32", L"");
+ HWND hWndTab = FindWindowEx(GetParent(hwndParent), nullptr, L"SysTabControl32", L"");
if (!hWndTab) {
_ASSERT(0);
return;
@@ -64,7 +64,7 @@ void MySetPos(HWND hwndParent)
// ================================================ Message options ================================================
-COptPage g_MessagesOptPage(MOD_NAME, NULL);
+COptPage g_MessagesOptPage(MOD_NAME, nullptr);
void EnableMessagesOptDlgControls(CMsgTree* MsgTree)
{
@@ -318,7 +318,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_DESTROY:
delete MsgTree;
MsgTree = nullptr;
- g_MessagesOptPage.SetWnd(NULL);
+ g_MessagesOptPage.SetWnd(nullptr);
break;
}
return 0;
@@ -326,7 +326,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP
// ================================================ Main options ================================================
-COptPage g_MoreOptPage(MOD_NAME, NULL);
+COptPage g_MoreOptPage(MOD_NAME, nullptr);
void EnableMoreOptDlgControls()
{
@@ -337,7 +337,7 @@ void EnableMoreOptDlgControls()
g_MoreOptPage.Enable(IDC_MOREOPTDLG_USEDEFMSG, bEnabled);
g_MoreOptPage.Enable(IDC_MOREOPTDLG_PERSTATUSPERSONAL, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_SAVEPERSONALMSGS) != 0);
g_MoreOptPage.Enable(IDC_MOREOPTDLG_UPDATEMSGSPERIOD, g_MoreOptPage.GetWndValue(IDC_MOREOPTDLG_UPDATEMSGS) != 0);
- InvalidateRect(GetDlgItem(g_MoreOptPage.GetWnd(), IDC_MOREOPTDLG_UPDATEMSGSPERIOD_SPIN), NULL, false); // update spin control
+ InvalidateRect(GetDlgItem(g_MoreOptPage.GetWnd(), IDC_MOREOPTDLG_UPDATEMSGSPERIOD_SPIN), nullptr, false); // update spin control
g_MoreOptPage.MemToPage(true);
}
@@ -438,7 +438,7 @@ static INT_PTR CALLBACK MoreOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
break;
case WM_DESTROY:
- g_MoreOptPage.SetWnd(NULL);
+ g_MoreOptPage.SetWnd(nullptr);
break;
}
return 0;
@@ -446,7 +446,7 @@ static INT_PTR CALLBACK MoreOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
// ================================================ Autoreply options ================================================
-COptPage g_AutoreplyOptPage(MOD_NAME, NULL);
+COptPage g_AutoreplyOptPage(MOD_NAME, nullptr);
void EnableAutoreplyOptDlgControls()
{
@@ -464,7 +464,7 @@ void EnableAutoreplyOptDlgControls()
}
}
g_AutoreplyOptPage.MemToPage(true);
- InvalidateRect(GetDlgItem(g_AutoreplyOptPage.GetWnd(), IDC_REPLYDLG_SENDCOUNT_SPIN), NULL, 0); // update spin control
+ InvalidateRect(GetDlgItem(g_AutoreplyOptPage.GetWnd(), IDC_REPLYDLG_SENDCOUNT_SPIN), nullptr, 0); // update spin control
}
static struct {
@@ -549,7 +549,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
IDC_MOREOPTDLG_EVNTURL, LPGENW("URL"),
IDC_MOREOPTDLG_EVNTFILE, LPGENW("File")
};
- hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP | TTS_NOPREFIX, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
+ hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP | TTS_NOPREFIX, 0, 0, 0, 0, nullptr, nullptr, GetModuleHandleA("mir_app.mir"), nullptr);
TOOLINFO ti = { 0 };
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
@@ -637,7 +637,7 @@ INT_PTR CALLBACK AutoreplyOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
break;
case WM_DESTROY:
- g_AutoreplyOptPage.SetWnd(NULL);
+ g_AutoreplyOptPage.SetWnd(nullptr);
if (s_hDrawFont)
DeleteObject(s_hDrawFont);
@@ -1048,8 +1048,8 @@ int OptsDlgInit(WPARAM wParam, LPARAM)
return 0;
}
-COptPage g_SetAwayMsgPage(MOD_NAME, NULL);
-COptPage g_MsgTreePage(MOD_NAME, NULL);
+COptPage g_SetAwayMsgPage(MOD_NAME, nullptr);
+COptPage g_MsgTreePage(MOD_NAME, nullptr);
void InitOptions()
{
@@ -1057,15 +1057,15 @@ void InitOptions()
g_MessagesOptPage.Items.AddElem(new COptItem_Generic(IDC_MESSAGEDLG_DEL));
g_MessagesOptPage.Items.AddElem(new COptItem_Generic(IDC_MESSAGEDLG_MSGTITLE));
g_MessagesOptPage.Items.AddElem(new COptItem_Generic(IDC_MESSAGEDLG_MSGDATA));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_ONL, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_AWAY, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_NA, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OCC, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_DND, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_FFC, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_INV, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTP, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
- g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTL, NULL, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_ONL, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_AWAY, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_NA, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OCC, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_DND, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_FFC, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_INV, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTP, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
+ g_MessagesOptPage.Items.AddElem(new COptItem_Checkbox(IDC_MESSAGEDLG_DEF_OTL, nullptr, DBVT_BYTE, 0, 0, IDC_MESSAGEDLG_MSGTREE));
TreeItemArray DefMsgTree;
int ParentID1;
int ID = 0;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index eef50f0655..fd339acc69 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -107,16 +107,16 @@ TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto, DWORD UIN, int iSta
{
// hContact is the contact that requests the status message
if (hContact != INVALID_CONTACT_ID)
- VarParseData.Message = CContactSettings(iStatus, hContact).GetMsgFormat(GMF_ANYCURRENT, NULL, szProto);
+ VarParseData.Message = CContactSettings(iStatus, hContact).GetMsgFormat(GMF_ANYCURRENT, nullptr, szProto);
else // contact is unknown
VarParseData.Message = CProtoSettings(szProto, iStatus).GetMsgFormat(iStatus ? GMF_LASTORDEFAULT : GMF_ANYCURRENT);
TCString sTime;
- VarParseData.szProto = szProto ? szProto : ((hContact && hContact != INVALID_CONTACT_ID) ? GetContactProto(hContact) : NULL);
+ VarParseData.szProto = szProto ? szProto : ((hContact && hContact != INVALID_CONTACT_ID) ? GetContactProto(hContact) : nullptr);
VarParseData.UIN = UIN;
VarParseData.Flags = 0;
if (ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
- wchar_t *szResult = variables_parse(VarParseData.Message, 0, hContact);
+ wchar_t *szResult = variables_parse(VarParseData.Message, nullptr, hContact);
if (szResult) {
VarParseData.Message = szResult;
mir_free(szResult);
@@ -155,7 +155,7 @@ int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto)
hContactForSettings = INVALID_CONTACT_ID; // INVALID_HANDLE_VALUE means the contact is not-on-list
if (g_SetAwayMsgPage.GetWnd()) {
- CallAllowedPS_SETAWAYMSG(szProto, iMode, NULL); // we can set status messages to NULL here, as they'll be changed again when the SAM dialog closes.
+ CallAllowedPS_SETAWAYMSG(szProto, iMode, nullptr); // we can set status messages to NULL here, as they'll be changed again when the SAM dialog closes.
return 0;
}
if (CContactSettings(iMode, hContactForSettings).Ignore) {
@@ -345,10 +345,10 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM)
case 0: hIcon = iconList[0].hIcolib; break;
default: iAutoreply = 1; hIcon = iconList[1].hIcolib; break;
}
- Menu_ModifyItem(g_hToggleSOEContactMenuItem, NULL, hIcon, 0);
- Menu_ModifyItem(g_hAutoreplyOnContactMenuItem, NULL, iconList[1].hIcolib, (iAutoreply == 1) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(g_hAutoreplyOffContactMenuItem, NULL, iconList[0].hIcolib, (iAutoreply == 0) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(g_hAutoreplyUseDefaultContactMenuItem, NULL, iconList[5].hIcolib, (iAutoreply == VAL_USEDEFAULT) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hToggleSOEContactMenuItem, nullptr, hIcon, 0);
+ Menu_ModifyItem(g_hAutoreplyOnContactMenuItem, nullptr, iconList[1].hIcolib, (iAutoreply == 1) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hAutoreplyOffContactMenuItem, nullptr, iconList[0].hIcolib, (iAutoreply == 0) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hAutoreplyUseDefaultContactMenuItem, nullptr, iconList[5].hIcolib, (iAutoreply == VAL_USEDEFAULT) ? CMIF_CHECKED : 0);
}
else // hide the Autoreply menu item
Menu_ShowItem(g_hToggleSOEContactMenuItem, false);
@@ -389,7 +389,7 @@ static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM)
INT_PTR ToggleSendOnEvent(WPARAM hContact, LPARAM)
{
// used only for the global setting
- CContactSettings(g_ProtoStates[hContact ? GetContactProto(hContact) : NULL].m_status, hContact).Autoreply.Toggle();
+ CContactSettings(g_ProtoStates[hContact ? GetContactProto(hContact) : nullptr].m_status, hContact).Autoreply.Toggle();
if (hContact == NULL) {
int SendOnEvent = CContactSettings(g_ProtoStates[(LPSTR)NULL].m_status).Autoreply;
@@ -490,7 +490,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam)
Result.ReleaseBuffer();
}
else if (!mir_wstrcmp(ai->targv[0], VAR_AWAYSINCE_DATE)) {
- GetDateFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : NULL, Result.GetBuffer(256), 256);
+ GetDateFormat(LOCALE_USER_DEFAULT, 0, g_ProtoStates[VarParseData.szProto].m_awaySince, (ai->argc > 1 && *ai->targv[1]) ? ai->targv[1] : nullptr, Result.GetBuffer(256), 256);
Result.ReleaseBuffer();
}
else if (!mir_wstrcmp(ai->targv[0], VAR_STATDESC)) {
@@ -498,12 +498,12 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam)
}
else if (!mir_wstrcmp(ai->targv[0], VAR_MYNICK)) {
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_MYNICKPERPROTO) && VarParseData.szProto)
- Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)NULL);
+ Result = db_get_s(NULL, VarParseData.szProto, "Nick", (wchar_t*)nullptr);
- if (Result == NULL)
+ if (Result == nullptr)
Result = pcli->pfnGetContactDisplayName(NULL, 0);
- if (Result == NULL)
+ if (Result == nullptr)
Result = TranslateT("Stranger");
}
else if (!mir_wstrcmp(ai->targv[0], VAR_REQUESTCOUNT)) {
@@ -546,7 +546,7 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam)
break;
}
}
- if (Result == NULL) // if we didn't find a message with specified title
+ if (Result == nullptr) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
else if (!mir_wstrcmp(ai->targv[0], VAR_PROTOCOL)) {
@@ -556,14 +556,14 @@ INT_PTR srvVariablesHandler(WPARAM, LPARAM lParam)
AnsiResult.ReleaseBuffer();
Result = _A2T(AnsiResult);
}
- if (Result == NULL) // if we didn't find a message with specified title
+ if (Result == nullptr) // if we didn't find a message with specified title
return NULL; // return it now, as later we change NULL to ""
}
wchar_t *szResult = (wchar_t*)malloc((Result.GetLen() + 1) * sizeof(wchar_t));
if (!szResult)
return NULL;
- mir_wstrcpy(szResult, (Result != NULL) ? Result : L"");
+ mir_wstrcpy(szResult, (Result != nullptr) ? Result : L"");
return (INT_PTR)szResult;
}
@@ -657,7 +657,7 @@ int MirandaLoaded(WPARAM, LPARAM)
memset(&mi, 0, sizeof(mi));
SET_UID(mi, 0x47a3c631, 0x8ca9, 0x4b7e, 0x84, 0x6e, 0x29, 0xbf, 0x53, 0x30, 0x6f, 0x83);
mi.flags = CMIF_UNICODE;
- mi.hIcolibItem = NULL;
+ mi.hIcolibItem = nullptr;
mi.position = 1000020000;
mi.name.w = LPGENW("Autoreply");
g_hToggleSOEContactMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp
index 727ea9fb41..5a61b36edb 100644
--- a/plugins/NewAwaySysMod/src/CString.cpp
+++ b/plugins/NewAwaySysMod/src/CString.cpp
@@ -38,7 +38,7 @@ void TString<T>::Free()
{
// HeapFree(GetProcessHeap(), 0, pBuf);
free(pBuf);
- pBuf = NULL;
+ pBuf = nullptr;
nBufSize = 0;
nAllocSize = 0;
}
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h
index decedaaac7..22cb0dd4c3 100644
--- a/plugins/NewAwaySysMod/src/CString.h
+++ b/plugins/NewAwaySysMod/src/CString.h
@@ -45,9 +45,9 @@ template <class T>
class TString
{
public:
- TString(): pBuf(NULL), nBufSize(0), nAllocSize(0) {}
- TString(const T *pStr): pBuf(NULL), nBufSize(0), nAllocSize(0) {*this = pStr;}
- TString(const TString<T> &Str): pBuf(NULL), nBufSize(0), nAllocSize(0) {*this = Str.pBuf;}
+ TString(): pBuf(nullptr), nBufSize(0), nAllocSize(0) {}
+ TString(const T *pStr): pBuf(nullptr), nBufSize(0), nAllocSize(0) {*this = pStr;}
+ TString(const TString<T> &Str): pBuf(nullptr), nBufSize(0), nAllocSize(0) {*this = Str.pBuf;}
~TString() {Free();}
int GetLen() const {return (nBufSize) ? (nBufSize - 1) : 0;};
@@ -183,7 +183,7 @@ private:
class UTF8DecodeA
{
public:
- UTF8DecodeA(const char *str) { p = mir_strdup(str); mir_utf8decode(p, NULL); }
+ UTF8DecodeA(const char *str) { p = mir_strdup(str); mir_utf8decode(p, nullptr); }
~UTF8DecodeA() { mir_free(p); }
operator char*() { return p; }
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp
index 92dbffb9c4..a062efb8ac 100644
--- a/plugins/NewAwaySysMod/src/Client.cpp
+++ b/plugins/NewAwaySysMod/src/Client.cpp
@@ -76,7 +76,7 @@ void InitUpdateMsgs()
}
else if (!g_hUpdateMsgsThread && UpdateMsgs) {
g_hTerminateUpdateMsgsThread = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- g_hUpdateMsgsThread = (HANDLE)mir_forkthread(UpdateMsgsThreadProc, NULL);
+ g_hUpdateMsgsThread = (HANDLE)mir_forkthread(UpdateMsgsThreadProc, nullptr);
}
}
@@ -85,7 +85,7 @@ void ChangeProtoMessages(char* szProto, int iMode, const TCString &Msg)
{
TCString CurMsg(Msg);
if (szProto) {
- if (Msg == NULL)
+ if (Msg == nullptr)
CurMsg = GetDynamicStatMsg(INVALID_CONTACT_ID, szProto);
CallAllowedPS_SETAWAYMSG(szProto, iMode, CurMsg);
@@ -98,7 +98,7 @@ void ChangeProtoMessages(char* szProto, int iMode, const TCString &Msg)
for (int i = 0; i < numAccs; i++) {
PROTOACCOUNT *p = accs[i];
if (!db_get_b(NULL, p->szModuleName, "LockMainStatus", 0)) {
- if (Msg == NULL)
+ if (Msg == nullptr)
CurMsg = GetDynamicStatMsg(INVALID_CONTACT_ID, p->szModuleName);
CallAllowedPS_SETAWAYMSG(p->szModuleName, iMode, CurMsg);
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp
index 99a50335fa..464a2881cf 100644
--- a/plugins/NewAwaySysMod/src/ContactList.cpp
+++ b/plugins/NewAwaySysMod/src/ContactList.cpp
@@ -176,7 +176,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
break;
case INTM_INVALIDATE:
- InvalidateRect(hWnd, NULL, true);
+ InvalidateRect(hWnd, nullptr, true);
break;
case WM_RBUTTONDOWN:
@@ -317,7 +317,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
HMENU hMenu = Menu_BuildContactMenu(hContact);
if (hMenu) {
ClientToScreen(hWnd, &pt);
- Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, NULL), MPCF_CONTACTMENU, hContact);
+ Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hWnd, nullptr), MPCF_CONTACTMENU, hContact);
DestroyMenu(hMenu);
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/ContactList.h b/plugins/NewAwaySysMod/src/ContactList.h
index b85df45a01..e6467c282f 100644
--- a/plugins/NewAwaySysMod/src/ContactList.h
+++ b/plugins/NewAwaySysMod/src/ContactList.h
@@ -51,7 +51,7 @@ public:
HTREEITEM AddContact(MCONTACT hContact);
HTREEITEM AddGroup(TCString GroupName);
- HTREEITEM AddInfo(TCString Title, HTREEITEM hParent, HTREEITEM hInsertAfter, LPARAM lParam = NULL, HICON hIcon = NULL);
+ HTREEITEM AddInfo(TCString Title, HTREEITEM hParent, HTREEITEM hInsertAfter, LPARAM lParam = NULL, HICON hIcon = nullptr);
void SetInfoIcon(HTREEITEM hItem, HICON hIcon);
int GetExtraImage(HTREEITEM hItem, int iColumn); // returns iImage, or CLC_EXTRAICON_EMPTY
void SetExtraImage(HTREEITEM hItem, int iColumn, int iImage); // set iImage to CLC_EXTRAICON_EMPTY to reset image
@@ -61,7 +61,7 @@ public:
void SortContacts();
MCONTACT GethContact(HTREEITEM hItem); // returns hContact, hGroup or hInfo
HTREEITEM HitTest(LPPOINT pt, PDWORD hitFlags); // pt is relative to control; returns hItem or NULL
- void EnsureVisible(HTREEITEM hItem) {TreeView_EnsureVisible(hTreeView, hItem); InvalidateRect(hTreeView, NULL, false);} // sometimes horizontal scrollbar position changes too, so we must redraw extra icons - that's why here is InvalidateRect. TODO: try to find a way to invalidate it on _every_ horizontal scrollbar position change, instead of just here - unfortunately the scrollbar doesn't notify the tree control of its position change through WM_HSCROLL in some cases
+ void EnsureVisible(HTREEITEM hItem) {TreeView_EnsureVisible(hTreeView, hItem); InvalidateRect(hTreeView, nullptr, false);} // sometimes horizontal scrollbar position changes too, so we must redraw extra icons - that's why here is InvalidateRect. TODO: try to find a way to invalidate it on _every_ horizontal scrollbar position change, instead of just here - unfortunately the scrollbar doesn't notify the tree control of its position change through WM_HSCROLL in some cases
int SelectItem(HTREEITEM hItem) {return TreeView_SelectItem(hTreeView, hItem);}
void SetItemParam(HTREEITEM hItem, LPARAM lParam) {GetItemData(hItem).lParam = lParam;}
LPARAM GetItemParam(HTREEITEM hItem) {return GetItemData(hItem).lParam;}
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
index 6316a5d50f..0fee8edf25 100644
--- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
+++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
@@ -69,7 +69,7 @@ void __cdecl AutoreplyDelayThread(void *_ad)
dbeo.eventType = EVENTTYPE_MESSAGE;
dbeo.flags = DBEF_SENT | DBEF_UTF;
dbeo.szModule = szProto;
- dbeo.timestamp = time(NULL);
+ dbeo.timestamp = time(nullptr);
dbeo.cbBlob = ReplyLen;
dbeo.pBlob = (PBYTE)(char*)pszReply;
@@ -114,7 +114,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
if (dbei->flags & DBEF_SENT || (dbei->eventType != EVENTTYPE_MESSAGE && dbei->eventType != EVENTTYPE_URL && dbei->eventType != EVENTTYPE_FILE))
return 0;
- if (time(NULL) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
+ if (time(nullptr) - dbei->timestamp > MAX_REPLY_TIMEDIFF) // don't reply to offline messages
return 0;
char *szProto = GetContactProto(hContact);
@@ -222,7 +222,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
db_set_b(hContact, MOD_NAME, DB_SENDCOUNT, db_get_b(hContact, MOD_NAME, DB_SENDCOUNT, 0) + 1);
GetDynamicStatMsg(hContact); // it updates VarParseData.Message needed for %extratext% in the format
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
- if (Reply != NULL && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
+ if (Reply != nullptr && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
wchar_t *szResult = variables_parse(Reply, VarParseData.Message, hContact);
if (szResult != nullptr) {
Reply = szResult;
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp
index 3dc99705b2..647f6bbff4 100644
--- a/plugins/NewAwaySysMod/src/MsgTree.cpp
+++ b/plugins/NewAwaySysMod/src/MsgTree.cpp
@@ -176,7 +176,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
int x = rc.left - iSize - 5;
for (int i = 0; i < _countof(SettingsList); i++) {
if (lpNMCD->nmcd.lItemlParam == (LPARAM)dat->MsgTreePage.GetValue(SettingsList[i].DBSetting)) {
- DrawIconEx(lpNMCD->nmcd.hdc, x, rc.top, Skin_LoadProtoIcon(NULL, SettingsList[i].Status), iSize, iSize, 0, GetSysColorBrush(COLOR_WINDOW), DI_NORMAL);
+ DrawIconEx(lpNMCD->nmcd.hdc, x, rc.top, Skin_LoadProtoIcon(nullptr, SettingsList[i].Status), iSize, iSize, 0, GetSysColorBrush(COLOR_WINDOW), DI_NORMAL);
x -= iSize + 1;
}
}
@@ -506,7 +506,7 @@ bool CMsgTree::SetSelection(int ID, int Flags) // set ID = -1 to unselect; retur
if (Order == -1 && ID != -1)
return false;
- TreeView_SelectItem(hTreeView, (Order == -1) ? NULL : ((Order <= TREECTRL_ROOTORDEROFFS) ? TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : TreeCtrl->m_value[Order].hItem));
+ TreeView_SelectItem(hTreeView, (Order == -1) ? nullptr : ((Order <= TREECTRL_ROOTORDEROFFS) ? TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)].hItem : TreeCtrl->m_value[Order].hItem));
return true;
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp
index 56ee9cf2cd..27445ccb66 100644
--- a/plugins/NewAwaySysMod/src/Notification.cpp
+++ b/plugins/NewAwaySysMod/src/Notification.cpp
@@ -25,7 +25,7 @@ void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeo
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
POPUPDATAT ppd = { 0 };
- ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
+ ppd.lchIcon = LoadIcon(nullptr, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION);
mir_wstrncpy(ppd.lptzContactName, FirstLine, MAX_CONTACTNAME);
mir_wstrncpy(ppd.lptzText, SecondLine, MAX_SECONDLINE);
ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD;
@@ -33,7 +33,7 @@ void ShowMsg(wchar_t *FirstLine, wchar_t *SecondLine, bool IsErrorMsg, int Timeo
ppd.iSeconds = Timeout;
PUAddPopupT(&ppd);
}
- else MessageBox(NULL, SecondLine, FirstLine, MB_OK | (IsErrorMsg ? MB_ICONEXCLAMATION : MB_ICONINFORMATION));
+ else MessageBox(nullptr, SecondLine, FirstLine, MB_OK | (IsErrorMsg ? MB_ICONEXCLAMATION : MB_ICONINFORMATION));
}
@@ -53,12 +53,12 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
static VOID CALLBACK ShowContactMenu(MCONTACT hContact)
{
POINT pt;
- HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", MOD_NAMEW L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL);
+ HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", MOD_NAMEW L"_MenuWindow", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_hInstance, nullptr);
SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG_PTR)MenuWndProc);
HMENU hMenu = Menu_BuildContactMenu(hContact);
GetCursorPos(&pt);
SetForegroundWindow(hMenuWnd);
- Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hMenuWnd, NULL), MPCF_CONTACTMENU, hContact);
+ Clist_MenuProcessCommand(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hMenuWnd, nullptr), MPCF_CONTACTMENU, hContact);
PostMessage(hMenuWnd, WM_NULL, 0, 0);
DestroyMenu(hMenu);
DestroyWindow(hMenuWnd);
@@ -66,7 +66,7 @@ static VOID CALLBACK ShowContactMenu(MCONTACT hContact)
void ShowLog(TCString &LogFilePath)
{
- INT_PTR Result = (INT_PTR)ShellExecute(NULL, L"open", LogFilePath, NULL, NULL, SW_SHOW);
+ INT_PTR Result = (INT_PTR)ShellExecute(nullptr, L"open", LogFilePath, nullptr, nullptr, SW_SHOW);
if (Result <= 32) {
wchar_t szError[64];
mir_snwprintf(szError, TranslateT("Error #%d"), Result);
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp
index 9b4ead3136..f0cac57fb3 100644
--- a/plugins/NewAwaySysMod/src/Options.cpp
+++ b/plugins/NewAwaySysMod/src/Options.cpp
@@ -116,7 +116,7 @@ COptPage& COptPage::operator = (const COptPage& Page)
int COptItem::GetIntDBVal(const CString &sModule, int bSigned, CString*)
{ // default procedure for reading value from DB; used only for integral types
- if (sDBSetting != NULL) {
+ if (sDBSetting != nullptr) {
_ASSERT(nValueSize == DBVT_BYTE || nValueSize == DBVT_WORD || nValueSize == DBVT_DWORD);
DBVARIANT dbv;
if (db_get(NULL, sModule, sDBSetting, &dbv))
@@ -129,7 +129,7 @@ int COptItem::GetIntDBVal(const CString &sModule, int bSigned, CString*)
void COptItem::SetIntDBVal(const CString &sModule, int m_value, CString*)
{ // default procedure for writing value to the DB; used only for integral types
- if (sDBSetting != NULL && !m_bReadOnly) {
+ if (sDBSetting != nullptr && !m_bReadOnly) {
_ASSERT(nValueSize == DBVT_BYTE || nValueSize == DBVT_WORD || nValueSize == DBVT_DWORD);
DBVARIANT dbv;
@@ -141,7 +141,7 @@ void COptItem::SetIntDBVal(const CString &sModule, int m_value, CString*)
TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix)
{
- if (sDBSetting != NULL) {
+ if (sDBSetting != nullptr) {
_ASSERT(GetDefValue());
return db_get_s(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, *(TCString*)GetDefValue());
}
@@ -150,7 +150,7 @@ TCString COptItem::GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix
void COptItem::SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix)
{
- if (sDBSetting != NULL && !m_bReadOnly) {
+ if (sDBSetting != nullptr && !m_bReadOnly) {
db_set_ws(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
}
}
@@ -284,9 +284,9 @@ int TreeReadEnum(const char *szSetting, void *lParam)
pItem.Flags = Flags;
pItem.hItem = nullptr;
pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
- pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
+ pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == nullptr) ? nullptr :
db_get_s(NULL, pData->sModule,
- *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)NULL);
+ *pData->sDBSettingPrefix + pData->TreeCtrl->sDBSetting + pData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (wchar_t*)nullptr);
}
}
return 0;
@@ -306,7 +306,7 @@ void COptItem_TreeCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi
}
else {
for (int i = 0; i < m_value.GetSize(); i++) {
- if (m_value[i].Title == NULL) {
+ if (m_value[i].Title == nullptr) {
m_value.RemoveElem(i);
i--;
}
@@ -334,7 +334,7 @@ void COptItem_TreeCtrl::MemToDB(const CString &sModule, CString *sDBSettingPrefi
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) || TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)
db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, m_value[i].Flags);
- if (User_Str1_DBName != NULL && m_value[i].User_Str1 != NULL)
+ if (User_Str1_DBName != nullptr && m_value[i].User_Str1 != nullptr)
db_set_ws(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, m_value[i].User_Str1);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
@@ -414,7 +414,7 @@ void COptItem_TreeCtrl::MemToWnd(HWND hWnd)
i--;
}
}
- TreeView_SelectItem(hTreeView, (SelectOrder >= 0) ? m_value[SelectOrder].hItem : ((SelectOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(SelectOrder)].hItem : NULL));
+ TreeView_SelectItem(hTreeView, (SelectOrder >= 0) ? m_value[SelectOrder].hItem : ((SelectOrder <= TREECTRL_ROOTORDEROFFS) ? RootItems[ROOT_ORDER_TO_INDEX(SelectOrder)].hItem : nullptr));
SendMessage(hTreeView, WM_SETREDRAW, true, 0);
SCROLLBARINFO sbi;
sbi.cbSize = sizeof(sbi);
@@ -460,7 +460,7 @@ int TreeDeleteEnum(const char *szSetting, void *lParam)
if (!strncmp(szSetting, CurSetting, CurSetting.GetLen()))
TreeDeleteEnumData->TreeSettings.AddElem(szSetting);
- if (TreeDeleteEnumData->TreeCtrl->User_Str1_DBName != NULL) {
+ if (TreeDeleteEnumData->TreeCtrl->User_Str1_DBName != nullptr) {
CurSetting = *TreeDeleteEnumData->sDBSettingPrefix + TreeDeleteEnumData->TreeCtrl->sDBSetting + TreeDeleteEnumData->TreeCtrl->User_Str1_DBName;
if (!strncmp(szSetting, CurSetting, CurSetting.GetLen()))
TreeDeleteEnumData->TreeSettings.AddElem(szSetting);
@@ -668,7 +668,7 @@ void COptItem_ListCtrl::DBToMem(const CString &sModule, CString *sDBSettingPrefi
m_value = m_defValue;
else {
for (int i = 0; i < m_value.GetSize(); i++) {
- if (m_value[i].Text == NULL) {
+ if (m_value[i].Text == nullptr) {
m_value.RemoveElem(i);
i--;
}
diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h
index aac3e9d1c0..2b06244c44 100644
--- a/plugins/NewAwaySysMod/src/Options.h
+++ b/plugins/NewAwaySysMod/src/Options.h
@@ -33,23 +33,23 @@ public:
virtual ~COptItem() {}
- virtual void DBToMem(const CString&, CString* = NULL) { m_bModified = false; }
- virtual void MemToDB(const CString&, CString* = NULL) { m_bModified = false; }
+ virtual void DBToMem(const CString&, CString* = nullptr) { m_bModified = false; }
+ virtual void MemToDB(const CString&, CString* = nullptr) { m_bModified = false; }
virtual void WndToMem(HWND) {}
virtual void MemToWnd(HWND hWnd) { EnableWindow(GetDlgItem(hWnd, m_dlgItemID), m_bEnabled); }
- void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); }
- void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = NULL) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); }
- virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue?
+ void DBToMemToWnd(const CString &sModule, HWND hWnd, CString *sDBSettingPrefix = nullptr) { DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd); }
+ void WndToMemToDB(HWND hWnd, const CString &sModule, CString *sDBSettingPrefix = nullptr) { WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix); }
+ virtual void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr) { db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting); }; // TODO: also set m_value to m_defValue?
virtual void SetValue(INT_PTR) { m_bModified = true; }
virtual void SetDefValue(INT_PTR) {}
virtual INT_PTR GetValue() { return 0; }
virtual INT_PTR GetDefValue() { return 0; }
- INT_PTR GetDBValue(const CString &sModule, CString *sDBSettingPrefix = NULL) { DBToMem(sModule, sDBSettingPrefix); return GetValue(); }
- void SetDBValue(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = NULL) { SetValue(m_value); MemToDB(sModule, sDBSettingPrefix); }
- INT_PTR GetDBValueCopy(const CString &sModule, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->DBToMem(sModule, sDBSettingPrefix); INT_PTR m_value = Item->GetValue(); delete Item; return m_value; } // retrieves DB value, but doesn't affect current page/item state; beware! it doesn't work with string values / other dynamic pointers
- void SetDBValueCopy(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = NULL) { COptItem* Item = Copy(); Item->SetValue(m_value); Item->MemToDB(sModule, sDBSettingPrefix); delete Item; }
+ INT_PTR GetDBValue(const CString &sModule, CString *sDBSettingPrefix = nullptr) { DBToMem(sModule, sDBSettingPrefix); return GetValue(); }
+ void SetDBValue(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = nullptr) { SetValue(m_value); MemToDB(sModule, sDBSettingPrefix); }
+ INT_PTR GetDBValueCopy(const CString &sModule, CString *sDBSettingPrefix = nullptr) { COptItem* Item = Copy(); Item->DBToMem(sModule, sDBSettingPrefix); INT_PTR m_value = Item->GetValue(); delete Item; return m_value; } // retrieves DB value, but doesn't affect current page/item state; beware! it doesn't work with string values / other dynamic pointers
+ void SetDBValueCopy(const CString &sModule, INT_PTR m_value, CString *sDBSettingPrefix = nullptr) { COptItem* Item = Copy(); Item->SetValue(m_value); Item->MemToDB(sModule, sDBSettingPrefix); delete Item; }
INT_PTR GetWndValue(HWND hWnd) { WndToMem(hWnd); return GetValue(); }
void SetWndValue(HWND hWnd, INT_PTR m_value) { SetValue(m_value); MemToWnd(hWnd); }
@@ -62,15 +62,15 @@ public:
int GetID() { return m_dlgItemID; }
// virtual COptItem& operator = (const COptItem& Item) {return *this;};
- virtual COptItem* Copy() { _ASSERT(0); return NULL; } // Attention! Free Copy() result when it's not needed anymore!
+ virtual COptItem* Copy() { _ASSERT(0); return nullptr; } // Attention! Free Copy() result when it's not needed anymore!
CString sDBSetting;
protected:
- int GetIntDBVal(const CString &sModule, int bSigned = false, CString *sDBSettingPrefix = NULL);
- void SetIntDBVal(const CString &sModule, int m_value, CString *sDBSettingPrefix = NULL);
- TCString GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix = NULL);
+ int GetIntDBVal(const CString &sModule, int bSigned = false, CString *sDBSettingPrefix = nullptr);
+ void SetIntDBVal(const CString &sModule, int m_value, CString *sDBSettingPrefix = nullptr);
+ TCString GetStrDBVal(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void SetStrDBVal(const CString &sModule, TCString &Str, CString *sDBSettingPrefix = nullptr);
int m_dlgItemID;
bool m_bEnabled;
@@ -84,7 +84,7 @@ class COptItem_Generic : public COptItem
{
public:
COptItem_Generic() {}
- COptItem_Generic(int m_dlgItemID, int lParam = 0) : COptItem(m_dlgItemID, NULL, 0, lParam) {}
+ COptItem_Generic(int m_dlgItemID, int lParam = 0) : COptItem(m_dlgItemID, nullptr, 0, lParam) {}
virtual COptItem* Copy() { return new COptItem_Generic(*this); }
};
@@ -96,8 +96,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { GetDlgItemText(hWnd, m_dlgItemID, sValue.GetBuffer(nValueSize), nValueSize); sValue.ReleaseBuffer(); COptItem::MemToWnd(hWnd); }
void MemToWnd(HWND hWnd) { SetDlgItemText(hWnd, m_dlgItemID, sValue); COptItem::MemToWnd(hWnd); }
@@ -123,9 +123,9 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), bSigned(bSigned)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
- void WndToMem(HWND hWnd) { m_value = GetDlgItemInt(hWnd, m_dlgItemID, NULL, bSigned); COptItem::WndToMem(hWnd); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void WndToMem(HWND hWnd) { m_value = GetDlgItemInt(hWnd, m_dlgItemID, nullptr, bSigned); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SetDlgItemInt(hWnd, m_dlgItemID, m_value, bSigned); COptItem::MemToWnd(hWnd); }
virtual void SetValue(INT_PTR _Value) { this->m_value = _Value; COptItem::SetValue(_Value); }
@@ -149,8 +149,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
@@ -175,8 +175,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) == m_valueMask) ? BST_CHECKED : BST_UNCHECKED; COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { if ((m_value == BST_CHECKED)) SetIntDBVal(sModule, m_valueMask, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = (GetIntDBVal(sModule, false, sDBSettingPrefix) == m_valueMask) ? BST_CHECKED : BST_UNCHECKED; COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { if ((m_value == BST_CHECKED)) SetIntDBVal(sModule, m_valueMask, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = IsDlgButtonChecked(hWnd, m_dlgItemID); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { CheckDlgButton(hWnd, m_dlgItemID, m_value ? BST_CHECKED : BST_UNCHECKED); COptItem::MemToWnd(hWnd); }
@@ -201,8 +201,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hWnd, m_dlgItemID, CB_GETCURSEL, 0, 0), 0); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, CB_SETCURSEL, m_value, 0); COptItem::MemToWnd(hWnd); }
@@ -226,8 +226,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, CPM_GETCOLOUR, 0, 0); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, CPM_SETCOLOUR, 0, m_value); COptItem::MemToWnd(hWnd); }
@@ -252,8 +252,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, false, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { m_value = SendDlgItemMessage(hWnd, m_dlgItemID, TBM_GETPOS, 0, 0); COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { SendDlgItemMessage(hWnd, m_dlgItemID, TBM_SETPOS, true, m_value); COptItem::MemToWnd(hWnd); }
@@ -277,8 +277,8 @@ public:
: COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), bSigned(bSigned)
{}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { m_value = GetIntDBVal(sModule, bSigned, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetIntDBVal(sModule, m_value, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
@@ -301,8 +301,8 @@ public:
COptItem_BitDBSetting() {}
COptItem_BitDBSetting(int m_dlgItemID, char *szDBSetting, int nValueSize = DBVT_BYTE, int m_defValue = 0, int m_valueMask = 0, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nValueSize, lParam, m_bReadOnly), m_defValue(m_defValue), m_value(0), m_valueMask(m_valueMask) {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
@@ -324,8 +324,8 @@ class COptItem_StrDBSetting : public COptItem
public:
COptItem_StrDBSetting() {}
COptItem_StrDBSetting(int m_dlgItemID, char *szDBSetting, int nMaxLen, wchar_t *szDefValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, nMaxLen, lParam, m_bReadOnly), sDefValue(szDefValue) {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr) { sValue = GetStrDBVal(sModule, sDBSettingPrefix); COptItem::DBToMem(sModule, sDBSettingPrefix); }
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr) { SetStrDBVal(sModule, sValue, sDBSettingPrefix); COptItem::MemToDB(sModule, sDBSettingPrefix); }
void WndToMem(HWND hWnd) { COptItem::WndToMem(hWnd); }
void MemToWnd(HWND hWnd) { COptItem::MemToWnd(hWnd); }
@@ -352,7 +352,7 @@ class CBaseTreeItem
{
public:
CBaseTreeItem();
- CBaseTreeItem(TCString Title, int ID, int Flags) : Title(Title), ID(ID), Flags(Flags), hItem(NULL) {}
+ CBaseTreeItem(TCString Title, int ID, int Flags) : Title(Title), ID(ID), Flags(Flags), hItem(nullptr) {}
TCString Title;
int ID;
@@ -364,7 +364,7 @@ class CTreeItem : public CBaseTreeItem
{
public:
CTreeItem();
- CTreeItem(TCString Title, int ParentID, int ID, int Flags = 0, TCString User_Str1 = NULL) :
+ CTreeItem(TCString Title, int ParentID, int ID, int Flags = 0, TCString User_Str1 = nullptr) :
CBaseTreeItem(Title, ID, Flags & ~TIF_ROOTITEM), ParentID(ParentID), User_Str1(User_Str1)
{
}
@@ -402,7 +402,7 @@ class COptItem_TreeCtrl : public COptItem
{
public:
COptItem_TreeCtrl() {}
- COptItem_TreeCtrl(int m_dlgItemID, char *szDBSetting, TreeItemArray &m_defValue, TreeRootItemArray RootItems, int lParam = 0, CString User_Str1_DBName = NULL, bool m_bReadOnly = false, int TreeFlags = 0) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), RootItems(RootItems), User_Str1_DBName(User_Str1_DBName), TreeFlags(TreeFlags)
+ COptItem_TreeCtrl(int m_dlgItemID, char *szDBSetting, TreeItemArray &m_defValue, TreeRootItemArray RootItems, int lParam = 0, CString User_Str1_DBName = nullptr, bool m_bReadOnly = false, int TreeFlags = 0) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue), RootItems(RootItems), User_Str1_DBName(User_Str1_DBName), TreeFlags(TreeFlags)
{
if (TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) {
_ASSERT(!RootItems.GetSize()); // there can't be any root items when the tree is a plain list
@@ -411,11 +411,11 @@ public:
}
}
~COptItem_TreeCtrl() {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
- void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr);
virtual void SetValue(INT_PTR _Value) { this->m_value = *(TreeItemArray*)_Value; COptItem::SetValue(_Value); }
virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = *(TreeItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
@@ -463,11 +463,11 @@ public:
COptItem_ListCtrl() {}
COptItem_ListCtrl(int m_dlgItemID, char *szDBSetting, ListItemArray &m_defValue, int lParam = 0, bool m_bReadOnly = false) : COptItem(m_dlgItemID, szDBSetting, DBVT_DWORD, lParam, m_bReadOnly), m_defValue(m_defValue) {}
~COptItem_ListCtrl() {}
- void DBToMem(const CString &sModule, CString *sDBSettingPrefix = NULL);
- void MemToDB(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void DBToMem(const CString &sModule, CString *sDBSettingPrefix = nullptr);
+ void MemToDB(const CString &sModule, CString *sDBSettingPrefix = nullptr);
void WndToMem(HWND hWnd);
void MemToWnd(HWND hWnd);
- void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = NULL);
+ void CleanDBSettings(const CString &sModule, CString *sDBSettingPrefix = nullptr);
virtual void SetValue(INT_PTR _Value) { this->m_value = *(ListItemArray*)_Value; COptItem::SetValue(_Value); }
virtual void SetDefValue(INT_PTR _DefValue) { this->m_defValue = *(ListItemArray*)_DefValue; COptItem::SetDefValue(_DefValue); }
@@ -490,7 +490,7 @@ public:
class COptPage
{
public:
- COptPage() : hWnd(NULL), sDBSettingPrefix("") {}
+ COptPage() : hWnd(nullptr), sDBSettingPrefix("") {}
COptPage(char *szModule, HWND hWnd, CString sDBSettingPrefix = "") : sModule(szModule), hWnd(hWnd), sDBSettingPrefix(sDBSettingPrefix) {}
COptPage(const COptPage &Item);
~COptPage();
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp
index a48da5b3ee..7fc0fa32a5 100644
--- a/plugins/NewAwaySysMod/src/Properties.cpp
+++ b/plugins/NewAwaySysMod/src/Properties.cpp
@@ -40,7 +40,7 @@ void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPerson
if (!szProto || ((szCurProto = GetContactProto(hContact)) && !mir_strcmp(szProto, szCurProto))) {
ResetContactSettingsOnStatusChange(hContact);
if (bResetPersonalMsgs) {
- CContactSettings(Status, hContact).SetMsgFormat(SMF_PERSONAL, NULL); // TODO: delete only when SAM dialog opens?
+ CContactSettings(Status, hContact).SetMsgFormat(SMF_PERSONAL, nullptr); // TODO: delete only when SAM dialog opens?
}
}
hContact = db_find_next(hContact);
@@ -83,7 +83,7 @@ CProtoState::CStatus& CProtoState::CStatus::operator = (int Status)
bModified = true;
}
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_RESETPROTOMSGS))
- CProtoSettings(State.m_szProto, Status).SetMsgFormat(SMF_PERSONAL, NULL);
+ CProtoSettings(State.m_szProto, Status).SetMsgFormat(SMF_PERSONAL, nullptr);
}
}
if (bStatusModified)
@@ -107,12 +107,12 @@ void CProtoState::CAwaySince::Reset()
void CContactSettings::SetMsgFormat(int Flags, TCString Message)
{
if (Flags & SMF_PERSONAL) { // set a personal message for a contact. also it's used to set global status message (hContact = NULL).
- // if Message == NULL, then the function deletes the message.
+ // if Message == nullptr, then the function deletes the message.
CString DBSetting(StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL));
if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_RESETCOUNTERWHENSAMEICON) && GetMsgFormat(SMF_PERSONAL) != (const wchar_t*)Message)
ResetContactSettingsOnStatusChange(m_hContact);
- if (Message != NULL)
+ if (Message != nullptr)
db_set_ws(m_hContact, MOD_NAME, DBSetting, Message);
else
db_unset(m_hContact, MOD_NAME, DBSetting);
@@ -130,7 +130,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve
// szProtoOverride is needed only to get status message of the right protocol when the ICQ contact is on list, but not with the same
// protocol on which it requests the message - this way we can still get contact details.
{
- TCString Message = NULL;
+ TCString Message = nullptr;
if (pOrder)
*pOrder = -1;
@@ -138,7 +138,7 @@ TCString CContactSettings::GetMsgFormat(int Flags, int *pOrder, char *szProtoOve
Message = db_get_s(m_hContact, MOD_NAME, StatusToDBSetting(Status, DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPERSONAL), (wchar_t*)NULL);
if (Flags & (GMF_LASTORDEFAULT | GMF_PROTOORGLOBAL | GMF_TEMPORARY) && Message.IsEmpty()) {
- char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : NULL);
+ char *szProto = szProtoOverride ? szProtoOverride : (m_hContact ? GetContactProto(m_hContact) : nullptr);
// we mustn't pass here by GMF_TEMPORARY flag, as otherwise we'll handle GMF_TEMPORARY | GMF_PERSONAL combination incorrectly,
// which is supposed to get only per-contact messages, and at the same time also may be used with NULL contact to get the global status message
@@ -159,18 +159,18 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message)
if (Flags & SMF_TEMPORARY) {
_ASSERT(!Status || Status == g_ProtoStates[szProto].m_status);
- g_ProtoStates[szProto].TempMsg = (szProto || Message != NULL) ? Message : CProtoSettings(NULL, Status).GetMsgFormat(GMF_LASTORDEFAULT);
+ g_ProtoStates[szProto].TempMsg = (szProto || Message != nullptr) ? Message : CProtoSettings(nullptr, Status).GetMsgFormat(GMF_LASTORDEFAULT);
}
if (Flags & SMF_PERSONAL) { // set a "personal" message for a protocol. also it's used to set global status message (hContact = NULL).
// if Message == NULL, then we'll use the "default" message - i.e. it's either the global message for szProto != NULL (we delete the per-proto DB setting), or it's just a default message for a given status for szProto == NULL.
g_ProtoStates[szProto].TempMsg.Unset();
CString DBSetting(ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS));
- if (Message != NULL)
+ if (Message != nullptr)
db_set_ws(NULL, MOD_NAME, DBSetting, Message);
else {
if (!szProto)
- db_set_ws(NULL, MOD_NAME, DBSetting, CProtoSettings(NULL, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
+ db_set_ws(NULL, MOD_NAME, DBSetting, CProtoSettings(nullptr, Status).GetMsgFormat(GMF_LASTORDEFAULT)); // global message can't be NULL; we can use an empty string instead if it's really necessary
else
db_unset(NULL, MOD_NAME, DBSetting);
}
@@ -254,7 +254,7 @@ void CProtoSettings::SetMsgFormat(int Flags, TCString Message)
// returns the requested message; sets Order to the order of the message in the message tree, if available; or to -1 otherwise.
TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
{
- TCString Message = NULL;
+ TCString Message = nullptr;
if (pOrder)
*pOrder = -1;
@@ -265,23 +265,23 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
Flags &= ~GMF_PERSONAL; // don't allow personal message to overwrite our NULL temporary message
}
}
- if (Flags & GMF_PERSONAL && Message == NULL) // try getting personal message (it overrides global)
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL);
+ if (Flags & GMF_PERSONAL && Message == nullptr) // try getting personal message (it overrides global)
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr);
- if (Flags & GMF_PROTOORGLOBAL && Message == NULL) {
+ if (Flags & GMF_PROTOORGLOBAL && Message == nullptr) {
Message = CProtoSettings().GetMsgFormat(GMF_PERSONAL | (Flags & GMF_TEMPORARY), pOrder);
- return (Message == NULL) ? L"" : Message; // global message can't be NULL
+ return (Message == nullptr) ? L"" : Message; // global message can't be NULL
}
- if (Flags & GMF_LASTORDEFAULT && Message == NULL) { // try to get the last or default message, depending on current settings
+ if (Flags & GMF_LASTORDEFAULT && Message == nullptr) { // try to get the last or default message, depending on current settings
COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
TreeCtrl->DBToMem(CString(MOD_NAME));
- Message = NULL;
+ Message = nullptr;
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USELASTMSG)) { // if using last message by default...
- Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)NULL); // try per-protocol message first
+ Message = db_get_s(NULL, MOD_NAME, ProtoStatusToDBSetting(DB_STATUSMSG, IDC_MOREOPTDLG_PERSTATUSPROTOMSGS), (wchar_t*)nullptr); // try per-protocol message first
if (Message.IsEmpty()) {
- Message = NULL; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
+ Message = nullptr; // to be sure it's NULL, not "" - as we're checking 'Message == NULL' later
int RecentGroupID = GetRecentGroupID(Status);
if (RecentGroupID != -1) {
for (int i = 0; i < TreeCtrl->m_value.GetSize(); i++) { // find first message in the group
@@ -296,7 +296,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
}
} // else, if using default message by default...
- if (Message == NULL) { // ...or we didn't succeed retrieving the last message
+ if (Message == nullptr) { // ...or we didn't succeed retrieving the last message
// get default message for this status
int DefMsgID = -1;
static struct {
@@ -330,7 +330,7 @@ TCString CProtoSettings::GetMsgFormat(int Flags, int *pOrder)
if (pOrder)
*pOrder = Order;
}
- if (Message == NULL)
+ if (Message == nullptr)
Message = L""; // last or default message can't be NULL.. otherwise ICQ won't reply to status message requests and won't notify us of status message requests at all
}
return Message;
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h
index e31053ef42..64180a6405 100644
--- a/plugins/NewAwaySysMod/src/Properties.h
+++ b/plugins/NewAwaySysMod/src/Properties.h
@@ -33,7 +33,7 @@
class _CWndUserData
{
public:
- _CWndUserData(): MsgTree(NULL), CList(NULL) {}
+ _CWndUserData(): MsgTree(nullptr), CList(nullptr) {}
CMsgTree *MsgTree;
CCList *CList;
@@ -129,7 +129,7 @@ public:
if (Icons[i] & IL_SKINICON)
IconList.SetAtGrow(i) = (HICON)CopyImage(Skin_LoadIcon(Icons[i] & ~IL_SKINICON), IMAGE_ICON, cxIcon, cyIcon, LR_COPYFROMRESOURCE);
else if (Icons[i] & IL_PROTOICON)
- IconList.SetAtGrow(i) = (HICON)CopyImage(Skin_LoadProtoIcon(NULL, Icons[i] & ~IL_PROTOICON), IMAGE_ICON, cxIcon, cyIcon, LR_COPYFROMRESOURCE);
+ IconList.SetAtGrow(i) = (HICON)CopyImage(Skin_LoadProtoIcon(nullptr, Icons[i] & ~IL_PROTOICON), IMAGE_ICON, cxIcon, cyIcon, LR_COPYFROMRESOURCE);
else
IconList.SetAtGrow(i) = (HICON)GetIcon(Icons[i]);
}
@@ -178,7 +178,7 @@ public:
class CCurStatusMsg
{
public:
- CCurStatusMsg() {*this = NULL;}
+ CCurStatusMsg() {*this = nullptr;}
CCurStatusMsg& operator = (TCString Msg)
{
CurStatusMsg = Msg;
@@ -306,7 +306,7 @@ class CProtoSettings
LPCSTR szProto;
public:
- CProtoSettings(LPCSTR szProto = NULL, int iStatus = 0) :
+ CProtoSettings(LPCSTR szProto = nullptr, int iStatus = 0) :
szProto(szProto),
Status(iStatus, szProto)
{
@@ -349,7 +349,7 @@ public:
{
_ASSERT(Parent->szProto);
int m_value = *this;
- return (m_value == VAL_USEDEFAULT) ? CProtoSettings(NULL).Autoreply : m_value;
+ return (m_value == VAL_USEDEFAULT) ? CProtoSettings(nullptr).Autoreply : m_value;
}
friend class CProtoSettings;
private:
@@ -359,7 +359,7 @@ public:
class CStatus
{
public:
- CStatus(int iStatus = 0, const char *szProto = NULL): Status(iStatus), szProto(szProto) {}
+ CStatus(int iStatus = 0, const char *szProto = nullptr): Status(iStatus), szProto(szProto) {}
CStatus& operator = (int _Status) {this->Status = _Status; return *this;}
operator int()
{
@@ -373,7 +373,7 @@ public:
} Status;
void SetMsgFormat(int Flags, TCString Message);
- TCString GetMsgFormat(int Flags, int *pOrder = NULL);
+ TCString GetMsgFormat(int Flags, int *pOrder = nullptr);
};
@@ -458,7 +458,7 @@ public:
return *this;
}
operator int() {return db_get_b((Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL, MOD_NAME, Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS), Parent->m_hContact ? VAL_USEDEFAULT : AUTOREPLY_DEF_REPLY);}
- int IncludingParents(const char *szProtoOverride = NULL) // takes into account protocol and global data also, if per-contact setting is not defined
+ int IncludingParents(const char *szProtoOverride = nullptr) // takes into account protocol and global data also, if per-contact setting is not defined
{
_ASSERT((Parent->m_hContact && Parent->m_hContact != INVALID_CONTACT_ID) || szProtoOverride); // we need either correct protocol or a correct hContact to determine its protocol
int m_value = *this;
@@ -491,7 +491,7 @@ public:
{
if (!Status) {
_ASSERT(m_hContact != INVALID_CONTACT_ID);
- char *szProto = m_hContact ? GetContactProto(m_hContact) : NULL;
+ char *szProto = m_hContact ? GetContactProto(m_hContact) : nullptr;
Status = (szProto || !m_hContact) ? g_ProtoStates[szProto].m_status : ID_STATUS_AWAY;
}
return Status;
@@ -504,5 +504,5 @@ public:
} Status;
void SetMsgFormat(int Flags, TCString Message);
- TCString GetMsgFormat(int Flags, int *pOrder = NULL, char *szProtoOverride = NULL);
+ TCString GetMsgFormat(int Flags, int *pOrder = nullptr, char *szProtoOverride = nullptr);
};
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
index 75c0c05758..dbe67a24b5 100644
--- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
@@ -30,7 +30,7 @@ struct READAWAYMSGDATA
#define RAMDLGSIZESETTING "ReadAwayMsgDlg"
-MWindowList g_hReadWndList = NULL;
+MWindowList g_hReadWndList = nullptr;
static int ReadAwayMsgDlgResize(HWND, LPARAM, UTILRESIZECONTROL *urc)
{
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp
index 9f5ea5db36..c807905c73 100644
--- a/plugins/NewAwaySysMod/src/Services.cpp
+++ b/plugins/NewAwaySysMod/src/Services.cpp
@@ -53,7 +53,7 @@ __inline void PSSetStatus(char *szProto, WORD Status, int bNoClistSetStatusMode
INT_PTR GetStatusMsgW(WPARAM wParam, LPARAM)
{
LogMessage("MS_AWAYMSG_GETSTATUSMSGW called. status=%d", wParam);
- WCHAR *szMsg = mir_wstrdup(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
+ WCHAR *szMsg = mir_wstrdup(GetDynamicStatMsg(INVALID_CONTACT_ID, nullptr, 0, wParam));
LogMessage("returned szMsgW:\n%S", szMsg ? szMsg : L"NULL");
return (INT_PTR)szMsg;
}
@@ -66,10 +66,10 @@ INT_PTR SetStatusMode(WPARAM wParam, LPARAM lParam) // called by GamerStatus and
g_fNoProcessing = true;
Clist_SetStatusMode(wParam);
- _ASSERT(!g_fNoProcessing && g_ProtoStates[(char*)NULL].m_status == wParam);
+ _ASSERT(!g_fNoProcessing && g_ProtoStates[(char*)nullptr].m_status == wParam);
g_fNoProcessing = false;
- CProtoSettings(NULL, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (wchar_t*)_A2T((char*)lParam) : CProtoSettings(NULL, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
- ChangeProtoMessages(NULL, wParam, TCString());
+ CProtoSettings(nullptr, wParam).SetMsgFormat(SMF_TEMPORARY, lParam ? (wchar_t*)_A2T((char*)lParam) : CProtoSettings(nullptr, wParam).GetMsgFormat(GMF_LASTORDEFAULT));
+ ChangeProtoMessages(nullptr, wParam, TCString());
return 0;
}
@@ -88,18 +88,18 @@ int GetState(WPARAM wParam, LPARAM lParam, int Widechar)
LogMessage("%d (received): cbSize=%d, status=%d, szProto=%s, Flags=0x%x", i + 1, pi->cbSize, pi->status, pi->szProto ? pi->szProto : "NULL", Flags);
if ((pi->status >= ID_STATUS_ONLINE && pi->status <= ID_STATUS_OUTTOLUNCH) || !pi->status) {
TCString Msg(pi->status ? CProtoSettings(pi->szProto, pi->status).GetMsgFormat(GMF_LASTORDEFAULT) : CProtoSettings(pi->szProto).GetMsgFormat(((Flags & PIF_NOTTEMPORARY) ? 0 : GMF_TEMPORARY) | GMF_PERSONAL));
- if (Msg != NULL) {
+ if (Msg != nullptr) {
if (Widechar)
pi->tszMsg = mir_wstrdup(Msg);
else
pi->szMsg = mir_strdup(_T2A(Msg));
}
- else pi->szMsg = NULL;
+ else pi->szMsg = nullptr;
if (!pi->status)
pi->status = g_ProtoStates[pi->szProto].m_status;
}
- else pi->szMsg = NULL;
+ else pi->szMsg = nullptr;
LogMessage("%d (returned): status=%d, Flags=0x%x, szMsg:\n%s", i + 1, pi->status, (pi->cbSize > sizeof(NAS_PROTOINFOv1)) ? pi->Flags : 0, pi->szMsg ? (Widechar ? _T2A(pi->wszMsg) : pi->szMsg) : "NULL");
*(char**)&pi += pi->cbSize;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index 56aedf56e1..26fb5a2db7 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -259,7 +259,7 @@ void SetExtraIcon(CCList *CList, int nColumn, HTREEITEM hItem, int nIcon)
}
}
if (nColumn == EXTRACOLUMN_IGNORE && nIcon != EXTRAIMGLIST_IGNORE)
- nIcon = (CContactSettings(0, hContact).GetMsgFormat(GMF_PERSONAL) == NULL) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
+ nIcon = (CContactSettings(0, hContact).GetMsgFormat(GMF_PERSONAL) == nullptr) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
}
else if (ItemType == MCLCIT_INFO) {
char *szProto = (char*)CList->GetItemParam(hItem);
@@ -272,7 +272,7 @@ void SetExtraIcon(CCList *CList, int nColumn, HTREEITEM hItem, int nIcon)
if (!szProto && nIcon == EXTRAIMGLIST_DOT)
nIcon = EXTRAIMGLIST_AUTOREPLY_OFF;
}
- else nIcon = (CProtoSettings(szProto).GetMsgFormat(GMF_TEMPORARY | GMF_PERSONAL) == NULL) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
+ else nIcon = (CProtoSettings(szProto).GetMsgFormat(GMF_TEMPORARY | GMF_PERSONAL) == nullptr) ? EXTRAIMGLIST_DOT : EXTRAIMGLIST_MSG;
}
int Ignore = (nColumn == EXTRACOLUMN_IGNORE) ? (nIcon == EXTRAIMGLIST_IGNORE) : ((ItemType == MCLCIT_CONTACT) ? CContactSettings(0, hContact).Ignore : ((ItemType == MCLCIT_GROUP) ? CList->GetExtraImage(hItem, EXTRACOLUMN_IGNORE) : false));
@@ -369,7 +369,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY
GetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, Message.GetBuffer(AWAY_MSGDATA_MAX), AWAY_MSGDATA_MAX);
Message.ReleaseBuffer();
if (!mir_wstrlen(Message))
- Message = NULL; // delete personal message if it's empty
+ Message = nullptr; // delete personal message if it's empty
if (CList) {
if (!Selection)
@@ -384,7 +384,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY
}
else if (ItemType == MCLCIT_INFO) {
char *szProto = (char*)CList->GetItemParam(hItem);
- CProtoSettings(szProto).SetMsgFormat(SMF_PERSONAL, (szProto || Message != NULL) ? Message : L""); // "szProto || Message != NULL..." means that we'll set an empty message instead of NULL for the global status, if the message is empty (NULL for the global status has a special meaning - SetMsgFormat will set the default message instead of NULL)
+ CProtoSettings(szProto).SetMsgFormat(SMF_PERSONAL, (szProto || Message != nullptr) ? Message : L""); // "szProto || Message != NULL..." means that we'll set an empty message instead of NULL for the global status, if the message is empty (NULL for the global status has a special meaning - SetMsgFormat will set the default message instead of NULL)
}
else continue;
@@ -395,7 +395,7 @@ void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY
if (dat->hInitContact)
CContactSettings(0, dat->hInitContact).SetMsgFormat(SMF_PERSONAL, Message);
else
- CProtoSettings(dat->szProtocol).SetMsgFormat(SMF_PERSONAL, (dat->szProtocol || Message != NULL) ? Message : L"");
+ CProtoSettings(dat->szProtocol).SetMsgFormat(SMF_PERSONAL, (dat->szProtocol || Message != nullptr) ? Message : L"");
}
SendDlgItemMessage(hwndDlg, IDC_SAWAYMSG_MSGDATA, EM_SETMODIFY, false, 0);
SetDlgItemText(hwndDlg, IDC_OK, TranslateT("OK"));
@@ -579,7 +579,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (Order >= 0) // so just select an appropriate message tree item; MSGDATA text is filled automatically through SELCHANGED notification
MsgTree->SetSelection(Order, MTSS_BYORDER);
- if (dat->Message != NULL) { // this allows to override the default message
+ if (dat->Message != nullptr) { // this allows to override the default message
SetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, dat->Message);
SendDlgItemMessage(hwndDlg, IDC_SAWAYMSG_MSGDATA, EM_SETMODIFY, true, 0);
}
@@ -603,7 +603,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
// init tooltips
TOOLINFO ti = { 0 };
- hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
+ hWndTooltips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, L"", WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, GetModuleHandleA("mir_app.mir"), nullptr);
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
for (int i = 0; i < _countof(Tooltips); i++) {
@@ -707,7 +707,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
for (int i = 0; i < pnm->NewSelection->GetSize(); i++) {
HTREEITEM hItem = (*pnm->NewSelection)[i];
MCONTACT hContact = 0;
- char *szProto = NULL;
+ char *szProto = nullptr;
int ItemType = CList->GetItemType(hItem);
if (ItemType == MCLCIT_CONTACT) {
hContact = CList->GethContact(hItem);
@@ -722,10 +722,10 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
int CurStatus = g_ProtoStates[szProto].m_status;
if (!MessageDetermined) {
TCString CurMessage((ItemType == MCLCIT_CONTACT) ? CContactSettings(0, hContact).GetMsgFormat(GMF_PERSONAL) : CProtoSettings(szProto).GetMsgFormat(GMF_TEMPORARY | GMF_PERSONAL));
- if (CurMessage == NULL)
+ if (CurMessage == nullptr)
CurMessage = L"";
- if (Message == NULL)
+ if (Message == nullptr)
Message = CurMessage;
else if (CurMessage != (const wchar_t*)Message) {
Message = L"";
@@ -750,7 +750,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
}
if (!bLeaveOldMessage)
- SetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, (Message == NULL) ? L"" : Message);
+ SetDlgItemText(hwndDlg, IDC_SAWAYMSG_MSGDATA, (Message == nullptr) ? L"" : Message);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
TCString WindowTitle(TranslateT("Set message for"));
@@ -863,7 +863,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
CList->SetExtraImageList(hil);
HTREEITEM hSelItem;
- HTREEITEM hItem = hSelItem = CList->AddInfo(TranslateT("** All contacts **"), CLC_ROOT, CLC_ROOT, NULL, Skin_LoadProtoIcon(NULL, g_ProtoStates[(char*)NULL].m_status));
+ HTREEITEM hItem = hSelItem = CList->AddInfo(TranslateT("** All contacts **"), CLC_ROOT, CLC_ROOT, NULL, Skin_LoadProtoIcon(nullptr, g_ProtoStates[(char*)nullptr].m_status));
int numAccs;
PROTOACCOUNT **accs;
Proto_EnumAccounts(&numAccs, &accs);
@@ -927,13 +927,13 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
PROTOACCOUNT *p = accs[i];
if (CallProtoService(p->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) {
TCString Message(CProtoSettings(p->szModuleName).GetMsgFormat(GMF_PERSONAL)); // yes, we don't specify GMF_TEMPORARY here, because we don't need to save it
- if (Message != NULL)
+ if (Message != nullptr)
CProtoSettings(p->szModuleName).SetMsgFormat(SMF_LAST, Message); // if the user set a message for this protocol, save it to the recent messages
- ChangeProtoMessages(p->szModuleName, g_ProtoStates[p->szModuleName].m_status, TCString(NULL)); // and actual setting of a status message for the protocol
+ ChangeProtoMessages(p->szModuleName, g_ProtoStates[p->szModuleName].m_status, TCString(nullptr)); // and actual setting of a status message for the protocol
}
}
TCString Message(CProtoSettings().GetMsgFormat(GMF_PERSONAL));
- if (Message != NULL)
+ if (Message != nullptr)
CProtoSettings().SetMsgFormat(SMF_LAST, Message); // save the global message to the recent messages
if (g_SetAwayMsgPage.GetValue(IDS_SAWAYMSG_AUTOSAVEDLGSETTINGS))
diff --git a/plugins/NewAwaySysMod/src/TMyArray.h b/plugins/NewAwaySysMod/src/TMyArray.h
index 68ca908fe1..45eeaf1563 100644
--- a/plugins/NewAwaySysMod/src/TMyArray.h
+++ b/plugins/NewAwaySysMod/src/TMyArray.h
@@ -41,7 +41,7 @@ public:
void MoveElem(int nIndex, int nMoveTo);
T& SetAtGrow(int nIndex);
int Find(ARG_T pElem); // returns an index of the specified item, or -1 if the array doesn't contain the item
- int BinarySearch(int (*CmpFunc)(ARG_T pItem, LPARAM lParam), LPARAM lParam, int *pIndex = NULL); // returns an index of the specified item, or -1 if the array doesn't contain the item;
+ int BinarySearch(int (*CmpFunc)(ARG_T pItem, LPARAM lParam), LPARAM lParam, int *pIndex = nullptr); // returns an index of the specified item, or -1 if the array doesn't contain the item;
// also it's possible to specify pIndex so that even if the array doesn't contain the item, the function will set *pIndex to a position where the item can be inserted;
// CmpFunc must return -1, 0 and 1 depending whether pItem is lesser, equal or greater than needed;
// BinarySearch() requires the array to be sorted in an ascending order
@@ -65,7 +65,7 @@ TMyArray<T, ARG_T, GrowBy, FreeThreshold>::TMyArray()
{
nElemNum = 0;
nAllocNum = 0;
- pData = NULL;
+ pData = nullptr;
}
template <class T, class ARG_T, int GrowBy, int FreeThreshold>
@@ -73,7 +73,7 @@ TMyArray<T, ARG_T, GrowBy, FreeThreshold>::TMyArray(const TMyArray<T, ARG_T, Gro
{
nElemNum = 0;
nAllocNum = 0;
- pData = NULL;
+ pData = nullptr;
*this = A;
}
@@ -99,7 +99,7 @@ template <class T, class ARG_T, int GrowBy, int FreeThreshold>
__forceinline int TMyArray<T, ARG_T, GrowBy, FreeThreshold>::SetAllocNum(int nNewAllocNum)
{
_ASSERT(nNewAllocNum >= nElemNum);
- T*pNewData = (nNewAllocNum) ? (T*)malloc(sizeof(T) * nNewAllocNum) : NULL;
+ T*pNewData = (nNewAllocNum) ? (T*)malloc(sizeof(T) * nNewAllocNum) : nullptr;
if (pData)
{
if (pNewData)
diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h
index b64cb3a13f..8596cf2377 100644
--- a/plugins/NewAwaySysMod/src/stdafx.h
+++ b/plugins/NewAwaySysMod/src/stdafx.h
@@ -277,7 +277,7 @@ extern bool g_fNoProcessing;
extern int g_bIsIdle;
// AwaySys.cpp
-TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = NULL, DWORD UIN = 0, int iStatus = 0);
+TCString GetDynamicStatMsg(MCONTACT hContact, char *szProto = nullptr, DWORD UIN = 0, int iStatus = 0);
int IsAnICQProto(char *szProto);
// Client.cpp
@@ -319,7 +319,7 @@ static __inline int LogMessage(const char *Format, ...)
va_start(va, Format);
mir_vsnprintf(szText + (_countof(LOG_PREFIX) - 1), sizeof(szText) - (_countof(LOG_PREFIX) - 1), Format, va);
va_end(va);
- return Netlib_Log(NULL, szText);
+ return Netlib_Log(nullptr, szText);
}
__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const wchar_t *szMsg)
@@ -328,7 +328,7 @@ __inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const wcha
return CallProtoService(szProto, PS_SETAWAYMSG, iMode, (LPARAM)szMsg);
}
-static __inline int my_variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags = 0, char *szSubjectDesc = NULL, char *szExtraDesc = NULL)
+static __inline int my_variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags = 0, char *szSubjectDesc = nullptr, char *szExtraDesc = NULL)
{
if (ServiceExists(MS_VARS_SHOWHELPEX)) {
return variables_showhelp(hwndDlg, uIDEdit, flags, szSubjectDesc,szExtraDesc);