summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
commit1039b2829a264280493ba0fa979214fe024dc70c (patch)
tree8fa6a60eb46627582c372b56a4a1d4754d6732c3 /protocols/JabberG/src
parent62a186697df33c96dc1a6dac0f4dfc38652fb96f (diff)
WORD -> uint16_t
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp8
-rw-r--r--protocols/JabberG/src/jabber_ibb.cpp2
-rw-r--r--protocols/JabberG/src/jabber_ibb.h2
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_iqid.cpp4
-rw-r--r--protocols/JabberG/src/jabber_list.h2
-rwxr-xr-xprotocols/JabberG/src/jabber_opt.cpp12
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.h2
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp6
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp2
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp12
-rw-r--r--protocols/JabberG/src/jabber_ws.cpp2
-rwxr-xr-xprotocols/JabberG/src/stdafx.h2
16 files changed, 32 insertions, 32 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index 13691315d6..c9c9088aca 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -365,7 +365,7 @@ int CJabberProto::ByteSendParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, ch
// 03-03 address type (1=IPv4 address)
// 04-07 bnd.addr server bound address
// 08-09 bnd.port server bound port
- if (datalen == 47 && *((DWORD*)buffer) == 0x03000105 && buffer[4] == 40 && *((WORD*)(buffer + 45)) == 0) {
+ if (datalen == 47 && *((DWORD*)buffer) == 0x03000105 && buffer[4] == 40 && *((uint16_t*)(buffer + 45)) == 0) {
ptrA szInitiatorJid(JabberPrepareJid(jbt->srcJID));
ptrA szTargetJid(JabberPrepareJid(jbt->dstJID));
CMStringA szAuthString(FORMAT, "%s%s%s", jbt->sid, szInitiatorJid.get(), szTargetJid.get());
@@ -438,7 +438,7 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt)
char *szPort = jbt->szProxyPort;
char *szHost = jbt->szProxyHost;
- WORD port = (WORD)atoi(szPort);
+ uint16_t port = (uint16_t)atoi(szPort);
replaceStr(jbt->streamhostJID, jbt->szProxyJid);
NETLIBOPENCONNECTION nloc = {};
@@ -575,7 +575,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
return;
const TiXmlElement *iqNode, *queryNode = nullptr;
- WORD port;
+ uint16_t port;
char data[3];
char* buffer;
int datalen, bytesParsed, recvResult;
@@ -606,7 +606,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
const char *szHost = XmlGetAttr(n, "host");
const char *szPort = XmlGetAttr(n, "port");
if (str != nullptr && szHost != nullptr && szPort != nullptr) {
- port = (WORD)atoi(szPort);
+ port = (uint16_t)atoi(szPort);
replaceStr(jbt->streamhostJID, str);
debugLogA("bytestream_recv connecting to %s:%d", szHost, port);
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp
index 7a20c70760..3fefc2f186 100644
--- a/protocols/JabberG/src/jabber_ibb.cpp
+++ b/protocols/JabberG/src/jabber_ibb.cpp
@@ -171,7 +171,7 @@ bool CJabberProto::OnIbbRecvdData(const char *data, const char *sid, const char
if (item == nullptr)
return false;
- WORD wSeq = (WORD)atoi(seq);
+ uint16_t wSeq = (uint16_t)atoi(seq);
if (wSeq != item->jibb->wPacketId) {
if (item->jibb->hEvent)
SetEvent(item->jibb->hEvent);
diff --git a/protocols/JabberG/src/jabber_ibb.h b/protocols/JabberG/src/jabber_ibb.h
index 44312bb816..a9e7905237 100644
--- a/protocols/JabberG/src/jabber_ibb.h
+++ b/protocols/JabberG/src/jabber_ibb.h
@@ -38,7 +38,7 @@ struct JABBER_IBB_TRANSFER
HANDLE hEvent;
bool bStreamInitialized;
bool bStreamClosed;
- WORD wPacketId;
+ uint16_t wPacketId;
bool (CJabberProto::*pfnSend)(int blocksize, filetransfer *ft);
int (CJabberProto::*pfnRecv)(HNETLIBCONN hConn, filetransfer *ft, char* buffer, int datalen);
void (CJabberProto::*pfnFinal)(bool success, filetransfer *ft);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index d50c2e541f..93b287e016 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -340,7 +340,7 @@ INT_PTR __cdecl CJabberProto::OnGetAdvancedStatusIcon(WPARAM hContact, LPARAM)
if (iID < 0)
return -1;
- WORD Status = getWord(hContact, "Status", ID_STATUS_OFFLINE);
+ uint16_t Status = getWord(hContact, "Status", ID_STATUS_OFFLINE);
if (Status < ID_STATUS_OFFLINE)
Status = ID_STATUS_OFFLINE;
else if (Status > ID_STATUS_INVISIBLE)
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index a1b7fb9a43..cef7f3a195 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -283,7 +283,7 @@ bool CJabberProto::OnIqRequestOOB(const TiXmlElement*, CJabberIqInfo *pInfo)
strncpy_s(text, p, q - p);
text[q - p] = '\0';
if (char *d = strchr(text, ':')) {
- ft->httpPort = (WORD)atoi(d + 1);
+ ft->httpPort = (uint16_t)atoi(d + 1);
*d = '\0';
}
ft->httpHostName = mir_strdup(text);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 32449881be..07931a08ad 100755
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -703,7 +703,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo*
if (hContact != 0) {
if (sscanf(n->GetText(), "%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
- setWord(hContact, "BirthYear", (WORD)nYear);
+ setWord(hContact, "BirthYear", (uint16_t)nYear);
setByte(hContact, "BirthMonth", (uint8_t)nMonth);
setByte(hContact, "BirthDay", (uint8_t)nDay);
@@ -713,7 +713,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo*
if (sToday.wMonth < nMonth || (sToday.wMonth == nMonth && sToday.wDay < nDay))
nAge--;
if (nAge)
- setWord(hContact, "Age", (WORD)nAge);
+ setWord(hContact, "Age", (uint16_t)nAge);
}
}
else {
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 6ad73e6490..05d65fdb23 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -190,7 +190,7 @@ struct JABBER_LIST_ITEM : public MZeroedObject
// LIST_FILE
// jid = string representation of port number
filetransfer *ft;
- WORD port;
+ uint16_t port;
// LIST_BYTE
// jid = string representation of port number
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 1f4bfd91b4..97a821e275 100755
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -550,11 +550,11 @@ private:
m_txtPassword.GetTextU(regInfo.password, _countof(regInfo.password));
m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server));
if (m_chkManualHost.GetState() == BST_CHECKED) {
- regInfo.port = (WORD)m_txtManualPort.GetInt();
+ regInfo.port = (uint16_t)m_txtManualPort.GetInt();
m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost));
}
else {
- regInfo.port = (WORD)m_txtPort.GetInt();
+ regInfo.port = (uint16_t)m_txtPort.GetInt();
regInfo.manualHost[0] = '\0';
}
@@ -669,11 +669,11 @@ private:
m_txtPassword.GetTextU(regInfo.password, _countof(regInfo.password));
m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server));
if (m_chkManualHost.GetState() == BST_CHECKED) {
- regInfo.port = (WORD)m_txtManualPort.GetInt();
+ regInfo.port = (uint16_t)m_txtManualPort.GetInt();
m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost));
}
else {
- regInfo.port = (WORD)m_txtPort.GetInt();
+ regInfo.port = (uint16_t)m_txtPort.GetInt();
regInfo.manualHost[0] = '\0';
}
@@ -830,7 +830,7 @@ public:
if (hContact != 0) {
if (bChecked) {
if (item->getTemp()->m_iStatus != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) {
- m_proto->setWord(hContact, "Status", (WORD)item->getTemp()->m_iStatus);
+ m_proto->setWord(hContact, "Status", (uint16_t)item->getTemp()->m_iStatus);
}
}
else if (m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
@@ -1251,7 +1251,7 @@ private:
m_txtUsername.GetTextU(regInfo.username, _countof(regInfo.username));
m_txtPassword.GetTextU(regInfo.password, _countof(regInfo.password));
m_cbServer.GetTextA(regInfo.server, _countof(regInfo.server));
- regInfo.port = (WORD)m_txtPort.GetInt();
+ regInfo.port = (uint16_t)m_txtPort.GetInt();
if (m_chkManualHost.GetState() == BST_CHECKED)
m_txtManualHost.GetTextA(regInfo.manualHost, _countof(regInfo.manualHost));
else
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index a92d005d29..6559ac437e 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -1866,7 +1866,7 @@ public:
PostMessage(m_hwnd, WM_PROTO_REFRESH, 0, 0);
}
- void OnCommand_Close(HWND /*hwndCtrl*/, WORD /*idCtrl*/, WORD /*idCode*/)
+ void OnCommand_Close(HWND /*hwndCtrl*/, uint16_t /*idCtrl*/, uint16_t /*idCode*/)
{
if (IsWindowVisible(m_clcClist.GetHwnd()))
CListBuildList(clc_info.pList);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 7beb4d6a42..9ff764ecdc 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -989,7 +989,7 @@ int CJabberProto::SetApparentMode(MCONTACT hContact, int mode)
if (mode == oldMode)
return 1;
- setWord(hContact, "ApparentMode", (WORD)mode);
+ setWord(hContact, "ApparentMode", (uint16_t)mode);
if (!m_bJabberOnline)
return 0;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 4ac9cf3ee3..b82abb54e4 100755
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -884,7 +884,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
//---- jabber_ws.c -------------------------------------------------
- HNETLIBCONN WsConnect(char* host, WORD port);
+ HNETLIBCONN WsConnect(char* host, uint16_t port);
bool WsInit(void);
int WsSend(HNETLIBCONN s, char* data, int datalen, int flags);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index cff0eb6468..38cb49427c 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -51,7 +51,7 @@ struct JabberPasswordDlgParam
CJabberProto *pro;
BOOL saveOnlinePassword;
- WORD dlgResult;
+ uint16_t dlgResult;
wchar_t onlinePassword[128];
HANDLE hEventPasswdDlg;
char *pszJid;
@@ -188,7 +188,7 @@ void ThreadData::xmpp_client_query(void)
dnsList.insert(&rec->Data.Srv);
for (auto &it : dnsList) {
- WORD dnsPort = (conn.port == 0 || conn.port == 5222) ? it->wPort : conn.port;
+ uint16_t dnsPort = (conn.port == 0 || conn.port == 5222) ? it->wPort : conn.port;
char* dnsHost = it->pNameTarget;
proto->debugLogA("%s%s resolved to %s:%d", "_xmpp-client._tcp.", conn.server, dnsHost, dnsPort);
@@ -1514,7 +1514,7 @@ void CJabberProto::UpdateJidDbSettings(const char *jid)
if (strchr(jid, '@') != nullptr || m_bShowTransport == TRUE)
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
- setWord(hContact, "Status", (WORD)status);
+ setWord(hContact, "Status", (uint16_t)status);
// remove x-status icon
if (status == ID_STATUS_OFFLINE) {
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index b2d1856ce9..b8ddd22545 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -338,7 +338,7 @@ void CJabberProto::SendVisibleInvisiblePresence(bool invisible)
if (hContact == 0)
continue;
- WORD apparentMode = getWord(hContact, "ApparentMode", 0);
+ uint16_t apparentMode = getWord(hContact, "ApparentMode", 0);
if (invisible && apparentMode == ID_STATUS_OFFLINE)
m_ThreadInfo->send(XmlNode("presence") << XATTR("to", item->jid) << XATTR("type", "invisible"));
else if (!invisible && apparentMode == ID_STATUS_ONLINE)
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index f2c75e7112..d01fcb4d3b 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -563,7 +563,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
SetDlgItemTextA(hwndDlg, IDC_EMAIL, email);
mir_snprintf(idstr, "e-mailFlag%d", (int)lParam);
- WORD nFlag = dat->ppro->getWord(idstr, 0);
+ uint16_t nFlag = dat->ppro->getWord(idstr, 0);
if (nFlag & JABBER_VCEMAIL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, BST_CHECKED);
if (nFlag & JABBER_VCEMAIL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, BST_CHECKED);
if (nFlag & JABBER_VCEMAIL_INTERNET) CheckDlgButton(hwndDlg, IDC_INTERNET, BST_CHECKED);
@@ -588,7 +588,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
mir_snprintf(idstr, "e-mail%d", dat->id);
dat->ppro->setWString(idstr, text);
{
- WORD nFlag = 0;
+ uint16_t nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCEMAIL_HOME;
if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCEMAIL_WORK;
if (IsDlgButtonChecked(hwndDlg, IDC_INTERNET)) nFlag |= JABBER_VCEMAIL_INTERNET;
@@ -659,7 +659,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
mir_snprintf(idstr, "Phone%d", dat->id);
dat->ppro->setString(idstr, text);
{
- WORD nFlag = 0;
+ uint16_t nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCTEL_HOME;
if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCTEL_WORK;
if (IsDlgButtonChecked(hwndDlg, IDC_VOICE)) nFlag |= JABBER_VCTEL_VOICE;
@@ -872,7 +872,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
ppro->setString(idstr, fieldVal);
mir_snprintf(idstr, szFlagTemplate, i + 1);
- WORD nFlag = ppro->getWord(idstr, 0);
+ uint16_t nFlag = ppro->getWord(idstr, 0);
mir_snprintf(idstr, szFlagTemplate, i);
ppro->setWord(idstr, nFlag);
}
@@ -1043,7 +1043,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName)
AppendVcardFromDB(e, "USERID", idstr);
mir_snprintf(idstr, "e-mailFlag%d", i);
- WORD nFlag = getWord(idstr, 0);
+ uint16_t nFlag = getWord(idstr, 0);
if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD("HOME");
if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD("WORK");
if (nFlag & JABBER_VCEMAIL_INTERNET) e << XCHILD("INTERNET");
@@ -1091,7 +1091,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName)
AppendVcardFromDB(n, "NUMBER", idstr);
mir_snprintf(idstr, "PhoneFlag%d", i);
- WORD nFlag = getWord(idstr, 0);
+ uint16_t nFlag = getWord(idstr, 0);
if (nFlag & JABBER_VCTEL_HOME) n << XCHILD("HOME");
if (nFlag & JABBER_VCTEL_WORK) n << XCHILD("WORK");
if (nFlag & JABBER_VCTEL_VOICE) n << XCHILD("VOICE");
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp
index 79bffb948d..467e02d8f8 100644
--- a/protocols/JabberG/src/jabber_ws.cpp
+++ b/protocols/JabberG/src/jabber_ws.cpp
@@ -39,7 +39,7 @@ bool CJabberProto::WsInit(void)
return m_hNetlibUser != nullptr;
}
-HNETLIBCONN CJabberProto::WsConnect(char* host, WORD port)
+HNETLIBCONN CJabberProto::WsConnect(char* host, uint16_t port)
{
NETLIBOPENCONNECTION nloc = {};
nloc.szHost = host;
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index c007b351a7..2cc9550b8f 100755
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -432,7 +432,7 @@ struct filetransfer : public MZeroedObject
// Used by file receiving only
char* httpHostName;
- WORD httpPort;
+ uint16_t httpPort;
char* httpPath;
unsigned __int64 dwExpectedRecvFileSize;