summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 16:39:04 +0300
commit62a186697df33c96dc1a6dac0f4dfc38652fb96f (patch)
tree1437d0906218fae8827aed384026f2b7e656f4ac /protocols/VKontakte/src
parentfcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff)
BYTE -> uint8_t
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/misc.cpp8
-rw-r--r--protocols/VKontakte/src/vk_struct.cpp2
-rw-r--r--protocols/VKontakte/src/vk_struct.h146
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp2
4 files changed, 79 insertions, 79 deletions
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()]);