From 1c0172cca4f1e90679321912e20436a7f42f122d Mon Sep 17 00:00:00 2001 From: Goraf <22941576+Goraf@users.noreply.github.com> Date: Sat, 24 Feb 2018 15:32:06 +0100 Subject: more nullptr --- protocols/EmLanProto/src/mlan.h | 2 +- protocols/FacebookRM/src/proto.h | 4 +-- protocols/Gadu-Gadu/src/dialogs.cpp | 2 +- protocols/IRCG/src/irc_dlg.h | 2 +- protocols/IRCG/src/stdafx.h | 2 +- protocols/IcqOscarJ/src/changeinfo.h | 2 +- protocols/IcqOscarJ/src/icq_proto.h | 6 ++--- protocols/IcqOscarJ/src/icq_rates.h | 2 +- protocols/JabberG/src/jabber_notes.h | 4 +-- protocols/JabberG/src/jabber_thread.cpp | 4 +-- protocols/MRA/src/MraProto.h | 4 +-- protocols/MRA/src/MraSendCommand.cpp | 26 +++++++++---------- protocols/MRA/src/Mra_functions.cpp | 46 ++++++++++++++++----------------- protocols/MRA/src/Sdk/ListMT.h | 22 ++++++++-------- protocols/MRA/src/Sdk/MemoryFind.h | 2 +- protocols/MRA/src/Sdk/MemoryFindByte.h | 2 +- protocols/MSN/src/msn_proto.h | 12 ++++----- protocols/MSN/src/stdafx.h | 8 +++--- protocols/MinecraftDynmap/src/proto.h | 6 ++--- protocols/MinecraftDynmap/src/utils.h | 2 +- protocols/Omegle/src/client.h | 18 ++++++------- protocols/Omegle/src/proto.h | 2 +- protocols/Omegle/src/stdafx.h | 2 +- protocols/Tox/src/http_request.h | 12 ++++----- protocols/Tox/src/tox_profile.cpp | 2 +- protocols/Tox/src/tox_proto.h | 2 +- protocols/Tox/src/tox_thread.h | 6 ++--- protocols/Twitter/src/proto.h | 2 +- protocols/Twitter/src/utility.h | 4 +-- 29 files changed, 105 insertions(+), 105 deletions(-) (limited to 'protocols') diff --git a/protocols/EmLanProto/src/mlan.h b/protocols/EmLanProto/src/mlan.h index a314c054cd..d3f879bc2a 100644 --- a/protocols/EmLanProto/src/mlan.h +++ b/protocols/EmLanProto/src/mlan.h @@ -129,7 +129,7 @@ private: char* strAwayMessage; // NULL means no away message int idAckAwayMessage; }; - u_char* CreatePacket(TPacket& pak, int* pBufLen = NULL); + u_char* CreatePacket(TPacket& pak, int* pBufLen = nullptr); void ParsePacket(TPacket& pak, u_char* buf, int len = 65536); void SendPacketExt(TPacket& pak, u_long addr); diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 999ca5b704..03c3920150 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -74,9 +74,9 @@ public: inline int IdleSeconds() { if ((m_iStatus == ID_STATUS_AWAY || m_iStatus == ID_STATUS_INVISIBLE) && m_awayTS) - return time(0) - m_awayTS; + return time(nullptr) - m_awayTS; - return m_idleTS ? time(0) - m_idleTS : 0; + return m_idleTS ? time(nullptr) - m_idleTS : 0; } bool m_invisible; diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 694b1d6b80..e74e1461ac 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -794,7 +794,7 @@ int GaduProto::options_init(WPARAM wParam, LPARAM) odp.szTab.w = LPGENW("Advanced"); odp.position = 2; - odp.pszTemplate = 0; + odp.pszTemplate = nullptr; odp.pDialog = new GaduOptionsDlgAdvanced(this); Options_AddPage(wParam, &odp); diff --git a/protocols/IRCG/src/irc_dlg.h b/protocols/IRCG/src/irc_dlg.h index b491278c39..75a4d341e5 100644 --- a/protocols/IRCG/src/irc_dlg.h +++ b/protocols/IRCG/src/irc_dlg.h @@ -172,7 +172,7 @@ struct CManagerDlg : public CCoolIrcDlg struct CQuestionDlg : public CCoolIrcDlg { - CQuestionDlg(CIrcProto* _pro, CManagerDlg* owner = NULL); + CQuestionDlg(CIrcProto* _pro, CManagerDlg* owner = nullptr); virtual void OnInitDialog(); virtual void OnClose(); diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h index 14da73d80a..16f753c395 100644 --- a/protocols/IRCG/src/stdafx.h +++ b/protocols/IRCG/src/stdafx.h @@ -495,7 +495,7 @@ struct CIrcProto : public PROTO int NLReceive(unsigned char* buf, int cbBuf); void InsertIncomingEvent(wchar_t* pszRaw); - __inline bool IsConnected() const { return con != NULL; } + __inline bool IsConnected() const { return con != nullptr; } // send-to-stream operators int getCodepage() const; diff --git a/protocols/IcqOscarJ/src/changeinfo.h b/protocols/IcqOscarJ/src/changeinfo.h index 4c90b617f4..b487f75a64 100644 --- a/protocols/IcqOscarJ/src/changeinfo.h +++ b/protocols/IcqOscarJ/src/changeinfo.h @@ -85,7 +85,7 @@ struct ChangeInfoData : public MZeroedObject HANDLE hAckHook; HANDLE hUpload[2]; - ChangeInfoData() { settingData = (SettingItemData*)SAFE_MALLOC(sizeof(SettingItemData) * settingCount); hAckHook = NULL; hUpload[0] = NULL; hUpload[1] = NULL;} + ChangeInfoData() { settingData = (SettingItemData*)SAFE_MALLOC(sizeof(SettingItemData) * settingCount); hAckHook = nullptr; hUpload[0] = nullptr; hUpload[1] = nullptr;} ~ChangeInfoData() { SAFE_FREE((void**)&settingData); } char* GetItemSettingText(int i, char *buf, size_t buf_size); diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 5599fc409e..294fea1da5 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -588,8 +588,8 @@ struct CIcqProto : public PROTO void servlistPendingAddContactOperation(MCONTACT hContact, LPARAM param, PENDING_CONTACT_CALLBACK callback, DWORD flags); void servlistPendingAddGroupOperation(const char *pszGroup, LPARAM param, PENDING_GROUP_CALLBACK callback, DWORD flags); - int servlistPendingAddContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = NULL); - int servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPARAM param, PENDING_GROUP_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_GROUP_CALLBACK operationCallback = NULL); + int servlistPendingAddContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, LPARAM param, PENDING_CONTACT_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_CONTACT_CALLBACK operationCallback = nullptr); + int servlistPendingAddGroup(const char *pszGroup, WORD wGroupID, LPARAM param, PENDING_GROUP_CALLBACK callback, int bDoInline, LPARAM operationParam = 0, PENDING_GROUP_CALLBACK operationCallback = nullptr); void servlistPendingRemoveContact(MCONTACT hContact, WORD wContactID, WORD wGroupID, int nResult); void servlistPendingRemoveGroup(const char *pszGroup, WORD wGroupID, int nResult); void servlistPendingFlushOperations(); @@ -673,7 +673,7 @@ struct CIcqProto : public PROTO void icq_requestnewfamily(WORD wFamily, void (CIcqProto::*familyhandler)(HNETLIBCONN hConn, char* cookie, size_t cookieLen)); void icq_setidle(int bAllow); - void icq_setstatus(WORD wStatus, const char *szStatusNote = NULL); + void icq_setstatus(WORD wStatus, const char *szStatusNote = nullptr); DWORD icq_sendGetInfoServ(MCONTACT hContact, DWORD, int); DWORD icq_sendGetAimProfileServ(MCONTACT hContact, char *szUid); DWORD icq_sendGetAwayMsgServ(MCONTACT hContact, DWORD, int, WORD); diff --git a/protocols/IcqOscarJ/src/icq_rates.h b/protocols/IcqOscarJ/src/icq_rates.h index 73c12d01ba..500acfa8fb 100644 --- a/protocols/IcqOscarJ/src/icq_rates.h +++ b/protocols/IcqOscarJ/src/icq_rates.h @@ -101,7 +101,7 @@ protected: WORD wGroup; virtual BOOL isEqual(rates_queue_item *pItem); - virtual rates_queue_item* copyItem(rates_queue_item *pDest = NULL); + virtual rates_queue_item* copyItem(rates_queue_item *pDest = nullptr); public: rates_queue_item(CIcqProto *ppro, WORD wGroup); virtual ~rates_queue_item(); diff --git a/protocols/JabberG/src/jabber_notes.h b/protocols/JabberG/src/jabber_notes.h index eebd31fa4f..30ec4e5c04 100644 --- a/protocols/JabberG/src/jabber_notes.h +++ b/protocols/JabberG/src/jabber_notes.h @@ -38,7 +38,7 @@ private: public: CNoteItem(); - CNoteItem(HXML hXml, wchar_t *szFrom = 0); + CNoteItem(HXML hXml, wchar_t *szFrom = nullptr); ~CNoteItem(); void SetData(wchar_t *title, wchar_t *from, wchar_t *text, wchar_t *tags); @@ -76,7 +76,7 @@ public: OBJLIST::remove(p); } - void AddNote(HXML hXml, wchar_t *szFrom = 0); + void AddNote(HXML hXml, wchar_t *szFrom = nullptr); void LoadXml(HXML hXml); void SaveXml(HXML hXmlParent); diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 700512d631..b5954585cc 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1066,8 +1066,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (!m_options.EnableCarbons) return; - HXML forwarded = NULL; - HXML message = NULL; + HXML forwarded = nullptr; + HXML message = nullptr; //Carbons MUST have forwarded/message content if (!(forwarded = XmlGetChildByTag(carbon, "forwarded", "xmlns", JABBER_XMLNS_FORWARD)) || !(message = XmlGetChild(forwarded, "message"))) diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 86da122f9d..a9a95fbc07 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -198,8 +198,8 @@ struct CMraProto : public PROTO DWORD MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize); DWORD MraMessageAsk(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, const CMStringW &wszMessageRTF); DWORD MraMessageRecv(const CMStringA &szFrom, DWORD dwMsgID); - DWORD MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = 0, const CMStringW *wszAuthMessage = 0); - DWORD MraModifyContact(MCONTACT hContact, DWORD *pdwID = 0, DWORD *pdwContactFlag = 0, DWORD *pdwGroupID = 0, const CMStringA *pszEmail = 0, const CMStringW *pwszCustomName = 0, const CMStringA *pszPhones = 0); + DWORD MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwGroupID, const CMStringA &szEmail, const CMStringW &wszCustomName, const CMStringA *szPhones = nullptr, const CMStringW *wszAuthMessage = nullptr); + DWORD MraModifyContact(MCONTACT hContact, DWORD *pdwID = nullptr, DWORD *pdwContactFlag = nullptr, DWORD *pdwGroupID = nullptr, const CMStringA *pszEmail = nullptr, const CMStringW *pwszCustomName = nullptr, const CMStringA *pszPhones = nullptr); DWORD MraOfflineMessageDel(DWORDLONG dwMsgUIDL); DWORD MraMoveContactToGroup(MCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszGroup); DWORD MraAuthorize(const CMStringA &szEmail); diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index 54352926ac..8e26f28364 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -8,7 +8,7 @@ class OutBuffer size_t m_max, m_actual; public: - OutBuffer() : m_buf(0), m_max(0), m_actual(0) {} + OutBuffer() : m_buf(nullptr), m_max(0), m_actual(0) {} ~OutBuffer() { if (m_buf) free(m_buf); } void* Allocate(size_t len) @@ -77,7 +77,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType DWORD dwRet = 0; LPSTR lpszMessageConverted = (LPSTR)lpwszMessage.GetString(); - LPSTR lpszMessageRTF = NULL; + LPSTR lpszMessageRTF = nullptr; size_t dwMessageConvertedSize = lpwszMessage.GetLength()*sizeof(WCHAR), dwMessageRTFSize = 0; if (MraIsMessageFlashAnimation(lpwszMessage)) @@ -136,8 +136,8 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType } } - if (lpszMessageRTF == NULL || dwMessageRTFSize == 0) dwFlags &= ~(MESSAGE_FLAG_RTF | MESSAGE_FLAG_FLASH); - if (lpbMultiChatData == NULL || dwMultiChatDataSize == 0) dwFlags &= ~MESSAGE_FLAG_MULTICHAT; + if (lpszMessageRTF == nullptr || dwMessageRTFSize == 0) dwFlags &= ~(MESSAGE_FLAG_RTF | MESSAGE_FLAG_FLASH); + if (lpbMultiChatData == nullptr || dwMultiChatDataSize == 0) dwFlags &= ~MESSAGE_FLAG_MULTICHAT; OutBuffer buf; buf.SetUL(dwFlags); @@ -148,7 +148,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType buf.SetLPS(CMStringA((LPSTR)lpbMultiChatData, (int)dwMultiChatDataSize)); if (bAddToQueue) - dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, dwAckType, NULL, 0, MRIM_CS_MESSAGE, buf.Data(), buf.Len()); + dwRet = MraSendQueueCMD(hSendQueueHandle, 0, hContact, dwAckType, nullptr, 0, MRIM_CS_MESSAGE, buf.Data(), buf.Len()); else dwRet = MraSendCMD(MRIM_CS_MESSAGE, buf.Data(), buf.Len()); @@ -198,18 +198,18 @@ DWORD CMraProto::MraAddContact(MCONTACT hContact, DWORD dwContactFlag, DWORD dwG buf.SetUL(dwGroupID); buf.SetLPSLowerCase(szEmail); buf.SetLPSW(wszCustomName); - buf.SetLPS((szPhones == NULL) ? "" : *szPhones); + buf.SetLPS((szPhones == nullptr) ? "" : *szPhones); // pack auth message OutBuffer buf2; buf2.SetUL(2); buf2.SetLPSW(L"");//***deb possible nick here - buf2.SetLPSW((wszAuthMessage == NULL) ? L"" : *wszAuthMessage); + buf2.SetLPSW((wszAuthMessage == nullptr) ? L"" : *wszAuthMessage); buf.SetLPS(CMStringA(ptrA(mir_base64_encode(buf2.Data(), buf2.Len())))); buf.SetUL(0); - return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_ADD_CONTACT, buf.Data(), buf.Len()); + return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, nullptr, 0, MRIM_CS_ADD_CONTACT, buf.Data(), buf.Len()); } // change contact @@ -219,7 +219,7 @@ DWORD CMraProto::MraModifyContact(MCONTACT hContact, DWORD *pdwID, DWORD *pdwCon CMStringW wszNick, wszCustomName; DWORD dwID, dwGroupID, dwContactFlag; if (hContact) - GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones); + GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, nullptr, nullptr, &szEmail, &wszNick, &szPhones); else dwID = dwGroupID = dwContactFlag = 0; @@ -241,7 +241,7 @@ DWORD CMraProto::MraModifyContact(MCONTACT hContact, DWORD *pdwID, DWORD *pdwCon buf.SetLPSW(wszCustomName); buf.SetLPS(szPhones); - return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, NULL, 0, MRIM_CS_MODIFY_CONTACT, buf.Data(), buf.Len()); + return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ACKTYPE_ADDED, nullptr, 0, MRIM_CS_MODIFY_CONTACT, buf.Data(), buf.Len()); } // remove stored message @@ -377,7 +377,7 @@ HANDLE CMraProto::MraWPRequestW(MCONTACT hContact, DWORD dwAckType, DWORD dwRequ buf.SetLPS(tmp); } - return (HANDLE)MraSendQueueCMD(hSendQueueHandle, dwRequestFlags, hContact, dwAckType, NULL, 0, MRIM_CS_WP_REQUEST, buf.Data(), buf.Len()); + return (HANDLE)MraSendQueueCMD(hSendQueueHandle, dwRequestFlags, hContact, dwAckType, nullptr, 0, MRIM_CS_WP_REQUEST, buf.Data(), buf.Len()); } // Поиск контакта по EMail @@ -407,7 +407,7 @@ DWORD CMraProto::MraGame(const CMStringA &szEmail, DWORD dwGameSessionID, DWORD buf.SetUL(dwGameSessionID); buf.SetUL(dwGameMsg); buf.SetUL(dwGameMsgID); - buf.SetUL(_time32(NULL)); + buf.SetUL(_time32(nullptr)); buf.SetLPS(szData); return MraSendCMD(MRIM_CS_GAME, buf.Data(), buf.Len()); } @@ -449,7 +449,7 @@ DWORD CMraProto::MraSMSW(MCONTACT hContact, const CMStringA &lpszPhone, const CM /* Save phone number for ack notify after send. */ LPBYTE lpbData = (LPBYTE)mir_calloc(lpszPhone.GetLength() + sizeof(size_t)); - if (NULL == lpbData) + if (nullptr == lpbData) return (0); memcpy(lpbData, lpszPhone, lpszPhone.GetLength()); return MraSendQueueCMD(hSendQueueHandle, 0, hContact, ICQACKTYPE_SMS, lpbData, lpszPhone.GetLength(), MRIM_CS_SMS, buf.Data(), buf.Len()); diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 7acb2c8b80..da0902c387 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -114,7 +114,7 @@ DWORD MraAddrListGetFromBuff(const CMStringA &szAddresses, MRA_ADDR_LIST *pmalAd while (TRUE) { LPSTR lpszEndItem = strchr(lpszCurrentItem, ';'); - if (lpszEndItem == NULL) + if (lpszEndItem == nullptr) lpszEndItem = buf + szAddresses.GetLength(); if (!lpszEndItem) break; @@ -189,7 +189,7 @@ bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) { size_t dwRetBuffSizeLocal, dwReadedStringLen = mir_wstrlen(dbv.pwszVal); if (lpszRetBuff && (dwRetBuffSize > dwReadedStringLen)) { - dwRetBuffSizeLocal = WideCharToMultiByte(MRA_CODE_PAGE, 0, dbv.pwszVal, (int)dwReadedStringLen, lpszRetBuff, (int)dwRetBuffSize, NULL, NULL); + dwRetBuffSizeLocal = WideCharToMultiByte(MRA_CODE_PAGE, 0, dbv.pwszVal, (int)dwReadedStringLen, lpszRetBuff, (int)dwRetBuffSize, nullptr, nullptr); (*((CHAR*)(lpszRetBuff + dwRetBuffSizeLocal))) = 0; bRet = true; } @@ -305,7 +305,7 @@ bool DB_GetContactSettingBlob(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszV DWORD CMraProto::MraMoveContactToGroup(MCONTACT hContact, DWORD dwGroupID, LPCTSTR ptszName) { - MraGroupItem *p = NULL; + MraGroupItem *p = nullptr; for (auto &it : m_groups) if (it->m_name == ptszName) { @@ -313,13 +313,13 @@ DWORD CMraProto::MraMoveContactToGroup(MCONTACT hContact, DWORD dwGroupID, LPCTS break; } - if (p == NULL) { + if (p == nullptr) { if (m_groups.getCount() == 20) return 0; DWORD id; for (id = 0; id < 20; id++) - if (m_groups.find((MraGroupItem*)&id) == NULL) + if (m_groups.find((MraGroupItem*)&id) == nullptr) break; DWORD dwContactFlags = CONTACT_FLAG_UNICODE_NAME | CONTACT_FLAG_GROUP | (id << 24); @@ -448,7 +448,7 @@ DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, D if (dwFlags & SCBIF_ID) setDword(hContact, "ContactID", dwID); - if ((dwFlags & SCBIF_EMAIL) && szEmail != NULL && !szEmail->IsEmpty()) + if ((dwFlags & SCBIF_EMAIL) && szEmail != nullptr && !szEmail->IsEmpty()) mraSetStringExA(hContact, "e-mail", *szEmail); // поля изменения которых отслеживаются @@ -463,14 +463,14 @@ DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, D } } - if ((dwFlags & SCBIF_NICK) && wszNick != NULL && !wszNick->IsEmpty()) { + if ((dwFlags & SCBIF_NICK) && wszNick != nullptr && !wszNick->IsEmpty()) { if ((dwFlags & SCBIF_FLAG) && ((dwContactFlag & CONTACT_FLAG_UNICODE_NAME) == 0)) DB_SetStringExA(hContact, "CList", "MyHandle", CMStringA(*wszNick)); else DB_SetStringExW(hContact, "CList", "MyHandle", *wszNick); } - if ((dwFlags & SCBIF_PHONES) && szPhones != NULL && !szPhones->IsEmpty()) { + if ((dwFlags & SCBIF_PHONES) && szPhones != nullptr && !szPhones->IsEmpty()) { int iStart = 0, i = 0; while (true) { CMStringA szPhone = szPhones->Tokenize(",", iStart); @@ -525,7 +525,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe if (IsEMailChatAgent(szEmail)) { CMStringW wszEMail = szEmail; GCSessionInfoBase *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszEMail, wszEMail); - if (si != 0) { + if (si != nullptr) { bool bChatAdded = (si->hContact != NULL); if (bChatAdded == FALSE) hContact = NULL; @@ -538,12 +538,12 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe if (hContact) { if (IsEMailChatAgent(szEmail)) - SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS | SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_ONLINE, &szEmail, 0, 0); + SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS | SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_ONLINE, &szEmail, nullptr, nullptr); else { if (bTemporary) db_set_b(hContact, "CList", "NotOnList", 1); mraSetStringExA(hContact, "MirVer", MIRVER_UNKNOWN); - SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS | SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_OFFLINE, &szEmail, 0, 0); + SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID | SCBIF_GROUP_ID | SCBIF_SERVER_FLAG | SCBIF_STATUS | SCBIF_EMAIL), -1, -1, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, ID_STATUS_OFFLINE, &szEmail, nullptr, nullptr); } } } @@ -608,7 +608,7 @@ DWORD CMraProto::MraSetContactStatus(MCONTACT hContact, DWORD dwNewStatus) } else { if (dwOldStatus == ID_STATUS_OFFLINE) { - DWORD dwTime = (DWORD)_time32(NULL); + DWORD dwTime = (DWORD)_time32(nullptr); setDword(hContact, "LogonTS", dwTime); if (bChatAgent) @@ -639,7 +639,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (!pszFrom.IsEmpty() || !pszSubject.IsEmpty()) { CMStringA szFrom, szSubject; if (GetEMailFromString(szFrom, szEmail)) - hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL); + hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, nullptr); mir_snwprintf(szStatusText, TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus); } @@ -675,7 +675,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (bTrayIconNewMailNotify) pcli->pfnRemoveEvent(0, (LPARAM)m_szModuleName); PUDeletePopup(hWndEMailPopupStatus); - hWndEMailPopupStatus = NULL; + hWndEMailPopupStatus = nullptr; } else { mir_snwprintf(szStatusText, TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal); @@ -861,7 +861,7 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode if (dwErrorCode == NO_ERROR) wcsncpy_s(szErrorText, TranslateW(lpwszErrText), _TRUNCATE); else { - dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), NULL) - 2); + dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), nullptr) - 2); szErrDescription[dwErrDescriptionSize] = 0; mir_snwprintf(szErrorText, L"%s %lu: %s", TranslateW(lpwszErrText), dwErrorCode, szErrDescription); } @@ -996,7 +996,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP SetDlgItemText(hWndDlg, IDC_XMSG, L""); SendMessage(hWndDlg, WM_TIMER, 0, 0); - SetTimer(hWndDlg, 1, 1000, 0); + SetTimer(hWndDlg, 1, 1000, nullptr); iRet = TRUE; } break; @@ -1065,7 +1065,7 @@ bool CMraProto::MraRequestXStatusDetails(DWORD dwXStatus) SetXStatusData *dat = (SetXStatusData*)mir_calloc(sizeof(SetXStatusData)); dat->dwXStatus = dwXStatus; dat->ppro = this; - return DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETXSTATUS), NULL, SetXStatusDlgProc, (LPARAM)dat) != -1; + return DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETXSTATUS), nullptr, SetXStatusDlgProc, (LPARAM)dat) != -1; } return false; @@ -1181,7 +1181,7 @@ bool CMraProto::MraSendReplyBlogStatus(MCONTACT hContact) SetBlogStatusData* dat = (SetBlogStatusData*)mir_calloc(sizeof(SetBlogStatusData)); dat->ppro = this; dat->hContact = hContact; - return CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_MINIBLOG), NULL, SendReplyBlogStatusDlgProc, (LPARAM)dat) != NULL; + return CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_MINIBLOG), nullptr, SendReplyBlogStatusDlgProc, (LPARAM)dat) != nullptr; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -1238,7 +1238,7 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD dwRetErrorCode = ERROR_FILE_NOT_FOUND; prdsiItems[dwRecDeepCurPos].dwFileNameLen = 0; - prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, NULL, 0); + prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, nullptr, 0); if (prdsiItems[dwRecDeepCurPos].hFind != INVALID_HANDLE_VALUE) { do { dwPathLen -= prdsiItems[dwRecDeepCurPos].dwFileNameLen; @@ -1256,13 +1256,13 @@ DWORD FindFile(LPWSTR lpszFolder, DWORD dwFolderLen, LPWSTR lpszFileName, DWORD if (dwRecDeepCurPos == dwRecDeepAllocated) { // need more space dwRecDeepAllocated += RECURSION_DATA_STACK_ITEMS_MIN; prdsiItems = (RECURSION_DATA_STACK_ITEM*)mir_realloc(prdsiItems, dwRecDeepAllocated * sizeof(RECURSION_DATA_STACK_ITEM)); - if (prdsiItems == NULL) { + if (prdsiItems == nullptr) { dwRecDeepCurPos = 0; dwRetErrorCode = GetLastError(); break; } } - prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, NULL, 0); + prdsiItems[dwRecDeepCurPos].hFind = FindFirstFileEx(szPath, FindExInfoStandard, &prdsiItems[dwRecDeepCurPos].w32fdFindFileData, FindExSearchNameMatch, nullptr, 0); } } else {// file @@ -1375,7 +1375,7 @@ static DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplac while (dwFoundCount) { for (i = 0; i < dwReplaceItemsCount; i++) - if (plpbtFounded[i] && (plpbtFounded[i] < plpbtFounded[dwFirstFoundIndex] || plpbtFounded[dwFirstFoundIndex] == NULL)) + if (plpbtFounded[i] && (plpbtFounded[i] < plpbtFounded[dwFirstFoundIndex] || plpbtFounded[dwFirstFoundIndex] == nullptr)) dwFirstFoundIndex = i; if (plpbtFounded[dwFirstFoundIndex]) {// in found @@ -1388,7 +1388,7 @@ static DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplac for (i = 0; i < dwReplaceItemsCount; i++) {// looking for in next time if (plpbtFounded[i] && plpbtFounded[i] < lpbtInBuffCurPrev) { plpbtFounded[i] = (LPBYTE)MemoryFind((lpbtInBuffCurPrev - (LPBYTE)lpInBuff), lpInBuff, dwInBuffSize, plpInReplaceItems[i], pdwInReplaceItemsCounts[i]); - if (plpbtFounded[i] == NULL) dwFoundCount--; + if (plpbtFounded[i] == nullptr) dwFoundCount--; } } } diff --git a/protocols/MRA/src/Sdk/ListMT.h b/protocols/MRA/src/Sdk/ListMT.h index 4c3f6dd5b2..ed9b8cfec9 100644 --- a/protocols/MRA/src/Sdk/ListMT.h +++ b/protocols/MRA/src/Sdk/ListMT.h @@ -76,7 +76,7 @@ typedef CONST PLIST_MT_ITERATOR PCLIST_MT_ITERATOR, LPCLIST_MT_ITERATOR; __inline size_t ListMTGetCount(PCLIST_MT pclmtListMT) { - return((size_t)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL)); + return((size_t)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount, nullptr, nullptr)); } @@ -89,12 +89,12 @@ __inline size_t ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTIt if (pclmtListMT->plmtiLast) {// add node to end of list pclmtListMTItem->plmtiPrev=pclmtListMT->plmtiLast; - pclmtListMTItem->plmtiNext=NULL; + pclmtListMTItem->plmtiNext= nullptr; pclmtListMT->plmtiLast->plmtiNext=pclmtListMTItem; pclmtListMT->plmtiLast=pclmtListMTItem; }else{// add the first node to the linked list - pclmtListMTItem->plmtiPrev=NULL; - pclmtListMTItem->plmtiNext=NULL; + pclmtListMTItem->plmtiPrev= nullptr; + pclmtListMTItem->plmtiNext= nullptr; pclmtListMT->plmtiFirst=pclmtListMTItem; pclmtListMT->plmtiLast=pclmtListMTItem; } @@ -113,16 +113,16 @@ __inline DWORD ListMTItemDelete(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMT if (plmtiPrevNode || plmtiNextNode) { - if (plmtiPrevNode && plmtiNextNode==NULL) + if (plmtiPrevNode && plmtiNextNode == nullptr) {// This is the start node in the list to delete // отключился последний подключившийся - plmtiPrevNode->plmtiNext=NULL; + plmtiPrevNode->plmtiNext = nullptr; pclmtListMT->plmtiLast=plmtiPrevNode; }else{ - if (plmtiPrevNode==NULL && plmtiNextNode) + if (plmtiPrevNode == nullptr && plmtiNextNode) {// This is the end node in the list to delete // отключился первый подключившийся - plmtiNextNode->plmtiPrev=NULL; + plmtiNextNode->plmtiPrev = nullptr; pclmtListMT->plmtiFirst=plmtiNextNode; }else{// оключился клиент не первый и не последний //if (plmtiPrev && plmtiNext) @@ -133,11 +133,11 @@ __inline DWORD ListMTItemDelete(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMT } } }else{// This is the only node in the list to delete - pclmtListMT->plmtiFirst=NULL; - pclmtListMT->plmtiLast=NULL; + pclmtListMT->plmtiFirst = nullptr; + pclmtListMT->plmtiLast = nullptr; } - pclmtListMTItem->lpListMT=NULL; + pclmtListMTItem->lpListMT = nullptr; InterlockedDecrementPointer(&pclmtListMT->nCount);// pclmtListMT->nCount--; dwRetErrorCode=NO_ERROR; }else{// попытались удалить элемент не относящийся к данному списку diff --git a/protocols/MRA/src/Sdk/MemoryFind.h b/protocols/MRA/src/Sdk/MemoryFind.h index 75072540bd..f41ea64b6d 100644 --- a/protocols/MRA/src/Sdk/MemoryFind.h +++ b/protocols/MRA/src/Sdk/MemoryFind.h @@ -34,7 +34,7 @@ __inline void *MemoryFind(size_t dwFrom,const void *pBuff,size_t dwBuffSize,const void *pWhatFind,size_t dwWhatFindSize) { - void *pRet=NULL; + void *pRet = nullptr; if (pBuff && dwBuffSize && pWhatFind && dwWhatFindSize && (dwFrom+dwWhatFindSize)<=dwBuffSize) { diff --git a/protocols/MRA/src/Sdk/MemoryFindByte.h b/protocols/MRA/src/Sdk/MemoryFindByte.h index 27a3b96149..146fd74b30 100644 --- a/protocols/MRA/src/Sdk/MemoryFindByte.h +++ b/protocols/MRA/src/Sdk/MemoryFindByte.h @@ -34,7 +34,7 @@ __inline void *MemoryFindByte(size_t dwFrom,const void *pBuff,size_t dwBuffSize,unsigned char chWhatFind) { - void *pRet=NULL; + void *pRet = nullptr; if (pBuff && dwBuffSize && dwFrom ///////////////////////////////////////////////////////////////////////////////////////// // MSN message queue support - int MsgQueue_Add(const char* wlid, int msgType, const char* msg, int msglen, filetransfer* ft = NULL, int flags = 0, STRLIST *cnt = NULL); + int MsgQueue_Add(const char* wlid, int msgType, const char* msg, int msglen, filetransfer* ft = nullptr, int flags = 0, STRLIST *cnt = nullptr); const char* MsgQueue_CheckContact(const char* wlid, time_t tsc = 0); const char* MsgQueue_GetNextRecipient(void); bool MsgQueue_GetNext(const char* wlid, MsgQueueEntry& retVal); int MsgQueue_NumMsg(const char* wlid); - void MsgQueue_Clear(const char* wlid = NULL, bool msg = false); + void MsgQueue_Clear(const char* wlid = nullptr, bool msg = false); void MsgQueue_Init(void); void MsgQueue_Uninit(void); @@ -321,7 +321,7 @@ struct CMsnProto : public PROTO ///////////////////////////////////////////////////////////////////////////////////////// // MSN contact list - int Lists_Add(int list, int netId, const char* email, MCONTACT hContact = NULL, const char* nick = NULL, const char* invite = NULL); + int Lists_Add(int list, int netId, const char* email, MCONTACT hContact = NULL, const char* nick = nullptr, const char* invite = nullptr); bool Lists_IsInList(int list, const char* email); int Lists_GetMask(const char* email); int Lists_GetNetId(const char* email); @@ -346,11 +346,11 @@ struct CMsnProto : public PROTO bool MSN_RefreshContactList(void); bool MSN_IsMyContact(MCONTACT hContact); - bool MSN_IsMeByContact(MCONTACT hContact, char* szEmail = NULL); - bool MSN_AddUser(MCONTACT hContact, const char* email, int netId, int flags, const char *msg = NULL); + bool MSN_IsMeByContact(MCONTACT hContact, char* szEmail = nullptr); + bool MSN_AddUser(MCONTACT hContact, const char* email, int netId, int flags, const char *msg = nullptr); void MSN_AddAuthRequest(const char *email, const char *nick, const char *reason); void MSN_SetContactDb(MCONTACT hContact, const char *szEmail); - MCONTACT MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = NULL, bool addIfNeeded = false, bool temporary = false); + MCONTACT MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = nullptr, bool addIfNeeded = false, bool temporary = false); MCONTACT MSN_HContactFromChatID(const char* wlid); MCONTACT AddToListByEmail(const char *email, const char *nick, DWORD flags); diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index 13aa98cb49..df61064891 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -214,7 +214,7 @@ char* GetGlobalIp(void); template void UrlDecode(chartype* str); -char* MSN_GetAvatarHash(char* szContext, char** pszUrl = NULL); +char* MSN_GetAvatarHash(char* szContext, char** pszUrl = nullptr); bool MSN_MsgWndExist(MCONTACT hContact); #define MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a)) @@ -238,7 +238,7 @@ time_t MsnTSToUnixtime(const char *pszTS); wchar_t* EscapeChatTags(const wchar_t* pszText); -void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def = NULL); +void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def = nullptr); char* arrayToHex(BYTE* data, size_t datasz); @@ -692,7 +692,7 @@ public: bool Load(); void Save(); virtual bool Refresh(bool = false) { return false; } - bool Expired(time_t t = time(NULL)); + bool Expired(time_t t = time(nullptr)); void Clear(); const char *Token(); __forceinline operator char*() const { return m_pszToken; } @@ -767,7 +767,7 @@ struct MsnContact OBJLIST places; - MsnContact() : email(0), invite(0), nick(0), + MsnContact() : email(nullptr), invite(nullptr), nick(nullptr), hContact(0), list(0), netId(0), p2pMsgId(0), cap1(0), cap2(0), places(1, CompareId) { } diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h index cc5b296c48..15327988f5 100644 --- a/protocols/MinecraftDynmap/src/proto.h +++ b/protocols/MinecraftDynmap/src/proto.h @@ -70,7 +70,7 @@ public: // Chat handling void AddChat(const char *id, const char *name); - void UpdateChat(const char *name, const char *message, const time_t timestamp = time(NULL), bool addtochat = true); + void UpdateChat(const char *name, const char *message, const time_t timestamp = time(nullptr), bool addtochat = true); void AddChatContact(const char *nick); void DeleteChatContact(const char *name); void SetChatStatus(int); @@ -110,8 +110,8 @@ public: void __inline reset_error() { error_count_ = 0; } // HTTP communication - http::response sendRequest(const int request_type, std::string *post_data = NULL, std::string *get_data = NULL); - std::string chooseAction(int, std::string *get_data = NULL); + http::response sendRequest(const int request_type, std::string *post_data = nullptr, std::string *get_data = nullptr); + std::string chooseAction(int, std::string *get_data = nullptr); NETLIBHTTPHEADER *get_request_headers(int request_type, int *headers_count); // Requests and processing diff --git a/protocols/MinecraftDynmap/src/utils.h b/protocols/MinecraftDynmap/src/utils.h index 1944ec41e0..fd9e0c7616 100644 --- a/protocols/MinecraftDynmap/src/utils.h +++ b/protocols/MinecraftDynmap/src/utils.h @@ -56,7 +56,7 @@ public: void Unlock() { ReleaseMutex(handle_); - handle_ = 0; + handle_ = nullptr; } private: HANDLE handle_; diff --git a/protocols/Omegle/src/client.h b/protocols/Omegle/src/client.h index db44086101..60acaf0623 100644 --- a/protocols/Omegle/src/client.h +++ b/protocols/Omegle/src/client.h @@ -41,7 +41,7 @@ public: // Client definition Omegle_client() { - nick_ = NULL; + nick_ = nullptr; //msgid_ = 0; state_ = STATE_INACTIVE; @@ -49,12 +49,12 @@ public: error_count_ = 0; - parent = NULL; - handle_ = NULL; - hConnection = NULL; - hEventsConnection = NULL; - connection_lock_ = NULL; - chatHandle_ = NULL; + parent = nullptr; + handle_ = nullptr; + hConnection = nullptr; + hEventsConnection = nullptr; + connection_lock_ = nullptr; + chatHandle_ = nullptr; } HNETLIBCONN hConnection; @@ -108,10 +108,10 @@ public: bool send_message(const std::string &message_text); // HTTP communication - http::response flap(const int request_type, std::string *post_data = NULL, std::string *get_data = NULL); + http::response flap(const int request_type, std::string *post_data = nullptr, std::string *get_data = nullptr); std::string choose_server(int); - std::string choose_action(int, std::string *get_data = NULL); + std::string choose_action(int, std::string *get_data = nullptr); NETLIBHTTPHEADER *get_request_headers(int request_type, int *headers_count); diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index 23a96e44c5..4eac66f67e 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -95,7 +95,7 @@ public: void DeleteChatContact(const wchar_t *name); void SetChatStatus(int); void ClearChat(); - void SetTopic(const wchar_t *topic = NULL); + void SetTopic(const wchar_t *topic = nullptr); MCONTACT GetChatHandle(); // Connection client diff --git a/protocols/Omegle/src/stdafx.h b/protocols/Omegle/src/stdafx.h index 19412d8a2b..f216b4932c 100644 --- a/protocols/Omegle/src/stdafx.h +++ b/protocols/Omegle/src/stdafx.h @@ -93,7 +93,7 @@ public: void Unlock() { ReleaseMutex(handle_); - handle_ = 0; + handle_ = nullptr; } private: HANDLE handle_; diff --git a/protocols/Tox/src/http_request.h b/protocols/Tox/src/http_request.h index 18b8228f63..d51aab289f 100644 --- a/protocols/Tox/src/http_request.h +++ b/protocols/Tox/src/http_request.h @@ -27,14 +27,14 @@ private: cbSize = sizeof(NETLIBHTTPREQUEST); requestType = type; flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT; - szUrl = NULL; - headers = NULL; + szUrl = nullptr; + headers = nullptr; headersCount = 0; - pData = NULL; + pData = nullptr; dataLength = 0; resultCode = 0; - szResultDescr = NULL; - nlc = NULL; + szResultDescr = nullptr; + nlc = nullptr; timeout = 0; } @@ -90,7 +90,7 @@ public: void SetData(const char *data, size_t size) { - if (pData != NULL) + if (pData != nullptr) mir_free(pData); dataLength = (int)size; diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index 77f9285050..a5ced0c8f9 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -184,7 +184,7 @@ INT_PTR CToxProto::OnChangePassword(WPARAM, LPARAM) INT_PTR CToxProto::OnRemovePassword(WPARAM, LPARAM) { const wchar_t *message = TranslateT("Removing the password will lead to decryption of the profile.\r\nAre you sure to remove password?"); - int result = MessageBox(NULL, message, TranslateT("Remove password"), MB_YESNO | MB_ICONQUESTION); + int result = MessageBox(nullptr, message, TranslateT("Remove password"), MB_YESNO | MB_ICONQUESTION); if (result == IDYES) { delSetting(TOX_SETTINGS_PASSWORD); SaveToxProfile(m_toxThread->Tox()); diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index cfbee1b4ec..3971d76a72 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -161,7 +161,7 @@ private: ToxHexAddress GetContactPublicKey(const Tox *tox, const int friendNumber); - MCONTACT AddContact(const char *address, const char *nick = NULL, const char *dnsId = NULL, bool isTemporary = false); + MCONTACT AddContact(const char *address, const char *nick = nullptr, const char *dnsId = nullptr, bool isTemporary = false); MCONTACT GetContactFromAuthEvent(MEVENT hEvent); diff --git a/protocols/Tox/src/tox_thread.h b/protocols/Tox/src/tox_thread.h index 37372177dc..d47138822e 100644 --- a/protocols/Tox/src/tox_thread.h +++ b/protocols/Tox/src/tox_thread.h @@ -7,8 +7,8 @@ private: Tox *tox; public: - CToxThread(Tox_Options *options, TOX_ERR_NEW *error = NULL) - : tox(NULL) + CToxThread(Tox_Options *options, TOX_ERR_NEW *error = nullptr) + : tox(nullptr) { tox = tox_new(options, error); } @@ -19,7 +19,7 @@ public: if (tox) { tox_kill(tox); - tox = NULL; + tox = nullptr; } } diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index e1e7dd051e..46facedcc2 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -98,7 +98,7 @@ private: static void CALLBACK APC_callback(ULONG_PTR p); void UpdateChat(const twitter_user &update); - void AddChatContact(const char *name,const char *nick=0); + void AddChatContact(const char *name,const char *nick = nullptr); void DeleteChatContact(const char *name); void SetChatStatus(int); diff --git a/protocols/Twitter/src/utility.h b/protocols/Twitter/src/utility.h index 525e99428c..da2b4eb4a0 100644 --- a/protocols/Twitter/src/utility.h +++ b/protocols/Twitter/src/utility.h @@ -30,7 +30,7 @@ uint64_t str2int(const std::string &str); class mir_twitter : public twitter { public: - mir_twitter() : twitter(), handle_(NULL), httpPOST_(NULL) {} + mir_twitter() : twitter(), handle_(nullptr), httpPOST_(nullptr) {} void set_handle(PROTO_INTERFACE *ppro, HNETLIBUSER h) { ppro_ = ppro; @@ -73,7 +73,7 @@ public: std::wstring OAuthConcatenateRequestElements( const std::wstring& httpMethod, std::wstring url, const std::wstring& parameters ); std::map CrackURL(std::wstring ); std::wstring brook_httpsend(std::wstring, std::wstring, std::wstring, std::wstring); - void Disconnect(void) { if (httpPOST_) Netlib_CloseHandle(httpPOST_); httpPOST_ = NULL; } + void Disconnect(void) { if (httpPOST_) Netlib_CloseHandle(httpPOST_); httpPOST_ = nullptr; } std::wstring OAuthNormalizeUrl( const std::wstring& url ); std::wstring OAuthNormalizeRequestParameters( const OAuthParameters& requestParameters ); OAuthParameters ParseQueryString( const std::wstring& url ); -- cgit v1.2.3