summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
commitcddcd7483a7c472598af098e759e5d309024f606 (patch)
treeb0a227d6e087c41958cc84d27bc323353248aae5 /protocols/Gadu-Gadu/src
parent1039b2829a264280493ba0fa979214fe024dc70c (diff)
DWORD -> uint32_t
Diffstat (limited to 'protocols/Gadu-Gadu/src')
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp18
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp8
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp14
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h8
7 files changed, 27 insertions, 27 deletions
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index 14c2b58955..d0f72df6cd 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -298,8 +298,8 @@ void __cdecl GaduProto::avatarrequestthread(void*)
void GaduProto::initavatarrequestthread()
{
DWORD exitCode = 0;
-
GetExitCodeThread(pth_avatar.hThread, &exitCode);
+
if (exitCode != STILL_ACTIVE) {
avatar_requests.destroy();
avatar_transfers.destroy();
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index b3f8567b14..7777ae2329 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -26,7 +26,7 @@
#pragma warning(disable : 4189)
////////////////////////////////////////////////////////////
-// Swap bits in DWORD
+// Swap bits in uint32_t
uint32_t swap32(uint32_t x)
{
return (uint32_t)
@@ -436,11 +436,11 @@ retry:
&& errno == EACCES
&& (m_gaduOptions.autoRecconect || (hostnum < hostcount - 1)))
{
- DWORD dwInterval = getDword(GG_KEY_RECONNINTERVAL, GG_KEYDEF_RECONNINTERVAL);
+ uint32_t dwInterval = getDword(GG_KEY_RECONNINTERVAL, GG_KEYDEF_RECONNINTERVAL);
BOOL bRetry = TRUE;
hConnStopEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- DWORD dwResult = WaitForSingleObjectEx(hConnStopEvent, dwInterval, TRUE);
+ uint32_t dwResult = WaitForSingleObjectEx(hConnStopEvent, dwInterval, TRUE);
if ((dwResult == WAIT_OBJECT_0 && m_iDesiredStatus == ID_STATUS_OFFLINE)
|| (dwResult == WAIT_IO_COMPLETION && Miranda_IsTerminated()))
bRetry = FALSE;
@@ -547,7 +547,7 @@ retry:
// Received ackowledge
case GG_EVENT_ACK:
if (e->event.ack.seq && e->event.ack.recipient) {
- ProtoBroadcastAck(getcontact((DWORD)e->event.ack.recipient, 0, 0, nullptr),
+ ProtoBroadcastAck(getcontact((uint32_t)e->event.ack.recipient, 0, 0, nullptr),
ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)e->event.ack.seq, 0);
}
break;
@@ -904,10 +904,10 @@ retry:
{
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = (DWORD)e->event.multilogon_msg.time;
+ dbei.timestamp = (uint32_t)e->event.multilogon_msg.time;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)mir_strlen(e->event.multilogon_msg.message) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen(e->event.multilogon_msg.message) + 1;
dbei.pBlob = (uint8_t*)e->event.multilogon_msg.message;
db_event_add(getcontact(e->event.multilogon_msg.sender, 1, 0, nullptr), &dbei);
}
@@ -1474,7 +1474,7 @@ MCONTACT GaduProto::getcontact(uin_t uin, int create, int inlist, wchar_t *szNic
if (!inlist)
Contact_RemoveFromList(hContact);
- setDword(hContact, GG_KEY_UIN, (DWORD)uin);
+ setDword(hContact, GG_KEY_UIN, (uint32_t)uin);
setWord(hContact, GG_KEY_STATUS, ID_STATUS_OFFLINE);
// If nick specified use it
@@ -1626,12 +1626,12 @@ void GaduProto::changecontactstatus(uin_t uin, int status, const wchar_t *idescr
// Store contact ip and port
if (remote_ip)
- setDword(hContact, GG_KEY_CLIENTIP, (DWORD)swap32(remote_ip));
+ setDword(hContact, GG_KEY_CLIENTIP, (uint32_t)swap32(remote_ip));
if (remote_port)
setWord(hContact, GG_KEY_CLIENTPORT, (uint16_t)remote_port);
if (version) {
char sversion[48];
- setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD)version);
+ setDword(hContact, GG_KEY_CLIENTVERSION, (uint32_t)version);
mir_snprintf(sversion, "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
setString(hContact, "MirVer", sversion);
}
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index 6b5cd2c6c4..77e90dea4a 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -217,7 +217,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_INITDIALOG:
{
DBVARIANT dbv;
- DWORD num;
+ uint32_t num;
gg = (GaduProto *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
@@ -374,7 +374,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (ret == IDOK) {
DBVARIANT dbv;
- DWORD num;
+ uint32_t num;
// Show reload required window
ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
@@ -774,7 +774,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
TranslateDialogDefault(hwndDlg);
- DWORD num = gg->getDword(GG_KEY_UIN, 0);
+ uint32_t num = gg->getDword(GG_KEY_UIN, 0);
if (num)
SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
@@ -806,7 +806,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (ret == IDOK) {
DBVARIANT dbv;
- DWORD num;
+ uint32_t num;
// Show reload required window
ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index e7d512683a..9fd02f204a 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -25,13 +25,13 @@
void GaduProto::dccstart()
{
- DWORD exitCode = 0;
-
if (m_dcc)
return;
// Startup dcc thread
+ DWORD exitCode = 0;
GetExitCodeThread(pth_dcc.hThread, &exitCode);
+
// Check if dcc thread isn't running already
if (exitCode == STILL_ACTIVE)
{
@@ -71,9 +71,9 @@ void GaduProto::dccconnect(uin_t uin)
return;
// Read user IP and port
- DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
+ uint32_t ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
- DWORD myuin = getDword(GG_KEY_UIN, 0);
+ uint32_t myuin = getDword(GG_KEY_UIN, 0);
// If not port nor ip nor my uin (?) specified
if (!ip || !port || !uin) return;
@@ -151,7 +151,7 @@ void __cdecl GaduProto::dccmainthread(void*)
fd_set rd, wd;
int ret;
SOCKET maxfd;
- DWORD tick;
+ uint32_t tick;
char szFilename[MAX_PATH];
while (pth_dcc.dwThreadId && m_dcc)
@@ -915,11 +915,11 @@ HANDLE GaduProto::SendFile(MCONTACT hContact, const wchar_t *, wchar_t** ppszFil
filename = mir_u2a(ppszFiles[0]);
// Read user IP and port
- DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
+ uint32_t ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 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);
+ uint32_t ver = getDword(hContact, GG_KEY_CLIENTVERSION, 0);
// Use DCC7 if a contact is using at least version 7.6 or unknown version
if ((ver & 0x00ffffff) >= 0x29 || !ver) {
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 1ac8dae385..eb72b39041 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -157,7 +157,7 @@ const wchar_t *http_error_string(int h)
//////////////////////////////////////////////////////////
// Cleanups from last plugin
//
-void GaduProto::cleanuplastplugin(DWORD version)
+void GaduProto::cleanuplastplugin(uint32_t version)
{
// Store current plugin version
setDword(GG_PLUGINVERSION, pluginInfoEx.version);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 42a3bcc935..09e03f38a6 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -74,7 +74,7 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) :
mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARSW(L"%miranda_userdata%"), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathW(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
- DWORD pluginVersion = getDword(GG_PLUGINVERSION, 0);
+ uint32_t pluginVersion = getDword(GG_PLUGINVERSION, 0);
if (pluginVersion < pluginInfoEx.version)
cleanuplastplugin(pluginVersion);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index 4d6792cad6..8bb112ebc6 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -97,7 +97,7 @@ struct GaduProto : public PROTO<GaduProto>
#endif
void gg_EnterCriticalSection(CRITICAL_SECTION* mutex, char* callingFunction, int sectionNumber, char* mutexName, int logging);
void gg_LeaveCriticalSection(CRITICAL_SECTION* mutex, char* callingFunction, int sectionNumber, int returnNumber, char* mutexName, int logging);
- void gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging);
+ void gg_sleep(uint32_t miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging);
/* Global GG functions */
void notifyuser(MCONTACT hContact, int refresh);
@@ -108,7 +108,7 @@ struct GaduProto : public PROTO<GaduProto>
int refreshstatus(int status);
void broadcastnewstatus(int newStatus);
- void cleanuplastplugin(DWORD version);
+ void cleanuplastplugin(uint32_t version);
void notifyall();
void changecontactstatus(uin_t uin, int status, const wchar_t *idescr, int time, uint32_t remote_ip, uint16_t remote_port, uint32_t version);
wchar_t *getstatusmsg(int status);
@@ -296,9 +296,9 @@ inline void GaduProto::gg_LeaveCriticalSection(CRITICAL_SECTION* mutex, char *,
}
#ifdef DEBUGMODE
-inline void GaduProto::gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging) {
+inline void GaduProto::gg_sleep(uint32_t miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging) {
#else
-inline void GaduProto::gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int, int) {
+inline void GaduProto::gg_sleep(uint32_t miliseconds, BOOL alterable, char* callingFunction, int, int) {
#endif
SleepEx(miliseconds, alterable);
#ifdef DEBUGMODE