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/SecureIM/src/crypt_lists.cpp | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/SecureIM/src/crypt_lists.cpp')
-rw-r--r-- | plugins/SecureIM/src/crypt_lists.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 3eeabe0721..bb97d160f0 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -6,7 +6,7 @@ LIST<UinKey> arClist(100, NumericKeySortT); void loadSupportedProtocols()
{
LPSTR szNames = db_get_sa(0, MODULENAME, "protos");
- if (szNames && strchr(szNames, ':') == NULL) {
+ if (szNames && strchr(szNames, ':') == nullptr) {
LPSTR tmp = (LPSTR)mir_alloc(2048); int j = 0;
for (int i = 0; szNames[i]; i++) {
if (szNames[i] == ';')
@@ -70,16 +70,16 @@ pSupPro getSupPro(MCONTACT hContact) if (Proto_IsProtoOnContact(hContact, arProto[j]->name))
return arProto[j];
- return NULL;
+ return nullptr;
}
// add contact in the list of secureIM users
pUinKey addContact(MCONTACT hContact)
{
- if (hContact == NULL) return NULL;
+ if (hContact == NULL) return nullptr;
pSupPro proto = getSupPro(hContact);
- if (proto == NULL) return NULL;
+ if (proto == nullptr) return nullptr;
pUinKey p = (pUinKey)mir_calloc(sizeof(UinKey));
p->header = HEADER;
@@ -107,7 +107,7 @@ void delContact(MCONTACT hContact) if (p) {
arClist.remove(p);
- cpp_delete_context(p->cntx); p->cntx = 0;
+ cpp_delete_context(p->cntx); p->cntx = nullptr;
mir_free(p->tmp);
mir_free(p->msgSplitted);
mir_free(p);
@@ -129,7 +129,7 @@ void freeContactList() {
for (int j = 0; j < arClist.getCount(); j++) {
pUinKey p = arClist[j];
- cpp_delete_context(p->cntx); p->cntx = 0;
+ cpp_delete_context(p->cntx); p->cntx = nullptr;
mir_free(p->tmp);
mir_free(p->msgSplitted);
mir_free(p);
@@ -157,7 +157,7 @@ pUinKey getUinCtx(HANDLE cntx) if (arClist[j]->cntx == cntx)
return arClist[j];
- return NULL;
+ return nullptr;
}
// add message to user queue for send later
@@ -169,7 +169,7 @@ void addMsg2Queue(pUinKey ptr, WPARAM wParam, LPSTR szMsg) mir_cslock lck(localQueueMutex);
- if (ptr->msgQueue == NULL) {
+ if (ptr->msgQueue == nullptr) {
// create new
ptr->msgQueue = (pWM)mir_alloc(sizeof(struct waitingMessage));
ptrMessage = ptr->msgQueue;
@@ -185,7 +185,7 @@ void addMsg2Queue(pUinKey ptr, WPARAM wParam, LPSTR szMsg) }
ptrMessage->wParam = wParam;
- ptrMessage->nextMessage = NULL;
+ ptrMessage->nextMessage = nullptr;
ptrMessage->Message = mir_strdup(szMsg);
}
@@ -210,7 +210,7 @@ void getContactUinA(MCONTACT hContact, LPSTR szUIN) DBVARIANT dbv_uniqueid;
LPSTR uID = (LPSTR)CallProtoService(ptr->name, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if (uID == (LPSTR)CALLSERVICE_NOTFOUND) uID = 0; // Billy_Bons
+ if (uID == (LPSTR)CALLSERVICE_NOTFOUND) uID = nullptr; // Billy_Bons
if (uID && db_get(hContact, ptr->name, uID, &dbv_uniqueid) == 0) {
if (dbv_uniqueid.type == DBVT_WORD)
sprintf(szUIN, "%u [%s]", dbv_uniqueid.wVal, ptr->name); //!!!!!!!!!!!
|