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_phone.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/UserInfoEx/src/svc_phone.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/svc_phone.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index e18bacef16..daae9f022a 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -28,12 +28,12 @@ enum EPhoneType PHONE_SMS
};
-static HANDLE ghMenuItem = NULL;
+static HANDLE ghMenuItem = nullptr;
static HANDLE ghExtraIconDef[2] = { INVALID_HANDLE_VALUE, 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_eiPhone = false;
@@ -54,7 +54,7 @@ static INT_PTR Get(MCONTACT hContact) // ignore owner
if (hContact != NULL) {
LPCSTR pszProto = Proto_GetBaseAccountName(hContact);
- if (pszProto != NULL) {
+ if (pszProto != nullptr) {
LPCSTR e[2][4] = {
{ SET_CONTACT_CELLULAR, SET_CONTACT_PHONE, "MyPhone0" },
{ SET_CONTACT_COMPANY_CELLULAR, SET_CONTACT_COMPANY_PHONE, "MyCompanyPhone0" }
@@ -92,7 +92,7 @@ static int OnCListApplyIcons(MCONTACT hContact, LPARAM) switch (Get(hContact)) {
case PHONE_NORMAL: icoName = ICO_BTN_PHONE; break;
case PHONE_SMS: icoName = ICO_BTN_CELLULAR; break;
- default: icoName = NULL;
+ default: icoName = nullptr;
}
ExtraIcon_SetIconByName(ghExtraIconSvc, hContact, icoName);
return 0;
@@ -139,10 +139,10 @@ bool SvcPhoneEnableExtraIcons(bool bEnable, bool bUpdateDB) // force module enabled, if extraicon plugin was found
if (g_eiPhone) {
// 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, (MIRANDAHOOK)OnCListApplyIcons);
if (ghExtraIconSvc == INVALID_HANDLE_VALUE)
@@ -151,11 +151,11 @@ bool SvcPhoneEnableExtraIcons(bool bEnable, bool bUpdateDB) else {
if (hChangedHook) {
UnhookEvent(hChangedHook);
- hChangedHook = NULL;
+ hChangedHook = nullptr;
}
if (hApplyIconHook) {
UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
+ hApplyIconHook = nullptr;
}
}
return bChanged;
@@ -172,6 +172,6 @@ bool SvcPhoneEnableExtraIcons(bool bEnable, bool bUpdateDB) void SvcPhoneUnloadModule()
{
// unhook event handlers
- UnhookEvent(hChangedHook); hChangedHook = NULL;
- UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
+ UnhookEvent(hChangedHook); hChangedHook = nullptr;
+ UnhookEvent(hApplyIconHook); hApplyIconHook = nullptr;
}
|