From 324b246fb23cd518bdd1907985c695b8fc4f28d2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Sep 2013 15:19:44 +0000 Subject: minor code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@6241 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_byte.cpp | 2 +- protocols/JabberG/src/jabber_caps.cpp | 14 +++++----- protocols/JabberG/src/jabber_chat.cpp | 29 ++++++++++---------- protocols/JabberG/src/jabber_console.cpp | 22 +++++++-------- protocols/JabberG/src/jabber_disco.cpp | 12 ++++----- protocols/JabberG/src/jabber_form.cpp | 8 +++--- protocols/JabberG/src/jabber_frame.cpp | 8 +++--- protocols/JabberG/src/jabber_groupchat.cpp | 38 +++++++++----------------- protocols/JabberG/src/jabber_icolib.cpp | 2 +- protocols/JabberG/src/jabber_iq.cpp | 43 +++++++++++------------------- protocols/JabberG/src/jabber_iqid.cpp | 2 +- protocols/JabberG/src/jabber_iqid_muc.cpp | 2 +- protocols/JabberG/src/jabber_menu.cpp | 14 +++++----- protocols/JabberG/src/jabber_misc.cpp | 2 +- protocols/JabberG/src/jabber_notes.cpp | 8 +++--- protocols/JabberG/src/jabber_opt.cpp | 18 ++++++------- protocols/JabberG/src/jabber_opttree.cpp | 8 +++--- protocols/JabberG/src/jabber_privacy.cpp | 14 +++++----- protocols/JabberG/src/jabber_privacy.h | 4 +-- protocols/JabberG/src/jabber_proto.cpp | 4 +-- protocols/JabberG/src/jabber_proxy.cpp | 2 +- protocols/JabberG/src/jabber_rc.cpp | 2 +- protocols/JabberG/src/jabber_search.cpp | 2 +- protocols/JabberG/src/jabber_secur.cpp | 2 +- protocols/JabberG/src/jabber_svc.cpp | 16 +++++------ protocols/JabberG/src/jabber_thread.cpp | 19 +++++-------- protocols/JabberG/src/jabber_treelist.cpp | 4 +-- protocols/JabberG/src/jabber_userinfo.cpp | 6 ++--- protocols/JabberG/src/jabber_util.cpp | 10 +++---- protocols/JabberG/src/jabber_vcard.cpp | 4 +-- protocols/JabberG/src/jabber_xstatus.cpp | 8 +++--- protocols/JabberG/src/jabber_xstatus.h | 16 +++++------ protocols/JabberG/src/ui_utils.cpp | 6 ++--- 33 files changed, 160 insertions(+), 191 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 16d9c835ac..aa4a38f9ad 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -227,7 +227,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) query << XCHILD(_T("streamhost")) << XATTR(_T("jid"), m_ThreadInfo->fullJID) << XATTR(_T("host"), _A2T(localAddr)) << XATTRI(_T("port"), nlb.wPort); NETLIBIPLIST* ihaddr = (NETLIBIPLIST*)CallService(MS_NETLIB_GETMYIP, 1, 0); - for (unsigned i = 0; i < ihaddr->cbNum; i++) + for (unsigned i=0; i < ihaddr->cbNum; i++) if (strcmp(localAddr, ihaddr->szIp[i])) query << XCHILD(_T("streamhost")) << XATTR(_T("jid"), m_ThreadInfo->fullJID) << XATTR(_T("host"), _A2T(ihaddr->szIp[i])) << XATTRI(_T("port"), nlb.wPort); diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index 083baf3001..dd7762f1e9 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -199,7 +199,7 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid) } if (item) { - for (int i = 0; i < item->arResources.getCount(); i++) { + for (int i=0; i < item->arResources.getCount(); i++) { TCHAR szFullJid[JABBER_MAX_JID_LEN]; mir_sntprintf(szFullJid, JABBER_MAX_JID_LEN, _T("%s/%s"), szBareJid, item->arResources[i]->m_tszResourceName); JabberCapsBits jcb = GetResourceCapabilites(szFullJid, FALSE); @@ -549,7 +549,7 @@ void CJabberClientCapsManager::AddDefaultCaps() { SetClientCaps(JABBER_CAPS_MIRANDA_NODE, szCoreVersion, JABBER_CAPS_MIRANDA_ALL); - for (int i = 0; g_JabberFeatCapPairsExt[i].szFeature; i++) + for (int i=0; g_JabberFeatCapPairsExt[i].szFeature; i++) SetClientCaps(JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature, g_JabberFeatCapPairsExt[i].jcbCap); } @@ -614,7 +614,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con JabberCapsBits jcb = 0; if (szNode) { - for (i = 0; g_JabberFeatCapPairsExt[i].szFeature; i++) { + for (i=0; g_JabberFeatCapPairsExt[i].szFeature; i++) { TCHAR szExtCap[ 512 ]; mir_sntprintf(szExtCap, SIZEOF(szExtCap), _T("%s#%s"), JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature); if ( !_tcscmp(szNode, szExtCap)) { @@ -624,7 +624,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con } // check features registered through IJabberNetInterface::RegisterFeature() and IJabberNetInterface::AddFeatures() - for (i = 0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) { + for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) { TCHAR szExtCap[ 512 ]; mir_sntprintf(szExtCap, SIZEOF(szExtCap), _T("%s#%s"), JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt); if ( !_tcscmp(szNode, szExtCap)) { @@ -639,7 +639,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con } else { jcb = JABBER_CAPS_MIRANDA_ALL; - for (i = 0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) jcb |= ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap; } @@ -655,11 +655,11 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con query << XCHILD(_T("identity")) << XATTR(_T("category"), _T("client")) << XATTR(_T("type"), _T("pc")) << XATTR(_T("name"), _T("Miranda")); - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) query << XCHILD(_T("feature")) << XATTR(_T("var"), g_JabberFeatCapPairs[i].szFeature); - for (i = 0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap) query << XCHILD(_T("feature")) << XATTR(_T("var"), ppro->m_lstJabberFeatCapPairsDynamic[i]->szFeature); diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 14ccdb56c4..b21c0ddfa7 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -106,7 +106,8 @@ int JabberGcGetStatus(JABBER_GC_AFFILIATION a, JABBER_GC_ROLE r) switch (r) { case ROLE_MODERATOR: return 2; case ROLE_PARTICIPANT: return 1; - } } + } + } return 0; } @@ -121,8 +122,8 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) int i; // translate string for menus (this can't be done in initializer) - for (i = 0; i < SIZEOF(sttAffiliationItems); i++) sttAffiliationItems[i].translate(); - for (i = 0; i < SIZEOF(sttRoleItems); i++) sttRoleItems[i].translate(); + for (i=0; i < SIZEOF(sttAffiliationItems); i++) sttAffiliationItems[i].translate(); + for (i=0; i < SIZEOF(sttRoleItems); i++) sttRoleItems[i].translate(); TCHAR *szNick = JabberNickFromJID(item->jid); @@ -398,7 +399,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason) static gc_item *sttFindGcMenuItem(GCMENUITEMS *items, DWORD id) { - for (int i = 0; i < items->nItems; i++) + for (int i=0; i < items->nItems; i++) if (items->Item[i].dwID == id) return items->Item + i; return NULL; @@ -406,14 +407,14 @@ static gc_item *sttFindGcMenuItem(GCMENUITEMS *items, DWORD id) static void sttSetupGcMenuItem(GCMENUITEMS *items, DWORD id, bool disabled) { - for (int i = 0; i < items->nItems; i++) + for (int i=0; i < items->nItems; i++) if ( !id || (items->Item[i].dwID == id)) items->Item[i].bDisabled = disabled; } static void sttShowGcMenuItem(GCMENUITEMS *items, DWORD id, int type) { - for (int i = 0; i < items->nItems; i++) + for (int i=0; i < items->nItems; i++) if ( !id || (items->Item[i].dwID == id)) items->Item[i].uType = type; } @@ -611,13 +612,13 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) for (; idx <= IDM_LINK9; ++idx) sttFindGcMenuItem(gcmi, idx)->uType = 0; - for (i = 0; i < SIZEOF(sttAffiliationItems); i++) { + for (i=0; i < SIZEOF(sttAffiliationItems); i++) { gc_item *item = sttFindGcMenuItem(gcmi, sttAffiliationItems[i].id); item->uType = (him->m_affiliation == sttAffiliationItems[i].value) ? MENU_POPUPCHECK : MENU_POPUPITEM; item->bDisabled = !(force || sttAffiliationItems[i].check(me, him)); } - for (i = 0; i < SIZEOF(sttRoleItems); i++) { + for (i=0; i < SIZEOF(sttRoleItems); i++) { gc_item *item = sttFindGcMenuItem(gcmi, sttRoleItems[i].id); item->uType = (him->m_role == sttRoleItems[i].value) ? MENU_POPUPCHECK : MENU_POPUPITEM; item->bDisabled = !(force || sttRoleItems[i].check(me, him)); @@ -742,7 +743,7 @@ public: ~CGroupchatInviteDlg() { - for (int i = 0; i < m_newJids.getCount(); i++) + for (int i=0; i < m_newJids.getCount(); i++) mir_free(m_newJids[i]); mir_free(m_room); } @@ -779,7 +780,7 @@ public: } int i; - for (i = 0; i < m_newJids.getCount(); i++) + for (i=0; i < m_newJids.getCount(); i++) if ( !lstrcmp(m_newJids[i]->jid, buf)) break; if (i != m_newJids.getCount()) @@ -821,7 +822,7 @@ public: } // invite others - for (int i = 0; i < m_newJids.getCount(); i++) + for (int i=0; i < m_newJids.getCount(); i++) if (SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)m_newJids[i]->hItem, 0)) InviteUser(m_newJids[i]->jid, text); @@ -901,7 +902,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SetDlgItemText(hwndDlg, IDC_TXT_JID, dat->him->m_tszRealJid ? dat->him->m_tszRealJid : TranslateT("Real JID not available")); SetDlgItemText(hwndDlg, IDC_TXT_STATUS, dat->him->m_tszStatusMessage); - for (i = 0; i < SIZEOF(sttRoleItems); i++) + for (i=0; i < SIZEOF(sttRoleItems); i++) { if ((sttRoleItems[i].value == dat->him->m_role) || sttRoleItems[i].check(dat->me, dat->him)) { @@ -912,7 +913,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_SETCURSEL, idx, 0); } } - for (i = 0; i < SIZEOF(sttAffiliationItems); i++) + for (i=0; i < SIZEOF(sttAffiliationItems); i++) { if ((sttAffiliationItems[i].value == dat->him->m_affiliation) || sttAffiliationItems[i].check(dat->me, dat->him)) { @@ -1318,7 +1319,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g TCHAR *ptszBuf = (TCHAR*)_alloca(sizeof(TCHAR) * cbLen); if (s) { TCHAR *d = ptszBuf; - for (size_t i = 0; i < cbLen && s[i] != 0; i++) { + for (size_t i=0; i < cbLen && s[i] != 0; i++) { if (s[i] != '\n' || (i && s[i-1] == '\r')) *d++ = s[i]; else { diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 10a448a8b1..5a24587eac 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -96,7 +96,7 @@ void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags) } } else { - for (int i = 0; i < xmlGetChildCount(node); i++) + for (int i=0; i < xmlGetChildCount(node); i++) OnConsoleProcessXml(xmlGetChild(node, i), flags); } } @@ -106,13 +106,13 @@ bool CJabberProto::RecursiveCheckFilter(HXML node, DWORD flags) { int i; - for (i = 0; i < xmlGetAttrCount(node); i++) + for (i=0; i < xmlGetAttrCount(node); i++) { if (JabberStrIStr(xmlGetAttr(node,i), m_filterInfo.pattern)) return true; } - for (i = 0; i < xmlGetChildCount(node); i++) { + for (i=0; i < xmlGetChildCount(node); i++) { if (RecursiveCheckFilter(xmlGetChild(node, i), flags)) return true; } @@ -230,7 +230,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) sttAppendBufW(buf, (TCHAR*)xmlGetName(node)); sttAppendBufRaw(buf, RTF_ENDTAGNAME); - for (i = 0; i < xmlGetAttrCount(node); i++) + for (i=0; i < xmlGetAttrCount(node); i++) { TCHAR *attr = (TCHAR*)xmlGetAttrName(node, i); sttAppendBufRaw(buf, " "); @@ -267,7 +267,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) sttAppendBufRaw(buf, RTF_ENDTEXT); } - for (i = 0; i < xmlGetChildCount(node) ; i++) + for (i=0; i < xmlGetChildCount(node) ; i++) sttRtfAppendXml(buf, xmlGetChild(node ,i), flags & ~(JCPF_IN|JCPF_OUT), indent+1); if (xmlGetChildCount(node) || xmlGetText(node)) @@ -314,9 +314,9 @@ static void sttJabberConsoleRebuildStrings(CJabberProto *ppro, HWND hwndCombo) SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0); - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_JabberFeatCapPairs[i].szFeature); - for (i = 0; g_JabberFeatCapPairsExt[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairsExt[i].szFeature; i++) SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM)g_JabberFeatCapPairsExt[i].szFeature); LISTFOREACH_NODEF(i, ppro, LIST_ROSTER) @@ -405,7 +405,7 @@ void CJabberDlgConsole::OnInitDialog() }; int i; - for (i = 0; i < SIZEOF(buttons); i++) { + for (i=0; i < SIZEOF(buttons); i++) { SendDlgItemMessage(m_hwnd, buttons[i].idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(buttons[i].icon)); SendDlgItemMessage(m_hwnd, buttons[i].idc, BUTTONSETASFLATBTN, TRUE, 0); SendDlgItemMessage(m_hwnd, buttons[i].idc, BUTTONADDTOOLTIP, (WPARAM)buttons[i].title, 0); @@ -413,7 +413,7 @@ void CJabberDlgConsole::OnInitDialog() if (buttons[i].pushed) CheckDlgButton(m_hwnd, buttons[i].idc, TRUE); } - for (i = 0; i < SIZEOF(filter_modes); i++) + for (i=0; i < SIZEOF(filter_modes); i++) if (filter_modes[i].type == m_proto->m_filterInfo.type) { g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon))); SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon)); @@ -603,7 +603,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) { int i; HMENU hMenu = CreatePopupMenu(); - for (i = 0; i < SIZEOF(filter_modes); i++) + for (i=0; i < SIZEOF(filter_modes); i++) { AppendMenu(hMenu, MF_STRING | ((filter_modes[i].type == m_proto->m_filterInfo.type) ? MF_CHECKED : 0), @@ -618,7 +618,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (res) { m_proto->m_filterInfo.type = (TFilterInfo::Type)(res - 1); - for (i = 0; i < SIZEOF(filter_modes); i++) + for (i=0; i < SIZEOF(filter_modes); i++) if (filter_modes[i].type == m_proto->m_filterInfo.type) { g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon))); diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 0f73122e4b..c96dc4fdad 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -441,7 +441,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) else if ( !lstrcmp(szJid, _T(SD_FAKEJID_FAVORITES))) { sttBrowseMode = SD_BROWSE_FAVORITES; int count = getDword("discoWnd_favCount", 0); - for (int i = 0; i < count; i++) + for (int i=0; i < count; i++) { DBVARIANT dbv; char setting[MAXMODULELABELLENGTH]; @@ -508,7 +508,7 @@ void CJabberProto::ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode) iOverlay = SD_OVERLAY_NONE; } - for (int i = 0; i < SIZEOF(sttNodeIcons); i++) + for (int i=0; i < SIZEOF(sttNodeIcons); i++) { if ( !sttNodeIcons[i].iconIndex && !sttNodeIcons[i].iconName) continue; @@ -680,7 +680,7 @@ void CJabberDlgDiscovery::OnInitDialog() TreeList_Create(hwndList); TreeList_AddIcon(hwndList, m_proto->LoadIconEx("main"), 0); - for (i = 0; i < SIZEOF(sttNodeIcons); i++) + for (i=0; i < SIZEOF(sttNodeIcons); i++) { bool needDestroy = false; HICON hIcon; @@ -801,7 +801,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) { HMENU hMenu = CreatePopupMenu(); int count = m_proto->getDword("discoWnd_favCount", 0); - for (int i = 0; i < count; i++) { + for (int i=0; i < count; i++) { char setting[MAXMODULELABELLENGTH]; mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", i); @@ -867,7 +867,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) if (res == 1) { int count = m_proto->getDword("discoWnd_favCount", 0); - for (int i = 0; i < count; i++) + for (int i=0; i < count; i++) { char setting[MAXMODULELABELLENGTH]; mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", i); @@ -1216,7 +1216,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM HMENU hMenu = CreatePopupMenu(); BOOL lastSeparator = TRUE; bool bFilterItems = !GetAsyncKeyState(VK_CONTROL); - for (int i = 0; i < SIZEOF(items); i++) { + for (int i=0; i < SIZEOF(items); i++) { JABBER_LIST_ITEM *rosterItem = NULL; if (bFilterItems) { if ((items[i].flags & SD_FLG_NONODE) && pNode->GetNode()) diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index a1aa699924..4e46791804 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -124,7 +124,7 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text) if (fixedLen != len) { fixedText = (TCHAR *)mir_alloc(sizeof(TCHAR) * (fixedLen+1)); TCHAR *p = fixedText; - for (int i = 0; i < len; i++) { + for (int i=0; i < len; i++) { *p = text[i]; if (i && (text[i] == _T('\n')) && (text[i] != _T('\r'))) { *p++ = _T('\r'); @@ -420,7 +420,7 @@ void JabberFormLayoutControls(HWND hwndStatic, TJabberFormLayoutInfo *layout_inf TJabberFormControlList *controls = (TJabberFormControlList *)GetWindowLongPtr(hwndStatic, GWLP_USERDATA); if ( !controls) return; - for (int i = 0; i < controls->getCount(); i++) + for (int i=0; i < controls->getCount(); i++) { if ((*controls)[i]->hLabel) SetWindowPos((*controls)[i]->hLabel, 0, @@ -578,7 +578,7 @@ void JabberFormDestroyUI(HWND hwndStatic) { TJabberFormControlList *controls = (TJabberFormControlList *)GetWindowLongPtr(hwndStatic, GWLP_USERDATA); if (controls) { - for (int i = 0; i < controls->getCount(); i++) + for (int i=0; i < controls->getCount(); i++) mir_free((*controls)[i]); controls->destroy(); delete controls; @@ -798,7 +798,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (zDelta) { int nScrollLines=0; SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, (void*)&nScrollLines, 0); - for (int i = 0; i < (nScrollLines + 1) / 2; i++) + for (int i=0; i < (nScrollLines + 1) / 2; i++) SendMessage(hwndDlg, WM_VSCROLL, (zDelta < 0) ? SB_LINEDOWN : SB_LINEUP, 0); } } diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 76c3c9b4c0..a8da3a449f 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -191,7 +191,7 @@ LRESULT CJabberInfoFrame::WndProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONDOWN: { POINT pt = { LOWORD(lParam), HIWORD(lParam) }; - for (int i = 0; i < m_pItems.getCount(); i++) + for (int i=0; i < m_pItems.getCount(); i++) if (m_pItems[i].m_onEvent && PtInRect(&m_pItems[i].m_rcItem, pt)) { m_clickedItem = i; return 0; @@ -404,7 +404,7 @@ void CJabberInfoFrame::PaintNormal(HDC hdc) int line_height = cy_icon + SZ_LINEPADDING; int cy = SZ_FRAMEPADDING; - for (int i = 0; i < m_pItems.getCount(); i++) { + for (int i=0; i < m_pItems.getCount(); i++) { CJabberInfoFrameItem &item = m_pItems[i]; if ( !item.m_bShow) { @@ -474,7 +474,7 @@ void CJabberInfoFrame::ShowInfoItem(char *pszName, bool bShow) { bool bUpdate = false; size_t length = strlen(pszName); - for (int i = 0; i < m_pItems.getCount(); i++) + for (int i=0; i < m_pItems.getCount(); i++) if ((m_pItems[i].m_bShow != bShow) && !strncmp(m_pItems[i].m_pszName, pszName, length)) { m_pItems[i].m_bShow = bShow; m_hiddenItemCount += bShow ? -1 : 1; @@ -489,7 +489,7 @@ void CJabberInfoFrame::RemoveInfoItem(char *pszName) { bool bUpdate = false; size_t length = strlen(pszName); - for (int i = 0; i < m_pItems.getCount(); i++) + for (int i=0; i < m_pItems.getCount(); i++) if ( !strncmp(m_pItems[i].m_pszName, pszName, length)) { if ( !m_pItems[i].m_bShow) --m_hiddenItemCount; RemoveTooltip(m_pItems[i].m_tooltipId); diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 2913bc6cb1..e5a77e7d84 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -261,24 +261,19 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con { JabberGcRecentInfo info(this); - int i = 0; bool found = false; - for (i = 0 ; i < 5; i++) - { + for (int i=0 ; i < 5; i++) { if ( !info.loadRecent(i)) continue; - if (info.equals(room, server, nick, password)) - { + if (info.equals(room, server, nick, password)) { found = true; break; } } - if ( !found) - { - for (int i = 4; i--;) - { + if (!found) { + for (int i = 4; i--;) { if (info.loadRecent(i)) info.saveRecent(i + 1); } @@ -419,7 +414,7 @@ static void sttJoinDlgShowRecentItems(HWND hwndDlg, int newCount) RECT rc; int ctrls[] = { IDC_BOOKMARKS, IDOK, IDCANCEL }; - for (int i = 0; i < SIZEOF(ctrls); i++) + for (int i=0; i < SIZEOF(ctrls); i++) { GetWindowRect(GetDlgItem(hwndDlg, ctrls[i]), &rc); MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rc, 2); @@ -518,21 +513,18 @@ void CJabberDlgGcJoin::OnInitDialog() m_proto->ComboLoadRecentStrings(m_hwnd, IDC_SERVER, "joinWnd_rcSvr"); - int i = 0; - for (; i < 5; i++) + int i; + for (i=0; i < 5; i++) { TCHAR jid[JABBER_MAX_JID_LEN]; JabberGcRecentInfo info(m_proto); - if (info.loadRecent(i)) - { - mir_sntprintf(jid, SIZEOF(jid), _T("%s@%s (%s)"), - info.room, info.server, - info.nick ? info.nick : TranslateT("")); - SetDlgItemText(m_hwnd, IDC_RECENT1+i, jid); - } else - { + if ( !info.loadRecent(i)) break; - } + + mir_sntprintf(jid, SIZEOF(jid), _T("%s@%s (%s)"), + info.room, info.server, + info.nick ? info.nick : TranslateT("")); + SetDlgItemText(m_hwnd, IDC_RECENT1+i, jid); } sttJoinDlgShowRecentItems(m_hwnd, i); } @@ -917,9 +909,6 @@ void CJabberProto::GroupchatProcessPresence(HXML node) pResourceStatus r( item->findResource(resource)); HXML nNode = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK); - if (nNode == NULL) - nNode = xmlGetChildByTag(node, "nick:nick", "xmlns:nick", JABBER_FEAT_NICK); - const TCHAR *cnick = xmlGetText(nNode); const TCHAR *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource); @@ -928,7 +917,6 @@ void CJabberProto::GroupchatProcessPresence(HXML node) r->m_tszNick = mir_tstrdup(cnick); HXML xNode = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER); - HXML xUserNode = xmlGetChildByTag(node, "user:x", "xmlns:user", JABBER_FEAT_MUC_USER); HXML itemNode = xmlGetChild(xNode , "item"); const TCHAR *type = xmlGetAttrValue(node, _T("type")); diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index ee83c67a73..36994181cf 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -168,7 +168,7 @@ CIconPool::CPoolItem *CIconPool::FindItemByName(const char *name) void CJabberProto::IconsInit(void) { m_transportProtoTableStartIndex = (int *)mir_alloc(sizeof(int) * SIZEOF(TransportProtoTable)); - for (int i = 0; i < SIZEOF(TransportProtoTable); i++) + for (int i=0; i < SIZEOF(TransportProtoTable); i++) m_transportProtoTableStartIndex[i] = -1; } diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index 33792d81ad..acf1c0e6ae 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -48,66 +48,53 @@ void CJabberProto::IqUninit() void CJabberProto::IqRemove(int index) { - EnterCriticalSection(&m_csIqList); + mir_cslock lck(m_csIqList); if (index>=0 && index=m_nIqCount && m_nIqCount>=m_nIqAlloced) { + if (i >= m_nIqCount && m_nIqCount >= m_nIqAlloced) { m_nIqAlloced = m_nIqCount + 8; m_ppIqList = (JABBER_IQ_FUNC *)mir_realloc(m_ppIqList, sizeof(JABBER_IQ_FUNC)*m_nIqAlloced); } @@ -117,9 +104,9 @@ void CJabberProto::IqAdd(unsigned int iqId, JABBER_IQ_PROCID procId, JABBER_IQ_P m_ppIqList[i].procId = procId; m_ppIqList[i].func = func; m_ppIqList[i].requestTime = time(NULL); - if (i == m_nIqCount) m_nIqCount++; + if (i == m_nIqCount) + m_nIqCount++; } - LeaveCriticalSection(&m_csIqList); } BOOL CJabberIqManager::FillPermanentHandlers() @@ -205,7 +192,7 @@ void CJabberIqManager::ExpirerThread() Unlock(); if ( !pInfo) { - for (int i = 0; !m_bExpirerThreadShutdownRequest && (i < 10); i++) + for (int i=0; !m_bExpirerThreadShutdownRequest && (i < 10); i++) Sleep(50); // -1 thread :) diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index f34c53ca49..567c762869 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -1518,7 +1518,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode) ListRemoveList(LIST_BOOKMARK); HXML itemNode; - for (int i = 0; itemNode = xmlGetChild(storageNode, i); i++) { + for (int i=0; itemNode = xmlGetChild(storageNode, i); i++) { if (name = xmlGetName(itemNode)) { if ( !_tcscmp(name, _T("conference")) && (jid = xmlGetAttrValue(itemNode, _T("jid")))) { JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid); diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 03fc89c57a..d5d458c2c5 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -195,7 +195,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w {IDC_BTN_FILTERAPPLY, "Apply filter", "sd_filter_apply", false}, {IDC_BTN_FILTERRESET, "Reset filter", "sd_filter_reset", false}, }; - for (int i = 0; i < SIZEOF(buttons); i++) + for (int i=0; i < SIZEOF(buttons); i++) { SendDlgItemMessage(hwndDlg, buttons[i].idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)dat->ppro->LoadIconEx(buttons[i].icon)); SendDlgItemMessage(hwndDlg, buttons[i].idc, BUTTONSETASFLATBTN, TRUE, 0); diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 4e3f49443b..f15770ead0 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -285,7 +285,7 @@ void g_MenuInit(void) g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi); mi.flags |= CMIF_ROOTHANDLE | CMIF_TCHAR; - for (int i = 0; i < SIZEOF(PresenceModeArray); i++) { + for (int i=0; i < SIZEOF(PresenceModeArray); i++) { char buf[] = "Jabber/DirectPresenceX"; buf[SIZEOF(buf)-2] = '0' + i; mi.pszService = buf; @@ -367,7 +367,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) return 0; Menu_ShowItem(g_hMenuDirectPresence[0], TRUE); - for (int i = 0; i < SIZEOF(PresenceModeArray); i++) { + for (int i=0; i < SIZEOF(PresenceModeArray); i++) { CLISTMENUITEM clmi = { sizeof(clmi) }; clmi.flags = CMIM_ICON | CMIM_FLAGS; clmi.hIcon = (HICON)LoadSkinnedProtoIcon(m_szModuleName, PresenceModeArray[i].mode); @@ -438,7 +438,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) mi.pszContactOwner = m_szModuleName; TCHAR szTmp[512]; - for (int i = 0; i < nMenuResourceItemsNew; i++) { + for (int i=0; i < nMenuResourceItemsNew; i++) { mir_snprintf(tDest, SIZEOF(text) - nModuleNameLength, "/UseResource_%d", i); if (i >= m_nMenuResourceItems) { CreateProtoServiceParam(tDest, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES+i); @@ -796,7 +796,7 @@ void CJabberProto::MenuInit() CreateProtoServiceParam(svcName, &CJabberProto::OnMenuSetPriority, 0); int steps[] = { 10, 5, 1, 0, -1, -5, -10 }; - for (int i = 0; i < SIZEOF(steps); i++) { + for (int i=0; i < SIZEOF(steps); i++) { if ( !steps[i]) { mi.position += 100000; continue; @@ -1102,7 +1102,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam) AppendMenu(hMenu, MF_STRING, MENUITEM_SERVER, TranslateT("Highest priority (server's choice)")); AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); - for (int i = 0; i < LI->arResources.getCount(); i++) + for (int i=0; i < LI->arResources.getCount(); i++) AppendMenu(hMenu, MF_STRING, MENUITEM_RESOURCES+i, LI->arResources[i]->m_tszResourceName); if (LI->resourceMode == RSMODE_LASTSEEN) @@ -1215,7 +1215,7 @@ CJabberProto *JabberChooseInstance(bool bIsLink) } if (bIsLink) { - for (int i = 0; i < g_Instances.getCount(); i++) + for (int i=0; i < g_Instances.getCount(); i++) if (g_Instances[i]->m_options.ProcessXMPPLinks) return g_Instances[i]; } @@ -1223,7 +1223,7 @@ CJabberProto *JabberChooseInstance(bool bIsLink) CLISTMENUITEM clmi = { sizeof(clmi) }; int nItems = 0, lastItemId = 0; - for (int i = 0; i < g_Instances.getCount(); i++) { + for (int i=0; i < g_Instances.getCount(); i++) { clmi.flags = CMIM_FLAGS; CJabberProto *ppro = g_Instances[i]; diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 162c173d18..eef1de05ab 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -421,7 +421,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, TCHAR *buf, int bufSi int i; // search through known software list - for (i = 0; i < SIZEOF(sttCapsNodeToName_Map); i++) + for (i=0; i < SIZEOF(sttCapsNodeToName_Map); i++) if (_tcsstr(resource->m_tszCapsNode, sttCapsNodeToName_Map[i].node)) { mir_sntprintf(buf, bufSize, _T("%s %s"), sttCapsNodeToName_Map[i].name, resource->m_tszCapsVer); diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index d0b3c9ea3f..437679cd57 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -149,7 +149,7 @@ void CNoteList::LoadXml(HXML hXml) m_bIsModified = false; int count = xmlGetChildCount(hXml); - for (int i = 0; i < count; i++) + for (int i=0; i < count; i++) { CNoteItem *pNote = new CNoteItem(xi.getChild(hXml, i)); if (pNote->IsNotEmpty()) @@ -164,7 +164,7 @@ void CNoteList::SaveXml(HXML hXmlParent) m_bIsModified = false; CNoteList &me = *this; - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) { HXML hXmlItem = hXmlParent << XCHILD(_T("note")); hXmlItem << XATTR(_T("from"), me[i].GetFrom()) << XATTR(_T("tags"), me[i].GetTagsStr()); @@ -496,7 +496,7 @@ private: void PopulateTags(HTREEITEM htiRoot, TCHAR *szActiveTag) { LIST tagSet(5, _tcscmp); - for (int i = 0; i < m_proto->m_notes.getCount(); i++) + for (int i=0; i < m_proto->m_notes.getCount(); i++) { TCHAR *tags = m_proto->m_notes[i].GetTags(); for (TCHAR *tag = tags; tag && *tag; tag = tag + lstrlen(tag) + 1) @@ -551,7 +551,7 @@ private: void ListItems(const TCHAR *tag) { m_lstNotes.ResetContent(); - for (int i = 0; i < m_proto->m_notes.getCount(); i++) + for (int i=0; i < m_proto->m_notes.getCount(); i++) if (m_proto->m_notes[i].HasTag(tag)) InsertItem(m_proto->m_notes[i]); EnableControls(); diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 43b48918fa..e4b36f2c73 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -458,7 +458,7 @@ protected: // fill predefined resources TCHAR *szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") }; - for (i = 0; i < SIZEOF(szResources); i++) + for (i=0; i < SIZEOF(szResources); i++) m_cbResource.AddString(szResources[i]); // append computer name to the resource list @@ -476,7 +476,7 @@ protected: } else m_cbResource.SetText(_T("Miranda")); - for (i = 0; g_LanguageCodes[i].szCode; i++) + for (i=0; g_LanguageCodes[i].szCode; i++) { int iItem = m_cbLocale.AddString(TranslateTS(g_LanguageCodes[i].szDescription), (LPARAM)g_LanguageCodes[i].szCode); if ( !_tcscmp(m_proto->m_tszSelectedLang, g_LanguageCodes[i].szCode)) @@ -737,7 +737,7 @@ private: m_cbServer.ResetContent(); if (node) { - for (int i = 0; ; i++) { + for (int i=0; ; i++) { HXML n = xmlGetChild(node, i); if ( !n) break; @@ -1241,11 +1241,11 @@ static LRESULT CALLBACK _RosterItemNewEditProc(HWND hEditor, UINT msg, WPARAM wP void CJabberProto::_RosterExportToFile(HWND hwndDlg) { - TCHAR filename[MAX_PATH]={0}; + TCHAR filename[MAX_PATH] = { 0 }; TCHAR filter[MAX_PATH]; mir_sntprintf(filter, SIZEOF(filter), _T("%s (*.xml)%c*.xml%c%c"), TranslateT("XML for MS Excel (UTF-8 encoded)"), 0, 0, 0); - OPENFILENAME ofn={0}; + OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; @@ -1259,8 +1259,8 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg) FILE * fp = fopent(filename,_T("w")); if ( !fp) return; - HWND hList=GetDlgItem(hwndDlg, IDC_ROSTER); - int ListItemCount=ListView_GetItemCount(hList); + HWND hList = GetDlgItem(hwndDlg, IDC_ROSTER); + int ListItemCount = ListView_GetItemCount(hList); XmlNode root(_T("Workbook")); root << XATTR(_T("xmlns"), _T("urn:schemas-microsoft-com:office:spreadsheet")) @@ -1677,7 +1677,7 @@ protected: // fill predefined resources TCHAR *szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") }; - for (i = 0; i < SIZEOF(szResources); i++) + for (i=0; i < SIZEOF(szResources); i++) m_cbResource.AddString(szResources[i]); // append computer name to the resource list @@ -2197,7 +2197,7 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node) m_cbServer.ResetContent(); if (node) { - for (int i = 0; ; i++) { + for (int i=0; ; i++) { HXML n = xmlGetChild(node, i); if ( !n) break; diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp index 5ca3c03fe8..3745624755 100644 --- a/protocols/JabberG/src/jabber_opttree.cpp +++ b/protocols/JabberG/src/jabber_opttree.cpp @@ -36,7 +36,7 @@ CCtrlTreeOpts::CCtrlTreeOpts(CDlgBase* dlg, int ctrlId): CCtrlTreeOpts::~CCtrlTreeOpts() { - for (int i = 0; i < m_options.getCount(); i++) + for (int i=0; i < m_options.getCount(); i++) delete m_options[i]; m_options.destroy(); } @@ -120,7 +120,7 @@ void CCtrlTreeOpts::OnInit() SetImageList(hImgLst, TVSIL_NORMAL); /* build options tree. based on code from IcoLib */ - for (int i = 0; i < m_options.getCount(); i++) + for (int i=0; i < m_options.getCount(); i++) { TCHAR *sectionName; int sectionLevel = 0; @@ -198,7 +198,7 @@ void CCtrlTreeOpts::OnApply() { CCtrlTreeView::OnApply(); - for (int i = 0; i < m_options.getCount(); i++) + for (int i=0; i < m_options.getCount(); i++) { TVITEMEX tvi; GetItem(m_options[i]->m_hItem, &tvi); @@ -232,7 +232,7 @@ void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti) case IMG_NORCHECK: { int i; - for (i = 0; i < m_options.getCount(); i++) + for (i=0; i < m_options.getCount(); i++) { if (m_options[i]->m_groupId == m_options[tvi.lParam]->m_groupId) { diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 719af5cf2c..62ea484a56 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -372,7 +372,7 @@ public: TCHAR *szTypes[] = { _T("JID"), _T("Group"), _T("Subscription"), _T("Any") }; int i, nTypes[] = { Jid, Group, Subscription, Else }; - for (i = 0; i < SIZEOF(szTypes); i++) + for (i=0; i < SIZEOF(szTypes); i++) { LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTypes[i])); SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_SETITEMDATA, nItem, nTypes[i]); @@ -382,7 +382,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_RESETCONTENT, 0, 0); TCHAR *szSubscriptions[] = { _T("none"), _T("from"), _T("to"), _T("both") }; - for (i = 0; i < SIZEOF(szSubscriptions); i++) + for (i=0; i < SIZEOF(szSubscriptions); i++) { LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSubscriptions[i])); SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETITEMDATA, nItem, (LPARAM)szSubscriptions[i]); @@ -671,7 +671,7 @@ protected: TCLCInfo(): newJids(1, TJidData::cmp), bChanged(false), pList(0) {} ~TCLCInfo() { - for (int i = 0; i < newJids.getCount(); i++) + for (int i=0; i < newJids.getCount(); i++) { mir_free(newJids[i]->jid); mir_free(newJids[i]); @@ -966,7 +966,7 @@ BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) }; int i, totalWidth = -5; // spacing for last item - for (i = 0; i < SIZEOF(items); i++) + for (i=0; i < SIZEOF(items); i++) { SIZE sz = {0}; items[i].text = TranslateTS(items[i].textEng); @@ -978,7 +978,7 @@ BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) RECT rc = lpdis->rcItem; rc.left = (rc.left + rc.right - totalWidth)/2; - for (i = 0; i < SIZEOF(items); i++) + for (i=0; i < SIZEOF(items); i++) { DrawIconEx(lpdis->hDC, rc.left, (rc.top+rc.bottom-16)/2, m_proto->LoadIconEx(items[i].icon), 16, 16, 0, NULL, DI_NORMAL); @@ -1336,7 +1336,7 @@ void CJabberDlgPrivacyLists::CListResetOptions(HWND) m_clcClist.SetIndent(10); m_clcClist.SetHideEmptyGroups(false); m_clcClist.SetHideOfflineRoot(false); - for (int i = 0; i <= FONTID_MAX; i++) + for (int i=0; i <= FONTID_MAX; i++) m_clcClist.SetTextColor(i, GetSysColor(COLOR_WINDOWTEXT)); } @@ -1352,7 +1352,7 @@ void CJabberDlgPrivacyLists::CListFilter(HWND) void CJabberDlgPrivacyLists::CListResetIcons(HWND, HANDLE hItem, bool hide) { - for (int i = 0; i < 4; i++) + for (int i=0; i < 4; i++) m_clcClist.SetExtraImage(hItem, i, hide ? EMPTY_EXTRA_ICON : 0); } diff --git a/protocols/JabberG/src/jabber_privacy.h b/protocols/JabberG/src/jabber_privacy.h index ef29ce53d2..440c400319 100644 --- a/protocols/JabberG/src/jabber_privacy.h +++ b/protocols/JabberG/src/jabber_privacy.h @@ -265,7 +265,7 @@ public: // sort array of pointers, slow, but working :) DWORD i, j; CPrivacyListRule *pTmp; - for (i = 0; i < dwCount; i++) { + for (i=0; i < dwCount; i++) { for (j = dwCount - 1; j > i; j--) { if (pRules[j - 1]->GetOrder() > pRules[j]->GetOrder()) { pTmp = pRules[j - 1]; @@ -278,7 +278,7 @@ public: // reorder linked list DWORD dwOrder = 100; CPrivacyListRule **ppPtr = &m_pRules; - for (i = 0; i < dwCount; i++) { + for (i=0; i < dwCount; i++) { *ppPtr = pRules[ i ]; ppPtr = &pRules[ i ]->m_pNext; pRules[ i ]->SetOrder(dwOrder); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 289a045178..50b2ebd176 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -729,7 +729,7 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/) if (item != NULL) { if (item->arResources.getCount()) { - for (int i = 0; i < item->arResources.getCount(); i++) { + for (int i=0; i < item->arResources.getCount(); i++) { pResourceStatus r(item->arResources[i]); TCHAR szp1[JABBER_MAX_JID_LEN], tmp[JABBER_MAX_JID_LEN]; JabberStripJid(jid, szp1, SIZEOF(szp1)); @@ -951,7 +951,7 @@ int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts // m << XCHILD(_T("body"), msg); HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_ROSTER_EXCHANGE); - for (int i = 0; i < nContacts; i++) { + for (int i=0; i < nContacts; i++) { DBVARIANT dbv; if ( !getTString(hContactsList[i], "jid", &dbv)) { x << XCHILD(_T("item")) << XATTR(_T("action"), _T("add")) << XATTR(_T("jid"), dbv.ptszVal); diff --git a/protocols/JabberG/src/jabber_proxy.cpp b/protocols/JabberG/src/jabber_proxy.cpp index 1bcf6d7e32..46c3163abb 100644 --- a/protocols/JabberG/src/jabber_proxy.cpp +++ b/protocols/JabberG/src/jabber_proxy.cpp @@ -130,7 +130,7 @@ PBYTE JabberHttpGatewayUnwrapRecv(NETLIBHTTPREQUEST *nlhr, PBYTE buf, int len, i int i, copyBytes; tbuf = buf; - for (i = 0;;) + for (i=0;;) { if (tbuf - buf + 2 > len) break; unpackWord(&tbuf, &wLen); diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index aa660ff8ff..d1a9cdc90f 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -764,7 +764,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo* pInfo, CJabbe // Groupchat list here: HXML fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("groupchats")); if (fieldNode) { - for (i = 0; i < xmlGetChildCount(fieldNode); i++) { + for (i=0; i < xmlGetChildCount(fieldNode); i++) { HXML valueNode = xmlGetChild(fieldNode, i); if (valueNode && xmlGetName(valueNode) && xmlGetText(valueNode) && !_tcscmp(xmlGetName(valueNode), _T("value"))) { JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, xmlGetText(valueNode)); diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 5393322265..21819e80d4 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -154,7 +154,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode) } else { int Order=0; - for (int i = 0; ; i++) { + for (int i=0; ; i++) { HXML chNode = xmlGetChild(queryNode, i); if ( !chNode) break; diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 459c61f9e4..3ab48f0257 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -237,7 +237,7 @@ void TScramAuth::Hi(BYTE* res , char* passw, size_t passwLen, char* salt, size_t memcpy(u, salt, saltLen); *(unsigned*)(u + saltLen) = htonl(1); saltLen += 4; memset(res, 0, MIR_SHA1_HASH_SIZE); - for (int i = 0; i < ind; i++) + for (int i=0; i < ind; i++) { mir_hmac_sha1(u, (BYTE*)passw, passwLen, u, saltLen); saltLen = sizeof(u); diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 6c2bdb3d12..65bc24074d 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -929,7 +929,7 @@ int CJabberNetInterface::RemoveHandler(HJHANDLER hHandler) JabberFeatCapPairDynamic *CJabberNetInterface::FindFeature(LPCTSTR szFeature) { int i; - for (i = 0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (i=0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) if ( !lstrcmp(m_psProto->m_lstJabberFeatCapPairsDynamic[i]->szFeature, szFeature)) return m_psProto->m_lstJabberFeatCapPairsDynamic[i]; return NULL; @@ -943,7 +943,7 @@ int CJabberNetInterface::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescriptio // check for this feature in core features, and return false if it's present, to prevent re-registering a core feature int i; - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) { if ( !lstrcmp(g_JabberFeatCapPairs[i].szFeature, szFeature)) { @@ -957,11 +957,11 @@ int CJabberNetInterface::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescriptio JabberCapsBits jcb = JABBER_CAPS_OTHER_SPECIAL; // set all bits not included in g_JabberFeatCapPairs // set all bits occupied by g_JabberFeatCapPairs - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) jcb |= g_JabberFeatCapPairs[i].jcbCap; // set all bits already occupied by external plugins - for (i = 0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (i=0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) jcb |= m_psProto->m_lstJabberFeatCapPairsDynamic[i]->jcbCap; // Now get first zero bit. The line below is a fast way to do it. If there are no zero bits, it returns 0. @@ -1061,24 +1061,24 @@ LPTSTR CJabberNetInterface::GetResourceFeatures(LPCTSTR jid) int i; int iLen = 1; // 1 for extra zero terminator at the end of the string // calculate total necessary string length - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) iLen += lstrlen(g_JabberFeatCapPairs[i].szFeature) + 1; - for (i = 0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (i=0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) if (jcb & m_psProto->m_lstJabberFeatCapPairsDynamic[i]->jcbCap) iLen += lstrlen(m_psProto->m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1; // allocate memory and fill it LPTSTR str = (LPTSTR)mir_alloc(iLen * sizeof(TCHAR)); LPTSTR p = str; - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) { lstrcpy(p, g_JabberFeatCapPairs[i].szFeature); p += lstrlen(g_JabberFeatCapPairs[i].szFeature) + 1; } - for (i = 0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (i=0; i < m_psProto->m_lstJabberFeatCapPairsDynamic.getCount(); i++) if (jcb & m_psProto->m_lstJabberFeatCapPairsDynamic[i]->jcbCap) { lstrcpy(p, m_psProto->m_lstJabberFeatCapPairsDynamic[i]->szFeature); p += lstrlen(m_psProto->m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 4c2495fbfe..64428e6671 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -169,7 +169,7 @@ void ThreadData::xmpp_client_query(void) dnsList.insert(&rec->Data.Srv); } - for (int i = 0; i < dnsList.getCount(); i++) { + for (int i=0; i < dnsList.getCount(); i++) { WORD dnsPort = port == 0 || port == 5222 ? dnsList[i]->wPort : port; char* dnsHost = dnsList[i]->pNameTarget; @@ -1258,17 +1258,11 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) } // parsing extensions - for (int i = 0; (xNode = xmlGetChild(node, i)) != NULL; i++) { - xNode = xmlGetNthChild(node, _T("x"), i + 1); - if (xNode == NULL) { - xNode = xmlGetNthChild(node, _T("user:x"), i + 1); - if (xNode == NULL) - continue; - } + for (int i=0; (xNode = xmlGetChild(node, i)) != NULL; i++) { + if ((xNode = xmlGetNthChild(node, _T("x"), i+1)) == NULL) + continue; const TCHAR *ptszXmlns = xmlGetAttrValue(xNode, _T("xmlns")); - if (ptszXmlns == NULL) - ptszXmlns = xmlGetAttrValue(xNode, _T("xmlns:user")); if (ptszXmlns == NULL) continue; @@ -1481,8 +1475,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) // check XEP-0115 support, and old style: if ((n = xmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL || - (n = xmlGetChildByTag(node, "caps:c", "xmlns:caps", JABBER_FEAT_ENTITY_CAPS)) != NULL || - (n = xmlGetChild(node, "c")) != NULL) { + (n = xmlGetChild(node, "c")) != NULL) { const TCHAR *szNode = xmlGetAttrValue(n, _T("node")); const TCHAR *szVer = xmlGetAttrValue(n, _T("ver")); const TCHAR *szExt = xmlGetAttrValue(n, _T("ext")); @@ -1523,7 +1516,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) // Determine status to show for the contact based on the remaining resources int nSelectedResource = -1, i = 0; int nMaxPriority = -999; // -128...+127 valid range - for (i = 0; i < item->arResources.getCount(); i++) { + for (i=0; i < item->arResources.getCount(); i++) { pResourceStatus r(item->arResources[i]); if (r->m_iPriority > nMaxPriority) { nMaxPriority = r->m_iPriority; diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index 19da05a737..1936c6e8ca 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -264,7 +264,7 @@ void TreeList_SetIcon(HTREELISTITEM hItem, int iIcon, int iOverlay) void TreeList_RecursiveApply(HTREELISTITEM hItem, void (*func)(HTREELISTITEM, LPARAM), LPARAM data) { - for (int i = 0; i < hItem->subItems.getCount(); i++) { + for (int i=0; i < hItem->subItems.getCount(); i++) { func(hItem->subItems[i], data); TreeList_RecursiveApply(hItem->subItems[i], func, data); } } @@ -511,7 +511,7 @@ static void sttTreeList_ResetIndex(HTREELISTITEM hItem, LPARAM data) static void sttTreeList_FilterItems(HTREELISTITEM hItem, LPARAM data) { int i = 0; - for (i = 0; i < hItem->text.getCount(); i++) + for (i=0; i < hItem->text.getCount(); i++) if (JabberStrIStr(hItem->text[i], (TCHAR *)data)) break; diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index ee67004503..715bcb0578 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -274,7 +274,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti if ( !(jcb & JABBER_RESOURCE_CAPS_ERROR)) { HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), NULL, TranslateT("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS)); int i; - for (i = 0; g_JabberFeatCapPairs[i].szFeature; i++) + for (i=0; g_JabberFeatCapPairs[i].szFeature; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) { TCHAR szDescription[ 1024 ]; if (g_JabberFeatCapPairs[i].tszDescription) @@ -391,7 +391,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM // resources if (item->arResources.getCount()) { - for (int i = 0; i < item->arResources.getCount(); i++) + for (int i=0; i < item->arResources.getCount(); i++) sttFillResourceInfo(ppro, hwndTree, htiRoot, item, i+1); } else if ( !_tcschr(item->jid, _T('@')) || (r->m_iStatus != ID_STATUS_OFFLINE)) @@ -405,7 +405,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM static void sttGetNodeText(HWND hwndTree, HTREEITEM hti, UserInfoStringBuf *buf, int indent = 0) { - for (int i = 0; i < indent; i++) + for (int i=0; i < indent; i++) buf->append(_T("\t")); TVITEMEX tvi = {0}; diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 37cd2185fb..65a5f059f6 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -502,7 +502,7 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode) if (str == NULL) str = xmlGetText(xmlGetChild(errorNode, _T("text"))); if (str == NULL) { - for (int i = 0; ; i++) { + for (int i=0; ; i++) { HXML c = xmlGetChild(errorNode, i); if (c == NULL) break; const TCHAR *attr = xmlGetAttrValue(c, _T("xmlns")); @@ -653,7 +653,7 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR arrExtCaps.insert( _T(JABBER_EXT_MIR_NOTES)); // add features enabled through IJabberNetInterface::AddFeatures() - for (int i = 0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++) + for (int i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++) if (m_uEnabledFeatCapsDynamic & m_lstJabberFeatCapPairsDynamic[i]->jcbCap) arrExtCaps.insert(m_lstJabberFeatCapPairsDynamic[i]->szExt); @@ -953,7 +953,7 @@ TStringPairs::~TStringPairs() const char* TStringPairs::operator[](const char* key) const { - for (int i = 0; i < numElems; i++) + for (int i=0; i < numElems; i++) if ( !strcmp(elems[i].name, key)) return elems[i].value; @@ -965,7 +965,7 @@ const char* TStringPairs::operator[](const char* key) const void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *param, int recentCount) { - for (int i = 0; i < recentCount; i++) { + for (int i=0; i < recentCount; i++) { DBVARIANT dbv; char setting[MAXMODULELABELLENGTH]; mir_snprintf(setting, sizeof(setting), "%s%d", param, i); @@ -1395,7 +1395,7 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param) { OBJLIST &avs = *(OBJLIST*)param; HANDLE hHttpCon = NULL; - for (int i = 0; i < avs.getCount(); i++) { + for (int i=0; i < avs.getCount(); i++) { NETLIBHTTPREQUEST nlhr = {0}; nlhr.cbSize = sizeof(nlhr); nlhr.requestType = REQUEST_GET; diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 022725d273..d479960324 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -129,7 +129,7 @@ static INT_PTR CALLBACK HomeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (lParam) { ppro = (CJabberProto*)lParam; TranslateDialogDefault(hwndDlg); - for (int i = 0; i < g_cbCountries; i++) { + for (int i=0; i < g_cbCountries; i++) { if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) { TCHAR *country = mir_a2t(g_countries[i].szName); SendMessage(GetDlgItem(hwndDlg, IDC_COUNTRY), CB_ADDSTRING, 0, (LPARAM)TranslateTS(country)); @@ -192,7 +192,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (lParam) { // proto info is available ppro = (CJabberProto*)lParam; TranslateDialogDefault(hwndDlg); - for (int i = 0; i < g_cbCountries; i++) { + for (int i=0; i < g_cbCountries; i++) { if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) { TCHAR *country = mir_a2t(g_countries[i].szName); SendMessage(GetDlgItem(hwndDlg, IDC_COUNTRY), CB_ADDSTRING, 0, (LPARAM)TranslateTS(country)); diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index e610fa4f7b..e220c14302 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -226,7 +226,7 @@ void CJabberDlgPepSimple::OnInitDialog() SetWindowText(m_hwnd, m_title); m_txtDescription.Enable(false); - for (int i = 0; i < m_modes.getCount(); i++) { + for (int i=0; i < m_modes.getCount(); i++) { int idx = m_cbModes.AddString(m_modes[i].m_title, i); if ((m_modes[i].m_id == m_active) || !idx) { m_prevSelected = idx; @@ -638,7 +638,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode) if ( !moodNode) return; LPCTSTR moodType = NULL, moodText = NULL; - for (int i = 0; n = xmlGetChild(moodNode, i); i++) { + for (int i=0; n = xmlGetChild(moodNode, i); i++) { if ( !_tcscmp(xmlGetName(n), _T("text"))) moodText = xmlGetText(n); else @@ -1020,7 +1020,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode) LPCTSTR szFirstNode = NULL, szSecondNode = NULL; HXML n; - for (int i = 0; n = xmlGetChild(actNode, i); i++) { + for (int i=0; n = xmlGetChild(actNode, i); i++) { if (lstrcmp(xmlGetName(n), _T("text"))) { szFirstNode = xmlGetName(n); HXML secondNode = xmlGetChild(n, 0); @@ -1112,7 +1112,7 @@ void CPepActivity::SetActivity(HANDLE hContact, LPCTSTR szFirst, LPCTSTR szSecon void CPepActivity::ShowSetDialog(BYTE bQuiet) { CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Activity")); - for (int i = 0; i < SIZEOF(g_arrActivities); i++) + for (int i=0; i < SIZEOF(g_arrActivities); i++) if (g_arrActivities[i].szFirst || g_arrActivities[i].szSecond) dlg.AddStatusMode(i, ActivityGetId(i), g_ActivityIcons.GetIcon(returnActivity(i)), TranslateTS(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL)); diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h index 2fc8cb77ab..51b874f8c7 100644 --- a/protocols/JabberG/src/jabber_xstatus.h +++ b/protocols/JabberG/src/jabber_xstatus.h @@ -66,7 +66,7 @@ public: void ProcessEvent(const TCHAR *from, HXML eventNode) { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) { CPepService &pepSvc = (*this)[i]; HXML itemsNode = xmlGetChildByTag(eventNode, _T("items"), _T("node"), pepSvc.GetNode()); @@ -77,43 +77,43 @@ public: void InitGui() { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) (*this)[i].InitGui(); } void RebuildMenu() { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) (*this)[i].RebuildMenu(); } void ResetExtraIcon(HANDLE hContact) { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) (*this)[i].ResetExtraIcon(hContact); } void PublishAll() { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) (*this)[i].Publish(); } void RetractAll() { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) (*this)[i].Retract(); } void ResetPublishAll() { - for(int i = 0; i < getCount(); i++) + for(int i=0; i < getCount(); i++) (*this)[i].ResetPublish(); } CPepService *Find(TCHAR *node) { - for (int i = 0; i < getCount(); i++) + for (int i=0; i < getCount(); i++) if ( !lstrcmp((*this)[i].GetNode(), node)) return &((*this)[i]); return NULL; diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp index 23f357adff..f4f7dfa7f7 100644 --- a/protocols/JabberG/src/ui_utils.cpp +++ b/protocols/JabberG/src/ui_utils.cpp @@ -250,7 +250,7 @@ void CDlgBase::AddControl(CCtrlBase *ctrl) void CDlgBase::NotifyControls(void (CCtrlBase::*fn)()) { - for (int i = 0; i < m_controls.getCount(); i++) + for (int i=0; i < m_controls.getCount(); i++) (m_controls[i]->*fn)(); } @@ -1450,7 +1450,7 @@ void CCtrlFilterListView::FilterHighlight(TCHAR *str) { TCHAR buf[256]; int count = GetItemCount(); - for (int i = 0; i < count; i++) + for (int i=0; i < count; i++) { bool found = false; @@ -2216,7 +2216,7 @@ BOOL CCtrlPages::OnNotify(int /*idCtrl*/, NMHDR *pnmh) void CCtrlPages::OnDestroy() { int count = TabCtrl_GetItemCount(m_hwnd); - for (int i = 0; i < count ; i++) + for (int i=0; i < count ; i++) { TCITEM tci = {0}; tci.mask = TCIF_PARAM; -- cgit v1.2.3