summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-03 16:56:45 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-03 16:56:45 +0300
commitf9883d97b3a586663f85075206fe7e07b41ed366 (patch)
tree1aa3f212a908eda296de192129df8e49cc10cb13
parent9613f96e6a6f96ad02a0fc926054132811ae2bb1 (diff)
unneeded size fields removed
-rw-r--r--include/delphi/m_protocols.inc3
-rw-r--r--include/m_protocols.h7
-rw-r--r--plugins/BuddyPounce/src/main.cpp2
-rw-r--r--plugins/CloudFile/src/file_transfer.h1
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp2
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp2
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp16
-rw-r--r--protocols/EmLanProto/src/mlan.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp4
-rw-r--r--protocols/ICQCorp/src/transfer.cpp1
-rw-r--r--protocols/IRCG/src/irclib.cpp1
-rw-r--r--protocols/IcqOscarJ/src/icq_filetransfer.cpp3
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp41
-rw-r--r--protocols/JabberG/src/jabber_file.cpp1
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp6
-rw-r--r--protocols/MRA/src/Mra_functions.cpp1
-rw-r--r--protocols/MSN/src/msn_misc.cpp1
-rw-r--r--protocols/Sametime/src/files.cpp5
-rw-r--r--protocols/Tox/src/tox_transfer.h1
-rw-r--r--src/core/stdaway/src/awaymsg.cpp1
-rw-r--r--src/core/stdfile/src/file.cpp13
-rw-r--r--src/mir_app/src/proto_utils.cpp2
22 files changed, 40 insertions, 76 deletions
diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc
index c4038e9600..76796c06ed 100644
--- a/include/delphi/m_protocols.inc
+++ b/include/delphi/m_protocols.inc
@@ -47,7 +47,6 @@ type
type
PACKDATA = ^TACKDATA;
TACKDATA = record
- cbSize : int;
szModule: PAnsiChar; // the name of the protocol module which initiated this ack
hContact: TMCONTACT;
_type : int; // an ACKTYPE_* constant
@@ -119,7 +118,6 @@ type
// especially for Miranda 9.0+
PPROTOFILETRANSFERSTATUS = ^TPROTOFILETRANSFERSTATUS;
TPROTOFILETRANSFERSTATUS = record
- cbSize : size_t;
hContact : TMCONTACT;
flags : dword; // one of PFTS_* constants
files : ^TCHAR;
@@ -241,7 +239,6 @@ type
PPROTOACCOUNT = ^TPROTOACCOUNT;
PPPROTOACCOUNT = ^PPROTOACCOUNT;
TPROTOACCOUNT = record
- cbSize :int; // sizeof this structure
szModuleName :PAnsiChar; // unique physical account name (matches database module name)
tszAccountName :TChar; // user-defined account name
szProtoName :PAnsiChar; // physical protocol name
diff --git a/include/m_protocols.h b/include/m_protocols.h
index 55b2b28cc0..3aaf125906 100644
--- a/include/m_protocols.h
+++ b/include/m_protocols.h
@@ -34,12 +34,13 @@ struct PROTO_INTERFACE;
#include <m_core.h>
#include <m_system_cpp.h>
-typedef struct {
+struct CCSDATA
+{
MCONTACT hContact;
const char *szProtoService; // a PS_ constant
WPARAM wParam;
LPARAM lParam;
-} CCSDATA;
+};
/////////////////////////////////////////////////////////////////////////////////////////
// a general network 'ack'
@@ -85,7 +86,6 @@ typedef struct {
struct ACKDATA
{
- int cbSize;
const char *szModule; // the name of the protocol module which initiated this ack
MCONTACT hContact;
int type; // an ACKTYPE_ constant
@@ -111,7 +111,6 @@ struct ACKDATA
struct PROTOFILETRANSFERSTATUS
{
- size_t cbSize;
MCONTACT hContact;
DWORD flags; // one of PFTS_* constants
MAllStringArray pszFiles;
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();
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp
index c24d0d9e42..e7e6b8963d 100644
--- a/protocols/EmLanProto/src/mlan.cpp
+++ b/protocols/EmLanProto/src/mlan.cpp
@@ -1099,7 +1099,6 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
ProtoBroadcastAck(PROTONAME, conn->m_hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)conn->m_cid, 0);
PROTOFILETRANSFERSTATUS fts;
- fts.cbSize = sizeof(fts);
fts.flags = PFTS_UNICODE;
fts.hContact = conn->m_hContact;
fts.totalBytes = rcTotalSize;
@@ -1304,7 +1303,6 @@ void CMLan::OnOutTCPConnection(u_long, SOCKET out_socket, LPVOID lpParameter)
conn->m_szDir = mir_wstrdup(name);
PROTOFILETRANSFERSTATUS fts;
- fts.cbSize = sizeof(fts);
fts.flags = PFTS_SENDING | PFTS_UNICODE;
fts.hContact = conn->m_hContact;
fts.totalBytes = size;
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 4d51ee4103..3abef753e7 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -279,7 +279,6 @@ void __cdecl GaduProto::dccmainthread(void*)
local_dcc->tick = tick;
mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc->contact;
pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND);
pfts.pszFiles.a = nullptr;
@@ -309,7 +308,6 @@ void __cdecl GaduProto::dccmainthread(void*)
PROTOFILETRANSFERSTATUS pfts;
mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc->contact;
pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND);
pfts.pszFiles.a = nullptr;
@@ -508,7 +506,6 @@ void __cdecl GaduProto::dccmainthread(void*)
local_dcc7->tick = tick;
mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc7->contact;
pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND);
pfts.pszFiles.a = nullptr;
@@ -538,7 +535,6 @@ void __cdecl GaduProto::dccmainthread(void*)
PROTOFILETRANSFERSTATUS pfts;
mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc7->contact;
pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND);
pfts.pszFiles.a = nullptr;
diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp
index a3917047dc..07a9dbc893 100644
--- a/protocols/ICQCorp/src/transfer.cpp
+++ b/protocols/ICQCorp/src/transfer.cpp
@@ -306,7 +306,6 @@ void ICQTransfer::ack(unsigned int result)
return;
PROTOFILETRANSFERSTATUS fts;
- fts.cbSize = sizeof(fts);
fts.flags = PFTS_UNICODE;
fts.hContact = hContact;
fts.pszFiles.w = files;
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 956634afb0..5cd1451059 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -724,7 +724,6 @@ CDccSession::CDccSession(CIrcProto* _pro, DCCINFO *pdci) :
di = pdci; // Setup values passed to the constructor
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
if (di->iType == DCC_SEND && di->bSender == false)
hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
diff --git a/protocols/IcqOscarJ/src/icq_filetransfer.cpp b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
index 5e001d8abc..03f3484bcb 100644
--- a/protocols/IcqOscarJ/src/icq_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
@@ -28,7 +28,6 @@
static void file_buildProtoFileTransferStatus(filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts)
{
memset(pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts->cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts->hContact = ft->hContact;
pfts->flags = PFTS_UTF | (ft->sending ? PFTS_SENDING : PFTS_RECEIVING); /* Standard FT is Ansi only */
if (ft->sending)
@@ -394,7 +393,7 @@ void CIcqProto::handleFileTransferPacket(directconnect* dc, PBYTE buf, size_t wL
}
else {
/* file resume */
- PROTOFILETRANSFERSTATUS pfts = { 0 };
+ PROTOFILETRANSFERSTATUS pfts = {};
file_buildProtoFileTransferStatus(dc->ft, &pfts);
if (ProtoBroadcastAck(dc->ft->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, dc->ft, (LPARAM)&pfts))
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index 39bd428744..22e6d6dcd1 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -1006,7 +1006,6 @@ void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const wchar_t
static void oft_buildProtoFileTransferStatus(oscar_filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts)
{
memset(pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
- pfts->cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts->hContact = ft->hContact;
pfts->flags = PFTS_UTF + ((ft->flags & OFTF_SENDING) ? PFTS_SENDING : PFTS_RECEIVING);
if (ft->flags & OFTF_SENDING)
@@ -1539,9 +1538,9 @@ int CIcqProto::oft_handleFileData(oscar_connection *oc, BYTE *buf, size_t len)
ft->qwBytesDone += dwLen;
ft->qwFileBytesDone += dwLen;
- if (GetTickCount() > ft->dwLastNotify + 700 || ft->qwFileBytesDone == ft->qwThisFileSize) { // notify FT UI of our progress, at most every 700ms - do not be faster than Miranda
+ // notify FT UI of our progress, at most every 700ms - do not be faster than Miranda
+ if (GetTickCount() > ft->dwLastNotify + 700 || ft->qwFileBytesDone == ft->qwThisFileSize) {
PROTOFILETRANSFERSTATUS pfts;
-
oft_buildProtoFileTransferStatus(ft, &pfts);
ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&pfts);
ft->dwLastNotify = GetTickCount();
@@ -1743,32 +1742,30 @@ void CIcqProto::handleOFT2FramePacket(oscar_connection *oc, WORD datatype, BYTE
ft->qwFileBytesDone = 0;
- {
- /* file resume */
- PROTOFILETRANSFERSTATUS pfts;
-
- oft_buildProtoFileTransferStatus(ft, &pfts);
- if (ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&pfts)) {
- oc->status = OCS_WAITING;
- break; /* UI supports resume: it will call PS_FILERESUME */
- }
+ /* file resume */
+ PROTOFILETRANSFERSTATUS pfts;
+ oft_buildProtoFileTransferStatus(ft, &pfts);
+ if (ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&pfts)) {
+ oc->status = OCS_WAITING;
+ break; /* UI supports resume: it will call PS_FILERESUME */
+ }
- ft->fileId = OpenFileUtf(ft->szThisFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
+ ft->fileId = OpenFileUtf(ft->szThisFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
#ifdef _DEBUG
- NetLog_Direct("OFT: OpenFileUtf(%s, %u) returned %u", ft->szThisFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, ft->fileId);
+ NetLog_Direct("OFT: OpenFileUtf(%s, %u) returned %u", ft->szThisFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, ft->fileId);
#endif
- if (ft->fileId == -1) {
+ if (ft->fileId == -1) {
#ifdef _DEBUG
- NetLog_Direct("OFT: errno=%d", errno);
+ NetLog_Direct("OFT: errno=%d", errno);
#endif
- icq_LogMessage(LOG_ERROR, LPGEN("Your file receive has been aborted because Miranda could not open the destination file in order to write to it. You may be trying to save to a read-only folder."));
+ icq_LogMessage(LOG_ERROR, LPGEN("Your file receive has been aborted because Miranda could not open the destination file in order to write to it. You may be trying to save to a read-only folder."));
- ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
- // Release transfer
- SafeReleaseFileTransfer((basic_filetransfer**)&oc->ft);
- return;
- }
+ ProtoBroadcastAck(ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft, 0);
+ // Release transfer
+ SafeReleaseFileTransfer((basic_filetransfer**)&oc->ft);
+ return;
}
+
// Send "we are ready"
oc->status = OCS_DATA;
ft->flags |= OFTF_FILE_RECEIVING;
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index eebf790d5d..84a0e0cd37 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -451,7 +451,6 @@ filetransfer::filetransfer(CJabberProto *proto)
memset(this, 0, sizeof(filetransfer));
ppro = proto;
fileId = -1;
- std.cbSize = sizeof(std);
std.flags = PFTS_UNICODE;
}
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index 996503fee4..c106a7b073 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -722,13 +722,12 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter)
size_t i, dwBuffSizeUsed;
LARGE_INTEGER liFileSize;
NETLIBSELECT nls = { 0 };
- PROTOFILETRANSFERSTATUS pfts = { 0 };
+ PROTOFILETRANSFERSTATUS pfts = {};
mir_free(lpParameter);
bFailed = TRUE;
bConnected = FALSE;
- pfts.cbSize = sizeof(pfts);
pfts.hContact = dat->hContact;
pfts.flags = (PFTS_RECEIVING | PFTS_UNICODE);// pfts.sending = dat->bSending; //true if sending, false if receiving
//pfts.files;
@@ -981,8 +980,7 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter)
size_t i, j, dwBuffSizeUsed = 0;
LPWSTR lpwszFileName;
- PROTOFILETRANSFERSTATUS pfts = { 0 };
- pfts.cbSize = sizeof(pfts);
+ PROTOFILETRANSFERSTATUS pfts = {};
pfts.hContact = dat->hContact;
pfts.flags = (PFTS_SENDING | PFTS_UNICODE);// pfts.sending = dat->bSending; //true if sending, false if receiving
pfts.totalFiles = dat->dwFilesCount;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 0de82591be..e5c76b7811 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -885,7 +885,6 @@ static void FakeThread(void* param)
DWORD CMraProto::ProtoBroadcastAckAsync(MCONTACT hContact, int type, int hResult, HANDLE hProcess, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)::mir_calloc(sizeof(ACKDATA));
- ack->cbSize = sizeof(ACKDATA);
ack->szModule = m_szModuleName;
ack->hContact = hContact;
ack->type = type;
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 4018af2f67..4e09b187f7 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -894,7 +894,6 @@ filetransfer::filetransfer(CMsnProto* prt)
{
memset(this, 0, sizeof(filetransfer));
fileId = -1;
- std.cbSize = sizeof(std);
std.flags = PFTS_UNICODE;
proto = prt;
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp
index f4087265c5..e7d206c4fc 100644
--- a/protocols/Sametime/src/files.cpp
+++ b/protocols/Sametime/src/files.cpp
@@ -81,9 +81,7 @@ void __cdecl SendThread(LPVOID param) {
proto->debugLogW(L"SendThread() start");
- PROTOFILETRANSFERSTATUS pfts = {0};
-
- pfts.cbSize = sizeof(pfts);
+ PROTOFILETRANSFERSTATUS pfts = {};
pfts.flags = PFTS_UTF;
pfts.hContact = ftcd->hContact;
if (ftcd->sending == 1)
@@ -230,7 +228,6 @@ void mwFileTransfer_recv(mwFileTransfer* ft, struct mwOpaque* data)
mwFileTransfer_ack(ft); // acknowledge chunk
PROTOFILETRANSFERSTATUS pfts = { 0 };
- pfts.cbSize = sizeof(pfts);
pfts.flags = PFTS_UTF;
pfts.hContact = ftcd->hContact;
if (ftcd->sending == 1) {
diff --git a/protocols/Tox/src/tox_transfer.h b/protocols/Tox/src/tox_transfer.h
index 4c2feb1e68..0e72a4cf77 100644
--- a/protocols/Tox/src/tox_transfer.h
+++ b/protocols/Tox/src/tox_transfer.h
@@ -18,7 +18,6 @@ struct FileTransferParam
this->fileNumber = fileNumber;
transferNumber = (((int64_t)friendNumber) << 32) | ((int64_t)fileNumber);
- pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.flags = PFTS_UNICODE;
pfts.hContact = NULL;
pfts.totalFiles = 1;
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp
index 892556f77b..87a68ffb0c 100644
--- a/src/core/stdaway/src/awaymsg.cpp
+++ b/src/core/stdaway/src/awaymsg.cpp
@@ -73,7 +73,6 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP
if (dat->hSeq == nullptr) {
ACKDATA ack = { 0 };
- ack.cbSize = sizeof(ack);
ack.hContact = dat->hContact;
ack.type = ACKTYPE_AWAYMSG;
ack.result = ACKRESULT_SUCCESS;
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 87fcaf65d1..9982d6274c 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -304,13 +304,12 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM)
static int SRFileProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)lParam;
- if (ack->type != ACKTYPE_FILE) return 0;
-
- int iEvent = 0;
- while (CLISTEVENT *cle = pcli->pfnGetEvent(ack->hContact, iEvent++))
- if (cle->lParam == (LPARAM)ack->hProcess)
- pcli->pfnRemoveEvent(ack->hContact, cle->hDbEvent);
-
+ if (ack->type == ACKTYPE_FILE) {
+ int iEvent = 0;
+ while (CLISTEVENT *cle = pcli->pfnGetEvent(ack->hContact, iEvent++))
+ if (cle->lParam == (LPARAM)ack->hProcess)
+ pcli->pfnRemoveEvent(ack->hContact, cle->hDbEvent);
+ }
return 0;
}
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp
index 2211332254..787187f616 100644
--- a/src/mir_app/src/proto_utils.cpp
+++ b/src/mir_app/src/proto_utils.cpp
@@ -56,7 +56,7 @@ MIR_APP_DLL(void) Proto_EnumProtocols(int *nProtos, PROTOCOLDESCRIPTOR ***pProto
MIR_APP_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- ACKDATA ack = { sizeof(ACKDATA), szModule, hContact, type, result, hProcess, lParam };
+ ACKDATA ack = { szModule, hContact, type, result, hProcess, lParam };
return NotifyEventHooks(hAckEvent, 0, (LPARAM)&ack);
}