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/Db3x_mmap | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r-- | plugins/Db3x_mmap/src/database.cpp | 4 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbcrypt.cpp | 2 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbsettings.cpp | 8 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/ui.cpp | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index d96086a42a..27b86c38af 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -87,9 +87,9 @@ void __cdecl dbpanic(void *) wchar_t err[256];
mir_snwprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
- MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
+ MessageBox(nullptr, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
- else MessageBox(0, TranslateW(tszPanic), TranslateT("Database Panic"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
+ else MessageBox(nullptr, TranslateW(tszPanic), TranslateT("Database Panic"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
TerminateProcess(GetCurrentProcess(), 255);
}
diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 66559fff3a..03c6da8385 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -396,7 +396,7 @@ void CDb3Mmap::ToggleEventsEncryption(MCONTACT contactID) size_t len;
DWORD ofsDest;
mir_ptr<BYTE> pBlob;
- BYTE *pSource = DBRead(offset + offsetof(DBEvent, blob), 0);
+ BYTE *pSource = DBRead(offset + offsetof(DBEvent, blob), nullptr);
if (!m_bEncrypted) { // we need more space
if ((pBlob = m_crypto->encodeBuffer(pSource, evt.cbBlob, &len)) == nullptr)
return;
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index aacb29f2da..8fd9a1dde3 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -362,18 +362,18 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetContactSettingStatic(MCONTACT contactID, LPCSTR STDMETHODIMP_(BOOL) CDb3Mmap::FreeVariant(DBVARIANT *dbv)
{
- if (dbv == 0) return 1;
+ if (dbv == nullptr) return 1;
switch (dbv->type) {
case DBVT_ASCIIZ:
case DBVT_UTF8:
case DBVT_WCHAR:
if (dbv->pszVal) mir_free(dbv->pszVal);
- dbv->pszVal = 0;
+ dbv->pszVal = nullptr;
break;
case DBVT_BLOB:
if (dbv->pbVal) mir_free(dbv->pbVal);
- dbv->pbVal = 0;
+ dbv->pbVal = nullptr;
break;
}
dbv->type = 0;
@@ -801,7 +801,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteContactSetting(MCONTACT contactID, LPCSTR sz }
// notify
- DBCONTACTWRITESETTING dbcws = { 0 };
+ DBCONTACTWRITESETTING dbcws = {};
dbcws.szModule = szModule;
dbcws.szSetting = szSetting;
dbcws.value.type = DBVT_DELETED;
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index d73f95966a..2e088b95d8 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -140,7 +140,7 @@ bool CDb3Mmap::EnterPassword(const BYTE *pKey, const size_t keyLen) CredFree(pCred);
}
else {
- if (IDOK != DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_LOGIN), 0, sttEnterPassword, (LPARAM)¶m))
+ if (IDOK != DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_LOGIN), nullptr, sttEnterPassword, (LPARAM)¶m))
return false;
m_crypto->setPassword(T2Utf(param.newPass));
}
@@ -258,7 +258,7 @@ static INT_PTR ChangePassword(void* obj, WPARAM, LPARAM) {
CDb3Mmap *db = (CDb3Mmap*)obj;
DlgChangePassParam param = { db };
- DialogBoxParam(g_hInst, MAKEINTRESOURCE(db->usesPassword() ? IDD_CHANGEPASS : IDD_NEWPASS), 0, sttChangePassword, (LPARAM)¶m);
+ DialogBoxParam(g_hInst, MAKEINTRESOURCE(db->usesPassword() ? IDD_CHANGEPASS : IDD_NEWPASS), nullptr, sttChangePassword, (LPARAM)¶m);
return 0;
}
|