diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/UserInfoEx/src/svc_email.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/UserInfoEx/src/svc_email.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/svc_email.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 949a6cee5a..ba70f83a50 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -21,12 +21,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-static HGENMENU ghMenuItem = NULL;
+static HGENMENU ghMenuItem = nullptr;
static HANDLE ghExtraIconDef = INVALID_HANDLE_VALUE;
static HANDLE ghExtraIconSvc = INVALID_HANDLE_VALUE;
-static HANDLE hChangedHook = NULL;
-static HANDLE hApplyIconHook = NULL;
+static HANDLE hChangedHook = nullptr;
+static HANDLE hApplyIconHook = nullptr;
bool g_eiEmail = false;
@@ -45,7 +45,7 @@ static LPSTR Get(MCONTACT hContact) if (hContact != NULL) {
LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
- if (pszProto != NULL) {
+ if (pszProto != nullptr) {
LPCSTR e[2][4] = {
{ SET_CONTACT_EMAIL, SET_CONTACT_EMAIL0, SET_CONTACT_EMAIL1, "Mye-mail0"},
{ SET_CONTACT_COMPANY_EMAIL, SET_CONTACT_COMPANY_EMAIL0, SET_CONTACT_COMPANY_EMAIL1, "MyCompanye-mail0"}
@@ -64,7 +64,7 @@ static LPSTR Get(MCONTACT hContact) }
}
}
- return NULL;
+ return nullptr;
}
/**
@@ -80,7 +80,7 @@ static LPSTR Get(MCONTACT hContact) static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam)
{
int result = 0;
- LPSTR val = NULL;
+ LPSTR val = nullptr;
__try
{
@@ -100,7 +100,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) }
else {
result = 1;
- MsgBox((HWND)lParam, MB_OK, LPGENW("Send e-mail"), NULL, LPGENW("Memory allocation error!"));
+ MsgBox((HWND)lParam, MB_OK, LPGENW("Send e-mail"), nullptr, LPGENW("Memory allocation error!"));
}
}
__except(GetExceptionCode()==EXCEPTION_ACCESS_VIOLATION ?
@@ -127,7 +127,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) static int OnCListApplyIcons(WPARAM wParam, LPARAM)
{
LPSTR val = Get(wParam);
- ExtraIcon_SetIconByName(ghExtraIconSvc, wParam, (val) ? ICO_BTN_EMAIL : 0);
+ ExtraIcon_SetIconByName(ghExtraIconSvc, wParam, (val) ? ICO_BTN_EMAIL : nullptr);
mir_free(val);
return 0;
}
@@ -164,7 +164,7 @@ static int OnContactSettingChanged(MCONTACT hContact, DBCONTACTWRITESETTING* pdb static int OnPreBuildMenu(WPARAM wParam, LPARAM)
{
LPSTR val = Get(wParam);
- Menu_ShowItem(ghMenuItem, val != NULL);
+ Menu_ShowItem(ghMenuItem, val != nullptr);
mir_free(val);
return 0;
}
@@ -175,7 +175,7 @@ static int OnPreBuildMenu(WPARAM wParam, LPARAM) void SvcEMailRebuildMenu()
{
- static HANDLE hPrebuildMenuHook = NULL;
+ static HANDLE hPrebuildMenuHook = nullptr;
if (db_get_b(NULL, MODNAME, SET_EXTENDED_EMAILSERVICE, TRUE)) {
if (!hPrebuildMenuHook)
@@ -198,7 +198,7 @@ void SvcEMailRebuildMenu() if (ghMenuItem) {
Menu_RemoveItem(ghMenuItem);
- ghMenuItem = NULL;
+ ghMenuItem = nullptr;
}
}
}
@@ -222,10 +222,10 @@ bool SvcEMailEnableExtraIcons(bool bEnable, bool bUpdateDB) if (g_eiEmail) { // E-mail checked
// hook events
- if (hChangedHook == NULL)
+ if (hChangedHook == nullptr)
hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- if (hApplyIconHook == NULL)
+ if (hApplyIconHook == nullptr)
hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
@@ -234,11 +234,11 @@ bool SvcEMailEnableExtraIcons(bool bEnable, bool bUpdateDB) else { // E-mail uncheckt
if (hChangedHook) {
UnhookEvent(hChangedHook);
- hChangedHook = NULL;
+ hChangedHook = nullptr;
}
if (hApplyIconHook) {
UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
+ hApplyIconHook = nullptr;
}
}
@@ -270,6 +270,6 @@ void SvcEMailLoadModule() void SvcEMailUnloadModule()
{
// unhook event handlers
- UnhookEvent(hChangedHook); hChangedHook = NULL;
- UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
+ UnhookEvent(hChangedHook); hChangedHook = nullptr;
+ UnhookEvent(hApplyIconHook); hApplyIconHook = nullptr;
}
|