diff options
Diffstat (limited to 'protocols')
88 files changed, 418 insertions, 418 deletions
diff --git a/protocols/CloudFile/src/Services/dropbox_service.cpp b/protocols/CloudFile/src/Services/dropbox_service.cpp index f4b9a22b3d..46a096df0b 100644 --- a/protocols/CloudFile/src/Services/dropbox_service.cpp +++ b/protocols/CloudFile/src/Services/dropbox_service.cpp @@ -133,7 +133,7 @@ void CDropboxService::HandleJsonError(JSONNode &node) auto CDropboxService::UploadFile(const char *data, size_t size, const std::string &path) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); + uint8_t strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); DropboxAPI::UploadFileRequest request(token, path.c_str(), data, size, (OnConflict)strategy); NLHR_PTR response(request.Send(m_hConnection)); @@ -162,7 +162,7 @@ void CDropboxService::UploadFileChunk(const std::string &sessionId, const char * auto CDropboxService::CommitUploadSession(const std::string &sessionId, const char *data, size_t size, size_t offset, const std::string &path) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); + uint8_t strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); DropboxAPI::CommitUploadSessionRequest request(token, sessionId.c_str(), offset, path.c_str(), data, size, (OnConflict)strategy); NLHR_PTR response(request.Send(m_hConnection)); diff --git a/protocols/CloudFile/src/Services/microsoft_service.cpp b/protocols/CloudFile/src/Services/microsoft_service.cpp index 27ec0df7fb..1c74d469e8 100644 --- a/protocols/CloudFile/src/Services/microsoft_service.cpp +++ b/protocols/CloudFile/src/Services/microsoft_service.cpp @@ -154,7 +154,7 @@ void COneDriveService::HandleJsonError(JSONNode &node) auto COneDriveService::UploadFile(const std::string &parentId, const std::string &fileName, const char *data, size_t size) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); + uint8_t strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); OneDriveAPI::UploadFileRequest *request = !parentId.empty() ? new OneDriveAPI::UploadFileRequest(token, parentId.c_str(), fileName.c_str(), data, size, (OnConflict)strategy) : new OneDriveAPI::UploadFileRequest(token, fileName.c_str(), data, size, (OnConflict)strategy); @@ -168,7 +168,7 @@ auto COneDriveService::UploadFile(const std::string &parentId, const std::string auto COneDriveService::CreateUploadSession(const std::string &parentId, const std::string &fileName) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); + uint8_t strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); OneDriveAPI::CreateUploadSessionRequest *request = !parentId.empty() ? new OneDriveAPI::CreateUploadSessionRequest(token, parentId.c_str(), fileName.c_str(), (OnConflict)strategy) : new OneDriveAPI::CreateUploadSessionRequest(token, fileName.c_str(), (OnConflict)strategy); diff --git a/protocols/CloudFile/src/Services/yandex_service.cpp b/protocols/CloudFile/src/Services/yandex_service.cpp index 816e6ea5e4..739d8a2722 100644 --- a/protocols/CloudFile/src/Services/yandex_service.cpp +++ b/protocols/CloudFile/src/Services/yandex_service.cpp @@ -167,7 +167,7 @@ void CYandexService::HandleJsonError(JSONNode &node) auto CYandexService::CreateUploadSession(const std::string &path) { ptrA token(getStringA("TokenSecret")); - BYTE strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); + uint8_t strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); YandexAPI::GetUploadUrlRequest request(token, path.c_str(), (OnConflict)strategy); NLHR_PTR response(request.Send(m_hConnection)); diff --git a/protocols/CloudFile/src/options.cpp b/protocols/CloudFile/src/options.cpp index de961a314a..f50168005e 100644 --- a/protocols/CloudFile/src/options.cpp +++ b/protocols/CloudFile/src/options.cpp @@ -31,7 +31,7 @@ bool COptionsMainDlg::OnInitDialog() m_defaultService.SetCurSel(iItem); } - BYTE strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); + uint8_t strategy = g_plugin.getByte("ConflictStrategy", OnConflict::REPLACE); switch (strategy) { case OnConflict::RENAME: diff --git a/protocols/ConnectionNotify/src/options.cpp b/protocols/ConnectionNotify/src/options.cpp index ea9a98fac4..b643349249 100644 --- a/protocols/ConnectionNotify/src/options.cpp +++ b/protocols/ConnectionNotify/src/options.cpp @@ -206,7 +206,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_INTERVAL: g_plugin.iInterval = GetDlgItemInt(hwndDlg, IDC_INTERVAL, nullptr, FALSE); break; case IDC_INTERVAL1: g_plugin.iInterval1 = GetDlgItemInt(hwndDlg, IDC_INTERVAL1, nullptr, TRUE); break; case IDC_RESOLVEIP: g_plugin.bResolveIp = 0 != IsDlgButtonChecked(hwndDlg, IDC_RESOLVEIP); break; - case ID_CHK_DEFAULTACTION: g_plugin.iDefaultAction = (BYTE)IsDlgButtonChecked(hwndDlg, ID_CHK_DEFAULTACTION); break; + case ID_CHK_DEFAULTACTION: g_plugin.iDefaultAction = (uint8_t)IsDlgButtonChecked(hwndDlg, ID_CHK_DEFAULTACTION); break; case ID_ADD: { CONNECTION *cur = (CONNECTION *)mir_alloc(sizeof(CONNECTION)); diff --git a/protocols/CurrencyRates/src/ImportExport.cpp b/protocols/CurrencyRates/src/ImportExport.cpp index f21843f1f3..f2091a3d0b 100644 --- a/protocols/CurrencyRates/src/ImportExport.cpp +++ b/protocols/CurrencyRates/src/ImportExport.cpp @@ -316,7 +316,7 @@ bool handle_module(MCONTACT hContact, const TiXmlElement *pXmlModule) } else if (!mir_strcmpi(g_szXmlTypeBlob, sType)) { size_t bufLen; - mir_ptr<BYTE> buf((uint8_t*)mir_base64_decode(sValue, &bufLen)); + mir_ptr<uint8_t> buf((uint8_t*)mir_base64_decode(sValue, &bufLen)); if (buf) { dbs.value.pbVal = buf; dbs.value.cpbVal = (WORD)bufLen; diff --git a/protocols/CurrencyRates/src/SettingsDlg.cpp b/protocols/CurrencyRates/src/SettingsDlg.cpp index 36e1ad98d9..70e9b2fe9f 100644 --- a/protocols/CurrencyRates/src/SettingsDlg.cpp +++ b/protocols/CurrencyRates/src/SettingsDlg.cpp @@ -236,7 +236,7 @@ INT_PTR CALLBACK EditSettingsPerContactDlgProc(HWND hWnd, UINT msg, WPARAM wp, L ::SetDlgItemText(hWnd, IDC_EDIT_NAME, GetContactName(hContact)); - BYTE bUseContactSpecific = g_plugin.getByte(hContact, DB_STR_CONTACT_SPEC_SETTINGS, 0); + uint8_t bUseContactSpecific = g_plugin.getByte(hContact, DB_STR_CONTACT_SPEC_SETTINGS, 0); ::CheckDlgButton(hWnd, IDC_CHECK_CONTACT_SPECIFIC, bUseContactSpecific ? BST_CHECKED : BST_UNCHECKED); auto pProvider = GetContactProviderPtr(hContact); @@ -654,10 +654,10 @@ void CAdvProviderSettings::SaveToDb() const g_plugin.setByte(DB_KEY_PopupCondition, m_bShowPopupIfValueChanged); if (nullptr != m_pPopupSettings) { - g_plugin.setByte(DB_KEY_PopupColourMode, static_cast<BYTE>(m_pPopupSettings->GetColourMode())); + g_plugin.setByte(DB_KEY_PopupColourMode, static_cast<uint8_t>(m_pPopupSettings->GetColourMode())); g_plugin.setDword(DB_KEY_PopupBkColour, m_pPopupSettings->GetColourBk()); g_plugin.setDword(DB_KEY_PopupTextColour, m_pPopupSettings->GetColourText()); - g_plugin.setByte(DB_KEY_PopupDelayMode, static_cast<BYTE>(m_pPopupSettings->GetDelayMode())); + g_plugin.setByte(DB_KEY_PopupDelayMode, static_cast<uint8_t>(m_pPopupSettings->GetDelayMode())); g_plugin.setWord(DB_KEY_PopupDelayTimeout, m_pPopupSettings->GetDelayTimeout()); g_plugin.setByte(DB_KEY_PopupHistoryFlag, m_pPopupSettings->GetHistoryFlag()); } @@ -683,14 +683,14 @@ CPopupSettings::CPopupSettings() : m_bUseHistory(false) { - BYTE m = g_plugin.getByte(DB_KEY_PopupColourMode, static_cast<BYTE>(m_modeColour)); + uint8_t m = g_plugin.getByte(DB_KEY_PopupColourMode, static_cast<uint8_t>(m_modeColour)); if (m >= colourDefault && m <= colourUserDefined) m_modeColour = static_cast<EColourMode>(m); m_rgbBkg = g_plugin.getDword(DB_KEY_PopupBkColour, m_rgbBkg); m_rgbText = g_plugin.getDword(DB_KEY_PopupTextColour, m_rgbText); - m = g_plugin.getByte(DB_KEY_PopupDelayMode, static_cast<BYTE>(m_modeDelay)); + m = g_plugin.getByte(DB_KEY_PopupDelayMode, static_cast<uint8_t>(m_modeDelay)); if (m >= delayFromPopup && m <= delayPermanent) m_modeDelay = static_cast<EDelayMode>(m); @@ -712,7 +712,7 @@ COLORREF CPopupSettings::GetDefColourText() void CPopupSettings::InitForContact(MCONTACT hContact) { - BYTE m = g_plugin.getByte(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_MODE, static_cast<BYTE>(m_modeColour)); + uint8_t m = g_plugin.getByte(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_MODE, static_cast<uint8_t>(m_modeColour)); if (m >= CPopupSettings::colourDefault && m <= CPopupSettings::colourUserDefined) { m_modeColour = static_cast<CPopupSettings::EColourMode>(m); } @@ -720,7 +720,7 @@ void CPopupSettings::InitForContact(MCONTACT hContact) m_rgbBkg = g_plugin.getDword(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_BK, m_rgbBkg); m_rgbText = g_plugin.getDword(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_TEXT, m_rgbText); - m = g_plugin.getByte(hContact, DB_STR_CURRENCYRATE_POPUP_DELAY_MODE, static_cast<BYTE>(m_modeDelay)); + m = g_plugin.getByte(hContact, DB_STR_CURRENCYRATE_POPUP_DELAY_MODE, static_cast<uint8_t>(m_modeDelay)); if (m >= CPopupSettings::delayFromPopup && m <= CPopupSettings::delayPermanent) { m_modeDelay = static_cast<CPopupSettings::EDelayMode>(m); } @@ -730,10 +730,10 @@ void CPopupSettings::InitForContact(MCONTACT hContact) void CPopupSettings::SaveForContact(MCONTACT hContact) const { - g_plugin.setByte(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_MODE, static_cast<BYTE>(m_modeColour)); + g_plugin.setByte(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_MODE, static_cast<uint8_t>(m_modeColour)); g_plugin.setDword(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_BK, m_rgbBkg); g_plugin.setDword(hContact, DB_STR_CURRENCYRATE_POPUP_COLOUR_TEXT, m_rgbText); - g_plugin.setByte(hContact, DB_STR_CURRENCYRATE_POPUP_DELAY_MODE, static_cast<BYTE>(m_modeDelay)); + g_plugin.setByte(hContact, DB_STR_CURRENCYRATE_POPUP_DELAY_MODE, static_cast<uint8_t>(m_modeDelay)); g_plugin.setWord(hContact, DB_STR_CURRENCYRATE_POPUP_DELAY_TIMEOUT, m_wDelay); g_plugin.setByte(hContact, DB_STR_CURRENCYRATE_POPUP_HISTORY_FLAG, m_bUseHistory); } diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 8a4301fcad..13c920be77 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -260,10 +260,10 @@ class CDiscordProto : public PROTO<CDiscordProto> CMOption<wchar_t*> m_wszEmail; // my own email CMOption<wchar_t*> m_wszDefaultGroup; // clist group to store contacts - CMOption<BYTE> m_bUseGroupchats; // Shall we connect Guilds at all? - CMOption<BYTE> m_bHideGroupchats; // Do not open chat windows on creation - CMOption<BYTE> m_bUseGuildGroups; // use special subgroups for guilds - CMOption<BYTE> m_bSyncDeleteMsgs; // delete messages from Miranda if they are deleted at the server + CMOption<uint8_t> m_bUseGroupchats; // Shall we connect Guilds at all? + CMOption<uint8_t> m_bHideGroupchats; // Do not open chat windows on creation + CMOption<uint8_t> m_bUseGuildGroups; // use special subgroups for guilds + CMOption<uint8_t> m_bSyncDeleteMsgs; // delete messages from Miranda if they are deleted at the server ////////////////////////////////////////////////////////////////////////////////////// // common data diff --git a/protocols/Discord/src/voice.cpp b/protocols/Discord/src/voice.cpp index 7422d15aa8..723376091e 100644 --- a/protocols/Discord/src/voice.cpp +++ b/protocols/Discord/src/voice.cpp @@ -42,7 +42,7 @@ void CDiscordProto::OnCommandCallCreated(const JSONNode &pRoot) dbei.timestamp = pCall->startTime; dbei.eventType = EVENT_INCOMING_CALL; dbei.cbBlob = DWORD(mir_strlen(szMessage) + 1); - dbei.pBlob = (BYTE *)szMessage; + dbei.pBlob = (uint8_t *)szMessage; dbei.flags = DBEF_UTF; db_event_add(pUser->hContact, &dbei); } @@ -76,7 +76,7 @@ void CDiscordProto::OnCommandCallDeleted(const JSONNode &pRoot) dbei.timestamp = currTime; dbei.eventType = EVENT_CALL_FINISHED; dbei.cbBlob = DWORD(szMessage.GetLength() + 1); - dbei.pBlob = (BYTE *)szMessage.c_str(); + dbei.pBlob = (uint8_t *)szMessage.c_str(); dbei.flags = DBEF_UTF; db_event_add(pUser->hContact, &dbei); } diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index e88cd65b65..4833b0356a 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -573,7 +573,7 @@ u_char* CMLan::CreatePacket(TPacket &pak, int *pBufLen) } if (pak.strName) { - *pb++ = 1 + (BYTE)nameLen + 1; + *pb++ = 1 + (uint8_t)nameLen + 1; *pb++ = MCODE_SND_NAME; memcpy(pb, pak.strName, nameLen); pb += nameLen; @@ -587,7 +587,7 @@ u_char* CMLan::CreatePacket(TPacket &pak, int *pBufLen) if (pak.strMessage) { *pb++ = 255; - *((u_short*)pb) = 1 + 4 + (BYTE)mesLen + 1; + *((u_short*)pb) = 1 + 4 + (uint8_t)mesLen + 1; pb += sizeof(u_short); *pb++ = MCODE_SND_MESSAGE; *((u_int*)pb) = pak.idMessage; @@ -614,7 +614,7 @@ u_char* CMLan::CreatePacket(TPacket &pak, int *pBufLen) if (pak.strAwayMessage) { *pb++ = 255; - *((u_short*)pb) = 1 + 4 + (BYTE)awayLen + 1; + *((u_short*)pb) = 1 + 4 + (uint8_t)awayLen + 1; pb += sizeof(u_short); *pb++ = MCODE_SND_AWAYMSG; *((u_int*)pb) = pak.idAckAwayMessage; diff --git a/protocols/Facebook/src/http.cpp b/protocols/Facebook/src/http.cpp index 52fe522779..6f8a079e6d 100644 --- a/protocols/Facebook/src/http.cpp +++ b/protocols/Facebook/src/http.cpp @@ -41,8 +41,8 @@ void AsyncHttpRequest::CalcSig() buf.Append(FB_API_SECRET); char szHash[33]; - BYTE digest[16]; - mir_md5_hash((BYTE*)buf.c_str(), buf.GetLength(), digest); + uint8_t digest[16]; + mir_md5_hash((uint8_t*)buf.c_str(), buf.GetLength(), digest); bin2hex(digest, sizeof(digest), szHash); this << CHAR_PARAM("sig", szHash); diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 7c6c8ad707..14c2b58955 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -128,8 +128,8 @@ char *gg_avatarhash(char *param) if (param == nullptr || (result = (char *)mir_alloc(MIR_SHA1_HASH_SIZE * 2 + 1)) == nullptr)
return nullptr;
- BYTE digest[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE*)param, (int)mir_strlen(param), digest);
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
+ mir_sha1_hash((uint8_t*)param, (int)mir_strlen(param), digest);
return bin2hex(digest, sizeof(digest), result);
}
@@ -251,7 +251,7 @@ void __cdecl GaduProto::avatarrequestthread(void*) if (strncmp(resp->pData, "\xFF\xD8", 2) == 0) avatarType = PA_FORMAT_JPEG;
if (strncmp(resp->pData, "\x47\x49\x46\x38", 4) == 0) avatarType = PA_FORMAT_GIF;
if (strncmp(resp->pData, "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", 8) == 0) avatarType = PA_FORMAT_PNG;
- setByte(data->hContact, GG_KEY_AVATARTYPE, (BYTE)avatarType);
+ setByte(data->hContact, GG_KEY_AVATARTYPE, (uint8_t)avatarType);
getAvatarFilename(ai.hContact, ai.filename, _countof(ai.filename));
file_fd = _wopen(ai.filename, _O_WRONLY | _O_TRUNC | _O_BINARY | _O_CREAT, _S_IREAD | _S_IWRITE);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index a60c72dade..32d7629a7a 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -716,11 +716,11 @@ retry: if (__gender) {
if (res->seq == GG_SEQ_CHINFO)
setByte(hContact, GG_KEY_PD_GANDER,
- (BYTE)(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_SET_MALE) ? 'M' :
+ (uint8_t)(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_SET_MALE) ? 'M' :
(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_SET_FEMALE) ? 'F' : '?')));
else
setByte(hContact, GG_KEY_PD_GANDER,
- (BYTE)(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_MALE) ? 'M' :
+ (uint8_t)(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_MALE) ? 'M' :
(!mir_strcmp(__gender, GG_PUBDIR50_GENDER_FEMALE) ? 'F' : '?')));
}
else if (res->seq == GG_SEQ_CHINFO) {
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index e9bbc23395..6b5cd2c6c4 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -440,21 +440,21 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, gg->setString(GG_KEY_EMAIL, str); // Write checkboxes - gg->setByte(GG_KEY_FRIENDSONLY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FRIENDSONLY)); - gg->setByte(GG_KEY_SHOWINVISIBLE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWINVISIBLE)); - gg->setByte(GG_KEY_LEAVESTATUSMSG, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LEAVESTATUSMSG)); + gg->setByte(GG_KEY_FRIENDSONLY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FRIENDSONLY)); + gg->setByte(GG_KEY_SHOWINVISIBLE, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWINVISIBLE)); + gg->setByte(GG_KEY_LEAVESTATUSMSG, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_LEAVESTATUSMSG)); if (gg->gc_enabled) - gg->setByte(GG_KEY_IGNORECONF, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNORECONF)); - gg->setByte(GG_KEY_IMGRECEIVE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IMGRECEIVE)); - gg->setByte(GG_KEY_SHOWLINKS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWLINKS)); + gg->setByte(GG_KEY_IGNORECONF, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IGNORECONF)); + gg->setByte(GG_KEY_IMGRECEIVE, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_IMGRECEIVE)); + gg->setByte(GG_KEY_SHOWLINKS, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWLINKS)); if (IsDlgButtonChecked(hwndDlg, IDC_SHOWLINKS)) status_flags |= GG_STATUS_FLAG_SPAM; gg->gg_EnterCriticalSection(&gg->sess_mutex, "gg_genoptsdlgproc", 34, "sess_mutex", 1); gg_change_status_flags(gg->m_sess, status_flags); gg->gg_LeaveCriticalSection(&gg->sess_mutex, "gg_genoptsdlgproc", 34, 1, "sess_mutex", 1); - gg->setByte(GG_KEY_ENABLEAVATARS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENABLEAVATARS)); + gg->setByte(GG_KEY_ENABLEAVATARS, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ENABLEAVATARS)); - gg->setByte(GG_KEY_IMGMETHOD, (BYTE)SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_GETCURSEL, 0, 0)); + gg->setByte(GG_KEY_IMGMETHOD, (uint8_t)SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_GETCURSEL, 0, 0)); // Write leave status switch (SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_GETCURSEL, 0, 0)) { @@ -562,7 +562,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, SetValue(hwndDlg, IDC_GENDER, hContact, szProto, GG_KEY_PD_GANDER, SVS_GENDER, hContact != NULL); SetValue(hwndDlg, IDC_STATUSDESCR, hContact, "CList", GG_KEY_STATUSDESCR, SVS_NORMAL, hContact != NULL); } - else switch ((char)db_get_b(hContact, gg->m_szModuleName, GG_KEY_PD_GANDER, (BYTE)'?')) { + else switch ((char)db_get_b(hContact, gg->m_szModuleName, GG_KEY_PD_GANDER, (uint8_t)'?')) { case 'F': SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_SETCURSEL, 1, 0); break; diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 3d4d606aaa..ca86284ffc 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -506,7 +506,7 @@ int GaduProto::SendMsg(MCONTACT hContact, int, const char *msg) return 0;
gg_EnterCriticalSection(&sess_mutex, "SendMsg", 53, "sess_mutex", 1);
- int seq = gg_send_message(m_sess, GG_CLASS_CHAT, uin, (BYTE*)msg);
+ int seq = gg_send_message(m_sess, GG_CLASS_CHAT, uin, (uint8_t*)msg);
gg_LeaveCriticalSection(&sess_mutex, "SendMsg", 53, 1, "sess_mutex", 1);
// Auto-ack message without waiting for server ack
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 3790fbb373..00bb85647b 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -618,7 +618,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP p->unknown1 = 0x109;
p->size = dat->lpImages->nSize;
- dat->lpImages->crc32 = p->crc32 = gg_fix32(gg_crc32(0, (BYTE*)dat->lpImages->lpData, dat->lpImages->nSize));
+ dat->lpImages->crc32 = p->crc32 = gg_fix32(gg_crc32(0, (uint8_t*)dat->lpImages->lpData, dat->lpImages->nSize));
int len = sizeof(struct gg_msg_richtext_format) + sizeof(struct gg_msg_richtext_image);
((gg_msg_richtext*)format)->length = len;
@@ -754,7 +754,7 @@ int gg_img_isexists(wchar_t *szPath, GGIMAGEENTRY *dat) char *lpData = (char*)mir_alloc(dat->nSize);
if (fread(lpData, 1, dat->nSize, fp) == dat->nSize)
{
- if (dat->crc32 == gg_fix32(gg_crc32(0, (BYTE*)lpData, dat->nSize)) ||
+ if (dat->crc32 == gg_fix32(gg_crc32(0, (uint8_t*)lpData, dat->nSize)) ||
memcmp(lpData, dat->lpData, dat->nSize) == 0)
{
mir_free(lpData);
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 94d51e83f8..e7674e959a 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -185,9 +185,9 @@ int oauth_sign_request(LIST<OAUTHPARAMETER> ¶ms, const char *httpmethod, con mir_strcat(key, "&");
mir_strcat(key, tsenc);
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
unsigned len;
- HMAC(EVP_sha1(), key, (int)mir_strlen(key), (BYTE*)(char*)text, (int)mir_strlen(text), digest, &len);
+ HMAC(EVP_sha1(), key, (int)mir_strlen(key), (uint8_t*)(char*)text, (int)mir_strlen(text), digest, &len);
sign = mir_base64_encode(digest, MIR_SHA1_HASH_SIZE);
}
else { // PLAINTEXT
@@ -213,8 +213,8 @@ char* oauth_generate_nonce() CMStringA str(FORMAT, "%ld%s", time(0), randnum);
- BYTE digest[16];
- mir_md5_hash((BYTE*)str.GetString(), str.GetLength(), digest);
+ uint8_t digest[16];
+ mir_md5_hash((uint8_t*)str.GetString(), str.GetLength(), digest);
return bin2hex(digest, sizeof(digest), (char *)mir_alloc(32 + 1));
}
diff --git a/protocols/Gadu-Gadu/src/options.h b/protocols/Gadu-Gadu/src/options.h index 8e8694d25e..6e8d7502ac 100644 --- a/protocols/Gadu-Gadu/src/options.h +++ b/protocols/Gadu-Gadu/src/options.h @@ -4,14 +4,14 @@ struct GaduOptions { - CMOption<BYTE> autoRecconect; - CMOption<BYTE> keepConnectionAlive; - CMOption<BYTE> showConnectionErrors; - CMOption<BYTE> useDirectConnections; - CMOption<BYTE> useForwarding; - CMOption<BYTE> useManualHosts; - CMOption<BYTE> useMsgDeliveryAcknowledge; - CMOption<BYTE> useSslConnection; + CMOption<uint8_t> autoRecconect; + CMOption<uint8_t> keepConnectionAlive; + CMOption<uint8_t> showConnectionErrors; + CMOption<uint8_t> useDirectConnections; + CMOption<uint8_t> useForwarding; + CMOption<uint8_t> useManualHosts; + CMOption<uint8_t> useMsgDeliveryAcknowledge; + CMOption<uint8_t> useSslConnection; CMOption<WORD> directConnectionPort; CMOption<WORD> forwardPort; diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 8fee1a1798..9b08f19823 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -338,7 +338,7 @@ INT_PTR GaduProto::setmyavatar(WPARAM, LPARAM lParam) }
setByte(GG_KEY_AVATARTYPEPREV, getByte(GG_KEY_AVATARTYPE, -1));
- setByte(GG_KEY_AVATARTYPE, (BYTE)iAvType);
+ setByte(GG_KEY_AVATARTYPE, (uint8_t)iAvType);
wchar_t szMyFilename[MAX_PATH];
getAvatarFilename(NULL, szMyFilename, _countof(szMyFilename));
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index eec5793b6d..0c57effe4f 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -459,10 +459,10 @@ public: ~CIcqProto(); CMOption<wchar_t*> m_szOwnId; // our own aim id - CMOption<BYTE> m_bHideGroupchats; // don't pop up group chat windows on startup - CMOption<BYTE> m_bUseTrayIcon; // use tray icon notifications - CMOption<BYTE> m_bErrorPopups; // display popups with errors - CMOption<BYTE> m_bLaunchMailbox; // launch browser to view email + CMOption<uint8_t> m_bHideGroupchats; // don't pop up group chat windows on startup + CMOption<uint8_t> m_bUseTrayIcon; // use tray icon notifications + CMOption<uint8_t> m_bErrorPopups; // display popups with errors + CMOption<uint8_t> m_bLaunchMailbox; // launch browser to view email CMOption<DWORD> m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs CMOption<DWORD> m_iStatus1; CMOption<DWORD> m_iTimeDiff2; // set this status to m_iStatus2 after this interval of secs diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 2b41b5aee7..f30ec313eb 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -318,7 +318,7 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact, boo if (wszCap.GetLength() != 32) continue; - BYTE cap[16]; + uint8_t cap[16]; hex2binW(wszCap, cap, sizeof(cap)); if (!memcmp(cap, "MiNG", 4)) { // Miranda int v[4]; @@ -819,8 +819,8 @@ void CIcqProto::OnCheckPassword(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*) CMStringA szPassTemp = m_szPassword; unsigned int len; - BYTE hashOut[MIR_SHA256_HASH_SIZE]; - HMAC(EVP_sha256(), szPassTemp, szPassTemp.GetLength(), (BYTE*)szSessionSecret.c_str(), szSessionSecret.GetLength(), hashOut, &len); + uint8_t hashOut[MIR_SHA256_HASH_SIZE]; + HMAC(EVP_sha256(), szPassTemp, szPassTemp.GetLength(), (uint8_t*)szSessionSecret.c_str(), szSessionSecret.GetLength(), hashOut, &len); m_szSessionKey = ptrA(mir_base64_encode(hashOut, sizeof(hashOut))); setString(DB_KEY_SESSIONKEY, m_szSessionKey); diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp index 4bd51e050c..73af43851a 100644 --- a/protocols/ICQ-WIM/src/utils.cpp +++ b/protocols/ICQ-WIM/src/utils.cpp @@ -110,8 +110,8 @@ void CIcqProto::CalcHash(AsyncHttpRequest *pReq) mir_urlEncode(pReq->m_szUrl).c_str(), mir_urlEncode(pReq->m_szParam).c_str()); unsigned int len; - BYTE hashOut[MIR_SHA256_HASH_SIZE]; - HMAC(EVP_sha256(), m_szSessionKey, m_szSessionKey.GetLength(), (BYTE*)hashData.c_str(), hashData.GetLength(), hashOut, &len); + uint8_t hashOut[MIR_SHA256_HASH_SIZE]; + HMAC(EVP_sha256(), m_szSessionKey, m_szSessionKey.GetLength(), (uint8_t*)hashData.c_str(), hashData.GetLength(), hashOut, &len); pReq << CHAR_PARAM("sig_sha256", ptrA(mir_base64_encode(hashOut, sizeof(hashOut)))); } diff --git a/protocols/ICQCorp/src/protocol.h b/protocols/ICQCorp/src/protocol.h index ba75de163b..c939b2bd46 100644 --- a/protocols/ICQCorp/src/protocol.h +++ b/protocols/ICQCorp/src/protocol.h @@ -134,7 +134,7 @@ const unsigned int WM_NETEVENT_TRANSFER = WM_USER + 4; typedef struct { //extended search result structure, used for all searches
PROTOSEARCHRESULT hdr;
DWORD uin;
- BYTE auth;
+ uint8_t auth;
} ICQSEARCHRESULT;
///////////////////////////////////////////////////////////////////////////////
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<CIrcProto> 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<CIrcProto> // 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 ||
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 2968c14f18..ddbb71ae94 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -257,7 +257,7 @@ void CJabberProto::OnIqResultGetCollection(const TiXmlElement *iqNode, CJabberIq dbei.szModule = m_szModuleName;
dbei.cbBlob = (DWORD)mir_strlen(tszBody) + 1;
dbei.flags = DBEF_READ + DBEF_UTF + from;
- dbei.pBlob = (BYTE*)tszBody;
+ dbei.pBlob = (uint8_t*)tszBody;
dbei.timestamp = tmStart + atol(tszSecs);
if (!IsDuplicateEvent(hContact, dbei))
db_event_add(hContact, &dbei);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index a7ff8e6b11..13691315d6 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -321,7 +321,7 @@ void CJabberProto::ByteInitiateResult(const TiXmlElement *iqNode, CJabberIqInfo int CJabberProto::ByteSendParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, char* buffer, int datalen)
{
int nMethods;
- BYTE data[10];
+ uint8_t data[10];
int i;
switch (jbt->state) {
@@ -497,7 +497,7 @@ int CJabberProto::ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jb // 04-44 dst.addr (41 bytes: 1-byte length, 40-byte SHA1 hash of [sid,srcJID,dstJID])
// 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
- BYTE data[47];
+ uint8_t data[47];
memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
@@ -684,7 +684,7 @@ int CJabberProto::ByteReceiveParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, // 04-44 dst.addr (41 bytes: 1-byte length, 40-byte SHA1 hash of [sid,srcJID,dstJID])
// 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
- BYTE data[47];
+ uint8_t data[47];
memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index d9f2652dde..0ae90f8877 100755 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -456,8 +456,8 @@ void CJabberProto::UpdateFeatHash() feat_buf.Append(os); feat_buf.AppendChar('<');
}
- BYTE hash[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE *)feat_buf.c_str(), feat_buf.GetLength(), hash);
+ uint8_t hash[MIR_SHA1_HASH_SIZE];
+ mir_sha1_hash((uint8_t *)feat_buf.c_str(), feat_buf.GetLength(), hash);
ptrA szHash(mir_base64_encode(&hash, sizeof(hash)));
m_szFeaturesCrc = szHash;
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index 3ca2bae57e..daf69dac02 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -851,7 +851,7 @@ bool CJabberProto::FtHandleCidRequest(const TiXmlElement*, CJabberIqInfo *pInfo) if (fileId < 0)
goto LBL_Error;
- mir_ptr<BYTE> buf((BYTE *)mir_alloc(data.nFileSizeLow));
+ mir_ptr<uint8_t> buf((uint8_t *)mir_alloc(data.nFileSizeLow));
_read(fileId, buf, data.nFileSizeLow);
_close(fileId);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 9cd88f246e..32449881be 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -506,10 +506,10 @@ void CJabberProto::OnIqResultGetVcardPhoto(const TiXmlElement *n, MCONTACT hCont if (szPicType == nullptr)
return;
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha1ctx;
mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE *)buffer.get(), bufferLen);
+ mir_sha1_append(&sha1ctx, (uint8_t *)buffer.get(), bufferLen);
mir_sha1_finish(&sha1ctx, digest);
char digestHex[MIR_SHA1_HASH_SIZE*2 + 1];
@@ -704,8 +704,8 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo* if (sscanf(n->GetText(), "%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
setWord(hContact, "BirthYear", (WORD)nYear);
- setByte(hContact, "BirthMonth", (BYTE)nMonth);
- setByte(hContact, "BirthDay", (BYTE)nDay);
+ setByte(hContact, "BirthMonth", (uint8_t)nMonth);
+ setByte(hContact, "BirthDay", (uint8_t)nDay);
SYSTEMTIME sToday = { 0 };
GetLocalTime(&sToday);
@@ -728,7 +728,7 @@ void CJabberProto::OnIqResultGetVcard(const TiXmlElement *iqNode, CJabberIqInfo* if (hContact != 0) {
if (n->GetText()[0] && strchr("mMfF", n->GetText()[0]) != nullptr) {
hasGender = true;
- setByte(hContact, "Gender", (BYTE)toupper(n->GetText()[0]));
+ setByte(hContact, "Gender", (uint8_t)toupper(n->GetText()[0]));
}
}
else {
@@ -1291,10 +1291,10 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, const char *pszText, c setByte(hContact, "AvatarType", pictureType);
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)(char*)body, resultLen);
+ mir_sha1_append(&sha, (uint8_t*)(char*)body, resultLen);
mir_sha1_finish(&sha, digest);
GetAvatarFileName(hContact, tszFileName, _countof(tszFileName));
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 0350f28ad3..692510e09b 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -101,7 +101,7 @@ MCONTACT CJabberProto::DBCreateContact(const char *jid, const char *nick, bool t return hNewContact;
}
-bool CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
+bool CJabberProto::AddDbPresenceEvent(MCONTACT hContact, uint8_t btEventType)
{
if (!hContact)
return false;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index e479a1ca1b..4ac9cf3ee3 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -687,7 +687,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void AddContactToRoster(const char *jid, const char *nick, const char *grpName);
void DBAddAuthRequest(const char *jid, const char *nick);
- bool AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType);
+ bool AddDbPresenceEvent(MCONTACT hContact, uint8_t btEventType);
MCONTACT DBCreateContact(const char *jid, const char *nick, bool temporary, bool stripResource);
void GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbLen);
void ResolveTransportNicks(const char *jid);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 0a1f196cfd..ea35d49de9 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -373,7 +373,7 @@ int CJabberProto::AdhocSetStatusHandler(const TiXmlElement*, CJabberIqInfo *pInf SetAwayMsg(status, Utf2T(szStatusMessage));
// return NoDlg setting
- db_set_b(0, "SRAway", StatusModeToDbSetting(status, "NoDlg"), (BYTE)nNoDlg);
+ db_set_b(0, "SRAway", StatusModeToDbSetting(status, "NoDlg"), (uint8_t)nNoDlg);
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
}
diff --git a/protocols/JabberG/src/jabber_roster.cpp b/protocols/JabberG/src/jabber_roster.cpp index 399cd91a91..25f53f0664 100644 --- a/protocols/JabberG/src/jabber_roster.cpp +++ b/protocols/JabberG/src/jabber_roster.cpp @@ -141,11 +141,11 @@ class CRosterEditorDlg : public CJabberDlgBase friend struct CJabberProto; typedef CJabberDlgBase CSuper; - BYTE m_bRRAction; + uint8_t m_bRRAction; BOOL m_bReadyToDownload = true; BOOL m_bReadyToUpload = false; - void _RosterSendRequest(BYTE rrAction) + void _RosterSendRequest(uint8_t rrAction) { m_bRRAction = rrAction; diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index f04c105b3c..e04321e669 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -158,38 +158,38 @@ char* TMD5Auth::getChallenge(const char *challenge) ptrA serv(mir_utf8encode(info->conn.server));
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)info->conn.username, (int)mir_strlen(info->conn.username));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)realm, (int)mir_strlen(realm));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)info->conn.password, (int)mir_strlen(info->conn.password));
- mir_md5_finish(&ctx, (BYTE*)hash1);
+ mir_md5_append(&ctx, (uint8_t*)info->conn.username, (int)mir_strlen(info->conn.username));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)realm, (int)mir_strlen(realm));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)info->conn.password, (int)mir_strlen(info->conn.password));
+ mir_md5_finish(&ctx, (uint8_t*)hash1);
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)hash1, 16);
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
- mir_md5_finish(&ctx, (BYTE*)hash1);
+ mir_md5_append(&ctx, (uint8_t*)hash1, 16);
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)nonce, (int)mir_strlen(nonce));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)cnonce, (int)mir_strlen(cnonce));
+ mir_md5_finish(&ctx, (uint8_t*)hash1);
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)"AUTHENTICATE:xmpp/", 18);
- mir_md5_append(&ctx, (BYTE*)(char*)serv, (int)mir_strlen(serv));
- mir_md5_finish(&ctx, (BYTE*)hash2);
+ mir_md5_append(&ctx, (uint8_t*)"AUTHENTICATE:xmpp/", 18);
+ mir_md5_append(&ctx, (uint8_t*)(char*)serv, (int)mir_strlen(serv));
+ mir_md5_finish(&ctx, (uint8_t*)hash2);
mir_md5_init(&ctx);
mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
- mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
+ mir_md5_append(&ctx, (uint8_t*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_append(&ctx, (uint8_t*)":", 1);
+ mir_md5_append(&ctx, (uint8_t*)nonce, (int)mir_strlen(nonce));
mir_snprintf(tmpBuf, ":%08d:", iCallCount);
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
- mir_md5_append(&ctx, (BYTE*)":auth:", 6);
+ mir_md5_append(&ctx, (uint8_t*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_append(&ctx, (uint8_t*)cnonce, (int)mir_strlen(cnonce));
+ mir_md5_append(&ctx, (uint8_t*)":auth:", 6);
mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
- mir_md5_finish(&ctx, (BYTE*)digest);
+ mir_md5_append(&ctx, (uint8_t*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_finish(&ctx, (uint8_t*)digest);
char *buf = (char*)alloca(8000);
int cbLen = mir_snprintf(buf, 8000,
@@ -230,17 +230,17 @@ TScramAuth::~TScramAuth() mir_free(serverSignature);
}
-void TScramAuth::Hi(BYTE *res, char *passw, size_t passwLen, char *salt, size_t saltLen, int ind)
+void TScramAuth::Hi(uint8_t *res, char *passw, size_t passwLen, char *salt, size_t saltLen, int ind)
{
size_t bufLen = saltLen + sizeof(UINT32);
- BYTE *u = (BYTE*)_alloca(max(bufLen, EVP_MAX_MD_SIZE));
+ uint8_t *u = (uint8_t*)_alloca(max(bufLen, EVP_MAX_MD_SIZE));
memcpy(u, salt, saltLen); *(UINT32*)(u + saltLen) = htonl(1);
memset(res, 0, EVP_MAX_MD_SIZE);
for (int i = 0; i < ind; i++) {
unsigned int len;
- HMAC(hashMethod, (BYTE*)passw, (unsigned)passwLen, u, (unsigned)bufLen, u, &len);
+ HMAC(hashMethod, (uint8_t*)passw, (unsigned)passwLen, u, (unsigned)bufLen, u, &len);
bufLen = EVP_MD_size(hashMethod);
for (size_t j = 0; j < bufLen; j++)
@@ -292,14 +292,14 @@ char* TScramAuth::getChallenge(const char *challenge) int hashSize = EVP_MD_size(hashMethod);
- BYTE saltedPassw[EVP_MAX_MD_SIZE];
+ uint8_t saltedPassw[EVP_MAX_MD_SIZE];
Hi(saltedPassw, info->conn.password, mir_strlen(info->conn.password), salt, saltLen, ind);
- BYTE clientKey[EVP_MAX_MD_SIZE];
+ uint8_t clientKey[EVP_MAX_MD_SIZE];
unsigned int len;
- HMAC(hashMethod, saltedPassw, hashSize, (BYTE*)"Client Key", 10, clientKey, &len);
+ HMAC(hashMethod, saltedPassw, hashSize, (uint8_t*)"Client Key", 10, clientKey, &len);
- BYTE storedKey[EVP_MAX_MD_SIZE];
+ uint8_t storedKey[EVP_MAX_MD_SIZE];
{
EVP_MD_CTX *pctx = EVP_MD_CTX_new();
EVP_DigestInit(pctx, hashMethod);
@@ -308,20 +308,20 @@ char* TScramAuth::getChallenge(const char *challenge) EVP_MD_CTX_free(pctx);
}
- BYTE clientSig[EVP_MAX_MD_SIZE];
+ uint8_t clientSig[EVP_MAX_MD_SIZE];
CMStringA authmsg(FORMAT, "%s,%s,c=%s,r=%s", msg1, chl.get(), cbd.get(), snonce.get());
- HMAC(hashMethod, storedKey, hashSize, (BYTE*)authmsg.c_str(), authmsg.GetLength(), clientSig, &len);
+ HMAC(hashMethod, storedKey, hashSize, (uint8_t*)authmsg.c_str(), authmsg.GetLength(), clientSig, &len);
- BYTE clientProof[EVP_MAX_MD_SIZE];
+ uint8_t clientProof[EVP_MAX_MD_SIZE];
for (int j = 0; j < hashSize; j++)
clientProof[j] = clientKey[j] ^ clientSig[j];
/* Calculate the server signature */
- BYTE serverKey[EVP_MAX_MD_SIZE];
- HMAC(hashMethod, saltedPassw, hashSize, (BYTE*)"Server Key", 10, serverKey, &len);
+ uint8_t serverKey[EVP_MAX_MD_SIZE];
+ HMAC(hashMethod, saltedPassw, hashSize, (uint8_t*)"Server Key", 10, serverKey, &len);
- BYTE srvSig[EVP_MAX_MD_SIZE];
- HMAC(hashMethod, serverKey, hashSize, (BYTE*)authmsg.c_str(), authmsg.GetLength(), srvSig, &len);
+ uint8_t srvSig[EVP_MAX_MD_SIZE];
+ HMAC(hashMethod, serverKey, hashSize, (uint8_t*)authmsg.c_str(), authmsg.GetLength(), srvSig, &len);
serverSignature = mir_base64_encode(srvSig, hashSize);
ptrA encproof(mir_base64_encode(clientProof, hashSize));
diff --git a/protocols/JabberG/src/jabber_secur.h b/protocols/JabberG/src/jabber_secur.h index ab6c5bb6cc..e17d0c03e6 100644 --- a/protocols/JabberG/src/jabber_secur.h +++ b/protocols/JabberG/src/jabber_secur.h @@ -100,7 +100,7 @@ public: char* getChallenge(const char *challenge) override;
bool validateLogin(const char *challenge) override;
- void Hi(BYTE* res , char* passw, size_t passwLen, char* salt, size_t saltLen, int ind);
+ void Hi(uint8_t* res , char* passw, size_t passwLen, char* salt, size_t saltLen, int ind);
};
// ntlm auth - LanServer based authorization
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 1197453440..d6ffefc7ab 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -256,10 +256,10 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam) _read(fileIn, pResult, dwPngSize);
_close(fileIn);
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha1ctx;
mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE*)pResult, dwPngSize);
+ mir_sha1_append(&sha1ctx, (uint8_t*)pResult, dwPngSize);
mir_sha1_finish(&sha1ctx, digest);
wchar_t tFileName[MAX_PATH];
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index e012da46cd..cff0eb6468 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1225,7 +1225,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) // chatstates gone event
if (hContact && XmlGetChildByTag(node, "gone", "xmlns", JABBER_FEAT_CHATSTATES) && m_bLogChatstates) {
- BYTE bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
+ uint8_t bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
DBEVENTINFO dbei = {};
dbei.pBlob = &bEventType;
dbei.cbBlob = 1;
@@ -1439,8 +1439,8 @@ void CJabberProto::OnProcessPresenceCapabilites(const TiXmlElement *node, pResou const char *szHash = XmlGetAttr(n, "hash");
if (szHash == nullptr) { // old version
- BYTE hashOut[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE*)szVer, mir_strlen(szVer), hashOut);
+ uint8_t hashOut[MIR_SHA1_HASH_SIZE];
+ mir_sha1_hash((uint8_t*)szVer, mir_strlen(szVer), hashOut);
char szHashOut[MIR_SHA1_HASH_SIZE*2 + 1];
r->m_pCaps = g_clientCapsManager.GetPartialCaps(szNode, bin2hex(hashOut, _countof(hashOut), szHashOut));
@@ -2050,7 +2050,7 @@ int ThreadData::send_no_strm_mgmt(TiXmlElement *node) // strip forbidden control characters from outgoing XML stream
char *q = buf.GetBuffer();
for (char *p = buf.GetBuffer(); *p; ++p) {
- int c = *(BYTE*)p;
+ int c = *(uint8_t*)p;
if (c < 32 && c != '\t' && c != '\n' && c != '\r')
continue;
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index b92b688525..5113ee35b1 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TTreeList_ItemInfo
{
- BYTE flags;
+ uint8_t flags;
int indent, sortIndex;
struct TTreeList_ItemInfo *parent;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index d952602c46..b2d1856ce9 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -166,10 +166,10 @@ char* JabberPrepareJid(const char *jid) char* JabberSha1(const char *str, JabberShaStrBuf buf)
{
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)str, (int)mir_strlen(str));
+ mir_sha1_append(&sha, (uint8_t*)str, (int)mir_strlen(str));
mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buf);
@@ -947,10 +947,10 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param) setByte(ai.hContact, "AvatarType", pictureType);
char buffer[2 * MIR_SHA1_HASH_SIZE + 1];
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)res->pData, res->dataLength);
+ mir_sha1_append(&sha, (uint8_t*)res->pData, res->dataLength);
mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buffer);
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 391a237ff7..f2c75e7112 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -1140,10 +1140,10 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t *szPhotoFileName) n << XCHILD("BINVAL", str);
// NEED TO UPDATE OUR AVATAR HASH:
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha1ctx;
mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE*)(LPSTR)buffer, nRead);
+ mir_sha1_append(&sha1ctx, (uint8_t*)(LPSTR)buffer, nRead);
mir_sha1_finish(&sha1ctx, digest);
char buf[MIR_SHA1_HASH_SIZE * 2 + 1];
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index bdc64479d5..d7392b19d0 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -52,12 +52,12 @@ bool XmlNodeHash::VisitEnter(const TiXmlElement &pNode, const tinyxml2::XMLAttri void XmlNodeHash::add(const char *str)
{
if (str)
- mir_md5_append(&state, (const BYTE *)str, strlen(str));
+ mir_md5_append(&state, (const uint8_t *)str, strlen(str));
}
CMStringA XmlNodeHash::getResult()
{
- BYTE digest[16];
+ uint8_t digest[16];
mir_md5_finish(&state, digest);
CMStringA res;
diff --git a/protocols/JabberG/src/jabber_zstream.cpp b/protocols/JabberG/src/jabber_zstream.cpp index 9909027782..1e9534a5c2 100644 --- a/protocols/JabberG/src/jabber_zstream.cpp +++ b/protocols/JabberG/src/jabber_zstream.cpp @@ -105,7 +105,7 @@ retry: }
zStreamIn.avail_out = datalen;
- zStreamIn.next_out = (BYTE*)data;
+ zStreamIn.next_out = (uint8_t*)data;
switch (inflate(&zStreamIn, Z_NO_FLUSH)) {
case Z_OK: proto->debugLogA("Inflate: Z_OK"); break;
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 30263973f0..c007b351a7 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -447,9 +447,9 @@ struct filetransfer : public MZeroedObject struct JABBER_GCLOG_FONT
{
char face[LF_FACESIZE]; // LF_FACESIZE is from LOGFONT struct
- BYTE style;
+ uint8_t style;
char size; // signed
- BYTE charset;
+ uint8_t charset;
COLORREF color;
};
diff --git a/protocols/LotusNotify/src/LotusNotify.cpp b/protocols/LotusNotify/src/LotusNotify.cpp index 2412022516..73bd54a92a 100644 --- a/protocols/LotusNotify/src/LotusNotify.cpp +++ b/protocols/LotusNotify/src/LotusNotify.cpp @@ -43,7 +43,7 @@ wchar_t settingFilterSubject[MAX_SETTING_STR] = TEXT(""), settingFilterSender[MA COLORREF settingBgColor, settingFgColor; int settingInterval = 0, settingInterval1 = 0; DWORD settingNewestID = 0; -BYTE settingSetColours = 0, settingShowError = 1, settingIniAnswer = -1, settingIniCheck = 0, +uint8_t settingSetColours = 0, settingShowError = 1, settingIniAnswer = -1, settingIniCheck = 0, settingOnceOnly = 0, settingNonClickedOnly = 0, settingNewest = 0, settingEvenNonClicked = 0, settingKeepConnection = 1; BOOL settingStatus[STATUS_COUNT]; BOOL bMirandaCall=FALSE; @@ -887,10 +887,10 @@ void decodeServer(char *tmp) void fillServersList(HWND hwndDlg) { HANDLE hServerList = NULLHANDLE; - BYTE far *pServerList; /* Pointer to start of Server List */ + uint8_t far *pServerList; /* Pointer to start of Server List */ WORD wServerCount; /* Number of servers in list. */ WORD far *pwServerLength; /* Index to array of servername lens */ - BYTE far *pServerName; + uint8_t far *pServerName; STATUS error = NOERROR; /* Error return from API routines. */ char ServerString[MAXPATH]; /* String to hold server names. */ LPSTR szServerString = ServerString; @@ -902,12 +902,12 @@ void fillServersList(HWND hwndDlg) error = NSGetServerList1(nullptr, &hServerList); if (error == NOERROR) { - pServerList = (BYTE far *) OSLockObject1(hServerList); + pServerList = (uint8_t far *) OSLockObject1(hServerList); wServerCount = (WORD)*pServerList; pwServerLength = (WORD *)(pServerList + sizeof(WORD)); - pServerName = (BYTE far *) pServerList + sizeof(wServerCount) + ((wServerCount)* sizeof(WORD)); + pServerName = (uint8_t far *) pServerList + sizeof(wServerCount) + ((wServerCount)* sizeof(WORD)); for (USHORT i = 0; i < wServerCount; pServerName += pwServerLength[i], i++) { memmove(szServerString, pServerName, pwServerLength[i]); @@ -1103,7 +1103,7 @@ static INT_PTR CALLBACK DlgProcLotusNotifyConnectionOpts(HWND hwndDlg, UINT msg, GetDlgItemTextA(hwndDlg, IDC_DATABASE, settingDatabase, _countof(settingDatabase)); break; case IDC_BUTTON_CHECK: - settingIniCheck = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BUTTON_CHECK); + settingIniCheck = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_BUTTON_CHECK); checkNotesIniFile(TRUE); break; case IDC_DATABASE: @@ -1141,7 +1141,7 @@ static INT_PTR CALLBACK DlgProcLotusNotifyConnectionOpts(HWND hwndDlg, UINT msg, settingInterval = GetDlgItemInt(hwndDlg, IDC_INTERVAL, nullptr, FALSE); break; case IDC_KEEP_CONNEXION_ON_ERROR: - settingKeepConnection = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_KEEP_CONNEXION_ON_ERROR); + settingKeepConnection = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_KEEP_CONNEXION_ON_ERROR); break; } break; @@ -1223,21 +1223,21 @@ static INT_PTR CALLBACK DlgProcLotusNotifyPopupOpts(HWND hwndDlg, UINT msg, WPAR settingInterval1 = GetDlgItemInt(hwndDlg, IDC_INTERVAL1, nullptr, TRUE); break; case IDC_ONCEONLY: - settingOnceOnly = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONCEONLY); + settingOnceOnly = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ONCEONLY); EnableWindow(GetDlgItem(hwndDlg, IDC_NONCLICKEDONLY), settingOnceOnly); break; case IDC_NONCLICKEDONLY: - settingNonClickedOnly = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NONCLICKEDONLY); + settingNonClickedOnly = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NONCLICKEDONLY); break; case IDC_SHOWERROR: - settingShowError = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWERROR); + settingShowError = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SHOWERROR); break; case IDC_NEWEST: - settingNewest = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NEWEST); + settingNewest = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NEWEST); EnableWindow(GetDlgItem(hwndDlg, IDC_REMEMBEREVENNONCLICKED), settingNewest); break; case IDC_REMEMBEREVENNONCLICKED: - settingEvenNonClicked = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_REMEMBEREVENNONCLICKED); + settingEvenNonClicked = (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_REMEMBEREVENNONCLICKED); break; case IDC_COMMAND: GetDlgItemTextA(hwndDlg, IDC_COMMAND, settingCommand, _countof(settingCommand)); diff --git a/protocols/LotusNotify/src/lotusnotes.cpp b/protocols/LotusNotify/src/lotusnotes.cpp index adc60a7bdf..4867d094bb 100644 --- a/protocols/LotusNotify/src/lotusnotes.cpp +++ b/protocols/LotusNotify/src/lotusnotes.cpp @@ -77,7 +77,7 @@ void GetLotusPath(wchar_t *sTemp, DWORD size) return; } - RegQueryValueEx( dmKey, TEXT("Path"), nullptr, nullptr, (BYTE*)sTemp, &size ); + RegQueryValueEx( dmKey, TEXT("Path"), nullptr, nullptr, (uint8_t*)sTemp, &size ); RegCloseKey(dmKey); return; } diff --git a/protocols/NewsAggregator/Src/CheckFeed.cpp b/protocols/NewsAggregator/Src/CheckFeed.cpp index 5f02986f3e..e8724f0c60 100644 --- a/protocols/NewsAggregator/Src/CheckFeed.cpp +++ b/protocols/NewsAggregator/Src/CheckFeed.cpp @@ -160,7 +160,7 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr bool MesExist = false; T2Utf pszTemp(message); DWORD cbMemoLen = 10000, cbOrigLen = (DWORD)mir_strlen(pszTemp); - BYTE *pbBuffer = (BYTE*)mir_alloc(cbMemoLen); + uint8_t *pbBuffer = (uint8_t*)mir_alloc(cbMemoLen); DB::ECPTR pCursor(DB::EventsRev(hContact)); while (MEVENT hDbEvent = pCursor.FetchNext()) { diff --git a/protocols/Non-IM Contact/src/contactinfo.cpp b/protocols/Non-IM Contact/src/contactinfo.cpp index 6f34ff479b..47effee3e7 100644 --- a/protocols/Non-IM Contact/src/contactinfo.cpp +++ b/protocols/Non-IM Contact/src/contactinfo.cpp @@ -261,8 +261,8 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP else g_plugin.setWord(hContact, "Timer", 0); // always visible - g_plugin.setByte(hContact, "AlwaysVisible", (BYTE)IsDlgButtonChecked(hwnd, IDC_ALWAYS_VISIBLE)); - g_plugin.setByte(hContact, "VisibleUnlessOffline", (BYTE)IsDlgButtonChecked(hwnd, IDC_VISIBLE_UNLESS_OFFLINE)); + g_plugin.setByte(hContact, "AlwaysVisible", (uint8_t)IsDlgButtonChecked(hwnd, IDC_ALWAYS_VISIBLE)); + g_plugin.setByte(hContact, "VisibleUnlessOffline", (uint8_t)IsDlgButtonChecked(hwnd, IDC_VISIBLE_UNLESS_OFFLINE)); } return TRUE; } @@ -643,8 +643,8 @@ INT_PTR ImportContacts(WPARAM, LPARAM) // copy the ToolTip g_plugin.setString(hContact, "ToolTip", tooltip); // timer - g_plugin.setByte(hContact, "UseTimer", (BYTE)usetimer); - g_plugin.setByte(hContact, "Minutes", (BYTE)minutes); + g_plugin.setByte(hContact, "UseTimer", (uint8_t)usetimer); + g_plugin.setByte(hContact, "Minutes", (uint8_t)minutes); g_plugin.setWord(hContact, "Timer", (WORD)timer); //icon g_plugin.setWord(hContact, "Icon", (WORD)icon); diff --git a/protocols/Non-IM Contact/src/dialog.cpp b/protocols/Non-IM Contact/src/dialog.cpp index 1db80c26df..8549d7cecc 100644 --- a/protocols/Non-IM Contact/src/dialog.cpp +++ b/protocols/Non-IM Contact/src/dialog.cpp @@ -58,7 +58,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - g_plugin.setByte("AwayAsStatus", (BYTE)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE)); + g_plugin.setByte("AwayAsStatus", (uint8_t)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE)); if (BST_UNCHECKED == IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) { GetDlgItemText(hwnd, IDC_TIMER_INT, tmp, _countof(tmp)); g_plugin.setWord("Timer", (WORD)_wtoi(tmp)); diff --git a/protocols/Non-IM Contact/src/namereplacing.cpp b/protocols/Non-IM Contact/src/namereplacing.cpp index 54709aa37c..00a9ca07ab 100644 --- a/protocols/Non-IM Contact/src/namereplacing.cpp +++ b/protocols/Non-IM Contact/src/namereplacing.cpp @@ -302,7 +302,7 @@ void checkStringForSaveN(CMStringA &str) switch (D[0]) { case '0': case 'b': - db_set_b(0, A, B, (BYTE)atoi(C)); + db_set_b(0, A, B, (uint8_t)atoi(C)); break; case '1': case 'w': diff --git a/protocols/Omegle/src/dialogs.cpp b/protocols/Omegle/src/dialogs.cpp index d9fe55ccfb..a51707d962 100644 --- a/protocols/Omegle/src/dialogs.cpp +++ b/protocols/Omegle/src/dialogs.cpp @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-static BOOL LoadDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting, BYTE bDef = 0)
+static BOOL LoadDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting, uint8_t bDef = 0)
{
BOOL state = db_get_b(0, ppro->m_szModuleName, szSetting, bDef);
CheckDlgButton(hwnd, idCtrl, state ? BST_CHECKED : BST_UNCHECKED);
@@ -32,7 +32,7 @@ static BOOL LoadDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const cha static BOOL StoreDBCheckState(OmegleProto* ppro, HWND hwnd, int idCtrl, const char* szSetting)
{
BOOL state = IsDlgButtonChecked(hwnd, idCtrl);
- db_set_b(0, ppro->m_szModuleName, szSetting, (BYTE)state);
+ db_set_b(0, ppro->m_szModuleName, szSetting, (uint8_t)state);
return state;
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index e700e51d75..9d3ee43a98 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -90,7 +90,7 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) db_set_utf(hContact, m_szModuleName, "Nick", id);
}
- db_set_b(hContact, m_szModuleName, "type", (BYTE)type);
+ db_set_b(hContact, m_szModuleName, "type", (uint8_t)type);
if (new_contact) {
//add to our awareness list
@@ -142,9 +142,9 @@ void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temp mir_snprintf(buff, "GN_%s", group_alias);
db_set_utf(0, szProtoGroups, buff, group_name);
mir_snprintf(buff, "GT_%s", group_alias);
- db_set_b(0, szProtoGroups, buff, (BYTE)group_type);
+ db_set_b(0, szProtoGroups, buff, (uint8_t)group_type);
mir_snprintf(buff, "GO_%s", group_alias);
- db_set_b(0, szProtoGroups, buff, (BYTE)(group_open ? 1 : 0));
+ db_set_b(0, szProtoGroups, buff, (uint8_t)(group_open ? 1 : 0));
// inverse mapping
mir_snprintf(buff, "GA_%s", group_name);
@@ -208,7 +208,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) if (group_alias) {
mir_snprintf(buff, "GT_%s", group_alias);
- group_type = (mwSametimeGroupType)db_get_b(0, szProtoGroups, buff, (BYTE)mwSametimeGroup_NORMAL);
+ group_type = (mwSametimeGroupType)db_get_b(0, szProtoGroups, buff, (uint8_t)mwSametimeGroup_NORMAL);
// apparently we don't want to upload contacts in dynamic groups - see gaim sametime plugin comments
if (group_type == mwSametimeGroup_DYNAMIC) {
db_free(&dbv);
@@ -264,7 +264,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) else
user_alias = nullptr;
- user_type = (mwSametimeUserType)db_get_b(hContact, m_szModuleName, "type", (BYTE)mwSametimeUser_NORMAL);
+ user_type = (mwSametimeUserType)db_get_b(hContact, m_szModuleName, "type", (uint8_t)mwSametimeUser_NORMAL);
uid.user = id_block.user;
uid.community = id_block.community;
diff --git a/protocols/SkypeWeb/src/requests/login.h b/protocols/SkypeWeb/src/requests/login.h index f77f15c570..7ed847ec7a 100644 --- a/protocols/SkypeWeb/src/requests/login.h +++ b/protocols/SkypeWeb/src/requests/login.h @@ -30,8 +30,8 @@ struct LoginOAuthRequest : public AsyncHttpRequest CMStringA hashStr(::FORMAT, "%s\nskyper\n%s", pszLogin, password);
- BYTE digest[16];
- mir_md5_hash((const BYTE*)hashStr.GetString(), hashStr.GetLength(), digest);
+ uint8_t digest[16];
+ mir_md5_hash((const uint8_t*)hashStr.GetString(), hashStr.GetLength(), digest);
this << CHAR_PARAM("scopes", "client")
<< CHAR_PARAM("clientVersion", mir_urlEncode("0/7.4.85.102/259/").c_str())
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index ff2a273ea3..0cb850f393 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -169,9 +169,9 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam) if (length != -1) {
rewind(hFile);
- mir_ptr<BYTE> data((uint8_t*)mir_alloc(length));
+ mir_ptr<uint8_t> data((uint8_t*)mir_alloc(length));
- if (data != NULL && fread(data, sizeof(BYTE), length, hFile) == length) {
+ if (data != NULL && fread(data, sizeof(uint8_t), length, hFile) == length) {
const char *szMime = FreeImage_GetFIFMimeType(FreeImage_GetFIFFromFilenameU(path));
PushRequest(new SetAvatarRequest(data, length, szMime, this));
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 886f3b6ddc..9d30f6f8a6 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -49,7 +49,7 @@ MEVENT CSkypeProto::AddDbEvent(WORD type, MCONTACT hContact, DWORD timestamp, DW dbei.timestamp = timestamp; dbei.eventType = type; dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1; - dbei.pBlob = (BYTE *)szMsg; + dbei.pBlob = (uint8_t *)szMsg; dbei.flags = flags; dbei.szId = msgId; return db_event_add(hContact, &dbei); diff --git a/protocols/SkypeWeb/src/skype_files.cpp b/protocols/SkypeWeb/src/skype_files.cpp index 4bf25eee6a..a28cc9f860 100644 --- a/protocols/SkypeWeb/src/skype_files.cpp +++ b/protocols/SkypeWeb/src/skype_files.cpp @@ -62,8 +62,8 @@ LBL_Error: fseek(pFile, 0, SEEK_SET);
- mir_ptr<BYTE> pData((BYTE*)mir_alloc(lFileLen));
- long lBytes = (long)fread(pData, sizeof(BYTE), lFileLen, pFile);
+ mir_ptr<uint8_t> pData((uint8_t*)mir_alloc(lFileLen));
+ long lBytes = (long)fread(pData, sizeof(uint8_t), lFileLen, pFile);
if (lBytes != lFileLen) {
fclose(pFile);
goto LBL_Error;
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp index 8999663680..ce025cbfa3 100644 --- a/protocols/SkypeWeb/src/skype_profile.cpp +++ b/protocols/SkypeWeb/src/skype_profile.cpp @@ -253,7 +253,7 @@ void CSkypeProto::UpdateProfileGender(const JSONNode &root, MCONTACT hContact) {
CMStringW gender = root["gender"].as_mstring();
if (!gender.IsEmpty() && gender != "null")
- setByte(hContact, "Gender", (BYTE)(_wtoi(gender) == 1 ? 'M' : 'F'));
+ setByte(hContact, "Gender", (uint8_t)(_wtoi(gender) == 1 ? 'M' : 'F'));
else
delSetting(hContact, "Gender");
}
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index c618956198..fc4682bc1b 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -319,8 +319,8 @@ int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) for (int i = 0; i < nCount; i++) cbBlob += int(/*mir_wstrlen(isrList[i]->nick.w)*/0 + 2 + mir_wstrlen(isrList[i]->id.w) + mir_strlen(szMessageId)); - BYTE *pBlob = (uint8_t*)mir_calloc(cbBlob); - BYTE *pCurBlob = pBlob; + uint8_t *pBlob = (uint8_t*)mir_calloc(cbBlob); + uint8_t *pCurBlob = pBlob; for (int i = 0; i < nCount; i++) { //mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w)); diff --git a/protocols/Steam/src/steam_crypt.cpp b/protocols/Steam/src/steam_crypt.cpp index 28cc21f6f5..dd07cb7e32 100644 --- a/protocols/Steam/src/steam_crypt.cpp +++ b/protocols/Steam/src/steam_crypt.cpp @@ -2,7 +2,7 @@ #pragma comment(lib, "crypt32.lib") -int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, BYTE *encryptedData, DWORD &encryptedSize) +int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, uint8_t *encryptedData, DWORD &encryptedSize) { DWORD cchModulus = (DWORD)mir_strlen(pszModulus); int result; @@ -18,7 +18,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char } // allocate a new buffer. - mir_ptr<BYTE> pbBuffer((BYTE *)mir_alloc(cbLen)); + mir_ptr<uint8_t> pbBuffer((uint8_t *)mir_alloc(cbLen)); if (!CryptStringToBinaryA(pszModulus, cchModulus, CRYPT_STRING_HEX, pbBuffer, &cbLen, &dwSkip, &dwFlags)) { result = GetLastError(); __leave; @@ -26,7 +26,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // reverse byte array, because of microsoft for (int i = 0; i < (int)(cbLen / 2); ++i) { - BYTE temp = pbBuffer[cbLen - i - 1]; + uint8_t temp = pbBuffer[cbLen - i - 1]; pbBuffer[cbLen - i - 1] = pbBuffer[i]; pbBuffer[i] = temp; } @@ -39,7 +39,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // Move the key into the key container. DWORD cbKeyBlob = sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY) + cbLen; - mir_ptr<BYTE> pKeyBlob((BYTE *)mir_alloc(cbKeyBlob)); + mir_ptr<uint8_t> pKeyBlob((uint8_t *)mir_alloc(cbKeyBlob)); // Fill in the data. PUBLICKEYSTRUC *pPublicKey = (PUBLICKEYSTRUC *)pKeyBlob.get(); @@ -56,7 +56,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // Copy the modulus into the blob. Put the modulus directly after the // RSAPUBKEY structure in the blob. - BYTE *pKey = (BYTE *)(((BYTE *)pRsaPubKey) + sizeof(RSAPUBKEY)); + uint8_t *pKey = (uint8_t *)(((uint8_t *)pRsaPubKey) + sizeof(RSAPUBKEY)); memcpy(pKey, pbBuffer, cbLen); // Now import public key @@ -84,7 +84,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char // reverse byte array again for (int i = 0; i < (int)(encryptedSize / 2); ++i) { - BYTE temp = encryptedData[encryptedSize - i - 1]; + uint8_t temp = encryptedData[encryptedSize - i - 1]; encryptedData[encryptedSize - i - 1] = encryptedData[i]; encryptedData[i] = temp; } diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp index 63bb9a3158..9e7e998610 100644 --- a/protocols/Steam/src/steam_login.cpp +++ b/protocols/Steam/src/steam_login.cpp @@ -73,7 +73,7 @@ void CSteamProto::OnGotRsaKey(const JSONNode &root, void *) return; } - BYTE *encryptedPassword = (BYTE *)mir_calloc(encryptedSize); + uint8_t *encryptedPassword = (uint8_t *)mir_calloc(encryptedSize); if ((error = RsaEncrypt(modulus.c_str(), exponent, szPassword, encryptedPassword, encryptedSize)) != 0) { debugLogA(__FUNCTION__ ": encryption error (%lu)", error); SetStatus(ID_STATUS_OFFLINE); diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 9b56e4787e..3b526975b5 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -107,7 +107,7 @@ void CSteamProto::ParsePollData(const JSONNode &data) if (!getBool("ShowChatEvents", true)) continue; - BYTE bEventType = STEAM_DB_EVENT_CHATSTATES_GONE; + uint8_t bEventType = STEAM_DB_EVENT_CHATSTATES_GONE; DBEVENTINFO dbei = {}; dbei.pBlob = &bEventType; dbei.cbBlob = 1; diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index aec2210c51..8e4596c8ae 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -242,7 +242,7 @@ protected: static WORD SteamToMirandaStatus(PersonaState state);
static PersonaState MirandaToSteamState(int status);
- static int RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, BYTE *encrypted, DWORD &encryptedSize);
+ static int RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, uint8_t *encrypted, DWORD &encryptedSize);
static void ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
static void ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL);
diff --git a/protocols/Tox/src/tox_connection.cpp b/protocols/Tox/src/tox_connection.cpp index 9b7c40f39d..a602bb88a9 100644 --- a/protocols/Tox/src/tox_connection.cpp +++ b/protocols/Tox/src/tox_connection.cpp @@ -58,7 +58,7 @@ void CToxProto::CheckConnection() } } -void CToxProto::OnToxCheck(void *arg, BYTE) +void CToxProto::OnToxCheck(void *arg, uint8_t) { CToxProto *proto = (CToxProto*)arg; if (proto->m_tox == nullptr) @@ -71,7 +71,7 @@ void CToxProto::OnToxCheck(void *arg, BYTE) proto->CheckConnection(); } -void CToxProto::OnToxPoll(void *arg, BYTE) +void CToxProto::OnToxPoll(void *arg, uint8_t) { CToxProto *proto = (CToxProto*)arg; if (proto->m_tox) diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index e9e858ad7e..8367c8c71f 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -111,8 +111,8 @@ private: void TryConnect();
void CheckConnection();
- static void __stdcall OnToxCheck(void*, BYTE);
- static void __stdcall OnToxPoll(void*, BYTE);
+ static void __stdcall OnToxCheck(void*, uint8_t);
+ static void __stdcall OnToxPoll(void*, uint8_t);
// accounts
int __cdecl OnAccountRenamed(WPARAM, LPARAM);
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index bcd7274d00..8cfcac110d 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -520,7 +520,7 @@ void CTwitterProto::UpdateStatuses(bool pre_read, bool popups, bool tweetToMsg) // if we send twits as messages, add an unread event
if (tweetToMsg) {
DBEVENTINFO dbei = {};
- dbei.pBlob = (BYTE*)(u->status.text.c_str());
+ dbei.pBlob = (uint8_t*)(u->status.text.c_str());
dbei.cbBlob = (int)u->status.text.length() + 1;
dbei.eventType = TWITTER_DB_EVENT_TYPE_TWEET;
dbei.flags = DBEF_UTF;
diff --git a/protocols/Twitter/src/oauth.cpp b/protocols/Twitter/src/oauth.cpp index 6f8c997359..d3af693869 100644 --- a/protocols/Twitter/src/oauth.cpp +++ b/protocols/Twitter/src/oauth.cpp @@ -155,7 +155,7 @@ CMStringA CTwitterProto::OAuthCreateSignature(const CMStringA &signatureBase, co // URL encode key elements
CMStringA key = mir_urlEncode(consumerSecret) + "&" + mir_urlEncode(requestTokenSecret);
- BYTE digest[MIR_SHA1_HASH_SIZE];
+ uint8_t digest[MIR_SHA1_HASH_SIZE];
unsigned int len;
HMAC(EVP_sha1(), key.c_str(), (int)key.GetLength(), (uint8_t*)signatureBase.c_str(), signatureBase.GetLength(), digest, &len);
return CMStringA(ptrA(mir_base64_encode(digest, sizeof(digest))));
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 6e6452ac70..be9757d681 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -78,9 +78,9 @@ char* ExpUrlEncode(const char *szUrl, bool strict) if (szUrl == nullptr)
return nullptr;
- const BYTE *s;
+ const uint8_t *s;
int outputLen;
- for (outputLen = 0, s = (const BYTE*)szUrl; *s; s++)
+ for (outputLen = 0, s = (const uint8_t*)szUrl; *s; s++)
if ((*s & 0x80 && !strict) || // UTF-8 multibyte
('0' <= *s && *s <= '9') || //0-9
('A' <= *s && *s <= 'Z') || //ABC...XYZ
@@ -95,7 +95,7 @@ char* ExpUrlEncode(const char *szUrl, bool strict) return nullptr;
char *d = szOutput;
- for (s = (const BYTE*)szUrl; *s; s++)
+ for (s = (const uint8_t*)szUrl; *s; s++)
if ((*s & 0x80 && !strict) || // UTF-8 multibyte
('0' <= *s && *s <= '9') || //0-9
('A' <= *s && *s <= 'Z') || //ABC...XYZ
@@ -1677,7 +1677,7 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap) FIMEMORY *hMem = FreeImage_OpenMemory(nullptr, 0);
FreeImage_SaveToMemory(FIF_PNG, dib, hMem, 0);
- BYTE *buf = nullptr;
+ uint8_t *buf = nullptr;
DWORD bufLen;
FreeImage_AcquireMemory(hMem, &buf, &bufLen);
ptrA base64(mir_base64_encode(buf, bufLen));
diff --git a/protocols/VKontakte/src/vk_struct.cpp b/protocols/VKontakte/src/vk_struct.cpp index 4e3a1affd0..5d99138b48 100644 --- a/protocols/VKontakte/src/vk_struct.cpp +++ b/protocols/VKontakte/src/vk_struct.cpp @@ -229,7 +229,7 @@ CVKOptions::CVKOptions(PROTO_INTERFACE* proto) : int iStikersAsSmyles = db_get_b(0, proto->m_szModuleName, "StikersAsSmyles", -1);
if (iStikersAsSmyles != -1) {
bStikersAsSmileys = iStikersAsSmyles == 1;
- db_set_b(0, proto->m_szModuleName, "StikersAsSmileys", (BYTE)iStikersAsSmyles);
+ db_set_b(0, proto->m_szModuleName, "StikersAsSmileys", (uint8_t)iStikersAsSmyles);
db_unset(0, proto->m_szModuleName, "StikersAsSmyles");
}
// Note
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h index faaf5f6fe1..de0b732404 100644 --- a/protocols/VKontakte/src/vk_struct.h +++ b/protocols/VKontakte/src/vk_struct.h @@ -188,8 +188,8 @@ struct CVKNewsItem : public MZeroedObject { bool bIsRepost;
};
-enum VKBBCType : BYTE { vkbbcB, vkbbcI, vkbbcS, vkbbcU, vkbbcCode, vkbbcImg, vkbbcUrl, vkbbcSize, vkbbcColor };
-enum BBCSupport : BYTE { bbcNo, bbcBasic, bbcAdvanced };
+enum VKBBCType : uint8_t { vkbbcB, vkbbcI, vkbbcS, vkbbcU, vkbbcCode, vkbbcImg, vkbbcUrl, vkbbcSize, vkbbcColor };
+enum BBCSupport : uint8_t { bbcNo, bbcBasic, bbcAdvanced };
struct CVKBBCItem {
VKBBCType vkBBCType;
@@ -217,10 +217,10 @@ struct CVKLang { wchar_t *szDescription;
};
-enum MarkMsgReadOn : BYTE { markOnRead, markOnReceive, markOnReply, markOnTyping };
-enum SyncHistoryMetod : BYTE { syncOff, syncAuto, sync1Days, sync3Days };
-enum MusicSendMetod : BYTE { sendNone, sendStatusOnly, sendBroadcastOnly, sendBroadcastAndStatus };
-enum IMGBBCSypport : BYTE { imgNo, imgFullSize, imgPreview130, imgPreview604 };
+enum MarkMsgReadOn : uint8_t { markOnRead, markOnReceive, markOnReply, markOnTyping };
+enum SyncHistoryMetod : uint8_t { syncOff, syncAuto, sync1Days, sync3Days };
+enum MusicSendMetod : uint8_t { sendNone, sendStatusOnly, sendBroadcastOnly, sendBroadcastAndStatus };
+enum IMGBBCSypport : uint8_t { imgNo, imgFullSize, imgPreview130, imgPreview604 };
struct CVKSync {
const wchar_t *type;
@@ -244,69 +244,69 @@ struct CVkCookie };
struct CVKOptions {
- CMOption<BYTE> bLoadLastMessageOnMsgWindowsOpen;
- CMOption<BYTE> bLoadOnlyFriends;
- CMOption<BYTE> bServerDelivery;
- CMOption<BYTE> bHideChats;
- CMOption<BYTE> bMesAsUnread;
- CMOption<BYTE> bUseLocalTime;
- CMOption<BYTE> bReportAbuse;
- CMOption<BYTE> bClearServerHistory;
- CMOption<BYTE> bRemoveFromFrendlist;
- CMOption<BYTE> bRemoveFromCList;
- CMOption<BYTE> bPopUpSyncHistory;
- CMOption<BYTE> iMarkMessageReadOn;
- CMOption<BYTE> bStikersAsSmileys;
- CMOption<BYTE> bUseStikersAsStaticSmileys;
- CMOption<BYTE> bUserForceInvisibleOnActivity;
- CMOption<BYTE> iMusicSendMetod;
- CMOption<BYTE> bPopupContactsMusic;
- CMOption<BYTE> iSyncHistoryMetod;
- CMOption<BYTE> bNewsEnabled;
- CMOption<BYTE> iMaxLoadNewsPhoto;
- CMOption<BYTE> bNotificationsEnabled;
- CMOption<BYTE> bNotificationsMarkAsViewed;
- CMOption<BYTE> bSpecialContactAlwaysEnabled;
- CMOption<BYTE> iIMGBBCSupport;
- CMOption<BYTE> iBBCForNews;
- CMOption<BYTE> iBBCForAttachments;
- CMOption<BYTE> bUseBBCOnAttacmentsAsNews;
- CMOption<BYTE> bNewsAutoClearHistory;
- CMOption<BYTE> bNewsFilterPosts;
- CMOption<BYTE> bNewsFilterPhotos;
- CMOption<BYTE> bNewsFilterTags;
- CMOption<BYTE> bNewsFilterWallPhotos;
- CMOption<BYTE> bNewsSourceFriends;
- CMOption<BYTE> bNewsSourceGroups;
- CMOption<BYTE> bNewsSourcePages;
- CMOption<BYTE> bNewsSourceFollowing;
- CMOption<BYTE> bNewsSourceIncludeBanned;
- CMOption<BYTE> bNewsSourceNoReposts;
- CMOption<BYTE> bNotificationFilterComments;
- CMOption<BYTE> bNotificationFilterLikes;
- CMOption<BYTE> bNotificationFilterReposts;
- CMOption<BYTE> bNotificationFilterMentions;
- CMOption<BYTE> bNotificationFilterInvites;
- CMOption<BYTE> bNotificationFilterAcceptedFriends;
- CMOption<BYTE> bUseNonStandardNotifications;
- CMOption<BYTE> bShortenLinksForAudio;
- CMOption<BYTE> bAddMessageLinkToMesWAtt;
- CMOption<BYTE> bSplitFormatFwdMsg;
- CMOption<BYTE> bSyncReadMessageStatusFromServer;
- CMOption<BYTE> bLoadFullCList;
- CMOption<BYTE> bSendVKLinksAsAttachments;
- CMOption<BYTE> bLoadSentAttachments;
- CMOption<BYTE> bShowVkDeactivateEvents;
- CMOption<BYTE> bStickerBackground;
- CMOption<BYTE> bFilterAudioMessages;
-
- CMOption<BYTE> bShowProtoMenuItem0;
- CMOption<BYTE> bShowProtoMenuItem1;
- CMOption<BYTE> bShowProtoMenuItem2;
- CMOption<BYTE> bShowProtoMenuItem3;
- CMOption<BYTE> bShowProtoMenuItem4;
- CMOption<BYTE> bShowProtoMenuItem5;
- CMOption<BYTE> bShowProtoMenuItem6;
+ CMOption<uint8_t> bLoadLastMessageOnMsgWindowsOpen;
+ CMOption<uint8_t> bLoadOnlyFriends;
+ CMOption<uint8_t> bServerDelivery;
+ CMOption<uint8_t> bHideChats;
+ CMOption<uint8_t> bMesAsUnread;
+ CMOption<uint8_t> bUseLocalTime;
+ CMOption<uint8_t> bReportAbuse;
+ CMOption<uint8_t> bClearServerHistory;
+ CMOption<uint8_t> bRemoveFromFrendlist;
+ CMOption<uint8_t> bRemoveFromCList;
+ CMOption<uint8_t> bPopUpSyncHistory;
+ CMOption<uint8_t> iMarkMessageReadOn;
+ CMOption<uint8_t> bStikersAsSmileys;
+ CMOption<uint8_t> bUseStikersAsStaticSmileys;
+ CMOption<uint8_t> bUserForceInvisibleOnActivity;
+ CMOption<uint8_t> iMusicSendMetod;
+ CMOption<uint8_t> bPopupContactsMusic;
+ CMOption<uint8_t> iSyncHistoryMetod;
+ CMOption<uint8_t> bNewsEnabled;
+ CMOption<uint8_t> iMaxLoadNewsPhoto;
+ CMOption<uint8_t> bNotificationsEnabled;
+ CMOption<uint8_t> bNotificationsMarkAsViewed;
+ CMOption<uint8_t> bSpecialContactAlwaysEnabled;
+ CMOption<uint8_t> iIMGBBCSupport;
+ CMOption<uint8_t> iBBCForNews;
+ CMOption<uint8_t> iBBCForAttachments;
+ CMOption<uint8_t> bUseBBCOnAttacmentsAsNews;
+ CMOption<uint8_t> bNewsAutoClearHistory;
+ CMOption<uint8_t> bNewsFilterPosts;
+ CMOption<uint8_t> bNewsFilterPhotos;
+ CMOption<uint8_t> bNewsFilterTags;
+ CMOption<uint8_t> bNewsFilterWallPhotos;
+ CMOption<uint8_t> bNewsSourceFriends;
+ CMOption<uint8_t> bNewsSourceGroups;
+ CMOption<uint8_t> bNewsSourcePages;
+ CMOption<uint8_t> bNewsSourceFollowing;
+ CMOption<uint8_t> bNewsSourceIncludeBanned;
+ CMOption<uint8_t> bNewsSourceNoReposts;
+ CMOption<uint8_t> bNotificationFilterComments;
+ CMOption<uint8_t> bNotificationFilterLikes;
+ CMOption<uint8_t> bNotificationFilterReposts;
+ CMOption<uint8_t> bNotificationFilterMentions;
+ CMOption<uint8_t> bNotificationFilterInvites;
+ CMOption<uint8_t> bNotificationFilterAcceptedFriends;
+ CMOption<uint8_t> bUseNonStandardNotifications;
+ CMOption<uint8_t> bShortenLinksForAudio;
+ CMOption<uint8_t> bAddMessageLinkToMesWAtt;
+ CMOption<uint8_t> bSplitFormatFwdMsg;
+ CMOption<uint8_t> bSyncReadMessageStatusFromServer;
+ CMOption<uint8_t> bLoadFullCList;
+ CMOption<uint8_t> bSendVKLinksAsAttachments;
+ CMOption<uint8_t> bLoadSentAttachments;
+ CMOption<uint8_t> bShowVkDeactivateEvents;
+ CMOption<uint8_t> bStickerBackground;
+ CMOption<uint8_t> bFilterAudioMessages;
+
+ CMOption<uint8_t> bShowProtoMenuItem0;
+ CMOption<uint8_t> bShowProtoMenuItem1;
+ CMOption<uint8_t> bShowProtoMenuItem2;
+ CMOption<uint8_t> bShowProtoMenuItem3;
+ CMOption<uint8_t> bShowProtoMenuItem4;
+ CMOption<uint8_t> bShowProtoMenuItem5;
+ CMOption<uint8_t> bShowProtoMenuItem6;
CMOption<DWORD> iReqAuthTimeLater;
CMOption<DWORD> iNewsInterval;
@@ -321,8 +321,8 @@ struct CVKOptions { CVKOptions(PROTO_INTERFACE *proto);
- __forceinline BBCSupport BBCForNews() { return (BBCSupport)(BYTE)iBBCForNews; };
- __forceinline BBCSupport BBCForAttachments() { return (BBCSupport)(BYTE)iBBCForAttachments; };
+ __forceinline BBCSupport BBCForNews() { return (BBCSupport)(uint8_t)iBBCForNews; };
+ __forceinline BBCSupport BBCForAttachments() { return (BBCSupport)(uint8_t)iBBCForAttachments; };
};
@@ -331,8 +331,8 @@ struct CVKDeactivateEvent { char *szDescription;
};
-enum VKContactType : BYTE { vkContactNormal, vkContactSelf, vkContactMUCUser };
-enum VKMesType : BYTE { vkALL, vkIN, vkOUT };
+enum VKContactType : uint8_t { vkContactNormal, vkContactSelf, vkContactMUCUser };
+enum VKMesType : uint8_t { vkALL, vkIN, vkOUT };
struct CVKImageSizeItem {
CMStringW wszUrl;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 02c8acad13..7d6f93550b 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -579,7 +579,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, VKContactTy }
// MaritalStatus
- BYTE cMaritalStatus[] = { 0, 10, 11, 12, 20, 70, 50, 60, 80 };
+ uint8_t cMaritalStatus[] = { 0, 10, 11, 12, 20, 70, 50, 60, 80 };
if (jnItem["relation"] && jnItem["relation"].as_int() < _countof(cMaritalStatus))
setByte(hContact, "MaritalStatus", cMaritalStatus[jnItem["relation"].as_int()]);
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index 5d358de96b..bb8f288541 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -179,13 +179,13 @@ enum EWeatherCondition struct MYOPTIONS { // main options - BYTE AutoUpdate; - BYTE CAutoUpdate; - BYTE StartupUpdate; - BYTE NoProtoCondition; - BYTE UpdateOnlyConditionChanged; - BYTE RemoveOldData; - BYTE MakeItalic; + uint8_t AutoUpdate; + uint8_t CAutoUpdate; + uint8_t StartupUpdate; + uint8_t NoProtoCondition; + uint8_t UpdateOnlyConditionChanged; + uint8_t RemoveOldData; + uint8_t MakeItalic; WORD UpdateTime; WORD AvatarSize; @@ -198,21 +198,21 @@ struct MYOPTIONS WORD dUnit; WORD eUnit; wchar_t DegreeSign[4]; - BYTE DoNotAppendUnit; - BYTE NoFrac; + uint8_t DoNotAppendUnit; + uint8_t NoFrac; // advanced - BYTE DisCondIcon; + uint8_t DisCondIcon; // popup options - BYTE UsePopup; - BYTE UpdatePopup; - BYTE AlertPopup; - BYTE PopupOnChange; - BYTE ShowWarnings; + uint8_t UsePopup; + uint8_t UpdatePopup; + uint8_t AlertPopup; + uint8_t PopupOnChange; + uint8_t ShowWarnings; // popup colors - BYTE UseWinColors; + uint8_t UseWinColors; COLORREF BGColour; COLORREF TextColour; diff --git a/protocols/Weather/src/weather_contacts.cpp b/protocols/Weather/src/weather_contacts.cpp index 559238410b..2833521275 100644 --- a/protocols/Weather/src/weather_contacts.cpp +++ b/protocols/Weather/src/weather_contacts.cpp @@ -175,7 +175,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA db_free(&dbv); } // enable/disable the browse button depending on the value of external log checkbox - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)); // other checkbox options CheckDlgButton(hwndDlg, IDC_DPop, g_plugin.getByte(hContact, "DPopUp", FALSE) ? BST_CHECKED : BST_UNCHECKED); @@ -256,8 +256,8 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_External: // enable/disable the borwse button depending if the external log is enabled - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); - if (!(BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)); + if (!(uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)) return TRUE; __fallthrough; @@ -333,7 +333,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // start writing the new settings to database GetDlgItemText(hwndDlg, IDC_ID, str, _countof(str)); g_plugin.setWString(hContact, "ID", str); - if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set + if ((uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DEFA)) { // if default station is set mir_wstrcpy(opt.Default, str); opt.DefStn = hContact; g_plugin.setWString("Default", opt.Default); @@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city)); g_plugin.setWString(hContact, "Nick", city); mir_snwprintf(str2, TranslateT("Current weather information for %s."), city); - if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) { + if ((uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)) { GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str)); g_plugin.setWString(hContact, "Log", str); } @@ -356,11 +356,11 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA g_plugin.setWord(hContact, "StatusIcon", -1); AvatarDownloaded(hContact); g_plugin.setWString(hContact, "About", str2); - g_plugin.setByte(hContact, "History", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Internal)); - g_plugin.setByte(hContact, "Overwrite", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_Overwrite)); - g_plugin.setByte(hContact, "File", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)); - g_plugin.setByte(hContact, "DPopUp", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DPop)); - g_plugin.setByte(hContact, "DAutoUpdate", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DAutoUpdate)); + g_plugin.setByte(hContact, "History", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_Internal)); + g_plugin.setByte(hContact, "Overwrite", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_Overwrite)); + g_plugin.setByte(hContact, "File", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_External)); + g_plugin.setByte(hContact, "DPopUp", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DPop)); + g_plugin.setByte(hContact, "DAutoUpdate", (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DAutoUpdate)); // re-enable the protocol and update the data for the station g_plugin.setString(hContact, "LastCondition", "None"); diff --git a/protocols/Weather/src/weather_data.cpp b/protocols/Weather/src/weather_data.cpp index fe668dbfe8..69c92d8cda 100644 --- a/protocols/Weather/src/weather_data.cpp +++ b/protocols/Weather/src/weather_data.cpp @@ -129,7 +129,7 @@ void EraseAllInfo() g_plugin.setByte(hContact, "IsUpdated", FALSE); // reset logging settings if (!g_plugin.getWString(hContact, "Log", &dbv)) { - g_plugin.setByte(hContact, "File", (BYTE)(dbv.pwszVal[0] != 0)); + g_plugin.setByte(hContact, "File", (uint8_t)(dbv.pwszVal[0] != 0)); db_free(&dbv); } else g_plugin.setByte(hContact, "File", FALSE); diff --git a/protocols/Weather/src/weather_opt.cpp b/protocols/Weather/src/weather_opt.cpp index 19173b430b..3a8d7f26dd 100644 --- a/protocols/Weather/src/weather_opt.cpp +++ b/protocols/Weather/src/weather_opt.cpp @@ -137,14 +137,14 @@ void LoadOptions(void) void SaveOptions(void) { // main options - g_plugin.setByte("StartupUpdate", (BYTE)opt.StartupUpdate); - g_plugin.setByte("AutoUpdate", (BYTE)opt.AutoUpdate); + g_plugin.setByte("StartupUpdate", (uint8_t)opt.StartupUpdate); + g_plugin.setByte("AutoUpdate", (uint8_t)opt.AutoUpdate); g_plugin.setWord("UpdateTime", opt.UpdateTime); - g_plugin.setByte("NoStatus", (BYTE)opt.NoProtoCondition); - g_plugin.setByte("CondChangeAsUpdate", (BYTE)opt.UpdateOnlyConditionChanged); - g_plugin.setByte("RemoveOld", (BYTE)opt.RemoveOldData); - g_plugin.setByte("MakeItalic", (BYTE)opt.MakeItalic); - g_plugin.setByte("AvatarSize", (BYTE)opt.AvatarSize); + g_plugin.setByte("NoStatus", (uint8_t)opt.NoProtoCondition); + g_plugin.setByte("CondChangeAsUpdate", (uint8_t)opt.UpdateOnlyConditionChanged); + g_plugin.setByte("RemoveOld", (uint8_t)opt.RemoveOldData); + g_plugin.setByte("MakeItalic", (uint8_t)opt.MakeItalic); + g_plugin.setByte("AvatarSize", (uint8_t)opt.AvatarSize); // units g_plugin.setWord("tUnit", opt.tUnit); @@ -154,23 +154,23 @@ void SaveOptions(void) g_plugin.setWord("dUnit", opt.dUnit); g_plugin.setWord("eUnit", opt.eUnit); g_plugin.setWString("DegreeSign", opt.DegreeSign); - g_plugin.setByte("DoNotAppendUnit", (BYTE)opt.DoNotAppendUnit); - g_plugin.setByte("NoFractions", (BYTE)opt.NoFrac); + g_plugin.setByte("DoNotAppendUnit", (uint8_t)opt.DoNotAppendUnit); + g_plugin.setByte("NoFractions", (uint8_t)opt.NoFrac); // advanced - g_plugin.setByte("DisableConditionIcon", (BYTE)opt.DisCondIcon); + g_plugin.setByte("DisableConditionIcon", (uint8_t)opt.DisCondIcon); // popup options - g_plugin.setByte("UsePopUp", (BYTE)opt.UsePopup); - g_plugin.setByte("UpdatePopup", (BYTE)opt.UpdatePopup); - g_plugin.setByte("AlertPopup", (BYTE)opt.AlertPopup); - g_plugin.setByte("PopUpOnChange", (BYTE)opt.PopupOnChange); - g_plugin.setByte("ShowWarnings", (BYTE)opt.ShowWarnings); + g_plugin.setByte("UsePopUp", (uint8_t)opt.UsePopup); + g_plugin.setByte("UpdatePopup", (uint8_t)opt.UpdatePopup); + g_plugin.setByte("AlertPopup", (uint8_t)opt.AlertPopup); + g_plugin.setByte("PopUpOnChange", (uint8_t)opt.PopupOnChange); + g_plugin.setByte("ShowWarnings", (uint8_t)opt.ShowWarnings); // popup colors g_plugin.setDword("BackgroundColour", opt.BGColour); g_plugin.setDword("TextColour", opt.TextColour); - g_plugin.setByte("UseWinColors", (BYTE)opt.UseWinColors); + g_plugin.setByte("UseWinColors", (uint8_t)opt.UseWinColors); // popup actions g_plugin.setDword("LeftClickAction", opt.LeftClickAction); @@ -279,7 +279,7 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l opt.AutoUpdate = IsDlgButtonChecked(hdlg, IDC_UPDATE); opt.NoProtoCondition = BST_UNCHECKED == IsDlgButtonChecked(hdlg, IDC_PROTOCOND); opt.DisCondIcon = IsDlgButtonChecked(hdlg, IDC_DISCONDICON); - opt.UpdateOnlyConditionChanged = (BYTE)IsDlgButtonChecked(hdlg, IDC_UPDCONDCHG); + opt.UpdateOnlyConditionChanged = (uint8_t)IsDlgButtonChecked(hdlg, IDC_UPDCONDCHG); opt.RemoveOldData = IsDlgButtonChecked(hdlg, IDC_REMOVEOLD); opt.MakeItalic = IsDlgButtonChecked(hdlg, IDC_MAKEI); opt.AvatarSize = GetDlgItemInt(hdlg, IDC_AVATARSIZE, nullptr, FALSE); diff --git a/protocols/Weather/src/weather_popup.cpp b/protocols/Weather/src/weather_popup.cpp index 1ad47de9fd..94ed3508a4 100644 --- a/protocols/Weather/src/weather_popup.cpp +++ b/protocols/Weather/src/weather_popup.cpp @@ -234,12 +234,12 @@ void ReadPopupOpt(HWND hdlg) opt.pDelay = num; // other options - opt.UseWinColors = (BYTE)IsDlgButtonChecked(hdlg, IDC_USEWINCOLORS); - opt.UsePopup = (BYTE)IsDlgButtonChecked(hdlg, IDC_E); - opt.UpdatePopup = (BYTE)IsDlgButtonChecked(hdlg, IDC_POP1); - opt.AlertPopup = (BYTE)IsDlgButtonChecked(hdlg, IDC_POP2); - opt.PopupOnChange = (BYTE)IsDlgButtonChecked(hdlg, IDC_CH); - opt.ShowWarnings = (BYTE)IsDlgButtonChecked(hdlg, IDC_W); + opt.UseWinColors = (uint8_t)IsDlgButtonChecked(hdlg, IDC_USEWINCOLORS); + opt.UsePopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_E); + opt.UpdatePopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP1); + opt.AlertPopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP2); + opt.PopupOnChange = (uint8_t)IsDlgButtonChecked(hdlg, IDC_CH); + opt.ShowWarnings = (uint8_t)IsDlgButtonChecked(hdlg, IDC_W); } // copied and modified from NewStatusNotify diff --git a/protocols/Weather/src/weather_svcs.cpp b/protocols/Weather/src/weather_svcs.cpp index 2d143d5172..113669d968 100644 --- a/protocols/Weather/src/weather_svcs.cpp +++ b/protocols/Weather/src/weather_svcs.cpp @@ -288,7 +288,7 @@ void UpdateMenu(BOOL State) { // update option setting opt.CAutoUpdate = State; - g_plugin.setByte("AutoUpdate", (BYTE)State); + g_plugin.setByte("AutoUpdate", (uint8_t)State); if (State) { // to enable auto-update Menu_ModifyItem(hEnableDisableMenu, LPGENW("Auto Update Enabled"), g_plugin.getIconHandle(IDI_ICON)); @@ -306,7 +306,7 @@ void UpdatePopupMenu(BOOL State) { // update option setting opt.UsePopup = State; - g_plugin.setByte("UsePopup", (BYTE)opt.UsePopup); + g_plugin.setByte("UsePopup", (uint8_t)opt.UsePopup); if (State) // to enable popup Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &weather notification"), g_plugin.getIconHandle(IDI_POPUP)); diff --git a/protocols/WebView/src/webview.cpp b/protocols/WebView/src/webview.cpp index f32d3defe9..58b8e780b0 100644 --- a/protocols/WebView/src/webview.cpp +++ b/protocols/WebView/src/webview.cpp @@ -247,7 +247,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb else mir_wstrcpy(cfFM.szFaceName, Def_font_face); HDC hDC = GetDC(hWindow); - cfFM.yHeight = (BYTE)MulDiv(abs(g_lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (g_plugin.getByte(FONT_SIZE_KEY, 14)); + cfFM.yHeight = (uint8_t)MulDiv(abs(g_lf.lfHeight), 120, GetDeviceCaps(GetDC(hWindow), LOGPIXELSY)) * (g_plugin.getByte(FONT_SIZE_KEY, 14)); ReleaseDC(hWindow, hDC); cfFM.bCharSet = g_plugin.getByte(FONT_SCRIPT_KEY, 0); diff --git a/protocols/WebView/src/webview_opts.cpp b/protocols/WebView/src/webview_opts.cpp index ebd445b6ac..923b45142c 100644 --- a/protocols/WebView/src/webview_opts.cpp +++ b/protocols/WebView/src/webview_opts.cpp @@ -103,21 +103,21 @@ static INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM case IDC_POP_USESAMECOLORS: // use same color as data window - enable/disable color selection // controls - EnableWindow(GetDlgItem(hdlg, IDC_POP_BGCOLOUR), !((BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USESAMECOLORS))); - EnableWindow(GetDlgItem(hdlg, IDC_POP_TEXTCOLOUR), !((BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USESAMECOLORS))); + EnableWindow(GetDlgItem(hdlg, IDC_POP_BGCOLOUR), !((uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USESAMECOLORS))); + EnableWindow(GetDlgItem(hdlg, IDC_POP_TEXTCOLOUR), !((uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USESAMECOLORS))); SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); break; case IDC_POP_USEWINCOLORS: // use window color - enable/disable color selection controls - EnableWindow(GetDlgItem(hdlg, IDC_POP_BGCOLOUR), !((BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USEWINCOLORS))); - EnableWindow(GetDlgItem(hdlg, IDC_POP_TEXTCOLOUR), !((BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USEWINCOLORS))); + EnableWindow(GetDlgItem(hdlg, IDC_POP_BGCOLOUR), !((uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USEWINCOLORS))); + EnableWindow(GetDlgItem(hdlg, IDC_POP_TEXTCOLOUR), !((uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USEWINCOLORS))); SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); break; case IDC_POP_USECUSTCOLORS: - EnableWindow(GetDlgItem(hdlg, IDC_POP_BGCOLOUR), ((BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USECUSTCOLORS))); - EnableWindow(GetDlgItem(hdlg, IDC_POP_TEXTCOLOUR), ((BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USECUSTCOLORS))); + EnableWindow(GetDlgItem(hdlg, IDC_POP_BGCOLOUR), ((uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USECUSTCOLORS))); + EnableWindow(GetDlgItem(hdlg, IDC_POP_TEXTCOLOUR), ((uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USECUSTCOLORS))); break; case IDC_PD1: @@ -178,17 +178,17 @@ static INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM popupdelayval = _wtol(str2); g_plugin.setDword(POP_DELAY_KEY, popupdelayval); - g_plugin.setByte(LCLK_WINDOW_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_LCLK_WINDOW)); - g_plugin.setByte(LCLK_WEB_PGE_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_LCLK_WEB_PGE)); - g_plugin.setByte(LCLK_DISMISS_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_LCLK_DISMISS)); + g_plugin.setByte(LCLK_WINDOW_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_LCLK_WINDOW)); + g_plugin.setByte(LCLK_WEB_PGE_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_LCLK_WEB_PGE)); + g_plugin.setByte(LCLK_DISMISS_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_LCLK_DISMISS)); - g_plugin.setByte(RCLK_WINDOW_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_RCLK_WINDOW)); - g_plugin.setByte(RCLK_WEB_PGE_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_RCLK_WEB_PGE)); - g_plugin.setByte(RCLK_DISMISS_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_RCLK_DISMISS)); + g_plugin.setByte(RCLK_WINDOW_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_RCLK_WINDOW)); + g_plugin.setByte(RCLK_WEB_PGE_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_RCLK_WEB_PGE)); + g_plugin.setByte(RCLK_DISMISS_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_RCLK_DISMISS)); - g_plugin.setByte(POP_USECUSTCLRS_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USECUSTCOLORS)); - g_plugin.setByte(POP_USEWINCLRS_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USEWINCOLORS)); - g_plugin.setByte(POP_USESAMECLRS_KEY, (BYTE)IsDlgButtonChecked(hdlg, IDC_POP_USESAMECOLORS)); + g_plugin.setByte(POP_USECUSTCLRS_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USECUSTCOLORS)); + g_plugin.setByte(POP_USEWINCLRS_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USEWINCOLORS)); + g_plugin.setByte(POP_USESAMECLRS_KEY, (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP_USESAMECOLORS)); BGColour = (SendDlgItemMessage(hdlg, IDC_POP_BGCOLOUR, CPM_GETCOLOUR, 0, 0)); TextColour = (SendDlgItemMessage(hdlg, IDC_POP_TEXTCOLOUR, CPM_GETCOLOUR, 0, 0)); @@ -304,7 +304,7 @@ static INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontScriptsProc, (LPARAM)GetDlgItem(hwndDlg, IDC_SCRIPT), 0); ReleaseDC(hwndDlg, hdc); for (i = SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCOUNT, 0, 0) - 1; i >= 0; i--) { - if (SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, i, 0) == (BYTE)((g_plugin.getByte(FONT_SCRIPT_KEY, 0)))) { + if (SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, i, 0) == (uint8_t)((g_plugin.getByte(FONT_SCRIPT_KEY, 0)))) { SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_SETCURSEL, i, 0); break; } @@ -383,26 +383,26 @@ static INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - g_plugin.setByte(SUPPRESS_ERR_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SUPPRESS)); - g_plugin.setByte(UPDATE_ONSTART_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UPDATE_ONSTART)); - g_plugin.setByte(UPDATE_ON_OPEN_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UPDATE_ON_OPEN)); - g_plugin.setByte(HIDE_STATUS_ICON_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDE_STATUS_ICON)); - g_plugin.setByte(FONT_BOLD_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FONT_BOLD)); - g_plugin.setByte(FONT_ITALIC_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FONT_ITALIC)); - g_plugin.setByte(FONT_UNDERLINE_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FONT_UNDERLINE)); - g_plugin.setByte(UPDATE_ONALERT_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UPDATE_ONALERT)); - g_plugin.setByte(SAVE_INDIVID_POS_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVE_INDIVID_POS)); - g_plugin.setByte(NO_PROTECT_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NO_PROTECT)); - g_plugin.setByte(DATA_POPUP_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DATAPOPUP)); + g_plugin.setByte(SUPPRESS_ERR_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SUPPRESS)); + g_plugin.setByte(UPDATE_ONSTART_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_UPDATE_ONSTART)); + g_plugin.setByte(UPDATE_ON_OPEN_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_UPDATE_ON_OPEN)); + g_plugin.setByte(HIDE_STATUS_ICON_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_HIDE_STATUS_ICON)); + g_plugin.setByte(FONT_BOLD_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FONT_BOLD)); + g_plugin.setByte(FONT_ITALIC_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FONT_ITALIC)); + g_plugin.setByte(FONT_UNDERLINE_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_FONT_UNDERLINE)); + g_plugin.setByte(UPDATE_ONALERT_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_UPDATE_ONALERT)); + g_plugin.setByte(SAVE_INDIVID_POS_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SAVE_INDIVID_POS)); + g_plugin.setByte(NO_PROTECT_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_NO_PROTECT)); + g_plugin.setByte(DATA_POPUP_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DATAPOPUP)); wchar_t str[100]; GetDlgItemText(hwndDlg, IDC_TYPEFACE, str, _countof(str)); g_plugin.setWString(FONT_FACE_KEY, str); g_plugin.setByte(FONT_SIZE_KEY, (GetDlgItemInt(hwndDlg, IDC_FONTSIZE, nullptr, FALSE))); - g_plugin.setByte(FONT_SCRIPT_KEY, ((BYTE)SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCURSEL, 0, 0), 0))); + g_plugin.setByte(FONT_SCRIPT_KEY, ((uint8_t)SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCURSEL, 0, 0), 0))); - g_plugin.setByte(ERROR_POPUP_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ERROR_POPUP)); + g_plugin.setByte(ERROR_POPUP_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ERROR_POPUP)); timerval = GetDlgItemInt(hwndDlg, IDC_TIME, nullptr, FALSE); g_plugin.setDword(REFRESH_KEY, timerval); diff --git a/protocols/WebView/src/webview_ui.cpp b/protocols/WebView/src/webview_ui.cpp index cf0f00b4fb..a60057d8a5 100644 --- a/protocols/WebView/src/webview_ui.cpp +++ b/protocols/WebView/src/webview_ui.cpp @@ -520,10 +520,10 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l eventIndex = g_plugin.getByte(hContact, EVNT_INDEX_KEY, 0); alertIndex = g_plugin.getByte(hContact, ALRT_INDEX_KEY, 0); - g_plugin.setByte(hContact, ENABLE_ALERTS_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)); - g_plugin.setByte(hContact, APND_DATE_NAME_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ADD_DATE_NAME)); - g_plugin.setByte(hContact, USE_24_HOUR_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_24_HOUR)); - g_plugin.setByte(hContact, ALWAYS_LOG_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_LOG)); + g_plugin.setByte(hContact, ENABLE_ALERTS_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)); + g_plugin.setByte(hContact, APND_DATE_NAME_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ADD_DATE_NAME)); + g_plugin.setByte(hContact, USE_24_HOUR_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_24_HOUR)); + g_plugin.setByte(hContact, ALWAYS_LOG_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_LOG)); //if alerts is unticked delete the cache if (!(IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS))) @@ -566,8 +566,8 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l GetDlgItemText(hwndDlg, IDC_FILENAME, buf, _countof(buf)); g_plugin.setWString(hContact, FILE_KEY, buf); - g_plugin.setByte(hContact, APPEND_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_APPEND)); - g_plugin.setByte(hContact, SAVE_AS_RAW_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVE_AS_RAW)); + g_plugin.setByte(hContact, APPEND_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_APPEND)); + g_plugin.setByte(hContact, SAVE_AS_RAW_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_SAVE_AS_RAW)); GetDlgItemText(hwndDlg, IDC_ALERT_STRING, buf, _countof(buf)); g_plugin.setWString(hContact, ALERT_STRING_KEY, buf); @@ -578,7 +578,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l GetDlgItemText(hwndDlg, IDC_END2, buf, _countof(buf)); g_plugin.setWString(hContact, ALRT_E_STRING_KEY, buf); - g_plugin.setByte(hContact, CONTACT_PREFIX_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PREFIX)); + g_plugin.setByte(hContact, CONTACT_PREFIX_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_PREFIX)); EnableWindow(GetDlgItem(hwndDlg, IDC_ALERT_APPLY), 0); @@ -825,11 +825,11 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM GetDlgItemText(hwndDlg, IDC_SITE_NAME, str, _countof(str)); db_set_ws(hContact, "CList", "MyHandle", str); - g_plugin.setByte(hContact, DBLE_WIN_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DBLE_WIN)); - g_plugin.setByte(hContact, U_ALLSITE_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_U_ALLSITE)); + g_plugin.setByte(hContact, DBLE_WIN_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_DBLE_WIN)); + g_plugin.setByte(hContact, U_ALLSITE_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_U_ALLSITE)); - g_plugin.setByte(hContact, CLEAR_DISPLAY_KEY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLEAN)); - g_plugin.setByte(hContact, RWSPACE_KEY, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_GETPOS, 0, 0))); + g_plugin.setByte(hContact, CLEAR_DISPLAY_KEY, (uint8_t)IsDlgButtonChecked(hwndDlg, IDC_CLEAN)); + g_plugin.setByte(hContact, RWSPACE_KEY, (uint8_t)(SendDlgItemMessage(hwndDlg, IDC_RWSPACE, TBM_GETPOS, 0, 0))); SetDlgItemText(ParentHwnd, IDC_OPEN_URL, FixButtonText(url, _countof(url))); diff --git a/protocols/YAMN/src/mails/mime.cpp b/protocols/YAMN/src/mails/mime.cpp index 37afafc2d7..54f8e66943 100644 --- a/protocols/YAMN/src/mails/mime.cpp +++ b/protocols/YAMN/src/mails/mime.cpp @@ -478,7 +478,7 @@ struct APartDataType char *ContType; int CodePage; char *TransEnc; - BYTE TransEncType; //TE_something + uint8_t TransEncType; //TE_something char *body; int bodyLen; wchar_t *wBody; |