diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-24 13:20:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-24 13:20:12 +0300 |
commit | 0db449bf70966941453cfbb8ec05fd430a96dc12 (patch) | |
tree | e01421e30b58ae2799929e16a6a326f5d4f68a5d /protocols | |
parent | 30dad0388a14244ef9b06afc113085f6a49bcbb8 (diff) |
useless member NETLIBOPENCONNECTION::cbSize removed
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Discord/src/gateway.cpp | 3 | ||||
-rw-r--r-- | protocols/IRCG/src/irclib.cpp | 9 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_file.cpp | 3 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_ws.cpp | 1 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 1 | ||||
-rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 1 | ||||
-rw-r--r-- | protocols/Sametime/src/conference.cpp | 14 | ||||
-rw-r--r-- | protocols/Sametime/src/files.cpp | 7 | ||||
-rw-r--r-- | protocols/Sametime/src/messaging.cpp | 2 | ||||
-rw-r--r-- | protocols/Sametime/src/places.cpp | 24 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.cpp | 4 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.h | 2 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_session.cpp | 14 | ||||
-rw-r--r-- | protocols/YAMN/src/proto/netlib.cpp | 4 |
15 files changed, 40 insertions, 55 deletions
diff --git a/protocols/Discord/src/gateway.cpp b/protocols/Discord/src/gateway.cpp index cc48552b13..fc760cb980 100644 --- a/protocols/Discord/src/gateway.cpp +++ b/protocols/Discord/src/gateway.cpp @@ -140,8 +140,7 @@ bool CDiscordProto::GatewayThreadWorker() if (!mir_strncmp(m_szGateway, "wss://", 6)) m_szGateway.Delete(0, 6); - NETLIBOPENCONNECTION conn = { 0 }; - conn.cbSize = sizeof(conn); + NETLIBOPENCONNECTION conn = {}; conn.szHost = m_szGateway; conn.flags = NLOCF_V2 | NLOCF_SSL; conn.timeout = 5; diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 3dd16b0769..e72df9fa90 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -194,8 +194,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) { codepage = m_codepage; - NETLIBOPENCONNECTION ncon = { 0 }; - ncon.cbSize = sizeof(ncon); + NETLIBOPENCONNECTION ncon = {}; ncon.szHost = info.sServer.c_str(); ncon.wPort = info.iPort; con = Netlib_OpenConnection(m_hNetlibUser, &ncon); @@ -883,8 +882,7 @@ int CDccSession::SetupConnection() // If a remote computer initiates a chat session this is used to connect to the remote computer (user already accepted at this point). // also used for connecting to a remote computer for remote file transfers if (di->iType == DCC_CHAT && !di->bSender || di->iType == DCC_SEND && di->bSender && di->bReverse) { - NETLIBOPENCONNECTION ncon = { 0 }; - ncon.cbSize = sizeof(ncon); + NETLIBOPENCONNECTION ncon = {}; ncon.szHost = ConvertIntegerToIP(di->dwAdr); ncon.wPort = (WORD)di->iPort; con = Netlib_OpenConnection(m_proto->hNetlibDCC, &ncon); @@ -978,8 +976,7 @@ int CDccSession::SetupConnection() } // connect to the remote computer from which you are receiving the file (now all actions to take (resume/overwrite etc) have been decided - NETLIBOPENCONNECTION ncon = { 0 }; - ncon.cbSize = sizeof(ncon); + NETLIBOPENCONNECTION ncon = {}; ncon.szHost = ConvertIntegerToIP(di->dwAdr); ncon.wPort = (WORD)di->iPort; diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index fe2aaed8fd..7228b16fc1 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -441,10 +441,10 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt) WORD port = (WORD)atoi(szPort);
replaceStr(jbt->streamhostJID, jbt->szProxyJid);
- NETLIBOPENCONNECTION nloc = { 0 };
- nloc.cbSize = sizeof(nloc);
+ NETLIBOPENCONNECTION nloc = {};
nloc.szHost = szHost;
nloc.wPort = port;
+
HNETLIBCONN hConn = Netlib_OpenConnection(m_hNetlibUser, &nloc);
mir_free((void*)nloc.szHost);
@@ -608,9 +608,9 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) debugLogA("bytestream_recv connecting to %s:%d", szHost, port);
NETLIBOPENCONNECTION nloc = { 0 };
- nloc.cbSize = sizeof(nloc);
nloc.szHost = mir_strdup(szHost);
nloc.wPort = port;
+
HNETLIBCONN hConn = Netlib_OpenConnection(m_hNetlibUser, &nloc);
mir_free((void*)nloc.szHost);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 1cb53aa248..aff4a01567 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -36,8 +36,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft) ft->type = FT_OOB;
- NETLIBOPENCONNECTION nloc = { 0 };
- nloc.cbSize = sizeof(nloc);
+ NETLIBOPENCONNECTION nloc = {};
nloc.szHost = ft->httpHostName;
nloc.wPort = ft->httpPort;
info.s = Netlib_OpenConnection(m_hNetlibUser, &nloc);
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp index 228bb5f5c9..e138c0c733 100644 --- a/protocols/JabberG/src/jabber_ws.cpp +++ b/protocols/JabberG/src/jabber_ws.cpp @@ -42,7 +42,6 @@ BOOL CJabberProto::WsInit(void) HNETLIBCONN CJabberProto::WsConnect(char* host, WORD port)
{
NETLIBOPENCONNECTION nloc = {};
- nloc.cbSize = sizeof(nloc);
nloc.szHost = host;
nloc.wPort = port;
nloc.timeout = 6;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 655a0c048e..e26d2828f0 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -424,7 +424,6 @@ static void MyNetlibConnFromUrl(const char* szUrl, NETLIBOPENCONNECTION &nloc) if (ppath) *ppath = '\0';
memset(&nloc, 0, sizeof(nloc));
- nloc.cbSize = sizeof(nloc);
nloc.szHost = szHost;
char* pcolon = strrchr(szHost, ':');
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index 94870e2a1f..bad3db275d 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -126,7 +126,6 @@ void __cdecl CMsnProto::MSNServerThread(void* arg) mir_strcpy(info->mServer, MSN_DEFAULT_LOGIN_SERVER);
NETLIBOPENCONNECTION tConn = { 0 };
- tConn.cbSize = sizeof(tConn);
tConn.flags = NLOCF_V2;
tConn.timeout = 5;
tConn.flags = NLOCF_SSL;
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index dcba8b5dd6..666ed44cfe 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -146,7 +146,7 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members) /** triggered when a conference is closed. This is typically when
we've left it */
-void mwServiceConf_conf_closed(mwConference* conf, guint32 reason)
+void mwServiceConf_conf_closed(mwConference* conf, guint32)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLogW(L"mwServiceConf_conf_closed() start");
@@ -240,7 +240,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh }
/** typing notification */
-void mwServiceConf_on_typing(mwConference* conf, mwLoginInfo* who, gboolean typing)
+void mwServiceConf_on_typing(mwConference* conf, mwLoginInfo*, gboolean)
{
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLogW(L"mwServiceConf_on_typing() start");
@@ -248,7 +248,7 @@ void mwServiceConf_on_typing(mwConference* conf, mwLoginInfo* who, gboolean typi }
/** optional. called from mwService_free */
-void mwServiceConf_clear(mwServiceConference* srvc)
+void mwServiceConf_clear(mwServiceConference*)
{
}
@@ -277,7 +277,7 @@ void CSametimeProto::TerminateConference(char* name) }
-int CSametimeProto::GcEventHook(WPARAM wParam, LPARAM lParam) {
+int CSametimeProto::GcEventHook(WPARAM, LPARAM lParam) {
GCHOOK* gch = (GCHOOK*)lParam;
@@ -333,7 +333,7 @@ int CSametimeProto::ChatDeleted(MCONTACT hContact) { }
-INT_PTR CSametimeProto::onMenuLeaveChat(WPARAM wParam, LPARAM lParam)
+INT_PTR CSametimeProto::onMenuLeaveChat(WPARAM wParam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wParam;
debugLogW(L"CSametimeProto::onMenuLeaveChat() hContact=[%x]", hContact);
@@ -342,7 +342,7 @@ INT_PTR CSametimeProto::onMenuLeaveChat(WPARAM wParam, LPARAM lParam) }
-INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam)
+INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wParam;
debugLogW(L"CSametimeProto::onMenuCreateChat() hContact=[%x]", hContact);
@@ -375,7 +375,7 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam) return 0;
}
-int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
+int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wParam;
debugLogW(L"CSametimeProto::PrebuildContactMenu() hContact=[%x]", hContact);
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index a0b3d3dd74..e5dde87da3 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -257,7 +257,7 @@ void mwFileTransfer_handle_ack(mwFileTransfer* ft) }
/** optional. called from mwService_free */
-void mwFileTransfer_clear(mwServiceFileTransfer* srvc)
+void mwFileTransfer_clear(mwServiceFileTransfer*)
{
}
@@ -280,7 +280,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const idb.user = id_block.user;
idb.community = id_block.community;
- FileTransferClientData *ftcd, *prev_ftcd = nullptr, *first_ftcd = nullptr;
+ FileTransferClientData *ftcd, *prev_ftcd = nullptr;
mwFileTransfer *ft, *first_ft = nullptr;
for (int i = 0; files[i]; i++) {
@@ -346,7 +346,6 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s {
mwFileTransfer* ft = (mwFileTransfer*)hFt;
- CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
debugLogW(L"CSametimeProto::AcceptFileTransfer() start");
FileTransferClientData* ftcd = new FileTransferClientData;
@@ -392,7 +391,6 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s void CSametimeProto::RejectFileTransfer(HANDLE hFt)
{
mwFileTransfer* ft = (mwFileTransfer*)hFt;
- CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
debugLogW(L"CSametimeProto::RejectFileTransfer() start");
mwFileTransfer_reject(ft);
@@ -401,7 +399,6 @@ void CSametimeProto::RejectFileTransfer(HANDLE hFt) void CSametimeProto::CancelFileTransfer(HANDLE hFt)
{
mwFileTransfer* ft = (mwFileTransfer*)hFt;
- CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
debugLogW(L"CSametimeProto::CancelFileTransfer() start");
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index cc79c8b9dc..c8c3cb64cb 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -88,7 +88,7 @@ void mwIm_conversation_recv(mwConversation* conv, mwImSendType type, gconstpoint ProtoChainRecvMsg(hContact, &pre);
}
-void mwIm_place_invite(struct mwConversation* conv, const char* message, const char* title, const char* name)
+void mwIm_place_invite(struct mwConversation* conv, const char* message, const char*, const char*)
{
CSametimeProto* proto = getProtoFromMwConversation(conv);
proto->debugLogW(L"mwIm_place_invite() start");
diff --git a/protocols/Sametime/src/places.cpp b/protocols/Sametime/src/places.cpp index 8b3a030ed1..2fd862d70d 100644 --- a/protocols/Sametime/src/places.cpp +++ b/protocols/Sametime/src/places.cpp @@ -3,40 +3,40 @@ /* Stubs, NOT IMPLEMENTED NOW */
-void mwServicePlace_opened(struct mwPlace* place)
+void mwServicePlace_opened(struct mwPlace*)
{
}
-void mwServicePlace_closed(struct mwPlace* place, guint32 code)
+void mwServicePlace_closed(struct mwPlace*, guint32)
{
}
-void mwServicePlace_peerJoined(struct mwPlace* place, const struct mwIdBlock* peer)
+void mwServicePlace_peerJoined(struct mwPlace*, const struct mwIdBlock*)
{
}
-void mwServicePlace_peerParted(struct mwPlace* place, const struct mwIdBlock* peer)
+void mwServicePlace_peerParted(struct mwPlace*, const struct mwIdBlock*)
{
}
-void mwServicePlace_peerSetAttribute(struct mwPlace* place, const struct mwIdBlock* peer, guint32 attr, struct mwOpaque* o)
+void mwServicePlace_peerSetAttribute(struct mwPlace*, const struct mwIdBlock*, guint32, struct mwOpaque*)
{
}
-void mwServicePlace_peerUnsetAttribute(struct mwPlace* place, const struct mwIdBlock* peer, guint32 attr)
+void mwServicePlace_peerUnsetAttribute(struct mwPlace*, const struct mwIdBlock*, guint32)
{
}
-void mwServicePlace_message(struct mwPlace* place, const struct mwIdBlock* who, const char* msg)
+void mwServicePlace_message(struct mwPlace*, const struct mwIdBlock*, const char*)
{
}
-void mwServicePlace_clear(struct mwServicePlace* srvc)
+void mwServicePlace_clear(struct mwServicePlace*)
{
}
@@ -52,16 +52,16 @@ mwPlaceHandler mwPlace_handler = { mwServicePlace_clear
};
-void CSametimeProto::InitPlaces(mwSession* session)
+void CSametimeProto::InitPlaces(mwSession* pSession)
{
debugLogW(L"CSametimeProto::InitPlaces()");
- mwSession_addService(session, (mwService*)(service_places = mwServicePlace_new(session, &mwPlace_handler)));
+ mwSession_addService(pSession, (mwService*)(service_places = mwServicePlace_new(pSession, &mwPlace_handler)));
}
-void CSametimeProto::DeinitPlaces(mwSession* session)
+void CSametimeProto::DeinitPlaces(mwSession* pSession)
{
debugLogW(L"CSametimeProto::DeinitPlaces()");
- mwSession_removeService(session, mwService_PLACE);
+ mwSession_removeService(pSession, mwService_PLACE);
mwService_free((mwService*)service_places);
service_places = nullptr;
}
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 6bae4d5d0a..f47f031ffb 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -100,7 +100,7 @@ int CSametimeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* return 0;
}
-INT_PTR CSametimeProto::GetCaps(int type, MCONTACT hContact)
+INT_PTR CSametimeProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -233,7 +233,7 @@ int CSametimeProto::SetStatus(int iNewStatus) m_iDesiredStatus = iNewStatus;
if (iNewStatus != ID_STATUS_OFFLINE) {
if (m_iStatus == ID_STATUS_OFFLINE)
- LogIn(iNewStatus, m_hNetlibUser);
+ LogIn(iNewStatus);
else
SetSessionStatus(iNewStatus);
}
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index e81767cfd5..b97a53c40f 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -102,7 +102,7 @@ struct CSametimeProto : public PROTO<CSametimeProto> void SessionStarted();
void SessionStopping();
void InitSessionMenu();
- int LogIn(int status, HANDLE hNetlibUser);
+ int LogIn(int status);
int LogOut();
int OnLogInRedirect(char* newHost);
int SetSessionStatus(int status);
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index e9cd06818c..2e27b39822 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -142,7 +142,7 @@ void __cdecl SessionAdmin(struct mwSession* session, const char* text) mir_free(tt);
}
-void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from, gboolean may_reply, const char* text)
+void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from, gboolean, const char* text)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
proto->debugLogW(L"SessionAnnounce()");
@@ -275,7 +275,7 @@ int CSametimeProto::SetSessionStatus(int status) return 0;
}
-VOID CALLBACK IdleTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK IdleTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
{
CSametimeProto* proto = (CSametimeProto*)idEvent;
@@ -358,7 +358,7 @@ void __cdecl CSametimeProto::KeepAliveThread(void*) return;
}
-int waitcallback(unsigned int* timeout)
+int waitcallback(unsigned int*)
{
return continue_connect ? 1 : 0;
}
@@ -373,7 +373,6 @@ void __cdecl CSametimeProto::SessionThread(LPVOID) // setup
NETLIBOPENCONNECTION conn_data = { 0 };
- conn_data.cbSize = sizeof(NETLIBOPENCONNECTION);
conn_data.flags = NLOCF_V2;
conn_data.szHost = options.server_name;
conn_data.wPort = options.port;
@@ -470,7 +469,7 @@ WORD CSametimeProto::GetServerVersion() return retval;
}
-int CSametimeProto::LogIn(int ls, HANDLE hNetlibUser)
+int CSametimeProto::LogIn(int ls)
{
debugLogW(L"LogIn() start");
@@ -483,7 +482,6 @@ int CSametimeProto::LogIn(int ls, HANDLE hNetlibUser) login_status = ls;
ForkThread(&CSametimeProto::SessionThread);
-
return 0;
}
@@ -515,7 +513,7 @@ int CSametimeProto::OnLogInRedirect(char* newHost) mir_strcpy(options.server_name, newHost);
LogOut();
Sleep(50); //wait for SessionThread end
- LogIn(login_status, m_hNetlibUser);
+ LogIn(login_status);
return 0;
}
@@ -543,7 +541,7 @@ void SendAnnouncement(SendAnnouncementFunc_arg* arg) mwSession_sendAnnounce(proto->session, false, T2Utf(arg->msg), arg->recipients);
}
-INT_PTR CSametimeProto::SessionAnnounce(WPARAM wParam, LPARAM lParam)
+INT_PTR CSametimeProto::SessionAnnounce(WPARAM, LPARAM)
{
debugLogW(L"CSametimeProto::SessionAnnounce() start");
SessionAnnounceDialogProc_arg* sadpArg = (SessionAnnounceDialogProc_arg*)mir_calloc(sizeof(SessionAnnounceDialogProc_arg));
diff --git a/protocols/YAMN/src/proto/netlib.cpp b/protocols/YAMN/src/proto/netlib.cpp index 02fb6d3cdc..507b9b4051 100644 --- a/protocols/YAMN/src/proto/netlib.cpp +++ b/protocols/YAMN/src/proto/netlib.cpp @@ -92,11 +92,9 @@ void CNLClient::Connect(const char* servername, const int port) throw(DWORD) DebugLog(CommFile, "<connect>\n"); #endif try { - NETLIBOPENCONNECTION nloc; - nloc.cbSize = sizeof(NETLIBOPENCONNECTION); + NETLIBOPENCONNECTION nloc = {}; nloc.szHost = servername; nloc.wPort = port; - nloc.flags = 0; if (nullptr == (hConnection = Netlib_OpenConnection(hNetlibUser, &nloc))) { SystemError = WSAGetLastError(); throw NetworkError = (DWORD)ENL_CONNECT; |