diff options
author | George Hazan <ghazan@miranda.im> | 2017-08-23 15:17:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-08-23 15:17:45 +0300 |
commit | 3d977685e7dbc7b1f5fa3264c8a014b5b5d5ec43 (patch) | |
tree | 3be179d8a33dd4ab623d330f628ef09f078f3fa4 /protocols/JabberG/src/jabber_api.cpp | |
parent | 475debe8c34567137be9c1fd2252ed8816c6da31 (diff) |
code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_api.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_api.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index fe4247c359..ea3628328c 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -62,10 +62,10 @@ LPTSTR CJabberProto::ContactToJID(MCONTACT hContact) LPTSTR CJabberProto::GetBestResourceName(LPCTSTR jid)
{
- if (jid == NULL)
- return NULL;
+ if (jid == nullptr)
+ return nullptr;
LPCTSTR p = wcschr(jid, '/');
- if (p == NULL) {
+ if (p == nullptr) {
mir_cslock lck(m_csLists);
return mir_wstrdup(ListGetBestClientResourceNamePtr(jid));
}
@@ -74,18 +74,18 @@ LPTSTR CJabberProto::GetBestResourceName(LPCTSTR jid) LPTSTR CJabberProto::GetResourceList(LPCTSTR jid)
{
- if (jid == NULL)
- return NULL;
+ if (jid == nullptr)
+ return nullptr;
mir_cslock lck(m_csLists);
- JABBER_LIST_ITEM *item = NULL;
- if ((item = ListGetItemPtr(LIST_VCARD_TEMP, jid)) == NULL)
+ JABBER_LIST_ITEM *item = nullptr;
+ if ((item = ListGetItemPtr(LIST_VCARD_TEMP, jid)) == nullptr)
item = ListGetItemPtr(LIST_ROSTER, jid);
- if (item == NULL)
- return NULL;
+ if (item == nullptr)
+ return nullptr;
if (!item->arResources.getCount())
- return NULL;
+ return nullptr;
CMStringW res;
for (int i=0; i < item->arResources.getCount(); i++) {
@@ -173,7 +173,7 @@ HJHANDLER CJabberProto::AddTemporaryIqHandler(JABBER_HANDLER_FUNC Func, int iIqT sHandlerData *d = (sHandlerData*)malloc(sizeof(sHandlerData));
d->Func = Func;
d->pUserData = pUserData;
- CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ExternalTempIqHandler, iIqTypes, NULL, 0, iIqId, d, iPriority);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::ExternalTempIqHandler, iIqTypes, nullptr, 0, iIqId, d, iPriority);
if (pInfo && dwTimeout > 0)
pInfo->SetTimeout(dwTimeout);
return (HJHANDLER)pInfo;
@@ -202,7 +202,7 @@ JabberFeatCapPairDynamic *CJabberProto::FindFeature(LPCTSTR szFeature) if (!mir_wstrcmp(m_lstJabberFeatCapPairsDynamic[i]->szFeature, szFeature))
return m_lstJabberFeatCapPairsDynamic[i];
- return NULL;
+ return nullptr;
}
int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription)
@@ -248,7 +248,7 @@ int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription) fcp = new JabberFeatCapPairDynamic();
fcp->szExt = szExt; // will be deallocated along with other values of JabberFeatCapPairDynamic in CJabberProto destructor
fcp->szFeature = mir_wstrdup(szFeature);
- fcp->szDescription = szDescription ? mir_wstrdup(szDescription) : NULL;
+ fcp->szDescription = szDescription ? mir_wstrdup(szDescription) : nullptr;
fcp->jcbCap = jcb;
m_lstJabberFeatCapPairsDynamic.insert(fcp);
}
@@ -272,7 +272,7 @@ int CJabberProto::AddFeatures(LPCTSTR szFeatures) JabberFeatCapPairDynamic *fcp = FindFeature(szFeat);
// if someone is trying to add one of core features, RegisterFeature() will return false, so we don't have to perform this check here
if (!fcp) { // if the feature is not registered yet
- if (!RegisterFeature(szFeat, NULL))
+ if (!RegisterFeature(szFeat, nullptr))
ret = false;
else
fcp = FindFeature(szFeat); // update fcp after RegisterFeature()
@@ -320,7 +320,7 @@ LPTSTR CJabberProto::GetResourceFeatures(LPCTSTR jid) {
JabberCapsBits jcb = GetResourceCapabilites(jid, true);
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
- return NULL;
+ return nullptr;
mir_cslockfull lck(m_csLists);
int i;
|