From f9883d97b3a586663f85075206fe7e07b41ed366 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Apr 2018 16:56:45 +0300 Subject: unneeded size fields removed --- plugins/BuddyPounce/src/main.cpp | 2 +- plugins/CloudFile/src/file_transfer.h | 1 - plugins/TabSRMM/src/hotkeyhandler.cpp | 2 +- plugins/TabSRMM/src/sendqueue.cpp | 2 +- plugins/UserInfoEx/src/svc_refreshci.cpp | 16 ++++------------ 5 files changed, 7 insertions(+), 16 deletions(-) (limited to 'plugins') diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 7b9a7d2087..7cb321e292 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -57,7 +57,7 @@ int MsgAck(WPARAM, LPARAM lParam) { ACKDATA *ack=(ACKDATA*)lParam; - if (ack && ack->cbSize == sizeof(ACKDATA) && ack->type == ACKTYPE_MESSAGE) { + if (ack && ack->type == ACKTYPE_MESSAGE) { if (ack->hProcess == (HANDLE)WindowList_Find(hWindowList,ack->hContact)) { if (db_get_b(NULL, modname, "ShowDeliveryMessages", 1)) CreateMessageAcknowlegedWindow(ack->hContact,ack->result == ACKRESULT_SUCCESS); diff --git a/plugins/CloudFile/src/file_transfer.h b/plugins/CloudFile/src/file_transfer.h index d568e60327..a19c62a412 100644 --- a/plugins/CloudFile/src/file_transfer.h +++ b/plugins/CloudFile/src/file_transfer.h @@ -32,7 +32,6 @@ public: folderName = NULL; relativePathStart = 0; - pfts.cbSize = sizeof(this->pfts); pfts.flags = PFTS_UNICODE | PFTS_SENDING; pfts.hContact = hContact; pfts.currentFileNumber = -1; diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index b53ec868d1..69300b36ad 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -465,7 +465,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP { SendJob *job = sendQueue->getJobByIndex((int)wParam); - ACKDATA ack = { 0 }; + ACKDATA ack = {}; ack.hContact = job->hContact; ack.hProcess = (HANDLE)job->iSendId; ack.type = ACKTYPE_MESSAGE; diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index baf21a59d5..850ddee811 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -282,7 +282,7 @@ int SendQueue::sendQueued(CTabBaseDlg *dat, const int iEntry) m_jobs[iEntry].iSendId = ProtoChainSend(dat->m_hContact, PSS_MESSAGE, m_jobs[iEntry].dwFlags, (LPARAM)m_jobs[iEntry].szSendBuffer); if (dat->m_sendMode & SMODE_NOACK) { // fake the ack if we are not interested in receiving real acks - ACKDATA ack = { 0 }; + ACKDATA ack = {}; ack.hContact = dat->m_hContact; ack.hProcess = (HANDLE)m_jobs[iEntry].iSendId; ack.type = ACKTYPE_MESSAGE; diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 59b991cfb9..f340a300c3 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -541,27 +541,19 @@ class CContactUpdater : public CContactQueue **/ int __cdecl OnProtoAck(WPARAM, ACKDATA *ack) { - if (ack && ack->cbSize == sizeof(ACKDATA) && ack->hContact == _hContact && ack->type == ACKTYPE_GETINFO) - { - if (ack->hProcess || ack->lParam) - { - if (!_hContactAcks) - { + if (ack && ack->hContact == _hContact && ack->type == ACKTYPE_GETINFO) { + if (ack->hProcess || ack->lParam) { + if (!_hContactAcks) { _nContactAcks = (INT_PTR)ack->hProcess; _hContactAcks = (PBYTE)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess); } + if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) - { _hContactAcks[ack->lParam] = 1; - } for (int i = 0; i < _nContactAcks; i++) - { if (_hContactAcks[i] == 0) - { return 0; - } - } } // don't wait the full time, but continue immitiatly ContinueWithNext(); -- cgit v1.2.3