From 62a186697df33c96dc1a6dac0f4dfc38652fb96f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 16:39:04 +0300 Subject: BYTE -> uint8_t --- protocols/Gadu-Gadu/src/avatar.cpp | 6 +++--- protocols/Gadu-Gadu/src/core.cpp | 4 ++-- protocols/Gadu-Gadu/src/dialogs.cpp | 18 +++++++++--------- protocols/Gadu-Gadu/src/gg_proto.cpp | 2 +- protocols/Gadu-Gadu/src/image.cpp | 4 ++-- protocols/Gadu-Gadu/src/oauth.cpp | 8 ++++---- protocols/Gadu-Gadu/src/options.h | 16 ++++++++-------- protocols/Gadu-Gadu/src/services.cpp | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) (limited to 'protocols/Gadu-Gadu/src') 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 ¶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 autoRecconect; - CMOption keepConnectionAlive; - CMOption showConnectionErrors; - CMOption useDirectConnections; - CMOption useForwarding; - CMOption useManualHosts; - CMOption useMsgDeliveryAcknowledge; - CMOption useSslConnection; + CMOption autoRecconect; + CMOption keepConnectionAlive; + CMOption showConnectionErrors; + CMOption useDirectConnections; + CMOption useForwarding; + CMOption useManualHosts; + CMOption useMsgDeliveryAcknowledge; + CMOption useSslConnection; CMOption directConnectionPort; CMOption 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)); -- cgit v1.2.3