summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /protocols/JabberG
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp8
-rw-r--r--protocols/JabberG/src/jabber_console.cpp8
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp10
-rw-r--r--protocols/JabberG/src/jabber_events.cpp2
-rw-r--r--protocols/JabberG/src/jabber_filterlist.cpp6
-rw-r--r--protocols/JabberG/src/jabber_form.cpp18
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp10
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp8
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp6
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_omemo.cpp24
-rwxr-xr-xprotocols/JabberG/src/jabber_opt.cpp6
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp4
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp10
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp24
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_search.cpp14
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_userinfo.cpp8
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp2
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp2
25 files changed, 95 insertions, 95 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 6a887eadf0..252d82ee82 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -234,7 +234,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
gce.ptszUID = user->m_tszResourceName;
gce.ptszText = buf;
gce.dwFlags = GCEF_ADDTOLOG;
- gce.time = time(0);
+ gce.time = time(nullptr);
Chat_Event(&gce);
}
}
@@ -263,7 +263,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t
gce.ptszText = szReason;
if (item->bChatActive == 2) {
gce.dwFlags |= GCEF_ADDTOLOG;
- gce.time = time(0);
+ gce.time = time(nullptr);
}
switch (gce.iType = action) {
@@ -1137,7 +1137,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
wchar_t *resourceName_copy = NEWWSTR_ALLOCA(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
- wchar_t *szInviteTo = 0;
+ wchar_t *szInviteTo = nullptr;
int idx = gch->dwData - IDM_LINK0;
LISTFOREACH(i, ppro, LIST_CHATROOM)
{
@@ -1382,7 +1382,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
if (m_bJabberOnline) {
wchar_t tszID[100];
- int64_t id = (_time64(0) << 16) + (GetTickCount() & 0xFFFF);
+ int64_t id = (_time64(nullptr) << 16) + (GetTickCount() & 0xFFFF);
wchar_t *buf = NEWWSTR_ALLOCA(gch->ptszText);
Chat_UnescapeTags(buf);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index c6646f52c7..3173d6757a 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -85,7 +85,7 @@ void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags)
if (node && m_pDlgConsole) {
if (XmlGetName(node)) {
if (FilterXml(node, flags)) {
- StringBuf buf = {0};
+ StringBuf buf = {};
sttAppendBufRaw(&buf, RTF_HEADER);
sttRtfAppendXml(&buf, node, flags, 1);
sttAppendBufRaw(&buf, RTF_SEPARATOR);
@@ -186,7 +186,7 @@ static void sttAppendBufW(StringBuf *buf, const WCHAR *str)
static void sttEmptyBuf(StringBuf *buf)
{
if (buf->buf) mir_free(buf->buf);
- buf->buf = 0;
+ buf->buf = nullptr;
buf->size = 0;
buf->offset = 0;
}
@@ -509,7 +509,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
if (xmlTmp)
m_proto->m_ThreadInfo->send(xmlTmp);
else {
- StringBuf buf = { 0 };
+ StringBuf buf = {};
sttAppendBufRaw(&buf, RTF_HEADER);
sttAppendBufRaw(&buf, RTF_BEGINPLAINXML);
sttAppendBufT(&buf, TranslateT("Outgoing XML parsing error"));
@@ -614,7 +614,7 @@ void __cdecl CJabberProto::ConsoleThread(void*)
void CJabberProto::ConsoleInit()
{
- m_hThreadConsole = ForkThreadEx(&CJabberProto::ConsoleThread, 0, &m_dwConsoleThreadId);
+ m_hThreadConsole = ForkThreadEx(&CJabberProto::ConsoleThread, nullptr, &m_dwConsoleThreadId);
}
void CJabberProto::ConsoleUninit()
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 1c74eb3ac9..98dde44e89 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -1182,23 +1182,23 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
{ nullptr, LPGENW("Contact Menu..."), SD_ACT_USERMENU, SD_FLG_NONODE},
{ nullptr, LPGENW("View vCard"), SD_ACT_VCARD, SD_FLG_NONODE},
{ JABBER_FEAT_MUC, LPGENW("Join chatroom"), SD_ACT_JOIN, SD_FLG_NORESOURCE},
- {0},
+ {nullptr},
{ nullptr, LPGENW("Refresh Info"), SD_ACT_REFRESH},
{ nullptr, LPGENW("Refresh Children"), SD_ACT_REFRESHCHILDREN},
- {0},
+ {nullptr},
{ nullptr, LPGENW("Add to favorites"), SD_ACT_FAVORITE},
{ nullptr, LPGENW("Add to roster"), SD_ACT_ROSTER, SD_FLG_NONODE | SD_FLG_NOTONROSTER},
{ JABBER_FEAT_MUC, LPGENW("Bookmark chatroom"), SD_ACT_BOOKMARK, SD_FLG_NORESOURCE | SD_FLG_HASUSER},
{ L"jabber:iq:search", LPGENW("Add search directory"), SD_ACT_ADDDIRECTORY},
{ JABBER_FEAT_BYTESTREAMS, LPGENW("Use this proxy"), SD_ACT_PROXY},
- {0},
+ {nullptr},
{ JABBER_FEAT_REGISTER, LPGENW("Register"), SD_ACT_REGISTER},
{ L"jabber:iq:gateway", LPGENW("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED},
{ JABBER_FEAT_COMMANDS, LPGENW("Commands..."), SD_ACT_ADHOC},
- {0},
+ {nullptr},
{ L"jabber:iq:gateway", LPGENW("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_ONLINE},
{ L"jabber:iq:gateway", LPGENW("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_NOTONLINE},
- {0},
+ {nullptr},
{ nullptr, LPGENW("Copy JID"), SD_ACT_COPYJID},
{ nullptr, LPGENW("Copy node name"), SD_ACT_COPYNODE},
{ nullptr, LPGENW("Copy node information"), SD_ACT_COPYINFO},
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index bfbf88cd6e..1c3f03a575 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -189,7 +189,7 @@ int CJabberProto::OnIdleChanged(WPARAM, LPARAM lParam)
if (lParam & IDF_ISIDLE) {
MIRANDA_IDLE_INFO mii = { sizeof(mii) };
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
- m_tmJabberIdleStartTime = time(0) - mii.idleTime * 60;
+ m_tmJabberIdleStartTime = time(nullptr) - mii.idleTime * 60;
}
else m_tmJabberIdleStartTime = 0;
diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp
index 97b4178c4c..848c2ec451 100644
--- a/protocols/JabberG/src/jabber_filterlist.cpp
+++ b/protocols/JabberG/src/jabber_filterlist.cpp
@@ -98,7 +98,7 @@ static LRESULT CALLBACK sttEditBoxSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
if (fdat->m_filterText) mir_free(fdat->m_filterText);
int length = GetWindowTextLength(hwnd) + 1;
if (length == 1)
- fdat->m_filterText = 0;
+ fdat->m_filterText = nullptr;
else {
fdat->m_filterText = (wchar_t *)mir_alloc(sizeof(wchar_t) * length);
GetWindowText(hwnd, fdat->m_filterText, length);
@@ -165,10 +165,10 @@ LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lPara
case 1:
if (m_trackFilter && fdat->m_hwndEditBox) {
- wchar_t *str = 0;
+ wchar_t *str = nullptr;
int length = GetWindowTextLength(fdat->m_hwndEditBox) + 1;
if (length == 1)
- str = 0;
+ str = nullptr;
else {
str = (wchar_t *)mir_alloc(sizeof(wchar_t) * length);
GetWindowText(fdat->m_hwndEditBox, str, length);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index fbec892638..032e4cdf24 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -156,7 +156,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text)
}
deltaHeight += rcText.bottom - rcText.top;
- SetWindowPos(GetDlgItem(hwndForm, IDC_INSTRUCTION), 0, 0, 0,
+ SetWindowPos(GetDlgItem(hwndForm, IDC_INSTRUCTION), nullptr, 0, 0,
oldWidth,
rcText.bottom - rcText.top,
SWP_NOMOVE | SWP_NOZORDER);
@@ -164,7 +164,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text)
GetWindowRect(GetDlgItem(hwndForm, IDC_WHITERECT), &rcText);
MapWindowPoints(nullptr, hwndForm, (LPPOINT)&rcText, 2);
rcText.bottom += deltaHeight;
- SetWindowPos(GetDlgItem(hwndForm, IDC_WHITERECT), 0, 0, 0,
+ SetWindowPos(GetDlgItem(hwndForm, IDC_WHITERECT), nullptr, 0, 0,
rcText.right - rcText.left,
rcText.bottom - rcText.top,
SWP_NOMOVE | SWP_NOZORDER);
@@ -172,7 +172,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text)
GetWindowRect(GetDlgItem(hwndForm, IDC_FRAME1), &rcText);
MapWindowPoints(nullptr, hwndForm, (LPPOINT)&rcText, 2);
rcText.top += deltaHeight;
- SetWindowPos(GetDlgItem(hwndForm, IDC_FRAME1), 0,
+ SetWindowPos(GetDlgItem(hwndForm, IDC_FRAME1), nullptr,
rcText.left,
rcText.top,
0, 0,
@@ -181,7 +181,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text)
GetWindowRect(GetDlgItem(hwndForm, IDC_FRAME), &rcText);
MapWindowPoints(nullptr, hwndForm, (LPPOINT)&rcText, 2);
rcText.top += deltaHeight;
- SetWindowPos(GetDlgItem(hwndForm, IDC_FRAME), 0,
+ SetWindowPos(GetDlgItem(hwndForm, IDC_FRAME), nullptr,
rcText.left,
rcText.top,
rcText.right - rcText.left,
@@ -191,7 +191,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text)
GetWindowRect(GetDlgItem(hwndForm, IDC_VSCROLL), &rcText);
MapWindowPoints(nullptr, hwndForm, (LPPOINT)&rcText, 2);
rcText.top += deltaHeight;
- SetWindowPos(GetDlgItem(hwndForm, IDC_VSCROLL), 0,
+ SetWindowPos(GetDlgItem(hwndForm, IDC_VSCROLL), nullptr,
rcText.left,
rcText.top,
rcText.right - rcText.left,
@@ -268,9 +268,9 @@ void JabberFormLayoutSingleControl(TJabberFormControlInfo *item, TJabberFormLayo
}
if (item->hLabel)
- SetWindowPos(item->hLabel, 0, 0, 0, rcLabel.right - rcLabel.left, rcLabel.bottom - rcLabel.top, SWP_NOZORDER | SWP_NOMOVE);
+ SetWindowPos(item->hLabel, nullptr, 0, 0, rcLabel.right - rcLabel.left, rcLabel.bottom - rcLabel.top, SWP_NOZORDER | SWP_NOMOVE);
if (item->hCtrl)
- SetWindowPos(item->hCtrl, 0, 0, 0, rcCtrl.right - rcCtrl.left, rcCtrl.bottom - rcCtrl.top, SWP_NOZORDER | SWP_NOMOVE);
+ SetWindowPos(item->hCtrl, nullptr, 0, 0, rcCtrl.right - rcCtrl.left, rcCtrl.bottom - rcCtrl.top, SWP_NOZORDER | SWP_NOMOVE);
item->ptLabel.x = rcLabel.left;
item->ptLabel.y = rcLabel.top;
@@ -396,11 +396,11 @@ void JabberFormLayoutControls(HWND hwndStatic, TJabberFormLayoutInfo *layout_inf
for (int i = 0; i < controls->getCount(); i++) {
if ((*controls)[i]->hLabel)
- SetWindowPos((*controls)[i]->hLabel, 0,
+ SetWindowPos((*controls)[i]->hLabel, nullptr,
layout_info->offset + (*controls)[i]->ptLabel.x, layout_info->y_pos + (*controls)[i]->ptLabel.y, 0, 0,
SWP_NOZORDER | SWP_NOSIZE);
if ((*controls)[i]->hCtrl)
- SetWindowPos((*controls)[i]->hCtrl, 0,
+ SetWindowPos((*controls)[i]->hCtrl, nullptr,
layout_info->offset + (*controls)[i]->ptCtrl.x, layout_info->y_pos + (*controls)[i]->ptCtrl.y, 0, 0,
SWP_NOZORDER | SWP_NOSIZE);
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 1ec5ec20c4..294c197487 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -277,8 +277,8 @@ static int sttRoomListAppend(HWND hwndList, RoomInfo::Overlay overlay, const wch
{
RoomInfo *info = (RoomInfo *)mir_alloc(sizeof(RoomInfo));
info->overlay = overlay;
- info->line1 = line1 ? mir_wstrdup(line1) : 0;
- info->line2 = line2 ? mir_wstrdup(line2) : 0;
+ info->line1 = line1 ? mir_wstrdup(line1) : nullptr;
+ info->line2 = line2 ? mir_wstrdup(line2) : nullptr;
int id = SendMessage(hwndList, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwndList, CB_SETITEMDATA, id, (LPARAM)info);
@@ -650,7 +650,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
LISTFOREACH(i, m_proto, LIST_BOOKMARK)
{
- JABBER_LIST_ITEM *item = 0;
+ JABBER_LIST_ITEM *item = nullptr;
if (item = m_proto->ListGetItemPtrFromIndex(i))
if (!mir_wstrcmp(item->type, L"conference"))
AppendMenu(hMenu, MF_STRING, (UINT_PTR)item, item->name);
@@ -800,7 +800,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t *
GCEVENT gce = { m_szModuleName, item->jid, GC_EVENT_NICK };
if (jid != nullptr)
gce.ptszUserInfo = jid;
- gce.time = time(0);
+ gce.time = time(nullptr);
gce.ptszNick = oldNick;
gce.ptszUID = newNick;
gce.ptszText = newNick;
@@ -946,7 +946,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// leaving room
else if (!mir_wstrcmp(type, L"unavailable")) {
- const wchar_t *str = 0;
+ const wchar_t *str = nullptr;
if (xNode != nullptr && item->nick != nullptr) {
HXML reasonNode = XmlGetChild(itemNode, "reason");
str = XmlGetAttrValue(itemNode, L"jid");
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 98957ca5eb..e008da1f0c 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -119,7 +119,7 @@ void CIconPool::RegisterIcon(const char *name, wchar_t *filename, int iconid, wc
item->m_name = mir_strdup(name);
item->m_szIcolibName = mir_strdup(szSettingName);
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.defaultFile.w = filename;
sid.pszName = szSettingName;
sid.section.w = szSection;
@@ -201,7 +201,7 @@ static inline wchar_t qtoupper(wchar_t c)
static BOOL WildComparei(const wchar_t *name, const wchar_t *mask)
{
- const wchar_t *last = '\0';
+ const wchar_t *last = nullptr;
for (;; mask++, name++) {
if (*mask != '?' && qtoupper(*mask) != qtoupper(*name))
break;
@@ -285,8 +285,8 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, wchar_t *S
if (hi) has_proto_icon = TRUE;
if (hi && nf) DestroyIcon(hi);
if (IconName != nullptr && SectName != nullptr) {
- SKINICONDESC sid = { 0 };
- sid.hDefaultIcon = (has_proto_icon) ? nullptr : Skin_LoadProtoIcon(0, -internalidx);
+ SKINICONDESC sid = {};
+ sid.hDefaultIcon = (has_proto_icon) ? nullptr : Skin_LoadProtoIcon(nullptr, -internalidx);
sid.section.w = SectName;
sid.pszName = IconName;
sid.description.w = Description;
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index 4d9929b945..d9e88f7560 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -61,7 +61,7 @@ bool CJabberIqManager::Start()
if (m_hExpirerThread || m_bExpirerThreadShutdownRequest)
return false;
- m_hExpirerThread = ppro->ForkThreadEx(&CJabberProto::ExpirerThread, this, 0);
+ m_hExpirerThread = ppro->ForkThreadEx(&CJabberProto::ExpirerThread, this, nullptr);
if (!m_hExpirerThread)
return false;
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index c8dfdfbde9..f6ff5655de 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -57,7 +57,7 @@ BOOL CJabberProto::OnIqRequestLastActivity(HXML, CJabberIqInfo *pInfo)
{
m_ThreadInfo->send(
XmlNodeIq(L"result", pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY)
- << XATTRI(L"seconds", m_tmJabberIdleStartTime ? time(0) - m_tmJabberIdleStartTime : 0));
+ << XATTRI(L"seconds", m_tmJabberIdleStartTime ? time(nullptr) - m_tmJabberIdleStartTime : 0));
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 94a2fbb7ea..aeecad1744 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -173,7 +173,7 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq)
void CJabberProto::OnLoggedIn()
{
m_bJabberOnline = true;
- m_tmJabberLoggedInTime = time(0);
+ m_tmJabberLoggedInTime = time(nullptr);
m_ThreadInfo->dwLoginRqs = 0;
@@ -1415,7 +1415,7 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const wchar_t
if (mimeType != nullptr)
pictureType = ProtoGetAvatarFormatByMimeType(mimeType);
else
- pictureType = ProtoGetBufferFormat(body, 0);
+ pictureType = ProtoGetBufferFormat(body, nullptr);
if (pictureType == PA_FORMAT_UNKNOWN) {
debugLogW(L"Invalid mime type specified for picture: %s", mimeType);
return;
@@ -1582,7 +1582,7 @@ void CJabberProto::OnIqResultLastActivity(HXML iqNode, CJabberIqInfo *pInfo)
if (szSeconds) {
int nSeconds = _wtoi(szSeconds);
if (nSeconds > 0)
- lastActivity = time(0) - nSeconds;
+ lastActivity = time(nullptr) - nSeconds;
}
LPCTSTR szLastStatusMessage = XPathT(iqNode, "query[@xmlns='jabber:iq:last']");
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index c37e63b50a..03d4b5d6a7 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -187,7 +187,7 @@ void g_MenuInit(void)
CreateServiceFunction("Jabber/MenuChoose", JabberMenuChooseService);
- hChooserMenu = Menu_AddObject("JabberAccountChooser", LPGEN("Jabber account chooser"), 0, "Jabber/MenuChoose");
+ hChooserMenu = Menu_AddObject("JabberAccountChooser", LPGEN("Jabber account chooser"), nullptr, "Jabber/MenuChoose");
{
CMenuItem mi;
mi.name.a = "Cancel";
@@ -847,7 +847,7 @@ int g_OnToolbarInit(WPARAM, LPARAM)
if (g_Instances.getCount() == 0)
return 0;
- TTBButton ttb = { 0 };
+ TTBButton ttb = {};
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
CreateServiceFunction("JABBER/*/Groupchat", g_ToolbarHandleJoinGroupchat);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 91d7955c7e..7900f2711d 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -91,7 +91,7 @@ MCONTACT CJabberProto::DBCreateContact(const wchar_t *jid, const wchar_t *nick,
SendGetVcard(szJid);
if (JABBER_LIST_ITEM *pItem = ListAdd(LIST_ROSTER, jid, hNewContact))
- pItem->bUseResource = wcschr(szJid, '/') != 0;
+ pItem->bUseResource = wcschr(szJid, '/') != nullptr;
debugLogW(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
DBCheckIsTransportedContact(szJid, hNewContact);
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 4467b392f7..dd80f9d395 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static wchar_t* StrTrimCopy(wchar_t *str)
{
- if (!str) return 0;
+ if (!str) return nullptr;
while (*str && iswspace(*str)) ++str;
if (!*str) return mir_wstrdup(str);
@@ -468,7 +468,7 @@ private:
void InsertTag(HTREEITEM htiRoot, const wchar_t *tag, bool bSelect)
{
- TVINSERTSTRUCT tvi = { 0 };
+ TVINSERTSTRUCT tvi = {};
tvi.hParent = htiRoot;
tvi.hInsertAfter = TVI_LAST;
tvi.itemex.mask = TVIF_TEXT | TVIF_PARAM;
@@ -509,7 +509,7 @@ private:
m_tvFilter.DeleteAllItems();
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
tvis.hInsertAfter = TVI_LAST;
tvis.itemex.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvis.itemex.stateMask = tvis.itemex.state = TVIS_BOLD | TVIS_EXPANDED;
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index 7f29fd009f..d06af0543d 100755
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -118,7 +118,7 @@ namespace omemo {
goto complete;
}
- result = EVP_DigestInit_ex(ctx, EVP_sha512(), 0);
+ result = EVP_DigestInit_ex(ctx, EVP_sha512(), nullptr);
if (result == 1) {
result = SG_SUCCESS;
}
@@ -163,7 +163,7 @@ namespace omemo {
goto complete;
}
- result = EVP_DigestInit_ex(ctx, EVP_sha512(), 0);
+ result = EVP_DigestInit_ex(ctx, EVP_sha512(), nullptr);
if (result == 1) {
result = SG_SUCCESS;
}
@@ -214,7 +214,7 @@ namespace omemo {
return EVP_aes_256_ctr();
}
}
- return 0;
+ return nullptr;
}
int encrypt_func(signal_buffer **output,
@@ -226,7 +226,7 @@ namespace omemo {
{
//TODO: use netlib for log
int result = 0;
- uint8_t *out_buf = 0;
+ uint8_t *out_buf = nullptr;
const EVP_CIPHER *evp_cipher = aes_cipher(cipher, key_len);
if (!evp_cipher) {
@@ -247,7 +247,7 @@ namespace omemo {
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
- result = EVP_EncryptInit_ex(&ctx, evp_cipher, 0, key, iv);
+ result = EVP_EncryptInit_ex(&ctx, evp_cipher, nullptr, key, iv);
if (!result) {
//fprintf(stderr, "cannot initialize cipher\n");
result = SG_ERR_UNKNOWN;
@@ -306,7 +306,7 @@ namespace omemo {
{
//TODO: use netlib for log
int result = 0;
- uint8_t *out_buf = 0;
+ uint8_t *out_buf = nullptr;
const EVP_CIPHER *evp_cipher = aes_cipher(cipher, key_len);
if (!evp_cipher) {
@@ -327,7 +327,7 @@ namespace omemo {
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
- result = EVP_DecryptInit_ex(&ctx, evp_cipher, 0, key, iv);
+ result = EVP_DecryptInit_ex(&ctx, evp_cipher, nullptr, key, iv);
if (!result) {
///fprintf(stderr, "cannot initialize cipher\n");
result = SG_ERR_UNKNOWN;
@@ -592,7 +592,7 @@ namespace omemo {
session_signed_pre_key* signed_pre_key;
{
const unsigned int signed_pre_key_id = 1;
- signal_protocol_key_helper_generate_signed_pre_key(&signed_pre_key, new_dev->device_key, signed_pre_key_id, time(0), global_context);
+ signal_protocol_key_helper_generate_signed_pre_key(&signed_pre_key, new_dev->device_key, signed_pre_key_id, time(nullptr), global_context);
SIGNAL_UNREF(new_dev->device_key);
signal_buffer *serialized_signed_pre_key;
session_signed_pre_key_serialize(&serialized_signed_pre_key, signed_pre_key);
@@ -1247,7 +1247,7 @@ namespace omemo {
char *setting_name = (char*)mir_alloc(strlen(id_str) + 65);
mir_snprintf(setting_name, strlen(id_str) + 64, "%s%s", "OmemoSignalIdentity_", id_str);
mir_free(id_str);
- if (key_data != 0)
+ if (key_data != nullptr)
db_set_blob(data->hContact, data->proto->m_szModuleName, setting_name, key_data, (unsigned int)key_len); //TODO: check return value
else
db_unset(data->hContact, data->proto->m_szModuleName, setting_name);
@@ -1711,7 +1711,7 @@ void CJabberProto::OmemoHandleMessage(HXML node, wchar_t *jid, time_t msgTime)
}
if (deserialized && pm)
{
- int ret = session_cipher_decrypt_pre_key_signal_message((*(std::map<MCONTACT, std::map<unsigned int, omemo::omemo_session_jabber_internal_ptrs> >*)m_omemo.sessions_internal)[hContact][sender_dev_id_int].cipher, pm, 0, &decrypted_key);
+ int ret = session_cipher_decrypt_pre_key_signal_message((*(std::map<MCONTACT, std::map<unsigned int, omemo::omemo_session_jabber_internal_ptrs> >*)m_omemo.sessions_internal)[hContact][sender_dev_id_int].cipher, pm, nullptr, &decrypted_key);
switch (ret)
{
case SG_SUCCESS:
@@ -1766,7 +1766,7 @@ void CJabberProto::OmemoHandleMessage(HXML node, wchar_t *jid, time_t msgTime)
}
if (deserialized && sm)
{
- ret = session_cipher_decrypt_signal_message((*(std::map<MCONTACT, std::map<unsigned int, omemo::omemo_session_jabber_internal_ptrs> >*)m_omemo.sessions_internal)[hContact][sender_dev_id_int].cipher, sm, 0, &decrypted_key);
+ ret = session_cipher_decrypt_signal_message((*(std::map<MCONTACT, std::map<unsigned int, omemo::omemo_session_jabber_internal_ptrs> >*)m_omemo.sessions_internal)[hContact][sender_dev_id_int].cipher, sm, nullptr, &decrypted_key);
switch (ret)
{
case SG_SUCCESS:
@@ -2098,7 +2098,7 @@ bool CJabberProto::OmemoCheckSession(MCONTACT hContact)
wchar_t szBareJid[JABBER_MAX_JID_LEN];
unsigned int *dev_id = (unsigned int*)mir_alloc(sizeof(unsigned int));
*dev_id = id;
- XmlNodeIq iq(AddIQ(&CJabberProto::OmemoOnIqResultGetBundle, JABBER_IQ_TYPE_GET, 0, 0UL, -1, dev_id));
+ XmlNodeIq iq(AddIQ(&CJabberProto::OmemoOnIqResultGetBundle, JABBER_IQ_TYPE_GET, nullptr, 0UL, -1, dev_id));
iq << XATTR(L"from", JabberStripJid(m_ThreadInfo->fullJID, szBareJid, _countof_portable(szBareJid)));
wchar_t *jid = ContactToJID(hContact);
iq << XATTR(L"to", jid);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 5b3911e893..e75c01de02 100755
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "jabber_caps.h"
#include "jabber_opttree.h"
-static BOOL(WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0;
+static BOOL(WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
// JabberRegisterDlgProc - the dialog proc for registering new account
@@ -539,7 +539,7 @@ private:
void btnRegister_OnClick(CCtrlButton *)
{
- PSHNOTIFY pshn = { 0 };
+ PSHNOTIFY pshn = {};
pshn.hdr.code = PSN_APPLY;
pshn.hdr.hwndFrom = m_hwnd;
SendMessage(m_hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
@@ -1823,7 +1823,7 @@ private:
void btnRegister_OnClick(CCtrlButton *)
{
- PSHNOTIFY pshn = { 0 };
+ PSHNOTIFY pshn = {};
pshn.hdr.code = PSN_APPLY;
pshn.hdr.hwndFrom = m_hwnd;
SendMessage(m_hwnd, WM_NOTIFY, 0, (LPARAM)&pshn);
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index dc067efb28..ef65f14eb6 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -129,7 +129,7 @@ void CCtrlTreeOpts::OnInit()
hItem = FindNamedItem(hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
tvis.hParent = hSection;
tvis.hInsertAfter = TVI_LAST;//TVI_SORT;
tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
@@ -163,7 +163,7 @@ void CCtrlTreeOpts::OnInit()
TranslateTree();
ShowWindow(m_hwnd, SW_SHOW);
- SelectItem(FindNamedItem(0, nullptr));
+ SelectItem(FindNamedItem(nullptr, nullptr));
}
void CCtrlTreeOpts::OnDestroy()
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index ef1db75054..bff28c6457 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -431,7 +431,7 @@ public:
// append known chatroom jids from bookmarks
LISTFOREACH(i, m_proto, LIST_BOOKMARK)
{
- JABBER_LIST_ITEM *item = 0;
+ JABBER_LIST_ITEM *item = nullptr;
if (item = m_proto->ListGetItemPtrFromIndex(i))
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, (LPARAM)item->jid);
}
@@ -648,7 +648,7 @@ protected:
CPrivacyList *pList;
- TCLCInfo(): newJids(1, TJidData::cmp), bChanged(false), pList(0) {}
+ TCLCInfo(): newJids(1, TJidData::cmp), bChanged(false), pList(nullptr) {}
~TCLCInfo()
{
for (int i=0; i < newJids.getCount(); i++) {
@@ -667,10 +667,10 @@ protected:
HANDLE findJid(wchar_t *jid)
{
- TJidData data = {0};
+ TJidData data = {};
data.jid = jid;
TJidData *found = newJids.find(&data);
- return found ? found->hItem : 0;
+ return found ? found->hItem : nullptr;
}
};
@@ -1374,7 +1374,7 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList)
goto lbl_return;
for (CPrivacyListRule *pRule = pList->GetFirstRule(); pRule; pRule = pRule->GetNext()) {
- HANDLE hItem = 0;
+ HANDLE hItem = nullptr;
switch (pRule->GetType()) {
case Jid:
hItem = CListAddContact(hwndList, pRule->GetValue());
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 6b6c5b9adc..fa20992ff9 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -68,7 +68,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
m_privacyMenuServiceAllocated(-1),
m_priorityMenuVal(0),
m_priorityMenuValSet(false),
- m_hPrivacyMenuRoot(0),
+ m_hPrivacyMenuRoot(nullptr),
m_hPrivacyMenuItems(10),
m_lstJabberFeatCapPairsDynamic(2),
m_uEnabledFeatCapsDynamic(0)
@@ -425,7 +425,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const wchar_t *szPath)
{
if (!m_bJabberOnline)
- return 0;
+ return nullptr;
filetransfer *ft = (filetransfer*)hTransfer;
ft->std.tszWorkingDir = mir_wstrdup(szPath);
@@ -650,7 +650,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
JABBER_SEARCH_BASIC *jsb;
if (!m_bJabberOnline || (jsb = (JABBER_SEARCH_BASIC*)mir_alloc(sizeof(JABBER_SEARCH_BASIC))) == nullptr)
- return 0;
+ return nullptr;
if (wcschr(szJid, '@') == nullptr) {
wchar_t *szServer = mir_a2u(m_ThreadInfo->conn.server);
@@ -687,7 +687,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
HANDLE __cdecl CJabberProto::SearchByEmail(const wchar_t *email)
{
if (!m_bJabberOnline || email == nullptr)
- return 0;
+ return nullptr;
ptrA szServerName(getStringA("Jud"));
@@ -791,23 +791,23 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC
HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t** ppszFiles)
{
- if (!m_bJabberOnline) return 0;
+ if (!m_bJabberOnline) return nullptr;
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
- return 0;
+ return nullptr;
ptrW jid(getWStringA(hContact, "jid"));
if (jid == nullptr)
- return 0;
+ return nullptr;
struct _stati64 statbuf;
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == nullptr)
- return 0;
+ return nullptr;
// Check if another file transfer session request is pending (waiting for disco result)
if (item->ft != nullptr)
- return 0;
+ return nullptr;
JabberCapsBits jcb = GetResourceCapabilities(item->jid);
if (jcb == JABBER_RESOURCE_CAPS_IN_PROGRESS) {
@@ -833,7 +833,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri
// XEP-0096 and OOB not supported?
|| !(jcb & (JABBER_CAPS_SI_FT | JABBER_CAPS_OOB))) {
MsgPopup(hContact, TranslateT("No compatible file transfer mechanism exists"), item->jid);
- return 0;
+ return nullptr;
}
filetransfer *ft = new filetransfer(this);
@@ -915,7 +915,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const c
{
OmemoPutMessageToOutgoingQueue(hContact, unused_unknown, pszSrc);
int id = SerialNext();
- TFakeAckParams *param = new TFakeAckParams(hContact, 0, id);
+ TFakeAckParams *param = new TFakeAckParams(hContact, nullptr, id);
ForkThread(&CJabberProto::SendMessageAckThread, param);
return id;
}
@@ -998,7 +998,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const c
}
m_ThreadInfo->send(m);
- ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, 0, id));
+ ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, nullptr, id));
}
else {
XmlAddAttr(m, L"to", szClientJid); XmlAddAttrID(m, id);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 2d873ad70a..610c2d5514 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -684,7 +684,7 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo *pInfo, CJabberAdh
fieldNode = XmlGetChildByTag(xNode,"field", "var", L"allow-shutdown");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode) && _wtoi(XmlGetText(valueNode)))
- CallFunctionAsync(JabberQuitMirandaIMThread, 0);
+ CallFunctionAsync(JabberQuitMirandaIMThread, nullptr);
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
}
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 996018d1a8..d298054cc2 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -105,8 +105,8 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat)
int Order = (FieldDat->bHidden) ? -1 : FieldDat->Order;
- HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateW(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, nullptr, hInst, 0);
- HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, L"EDIT", (LPCTSTR)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, nullptr, hInst, 0);
+ HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateW(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, nullptr, hInst, nullptr);
+ HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, L"EDIT", (LPCTSTR)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, nullptr, hInst, nullptr);
SendMessage(hwndLabel, WM_SETFONT, (WPARAM)hFont, 0);
SendMessage(hwndVar, WM_SETFONT, (WPARAM)hFont, 0);
if (!FieldDat->bHidden) {
@@ -719,7 +719,7 @@ HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent)
return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this);
}
- return 0; // Failure
+ return nullptr; // Failure
}
//////////////////////////////////////////////////////////////////////////
@@ -728,15 +728,15 @@ HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent)
HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
{
if (!m_bJabberOnline || !hwndDlg)
- return 0; //error
+ return nullptr; //error
JabberSearchData * dat = (JabberSearchData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (!dat)
- return 0; //error
+ return nullptr; //error
// check if server connected (at least one field exists)
if (dat->nJSInfCount == 0)
- return 0;
+ return nullptr;
// formating request
BOOL fRequestNotEmpty = FALSE;
@@ -776,5 +776,5 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
m_ThreadInfo->send(iq);
return (HWND)pInfo->GetIqId();
}
- return 0;
+ return nullptr;
}
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 126befb184..4a1fec9a73 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -440,7 +440,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
szMsgBody += 5;
wchar_t *szDelim = wcschr(szMsgBody, ';');
if (szDelim)
- szDelim = 0;
+ szDelim = nullptr;
JabberHttpUrlDecode(szMsgBody);
}
}
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 33dff7e34f..13681ceb0f 100755
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -40,7 +40,7 @@ struct UserInfoStringBuf
wchar_t *buf;
size_t size, offset;
- UserInfoStringBuf() { buf = 0; size = 0; offset = 0; }
+ UserInfoStringBuf() { buf = nullptr; size = 0; offset = 0; }
~UserInfoStringBuf() { mir_free(buf); }
void append(wchar_t *str) {
@@ -151,7 +151,7 @@ void sttCleanupInfo(HWND hwndTree, int stage)
break;
}
- HTREEITEM hItemTmp = 0;
+ HTREEITEM hItemTmp = nullptr;
if (hItemTmp = TreeView_GetChild(hwndTree, hItem))
hItem = hItemTmp;
else if (hItemTmp = TreeView_GetNextSibling(hwndTree, hItem))
@@ -178,7 +178,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon,
else
mir_wstrncpy(buf, value, _countof(buf));
- TVINSERTSTRUCT tvis = {0};
+ TVINSERTSTRUCT tvis = {};
tvis.hParent = htiRoot;
tvis.hInsertAfter = TVI_LAST;
tvis.itemex.mask = TVIF_TEXT|TVIF_PARAM;
@@ -505,7 +505,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TV_INFO) {
HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO);
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- HTREEITEM hItem = 0;
+ HTREEITEM hItem = nullptr;
if ((pt.x == -1) && (pt.y == -1)) {
if (hItem = TreeView_GetSelection(hwndTree)) {
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 2ec6c71e85..bfa0387296 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -447,7 +447,7 @@ void CJabberProto::SendPresenceTo(int status, const wchar_t* to, HXML extra, con
}
if (m_tmJabberIdleStartTime)
- p << XQUERY(JABBER_FEAT_LAST_ACTIVITY) << XATTRI(L"seconds", time(0) - m_tmJabberIdleStartTime);
+ p << XQUERY(JABBER_FEAT_LAST_ACTIVITY) << XATTRI(L"seconds", time(nullptr) - m_tmJabberIdleStartTime);
if (m_options.EnableAvatars) {
HXML x = p << XCHILDNS(L"x", L"vcard-temp:x:update");
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index f4c899d3cd..a667148534 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -307,7 +307,7 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate)
XPath::PathType XPath::LookupImpl(bool bCreate)
{
LookupState state = S_START;
- LookupInfo info = {0};
+ LookupInfo info = {};
for (LPCTSTR p = m_szPath; state < S_FINAL; ++p) {
switch (state) {