summaryrefslogtreecommitdiff
path: root/plugins/StopSpamPlus/src
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/StopSpamPlus/src
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/StopSpamPlus/src')
-rw-r--r--plugins/StopSpamPlus/src/events.cpp2
-rw-r--r--plugins/StopSpamPlus/src/opt_proto.cpp4
-rw-r--r--plugins/StopSpamPlus/src/options.cpp4
-rw-r--r--plugins/StopSpamPlus/src/services.cpp10
4 files changed, 10 insertions, 10 deletions
diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp
index a926efd551..2810d8d68d 100644
--- a/plugins/StopSpamPlus/src/events.cpp
+++ b/plugins/StopSpamPlus/src/events.cpp
@@ -50,7 +50,7 @@ int OnDbEventFilterAdd(WPARAM w, LPARAM l)
{
MCONTACT hContact = (MCONTACT)w;
DBEVENTINFO *dbei = (DBEVENTINFO*)l;
- if (dbei == NULL) //fix potential DEP crash
+ if (dbei == nullptr) //fix potential DEP crash
return 0;
// if event is in protocol that is not despammed
diff --git a/plugins/StopSpamPlus/src/opt_proto.cpp b/plugins/StopSpamPlus/src/opt_proto.cpp
index ab4e3c7df0..90592d4047 100644
--- a/plugins/StopSpamPlus/src/opt_proto.cpp
+++ b/plugins/StopSpamPlus/src/opt_proto.cpp
@@ -16,7 +16,7 @@ int FillTree(HWND hwnd)
ProtocolData *PD;
TVINSERTSTRUCT tvis;
- tvis.hParent = NULL;
+ tvis.hParent = nullptr;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
@@ -79,7 +79,7 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam)
tvi.hItem = TreeView_GetRoot(hwndProto);
tvi.mask = TVIF_PARAM | TVIF_HANDLE;
- while (tvi.hItem != NULL) {
+ while (tvi.hItem != nullptr) {
TreeView_GetItem(hwndProto, &tvi);
if (tvi.lParam != 0) {
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp
index 3feb724e8f..2fcf6eeb47 100644
--- a/plugins/StopSpamPlus/src/options.cpp
+++ b/plugins/StopSpamPlus/src/options.cpp
@@ -47,7 +47,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case PSN_APPLY:
{
- plSets->MaxQuestCount = GetDlgItemInt(hwnd, ID_MAXQUESTCOUNT, NULL, FALSE);
+ plSets->MaxQuestCount = GetDlgItemInt(hwnd, ID_MAXQUESTCOUNT, nullptr, FALSE);
plSets->InfTalkProtection = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_INFTALKPROT));
plSets->AddPermanent = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_ADDPERMANENT));
plSets->HandleAuthReq = (BST_CHECKED == IsDlgButtonChecked(hwnd, ID_HANDLEAUTHREQ));
@@ -103,7 +103,7 @@ INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
return TRUE;
case IDC_VARS:
- variables_showhelp(hwnd, msg, VHF_FULLDLG | VHF_SETLASTSUBJECT, NULL, NULL);
+ variables_showhelp(hwnd, msg, VHF_FULLDLG | VHF_SETLASTSUBJECT, nullptr, nullptr);
return TRUE;
}
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp
index 31863978a3..7cc8fec1a5 100644
--- a/plugins/StopSpamPlus/src/services.cpp
+++ b/plugins/StopSpamPlus/src/services.cpp
@@ -3,7 +3,7 @@
INT_PTR IsContactPassed(WPARAM hContact, LPARAM /*lParam*/)
{
char *szProto = GetContactProto(hContact);
- if (szProto == NULL)
+ if (szProto == nullptr)
return CS_PASSED;
if (!plSets->ProtoDisabled(szProto))
@@ -29,7 +29,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam)
if (db_get_b(hContact, "CList", "NotOnList", 0) || (szGroup != NULL && (wcsstr(szGroup, L"Not In List") || wcsstr(szGroup, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
- if (szProto != NULL) {
+ if (szProto != nullptr) {
// Check if protocol uses server side lists
DWORD caps = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
@@ -49,8 +49,8 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam)
int hGroup = 1;
wchar_t *group_name;
do {
- group_name = Clist_GroupGetName(hGroup, 0);
- if (group_name != NULL && wcsstr(group_name, TranslateT("Not In List"))) {
+ group_name = Clist_GroupGetName(hGroup, nullptr);
+ if (group_name != nullptr && wcsstr(group_name, TranslateT("Not In List"))) {
BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
if (ConfirmDelete)
db_set_b(NULL, "CList", "ConfirmDelete", 0);
@@ -63,7 +63,7 @@ INT_PTR RemoveTempContacts(WPARAM, LPARAM lParam)
hGroup++;
} while (group_name);
if (!lParam)
- MessageBox(NULL, TranslateT("Complete"), TranslateT(pluginName), MB_ICONINFORMATION);
+ MessageBox(nullptr, TranslateT("Complete"), TranslateT(pluginName), MB_ICONINFORMATION);
return 0;
}