From 62a186697df33c96dc1a6dac0f4dfc38652fb96f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 16:39:04 +0300 Subject: BYTE -> uint8_t --- protocols/IRCG/src/clist.cpp | 2 +- protocols/IRCG/src/commandmonitor.cpp | 6 ++-- protocols/IRCG/src/input.cpp | 2 +- protocols/IRCG/src/irclib.cpp | 6 ++-- protocols/IRCG/src/ircproto.cpp | 2 +- protocols/IRCG/src/ircproto.h | 60 +++++++++++++++++------------------ protocols/IRCG/src/options.cpp | 12 +++---- protocols/IRCG/src/services.cpp | 4 +-- protocols/IRCG/src/stdafx.h | 2 +- protocols/IRCG/src/userinfo.cpp | 4 +-- 10 files changed, 50 insertions(+), 50 deletions(-) (limited to 'protocols/IRCG/src') diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index cb4a237209..5e73188509 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -134,7 +134,7 @@ MCONTACT CIrcProto::CList_SetOffline(CONTACT *user) return 0; } -bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) +bool CIrcProto::CList_SetAllOffline(uint8_t ChatsToo) { DBVARIANT dbv; diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 70eddc919a..8e5441809e 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -145,14 +145,14 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) if (ppro->isChatRoom(hContact)) continue; - BYTE bDCC = ppro->getByte(hContact, "DCC", 0); + uint8_t bDCC = ppro->getByte(hContact, "DCC", 0); bool bHidden = Contact_IsHidden(hContact); if (bDCC || bHidden) continue; if (ppro->getWString(hContact, "Default", &dbv)) continue; - BYTE bAdvanced = ppro->getByte(hContact, "AdvancedMode", 0); + uint8_t bAdvanced = ppro->getByte(hContact, "AdvancedMode", 0); if (!bAdvanced) { db_free(&dbv); if (!ppro->getWString(hContact, "Nick", &dbv)) { @@ -1248,7 +1248,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg) sChanName++; // Add a new chat window - BYTE btOwnMode = 0; + uint8_t btOwnMode = 0; SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, sChanName, sChanName); if (si) { diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index 2e1de9fb59..cba8115c47 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -788,7 +788,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha { DBVARIANT dbv; wchar_t windowname[256]; - BYTE bDCC = 0; + uint8_t bDCC = 0; if (hContact) bDCC = getByte(hContact, "DCC", 0); diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 73629ae988..d23c9c7991 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -179,7 +179,7 @@ void CIrcProto::SendIrcMessage(const wchar_t* msg, bool bNotify, int cp) int cbLen = (int)mir_strlen(str); str = (char*)mir_realloc(str, cbLen + 3); mir_strcat(str, "\r\n"); - NLSend((const BYTE*)str, cbLen + 2); + NLSend((const uint8_t*)str, cbLen + 2); mir_free(str); if (bNotify) { @@ -1032,7 +1032,7 @@ void CDccSession::DoSendFile() if (wPacketSize > 32 * 1024) wPacketSize = 32 * 1024; - BYTE* chBuf = new BYTE[wPacketSize + 1]; + uint8_t* chBuf = new uint8_t[wPacketSize + 1]; // is there a connection? if (con) { @@ -1173,7 +1173,7 @@ void CDccSession::DoReceiveFile() // initialize the filetransfer dialog ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (void *)di, 0); - BYTE chBuf[1024 * 32 + 1]; + uint8_t chBuf[1024 * 32 + 1]; // do some stupid thing so the filetransfer dialog shows the right thing ProtoBroadcastAck(m_proto->m_szModuleName, di->hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (void *)di, 0); diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index c6a4e86737..8c55fc7fc8 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -595,7 +595,7 @@ HANDLE CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFile int CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) { - BYTE bDcc = getByte(hContact, "DCC", 0); + uint8_t bDcc = getByte(hContact, "DCC", 0); WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE); if (bDcc && wStatus != ID_STATUS_ONLINE) { ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)TranslateT("The dcc chat connection is not active")); diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index 1cd646d368..f0792daf08 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -123,36 +123,36 @@ struct CIrcProto : public PROTO int m_quickComboSelection; int m_onlineNotificationTime; int m_onlineNotificationLimit; - BYTE m_IPFromServer; - BYTE m_showAddresses; - BYTE m_disconnectDCCChats; - BYTE m_disableErrorPopups; - BYTE m_rejoinChannels; - BYTE m_rejoinIfKicked; - BYTE m_hideServerWindow; - BYTE m_ident; - BYTE m_identTimer; - BYTE m_autoOnlineNotification; - BYTE m_sendKeepAlive; - BYTE m_joinOnInvite; - BYTE m_perform; - BYTE m_forceVisible; - BYTE m_ignore; - BYTE m_ignoreChannelDefault; - BYTE m_useServer; - BYTE m_DCCFileEnabled; - BYTE m_DCCChatEnabled; - BYTE m_DCCChatAccept; - BYTE m_DCCChatIgnore; - BYTE m_DCCPassive; - BYTE m_DCCMode; + uint8_t m_IPFromServer; + uint8_t m_showAddresses; + uint8_t m_disconnectDCCChats; + uint8_t m_disableErrorPopups; + uint8_t m_rejoinChannels; + uint8_t m_rejoinIfKicked; + uint8_t m_hideServerWindow; + uint8_t m_ident; + uint8_t m_identTimer; + uint8_t m_autoOnlineNotification; + uint8_t m_sendKeepAlive; + uint8_t m_joinOnInvite; + uint8_t m_perform; + uint8_t m_forceVisible; + uint8_t m_ignore; + uint8_t m_ignoreChannelDefault; + uint8_t m_useServer; + uint8_t m_DCCFileEnabled; + uint8_t m_DCCChatEnabled; + uint8_t m_DCCChatAccept; + uint8_t m_DCCChatIgnore; + uint8_t m_DCCPassive; + uint8_t m_DCCMode; WORD m_DCCPacketSize; - BYTE m_manualHost; - BYTE m_oldStyleModes; - BYTE m_channelAwayNotification; - BYTE m_sendNotice; - BYTE m_utfAutodetect; - BYTE m_bUseSASL; + uint8_t m_manualHost; + uint8_t m_oldStyleModes; + uint8_t m_channelAwayNotification; + uint8_t m_sendNotice; + uint8_t m_utfAutodetect; + uint8_t m_bUseSASL; int m_codepage; COLORREF colors[16]; HICON hIcon[13]; @@ -193,7 +193,7 @@ struct CIrcProto : public PROTO // clist.cpp MCONTACT CList_AddContact(CONTACT *user, bool InList, bool SetOnline); - bool CList_SetAllOffline(BYTE ChatsToo); + bool CList_SetAllOffline(uint8_t ChatsToo); MCONTACT CList_SetOffline(CONTACT *user); MCONTACT CList_FindContact(CONTACT *user); BOOL CList_AddDCCChat(const CMStringW &name, const CMStringW &hostmask, unsigned long adr, int port); diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index ab05340ed9..3c5285309c 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -34,15 +34,15 @@ static void removeSpaces(wchar_t* p) void CIrcProto::ReadSettings(TDbSetting *sets, int count) { - BYTE *base = (BYTE *)this; + uint8_t *base = (uint8_t *)this; DBVARIANT dbv; for (int i = 0; i < count; i++) { TDbSetting *p = &sets[i]; - BYTE *ptr = base + p->offset; + uint8_t *ptr = base + p->offset; switch (p->type) { case DBVT_BYTE: - *(BYTE*)ptr = getByte(p->name, p->defValue); + *(uint8_t*)ptr = getByte(p->name, p->defValue); break; case DBVT_WORD: *(WORD*)ptr = getWord(p->name, p->defValue); @@ -93,13 +93,13 @@ void CIrcProto::ReadSettings(TDbSetting *sets, int count) void CIrcProto::WriteSettings(TDbSetting *sets, int count) { - BYTE *base = (BYTE*)this; + uint8_t *base = (uint8_t*)this; for (int i = 0; i < count; i++) { TDbSetting *p = &sets[i]; - BYTE *ptr = base + p->offset; + uint8_t *ptr = base + p->offset; switch (p->type) { - case DBVT_BYTE: setByte(p->name, *(BYTE*)ptr); break; + case DBVT_BYTE: setByte(p->name, *(uint8_t*)ptr); break; case DBVT_WORD: setWord(p->name, *(WORD*)ptr); break; case DBVT_DWORD: setDword(p->name, *(DWORD*)ptr); break; diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 17562e9c72..af047b0530 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -185,7 +185,7 @@ void CIrcProto::OnContactDeleted(MCONTACT hContact) PostIrcMessage(L"/PART %s %s", dbv.pwszVal, m_userInfo); } else { - BYTE bDCC = getByte(hContact, "DCC", 0); + uint8_t bDCC = getByte(hContact, "DCC", 0); if (bDCC) { CDccSession *dcc = FindDCCSession(hContact); if (dcc) @@ -851,7 +851,7 @@ int __cdecl CIrcProto::OnMenuPreBuild(WPARAM hContact, LPARAM) Menu_ShowItem(hUMenuChanSettings, false); // for DCC contact - BYTE bDcc = getByte(hContact, "DCC", 0); + uint8_t bDcc = getByte(hContact, "DCC", 0); if (bDcc) Menu_ShowItem(hUMenuDisconnect, true); else { diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h index 9822e052fb..26b290438b 100644 --- a/protocols/IRCG/src/stdafx.h +++ b/protocols/IRCG/src/stdafx.h @@ -125,7 +125,7 @@ struct CHANNELINFO // Contains info about the channels wchar_t* pszMode; wchar_t* pszPassword; wchar_t* pszLimit; - BYTE OwnMode; /* own mode on the channel. Bitmask: + uint8_t OwnMode; /* own mode on the channel. Bitmask: 0: voice 1: halfop 2: op diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index 1b59dcda48..fa9620e4ee 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -54,7 +54,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM p->ppro = (CIrcProto*)((PSHNOTIFY*)lParam)->lParam; DBVARIANT dbv; - BYTE bAdvanced = p->ppro->getByte(p->hContact, "AdvancedMode", 0); + uint8_t bAdvanced = p->ppro->getByte(p->hContact, "AdvancedMode", 0); TranslateDialogDefault(m_hwnd); @@ -102,7 +102,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM wchar_t temp[500]; GetDlgItemText(m_hwnd, IDC_WILDCARD, temp, _countof(temp)); - BYTE bAdvanced = IsDlgButtonChecked(m_hwnd, IDC_RADIO1) ? 0 : 1; + uint8_t bAdvanced = IsDlgButtonChecked(m_hwnd, IDC_RADIO1) ? 0 : 1; if (bAdvanced) { if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_WILDCARD)) == 0 || GetWindowTextLength(GetDlgItem(m_hwnd, IDC_USER)) == 0 || -- cgit v1.2.3