diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
commit | b2fad485cd5b41744ef0cc4a02722c021afd926c (patch) | |
tree | aa19403cd699066600e8306be8ad33e4a17fba6f /protocols/JabberG/src | |
parent | fc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff) |
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber.h | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_archive.cpp | 10 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_disco.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_ft.cpp | 8 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_presence_manager.h | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_rc.h | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_send_manager.h | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_userinfo.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/ui_utils.cpp | 4 |
12 files changed, 25 insertions, 25 deletions
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index 7e20519a89..9b24a941d7 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -292,7 +292,7 @@ struct CJabberHttpAuthParams TCHAR *m_szUrl;
CJabberHttpAuthParams()
{
- ZeroMemory(this, sizeof(CJabberHttpAuthParams));
+ memset(this, 0, sizeof(CJabberHttpAuthParams));
}
~CJabberHttpAuthParams()
{
@@ -306,7 +306,7 @@ struct CJabberHttpAuthParams mir_free(m_szId);
mir_free(m_szMethod);
mir_free(m_szUrl);
- ZeroMemory(this, sizeof(CJabberHttpAuthParams));
+ memset(this, 0, sizeof(CJabberHttpAuthParams));
}
};
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 72be7ad08d..40cb7df0f8 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -130,7 +130,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) if (!(hExistingDbEvent = db_event_first(hContact)))
return FALSE;
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
dwEventTimeStamp = dbeiExisting.timestamp;
@@ -148,7 +148,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) // check for equal timestamps
if (dbei.timestamp == dwPreviousTimeStamp) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hPreviousDbEvent, &dbeiExisting);
@@ -161,7 +161,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) // find event with another timestamp
hExistingDbEvent = db_event_next(hContact, hPreviousDbEvent);
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
@@ -182,7 +182,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) if (dbei.timestamp <= dwPreviousTimeStamp) {
// look back
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
@@ -212,7 +212,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) else {
// look forward
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 52fd10c3f0..beddbee510 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -374,7 +374,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b for (i=0; i<40 && buffer[i+5]==str[i]; i++);
mir_free(str);
- ZeroMemory(data, 10);
+ memset(data, 0, sizeof(data));
data[1] = (i>=20)?0:2;
data[0] = 5;
data[3] = 1;
@@ -506,7 +506,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch // 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
BYTE data[47];
- ZeroMemory(data, sizeof(data));
+ memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
@@ -701,7 +701,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char // 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
BYTE data[47];
- ZeroMemory(data, sizeof(data));
+ memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index bfb4bc8a76..73e75d5faf 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -996,7 +996,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) lvhti.pt.x = rcCtl.left + 5;
lvhti.pt.y = rcHdr.bottom + 5;
int iFirst = ListView_HitTest(hwndList, &lvhti);
- ZeroMemory(&lvhti, sizeof(lvhti));
+ memset(&lvhti, 0, sizeof(lvhti));
lvhti.pt.x = rcCtl.left + 5;
lvhti.pt.y = rcCtl.bottom - 5;
int iLast = ListView_HitTest(hwndList, &lvhti);
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index 24db2e9e5f..e221abd5b1 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -143,7 +143,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo) if ((bDirect || bProxy) && !_tcscmp(xmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
- ZeroMemory(jbt, sizeof(JABBER_BYTE_TRANSFER));
+ memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
jbt->srcJID = mir_tstrdup(pInfo->m_szTo);
jbt->dstJID = mir_tstrdup(pInfo->m_szFrom);
jbt->sid = mir_tstrdup(ft->sid);
@@ -156,7 +156,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo) }
else if (!_tcscmp(xmlGetText(valueNode), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof (JABBER_IBB_TRANSFER));
- ZeroMemory(jibb, sizeof(JABBER_IBB_TRANSFER));
+ memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(pInfo->m_szTo);
jibb->dstJID = mir_tstrdup(pInfo->m_szFrom);
jibb->sid = mir_tstrdup(ft->sid);
@@ -434,7 +434,7 @@ BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo *pInfo) if ((sid = xmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
- ZeroMemory(jbt, sizeof(JABBER_BYTE_TRANSFER));
+ memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
jbt->iqNode = xi.copyNode(iqNode);
jbt->pfnRecv = &CJabberProto::FtReceive;
jbt->pfnFinal = &CJabberProto::FtReceiveFinal;
@@ -478,7 +478,7 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen) if (bOpen) {
if (!item->jibb) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof(JABBER_IBB_TRANSFER));
- ZeroMemory(jibb, sizeof(JABBER_IBB_TRANSFER));
+ memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(from);
jibb->dstJID = mir_tstrdup(to);
jibb->sid = mir_tstrdup(sid);
diff --git a/protocols/JabberG/src/jabber_presence_manager.h b/protocols/JabberG/src/jabber_presence_manager.h index 9b33288192..93a0c2757f 100644 --- a/protocols/JabberG/src/jabber_presence_manager.h +++ b/protocols/JabberG/src/jabber_presence_manager.h @@ -49,7 +49,7 @@ public: CJabberPresenceInfo()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
~CJabberPresenceInfo()
{
@@ -72,7 +72,7 @@ class CJabberPresencePermanentInfo public:
CJabberPresencePermanentInfo()
{
- ZeroMemory(this, sizeof(CJabberPresencePermanentInfo));
+ memset(this, 0, sizeof(CJabberPresencePermanentInfo));
}
~CJabberPresencePermanentInfo()
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h index 806b42839f..86cd472cc5 100644 --- a/protocols/JabberG/src/jabber_rc.h +++ b/protocols/JabberG/src/jabber_rc.h @@ -111,7 +111,7 @@ protected: public:
CJabberAdhocNode(CJabberProto* pProto, TCHAR* szJid, TCHAR* szNode, TCHAR* szName, JABBER_ADHOC_HANDLER pHandler)
{
- ZeroMemory(this, sizeof(CJabberAdhocNode));
+ memset(this, 0, sizeof(CJabberAdhocNode));
replaceStrT(m_szJid, szJid);
replaceStrT(m_szNode, szNode);
replaceStrT(m_szName, szName);
diff --git a/protocols/JabberG/src/jabber_send_manager.h b/protocols/JabberG/src/jabber_send_manager.h index 375b279b05..75e23956b4 100644 --- a/protocols/JabberG/src/jabber_send_manager.h +++ b/protocols/JabberG/src/jabber_send_manager.h @@ -49,7 +49,7 @@ public: CJabberSendInfo()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
~CJabberSendInfo()
{
@@ -73,7 +73,7 @@ class CJabberSendPermanentInfo public:
CJabberSendPermanentInfo()
{
- ZeroMemory(this, sizeof(CJabberSendPermanentInfo));
+ memset(this, 0, sizeof(CJabberSendPermanentInfo));
}
~CJabberSendPermanentInfo()
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index e214f6dbe1..b2dd0a460a 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1174,7 +1174,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (!pParams)
return;
- ZeroMemory(pParams, sizeof(CJabberHttpAuthParams));
+ memset(pParams, 0, sizeof(CJabberHttpAuthParams));
pParams->m_nType = CJabberHttpAuthParams::MSG;
pParams->m_szFrom = mir_tstrdup(from);
LPCTSTR ptszThread = xmlGetText(xmlGetChild(node, "thread"));
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index dad25263b6..a6a550ea7f 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -441,7 +441,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS)); dat = (JabberUserInfoDlgData *)mir_alloc(sizeof(JabberUserInfoDlgData)); - ZeroMemory(dat, sizeof(JabberUserInfoDlgData)); + memset(dat, 0, sizeof(JabberUserInfoDlgData)); dat->resourcesCount = -1; if (CallService(MS_DB_CONTACT_IS, (WPARAM)lParam, 0)) diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 58f55518cd..0dcbfca763 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1205,7 +1205,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s TCHAR *szListeningTo;
if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)) {
LISTENINGTOINFO li;
- ZeroMemory(&li, sizeof(li));
+ memset(&li, 0, sizeof(li));
li.cbSize = sizeof(li);
li.dwFlags = LTI_TCHAR;
li.ptszArtist = (TCHAR*)szArtist;
diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp index 9718015fdf..f20062aff5 100644 --- a/protocols/JabberG/src/ui_utils.cpp +++ b/protocols/JabberG/src/ui_utils.cpp @@ -1643,7 +1643,7 @@ HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const TCHAR *name) void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi)
{
- ZeroMemory(tvi, sizeof(*tvi));
+ memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE;
tvi->hItem = hItem;
GetItem(tvi);
@@ -1651,7 +1651,7 @@ void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi) void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength)
{
- ZeroMemory(tvi, sizeof(*tvi));
+ memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE|TVIF_TEXT;
tvi->hItem = hItem;
tvi->pszText = szText;
|