diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 17:06:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 17:06:04 +0300 |
commit | 1039b2829a264280493ba0fa979214fe024dc70c (patch) | |
tree | 8fa6a60eb46627582c372b56a4a1d4754d6732c3 /protocols/Gadu-Gadu/src | |
parent | 62a186697df33c96dc1a6dac0f4dfc38652fb96f (diff) |
WORD -> uint16_t
Diffstat (limited to 'protocols/Gadu-Gadu/src')
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 16 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/filetransfer.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/options.h | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 32d7629a7a..b3f8567b14 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -703,8 +703,8 @@ retry: int br = atoi(__birthyear);
if (br > 0)
{
- setWord(hContact, GG_KEY_PD_AGE, (WORD)(lt->tm_year + 1900 - br));
- setWord(hContact, GG_KEY_PD_BIRTHYEAR, (WORD)br);
+ setWord(hContact, GG_KEY_PD_AGE, (uint16_t)(lt->tm_year + 1900 - br));
+ setWord(hContact, GG_KEY_PD_BIRTHYEAR, (uint16_t)br);
}
}
else if (res->seq == GG_SEQ_CHINFO) {
@@ -758,7 +758,7 @@ retry: case GG_EVENT_STATUS60:
{
MCONTACT hContact = getcontact(e->event.status60.uin, 0, 0, nullptr);
- int oldstatus = getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE);
+ int oldstatus = getWord(hContact, GG_KEY_STATUS, (uint16_t)ID_STATUS_OFFLINE);
uin_t uin = (uin_t)getDword(GG_KEY_UIN, 0);
wchar_t *descrT = mir_utf8decodeW(e->event.status60.descr);
@@ -775,7 +775,7 @@ retry: mir_free(descrT);
- if (oldstatus == ID_STATUS_OFFLINE && getWord(hContact, GG_KEY_STATUS, (WORD)ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ if (oldstatus == ID_STATUS_OFFLINE && getWord(hContact, GG_KEY_STATUS, (uint16_t)ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
requestAvatarInfo(hContact, 0);
}
break;
@@ -1367,7 +1367,7 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh) {
// Check if user should be invisible
// Or be blocked ?
- if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact))
+ if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact))
{
gg_EnterCriticalSection(&sess_mutex, "notifyuser", 77, "sess_mutex", 1);
if (refresh) {
@@ -1422,7 +1422,7 @@ void GaduProto::notifyall() int cc = 0;
for (auto &hContact : AccContacts()) {
if (uins[cc] = getDword(hContact, GG_KEY_UIN, 0)) {
- if ((getWord(hContact, GG_KEY_APPARENT, (WORD)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact))
+ if ((getWord(hContact, GG_KEY_APPARENT, (uint16_t)ID_STATUS_ONLINE) == ID_STATUS_OFFLINE) || !Contact_OnList(hContact))
types[cc] = GG_USER_OFFLINE;
else if (getByte(hContact, GG_KEY_BLOCK, 0))
types[cc] = GG_USER_BLOCKED;
@@ -1612,7 +1612,7 @@ void GaduProto::changecontactstatus(uin_t uin, int status, const wchar_t *idescr return;
// Write contact status
- setWord(hContact, GG_KEY_STATUS, (WORD)status_gg2m(status));
+ setWord(hContact, GG_KEY_STATUS, (uint16_t)status_gg2m(status));
// Check if there's description and if it's not empty
if (idescr && *idescr) {
@@ -1628,7 +1628,7 @@ void GaduProto::changecontactstatus(uin_t uin, int status, const wchar_t *idescr if (remote_ip)
setDword(hContact, GG_KEY_CLIENTIP, (DWORD)swap32(remote_ip));
if (remote_port)
- setWord(hContact, GG_KEY_CLIENTPORT, (WORD)remote_port);
+ setWord(hContact, GG_KEY_CLIENTPORT, (uint16_t)remote_port);
if (version) {
char sversion[48];
setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD)version);
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index dac2149fb1..e7d512683a 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -72,7 +72,7 @@ void GaduProto::dccconnect(uin_t uin) // Read user IP and port
DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
- WORD port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
+ uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
DWORD myuin = getDword(GG_KEY_UIN, 0);
// If not port nor ip nor my uin (?) specified
@@ -916,7 +916,7 @@ HANDLE GaduProto::SendFile(MCONTACT hContact, const wchar_t *, wchar_t** ppszFil // Read user IP and port
DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
- WORD port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
+ uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
uin_t myuin = getDword(GG_KEY_UIN, 0);
uin_t uin = getDword(hContact, GG_KEY_UIN, 0);
DWORD ver = getDword(hContact, GG_KEY_CLIENTVERSION, 0);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index ca86284ffc..42a3bcc935 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -521,7 +521,7 @@ int GaduProto::SendMsg(MCONTACT hContact, int, const char *msg) //
int GaduProto::SetApparentMode(MCONTACT hContact, int mode)
{
- setWord(hContact, GG_KEY_APPARENT, (WORD)mode);
+ setWord(hContact, GG_KEY_APPARENT, (uint16_t)mode);
notifyuser(hContact, 1);
return 0;
diff --git a/protocols/Gadu-Gadu/src/options.h b/protocols/Gadu-Gadu/src/options.h index 6e8d7502ac..8061b8731a 100644 --- a/protocols/Gadu-Gadu/src/options.h +++ b/protocols/Gadu-Gadu/src/options.h @@ -13,8 +13,8 @@ struct GaduOptions CMOption<uint8_t> useMsgDeliveryAcknowledge; CMOption<uint8_t> useSslConnection; - CMOption<WORD> directConnectionPort; - CMOption<WORD> forwardPort; + CMOption<uint16_t> directConnectionPort; + CMOption<uint16_t> forwardPort; CMOption<wchar_t*> forwardHost; CMOption<wchar_t*> serverHosts; |