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_iq.cpp | 43 +++++++++++++------------------------ 1 file changed, 15 insertions(+), 28 deletions(-) (limited to 'protocols/JabberG/src/jabber_iq.cpp') 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 :) -- cgit v1.2.3