diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
commit | cddcd7483a7c472598af098e759e5d309024f606 (patch) | |
tree | b0a227d6e087c41958cc84d27bc323353248aae5 /protocols/IRCG/src | |
parent | 1039b2829a264280493ba0fa979214fe024dc70c (diff) |
DWORD -> uint32_t
Diffstat (limited to 'protocols/IRCG/src')
-rw-r--r-- | protocols/IRCG/src/clist.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/commandmonitor.cpp | 10 | ||||
-rw-r--r-- | protocols/IRCG/src/irclib.cpp | 36 | ||||
-rw-r--r-- | protocols/IRCG/src/irclib.h | 12 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.h | 4 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 4 | ||||
-rw-r--r-- | protocols/IRCG/src/tools.cpp | 2 |
7 files changed, 35 insertions, 35 deletions
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 5e73188509..5164ea6ffa 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -43,7 +43,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas DCCINFO *pdci = new DCCINFO;
pdci->sHostmask = hostmask;
pdci->hContact = hContact;
- pdci->dwAdr = (DWORD)adr;
+ pdci->dwAdr = (uint32_t)adr;
pdci->iPort = port;
pdci->iType = DCC_CHAT;
pdci->bSender = false;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 8e5441809e..c9014b413f 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -226,10 +226,10 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, const wchar_t *msg) DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = (DWORD)time(0);
+ dbei.timestamp = (uint32_t)time(0);
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.pBlob = (uint8_t*)mir_utf8encodeW(S);
- dbei.cbBlob = (DWORD)mir_strlen((char*)dbei.pBlob) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen((char*)dbei.pBlob) + 1;
db_event_add(hContact, &dbei);
mir_free(dbei.pBlob);
return 1;
@@ -689,7 +689,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage *pmsg) MCONTACT hContact = CList_AddContact(&user, false, true);
PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(0);
+ pre.timestamp = (uint32_t)time(0);
pre.szMessage = mir_utf8encodeW(mess);
setWString(hContact, "User", pmsg->prefix.sUser);
setWString(hContact, "Host", pmsg->prefix.sHost);
@@ -840,7 +840,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg) // components of a dcc message
CMStringW sFile = L"";
- DWORD dwAdr = 0;
+ uint32_t dwAdr = 0;
int iPort = 0;
unsigned __int64 dwSize = 0;
CMStringW sToken = L"";
@@ -1142,7 +1142,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg) PROTORECVFILE pre = { 0 };
pre.dwFlags = PRFF_UNICODE;
- pre.timestamp = (DWORD)time(0);
+ pre.timestamp = (uint32_t)time(0);
pre.fileCount = 1;
pre.files.w = &tszTemp;
pre.lParam = (LPARAM)di;
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 67625b3ccd..47ecfb62ac 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -251,7 +251,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) void CIrcProto::Disconnect(void) { - static const DWORD dwServerTimeout = 5 * 1000; + static const uint32_t dwServerTimeout = 5 * 1000; if (con == nullptr) return; @@ -805,7 +805,7 @@ void __cdecl CDccSession::ConnectProc(void *pparam) } // small function to setup the address and port of the remote computer fror passive filetransfers -void CDccSession::SetupPassive(DWORD adress, DWORD port) +void CDccSession::SetupPassive(uint32_t adress, uint32_t port) { di->dwAdr = adress; di->iPort = (int)port; @@ -975,7 +975,7 @@ int CDccSession::SetupConnection() } // called by netlib for incoming connections on a listening socket (chat/filetransfer) -int CDccSession::IncomingConnection(HNETLIBCONN hConnection, DWORD dwIP) +int CDccSession::IncomingConnection(HNETLIBCONN hConnection, uint32_t dwIP) { con = hConnection; if (con == nullptr) { @@ -1057,11 +1057,11 @@ void CDccSession::DoSendFile() tLastActivity = time(0); // create a packet receiver to handle receiving ack's from the remote computer. - HANDLE hPackrcver = Netlib_CreatePacketReceiver(con, sizeof(DWORD)); + HANDLE hPackrcver = Netlib_CreatePacketReceiver(con, sizeof(uint32_t)); NETLIBPACKETRECVER npr = {}; npr.dwTimeout = 60 * 1000; - npr.bufferSize = sizeof(DWORD); + npr.bufferSize = sizeof(uint32_t); // until the connection is dropped it will spin around in this while() loop while (con) { @@ -1082,17 +1082,17 @@ void CDccSession::DoSendFile() // block connection and receive ack's from remote computer (if applicable) if (m_proto->m_DCCMode == 0) { - DWORD dwRead = 0; - DWORD dwPacket = NULL; + uint32_t dwRead = 0; + uint32_t dwPacket = NULL; do { dwRead = Netlib_GetMorePackets(hPackrcver, &npr); - npr.bytesUsed = sizeof(DWORD); + npr.bytesUsed = sizeof(uint32_t); if (dwRead <= 0) break; // connection closed, or a timeout occurred. - dwPacket = *(DWORD*)npr.buffer; + dwPacket = *(uint32_t*)npr.buffer; dwLastAck = ntohl(dwPacket); } @@ -1103,16 +1103,16 @@ void CDccSession::DoSendFile() } if (m_proto->m_DCCMode == 1) { - DWORD dwRead = 0; - DWORD dwPacket = 0; + uint32_t dwRead = 0; + uint32_t dwPacket = 0; do { dwRead = Netlib_GetMorePackets(hPackrcver, &npr); - npr.bytesUsed = sizeof(DWORD); + npr.bytesUsed = sizeof(uint32_t); if (dwRead <= 0) break; // connection closed, or a timeout occurred. - dwPacket = *(DWORD*)npr.buffer; + dwPacket = *(uint32_t*)npr.buffer; dwLastAck = ntohl(dwPacket); } while (con && (di->dwSize != dwTotal @@ -1213,9 +1213,9 @@ void CDccSession::DoReceiveFile() // this snippet sends out an ack for every 4 kb received in send ahead // or every packet for normal mode if (!di->bTurbo) { - DWORD no = dwTotal; + uint32_t no = dwTotal; no = htonl(no); - NLSend((unsigned char *)&no, sizeof(DWORD)); + NLSend((unsigned char *)&no, sizeof(uint32_t)); dwLastAck = dwTotal; } else dwLastAck = dwTotal; @@ -1293,7 +1293,7 @@ void CDccSession::DoChatReceive() if (*pStart) { // send it off to some messaging module PROTORECVEVENT pre = { 0 }; - pre.timestamp = (DWORD)time(0); + pre.timestamp = (uint32_t)time(0); pre.szMessage = pStart; ProtoChainRecvMsg(di->hContact, &pre); } @@ -1340,7 +1340,7 @@ VOID CALLBACK DCCTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) } // helper function for incoming dcc connections. -void DoIncomingDcc(HNETLIBCONN hConnection, DWORD dwRemoteIP, void * p1) +void DoIncomingDcc(HNETLIBCONN hConnection, uint32_t dwRemoteIP, void * p1) { CDccSession *dcc = (CDccSession*)p1; dcc->IncomingConnection(hConnection, dwRemoteIP); @@ -1348,7 +1348,7 @@ void DoIncomingDcc(HNETLIBCONN hConnection, DWORD dwRemoteIP, void * p1) // ident server -void DoIdent(HNETLIBCONN hConnection, DWORD, void* extra) +void DoIdent(HNETLIBCONN hConnection, uint32_t, void* extra) { CIrcProto *ppro = (CIrcProto*)extra; diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h index 7b4524f16e..fee6eca5a7 100644 --- a/protocols/IRCG/src/irclib.h +++ b/protocols/IRCG/src/irclib.h @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma warning (disable: 4786)
-void DoIdent(HNETLIBCONN hConnection, DWORD dwRemoteIP, void* extra);
-void DoIncomingDcc(HNETLIBCONN hConnection, DWORD dwRemoteIP, void* extra);
+void DoIdent(HNETLIBCONN hConnection, uint32_t dwRemoteIP, void* extra);
+void DoIncomingDcc(HNETLIBCONN hConnection, uint32_t dwRemoteIP, void* extra);
unsigned long ConvertIPToInteger(char * IP);
char* ConvertIntegerToIP(unsigned long int_ip_addr);
@@ -41,9 +41,9 @@ const int UNDERLINE = 0x1F; struct DCCINFO : public MZeroedObject
{
- DWORD dwAdr;
+ uint32_t dwAdr;
unsigned __int64 dwSize;
- DWORD iType;
+ uint32_t iType;
CMStringW sToken;
int iPort;
BOOL bTurbo;
@@ -167,9 +167,9 @@ public: DCCINFO* di; // details regarding the filetrasnfer
int Connect();
- void SetupPassive( DWORD adr, DWORD port );
+ void SetupPassive( uint32_t adr, uint32_t port );
int SendStuff(const wchar_t* fmt);
- int IncomingConnection(HNETLIBCONN hConnection, DWORD dwIP);
+ int IncomingConnection(HNETLIBCONN hConnection, uint32_t dwIP);
int Disconnect();
};
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index efc465f31f..5804e3631a 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -169,8 +169,8 @@ struct CIrcProto : public PROTO<CIrcProto> SESSION_INFO *m_pServer; int m_portCount; - DWORD m_bConnectRequested; - DWORD m_bConnectThreadRunning; + uint32_t m_bConnectRequested; + uint32_t m_bConnectThreadRunning; HGENMENU hMenuQuick, hMenuServer, hMenuJoin, hMenuNick, hMenuList; HNETLIBUSER hNetlibDCC; diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 9961f0be81..8d0d8961db 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -48,7 +48,7 @@ void CIrcProto::ReadSettings(TDbSetting *sets, int count) *(uint16_t*)ptr = getWord(p->name, p->defValue);
break;
case DBVT_DWORD:
- *(DWORD*)ptr = getDword(p->name, p->defValue);
+ *(uint32_t*)ptr = getDword(p->name, p->defValue);
break;
case DBVT_ASCIIZ:
if (!getString(p->name, &dbv)) {
@@ -101,7 +101,7 @@ void CIrcProto::WriteSettings(TDbSetting *sets, int count) switch (p->type) {
case DBVT_BYTE: setByte(p->name, *(uint8_t*)ptr); break;
case DBVT_WORD: setWord(p->name, *(uint16_t*)ptr); break;
- case DBVT_DWORD: setDword(p->name, *(DWORD*)ptr); break;
+ case DBVT_DWORD: setDword(p->name, *(uint32_t*)ptr); break;
case DBVT_ASCIIZ:
if (p->size == -1)
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 133a8f9346..b1d3817489 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -123,7 +123,7 @@ void __stdcall RemoveLinebreaks(CMStringW &Message) char* __stdcall IrcLoadFile(wchar_t* szPath)
{
char * szContainer = nullptr;
- DWORD dwSiz = 0;
+ uint32_t dwSiz = 0;
FILE *hFile = _wfopen(szPath, L"rb");
if (hFile != nullptr) {
fseek(hFile, 0, SEEK_END); // seek to end
|