diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 16:39:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 16:39:04 +0300 |
commit | 62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch) | |
tree | 1437d0906218fae8827aed384026f2b7e656f4ac /protocols/Gadu-Gadu/src | |
parent | fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff) |
BYTE -> uint8_t
Diffstat (limited to 'protocols/Gadu-Gadu/src')
-rw-r--r-- | protocols/Gadu-Gadu/src/avatar.cpp | 6 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/dialogs.cpp | 18 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/image.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/oauth.cpp | 8 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/options.h | 16 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/services.cpp | 2 |
8 files changed, 30 insertions, 30 deletions
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));
|