From a7c24ca48995cf2bf436156302f96b91bf135409 Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Mon, 13 Nov 2017 15:03:31 +0100 Subject: Code modernize ... * replace 0/NULL with nullptr [using clang-tidy] --- plugins/StopSpamMod/src/init.cpp | 4 ++-- plugins/StopSpamMod/src/options.cpp | 4 ++-- plugins/StopSpamMod/src/utilities.cpp | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/StopSpamMod') diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index aeac374fd9..436f74125b 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -43,7 +43,7 @@ BOOL gbAutoAddToServerList=0; BOOL gbAutoReqAuth=1; BOOL gbMathExpression = 0; -HANDLE hStopSpamLogDirH=0; +HANDLE hStopSpamLogDirH=nullptr; wstring gbSpammersGroup = L"Spammers"; wstring gbAutoAuthGroup = L"NotSpammers"; @@ -128,7 +128,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) return 0; } -HANDLE hEventFilter = 0, hOptInitialise = 0, hSettingChanged = 0; +HANDLE hEventFilter = nullptr, hOptInitialise = nullptr, hSettingChanged = nullptr; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index cfb15f66c3..b06dae9313 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) switch (nmhdr->code) { case PSN_APPLY: { - db_set_dw(NULL, pluginName, "maxQuestCount", gbMaxQuestCount = GetDlgItemInt(hwnd, ID_MAXQUESTCOUNT, NULL, FALSE)); + db_set_dw(NULL, pluginName, "maxQuestCount", gbMaxQuestCount = GetDlgItemInt(hwnd, ID_MAXQUESTCOUNT, nullptr, FALSE)); db_set_b(NULL, pluginName, "infTalkProtection", gbInfTalkProtection = BST_CHECKED == IsDlgButtonChecked(hwnd, ID_INFTALKPROT)); db_set_b(NULL, pluginName, "addPermanent", gbAddPermanent = BST_CHECKED == IsDlgButtonChecked(hwnd, ID_ADDPERMANENT)); db_set_b(NULL, pluginName, "handleAuthReq", gbHandleAuthReq = BST_CHECKED == IsDlgButtonChecked(hwnd, ID_HANDLEAUTHREQ)); @@ -98,7 +98,7 @@ INT_PTR CALLBACK MessagesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar 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/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index c68e5581bf..ac47d6d7b0 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -71,7 +71,7 @@ void DeleteCListGroupsByName(wchar_t* szGroupName) db_set_b(NULL, "CList", "ConfirmDelete", 0); wchar_t *szGroup; - for (int i = 1; (szGroup = Clist_GroupGetName(i, NULL)) != NULL; i++) + for (int i = 1; (szGroup = Clist_GroupGetName(i, nullptr)) != nullptr; i++) if (!mir_wstrcmp(szGroupName, szGroup)) Clist_GroupDelete(i); @@ -133,7 +133,7 @@ const int Stricmp(const wchar_t *str, const wchar_t *substr) wchar_t* ReqGetText(DBEVENTINFO* dbei) { if (!dbei->pBlob) - return 0; + return nullptr; char * ptr = (char *)&dbei->pBlob[sizeof(DWORD) * 2]; int len = dbei->cbBlob - sizeof(DWORD) * 2; @@ -149,12 +149,12 @@ wchar_t* ReqGetText(DBEVENTINFO* dbei) char * tstr = (char *)mir_alloc(len + 1); memcpy(tstr, ptr, len); tstr[len] = 0; - WCHAR* msg = NULL; + WCHAR* msg = nullptr; msg = (dbei->flags&DBEF_UTF) ? mir_utf8decodeW(tstr) : mir_a2u(tstr); mir_free(tstr); return (wchar_t *)msg; }; - return 0; + return nullptr; } BOOL IsUrlContains(wchar_t * Str) @@ -316,7 +316,7 @@ void HistoryLog(MCONTACT hContact, char *data, int event_type, int flags) Event.szModule = pluginName; Event.eventType = event_type; Event.flags = flags | DBEF_UTF; - Event.timestamp = (DWORD)time(NULL); + Event.timestamp = (DWORD)time(nullptr); Event.cbBlob = (DWORD)mir_strlen(data) + 1; Event.pBlob = (PBYTE)_strdup(data); db_event_add(hContact, &Event); -- cgit v1.2.3