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/VKontakte/src/misc.cpp | 8 +- protocols/VKontakte/src/vk_struct.cpp | 2 +- protocols/VKontakte/src/vk_struct.h | 146 +++++++++++++++++----------------- protocols/VKontakte/src/vk_thread.cpp | 2 +- 4 files changed, 79 insertions(+), 79 deletions(-) (limited to 'protocols/VKontakte/src') 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 bLoadLastMessageOnMsgWindowsOpen; - CMOption bLoadOnlyFriends; - CMOption bServerDelivery; - CMOption bHideChats; - CMOption bMesAsUnread; - CMOption bUseLocalTime; - CMOption bReportAbuse; - CMOption bClearServerHistory; - CMOption bRemoveFromFrendlist; - CMOption bRemoveFromCList; - CMOption bPopUpSyncHistory; - CMOption iMarkMessageReadOn; - CMOption bStikersAsSmileys; - CMOption bUseStikersAsStaticSmileys; - CMOption bUserForceInvisibleOnActivity; - CMOption iMusicSendMetod; - CMOption bPopupContactsMusic; - CMOption iSyncHistoryMetod; - CMOption bNewsEnabled; - CMOption iMaxLoadNewsPhoto; - CMOption bNotificationsEnabled; - CMOption bNotificationsMarkAsViewed; - CMOption bSpecialContactAlwaysEnabled; - CMOption iIMGBBCSupport; - CMOption iBBCForNews; - CMOption iBBCForAttachments; - CMOption bUseBBCOnAttacmentsAsNews; - CMOption bNewsAutoClearHistory; - CMOption bNewsFilterPosts; - CMOption bNewsFilterPhotos; - CMOption bNewsFilterTags; - CMOption bNewsFilterWallPhotos; - CMOption bNewsSourceFriends; - CMOption bNewsSourceGroups; - CMOption bNewsSourcePages; - CMOption bNewsSourceFollowing; - CMOption bNewsSourceIncludeBanned; - CMOption bNewsSourceNoReposts; - CMOption bNotificationFilterComments; - CMOption bNotificationFilterLikes; - CMOption bNotificationFilterReposts; - CMOption bNotificationFilterMentions; - CMOption bNotificationFilterInvites; - CMOption bNotificationFilterAcceptedFriends; - CMOption bUseNonStandardNotifications; - CMOption bShortenLinksForAudio; - CMOption bAddMessageLinkToMesWAtt; - CMOption bSplitFormatFwdMsg; - CMOption bSyncReadMessageStatusFromServer; - CMOption bLoadFullCList; - CMOption bSendVKLinksAsAttachments; - CMOption bLoadSentAttachments; - CMOption bShowVkDeactivateEvents; - CMOption bStickerBackground; - CMOption bFilterAudioMessages; - - CMOption bShowProtoMenuItem0; - CMOption bShowProtoMenuItem1; - CMOption bShowProtoMenuItem2; - CMOption bShowProtoMenuItem3; - CMOption bShowProtoMenuItem4; - CMOption bShowProtoMenuItem5; - CMOption bShowProtoMenuItem6; + CMOption bLoadLastMessageOnMsgWindowsOpen; + CMOption bLoadOnlyFriends; + CMOption bServerDelivery; + CMOption bHideChats; + CMOption bMesAsUnread; + CMOption bUseLocalTime; + CMOption bReportAbuse; + CMOption bClearServerHistory; + CMOption bRemoveFromFrendlist; + CMOption bRemoveFromCList; + CMOption bPopUpSyncHistory; + CMOption iMarkMessageReadOn; + CMOption bStikersAsSmileys; + CMOption bUseStikersAsStaticSmileys; + CMOption bUserForceInvisibleOnActivity; + CMOption iMusicSendMetod; + CMOption bPopupContactsMusic; + CMOption iSyncHistoryMetod; + CMOption bNewsEnabled; + CMOption iMaxLoadNewsPhoto; + CMOption bNotificationsEnabled; + CMOption bNotificationsMarkAsViewed; + CMOption bSpecialContactAlwaysEnabled; + CMOption iIMGBBCSupport; + CMOption iBBCForNews; + CMOption iBBCForAttachments; + CMOption bUseBBCOnAttacmentsAsNews; + CMOption bNewsAutoClearHistory; + CMOption bNewsFilterPosts; + CMOption bNewsFilterPhotos; + CMOption bNewsFilterTags; + CMOption bNewsFilterWallPhotos; + CMOption bNewsSourceFriends; + CMOption bNewsSourceGroups; + CMOption bNewsSourcePages; + CMOption bNewsSourceFollowing; + CMOption bNewsSourceIncludeBanned; + CMOption bNewsSourceNoReposts; + CMOption bNotificationFilterComments; + CMOption bNotificationFilterLikes; + CMOption bNotificationFilterReposts; + CMOption bNotificationFilterMentions; + CMOption bNotificationFilterInvites; + CMOption bNotificationFilterAcceptedFriends; + CMOption bUseNonStandardNotifications; + CMOption bShortenLinksForAudio; + CMOption bAddMessageLinkToMesWAtt; + CMOption bSplitFormatFwdMsg; + CMOption bSyncReadMessageStatusFromServer; + CMOption bLoadFullCList; + CMOption bSendVKLinksAsAttachments; + CMOption bLoadSentAttachments; + CMOption bShowVkDeactivateEvents; + CMOption bStickerBackground; + CMOption bFilterAudioMessages; + + CMOption bShowProtoMenuItem0; + CMOption bShowProtoMenuItem1; + CMOption bShowProtoMenuItem2; + CMOption bShowProtoMenuItem3; + CMOption bShowProtoMenuItem4; + CMOption bShowProtoMenuItem5; + CMOption bShowProtoMenuItem6; CMOption iReqAuthTimeLater; CMOption 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()]); -- cgit v1.2.3