diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/m_clistint.h | 6 | ||||
-rw-r--r-- | include/m_core.h | 18 | ||||
-rw-r--r-- | include/m_crypto.h | 14 | ||||
-rw-r--r-- | include/m_database.h | 14 | ||||
-rw-r--r-- | include/m_fontservice.h | 10 | ||||
-rw-r--r-- | include/m_gui.h | 24 | ||||
-rw-r--r-- | include/m_netlib.h | 2 | ||||
-rw-r--r-- | include/m_protoint.h | 8 | ||||
-rw-r--r-- | include/m_srmm_int.h | 6 | ||||
-rw-r--r-- | include/m_system.h | 2 | ||||
-rw-r--r-- | include/m_types.h | 3 | ||||
-rw-r--r-- | include/newpluginapi.h | 6 |
12 files changed, 56 insertions, 57 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index d8a12dcc63..339ed32aa8 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -99,10 +99,10 @@ struct ClcFontInfo struct ClcContactBase
{
- __forceinline BYTE getType() const { return (this == nullptr) ? 0 : type; }
+ __forceinline uint8_t getType() const { return (this == nullptr) ? 0 : type; }
- BYTE type;
- BYTE flags;
+ uint8_t type;
+ uint8_t flags;
union {
struct {
int iImage;
diff --git a/include/m_core.h b/include/m_core.h index 780c39ddd5..4a4b763c73 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -259,9 +259,9 @@ typedef struct mir_md5_state_s { } mir_md5_state_t; MIR_CORE_DLL(void) mir_md5_init(mir_md5_state_t *pms); -MIR_CORE_DLL(void) mir_md5_append(mir_md5_state_t *pms, const BYTE *data, size_t nbytes); -MIR_CORE_DLL(void) mir_md5_finish(mir_md5_state_t *pms, BYTE digest[16]); -MIR_CORE_DLL(void) mir_md5_hash(const BYTE *data, size_t len, BYTE digest[16]); +MIR_CORE_DLL(void) mir_md5_append(mir_md5_state_t *pms, const uint8_t *data, size_t nbytes); +MIR_CORE_DLL(void) mir_md5_finish(mir_md5_state_t *pms, uint8_t digest[16]); +MIR_CORE_DLL(void) mir_md5_hash(const uint8_t *data, size_t len, uint8_t digest[16]); /////////////////////////////////////////////////////////////////////////////// // memory functions @@ -360,9 +360,9 @@ struct mir_sha1_ctx }; MIR_CORE_DLL(void) mir_sha1_init(mir_sha1_ctx *ctx); -MIR_CORE_DLL(void) mir_sha1_append(mir_sha1_ctx *ctx, const BYTE *dataIn, size_t len); -MIR_CORE_DLL(void) mir_sha1_finish(mir_sha1_ctx *ctx, BYTE hashout[MIR_SHA1_HASH_SIZE]); -MIR_CORE_DLL(void) mir_sha1_hash(BYTE *dataIn, size_t len, BYTE hashout[MIR_SHA1_HASH_SIZE]); +MIR_CORE_DLL(void) mir_sha1_append(mir_sha1_ctx *ctx, const uint8_t *dataIn, size_t len); +MIR_CORE_DLL(void) mir_sha1_finish(mir_sha1_ctx *ctx, uint8_t hashout[MIR_SHA1_HASH_SIZE]); +MIR_CORE_DLL(void) mir_sha1_hash(uint8_t *dataIn, size_t len, uint8_t hashout[MIR_SHA1_HASH_SIZE]); /////////////////////////////////////////////////////////////////////////////// // sha256 functions @@ -373,14 +373,14 @@ struct SHA256_CONTEXT { uint32_t h0, h1, h2, h3, h4, h5, h6, h7; uint32_t nblocks; - BYTE buf[MIR_SHA_BLOCKSIZE]; + uint8_t buf[MIR_SHA_BLOCKSIZE]; int count; }; MIR_CORE_DLL(void) mir_sha256_init(SHA256_CONTEXT *ctx); MIR_CORE_DLL(void) mir_sha256_write(SHA256_CONTEXT *ctx, const void *dataIn, size_t len); -MIR_CORE_DLL(void) mir_sha256_final(SHA256_CONTEXT *ctx, BYTE hashout[MIR_SHA256_HASH_SIZE]); -MIR_CORE_DLL(void) mir_sha256_hash(const void *dataIn, size_t len, BYTE hashout[MIR_SHA256_HASH_SIZE]); +MIR_CORE_DLL(void) mir_sha256_final(SHA256_CONTEXT *ctx, uint8_t hashout[MIR_SHA256_HASH_SIZE]); +MIR_CORE_DLL(void) mir_sha256_hash(const void *dataIn, size_t len, uint8_t hashout[MIR_SHA256_HASH_SIZE]); /////////////////////////////////////////////////////////////////////////////// // strings diff --git a/include/m_crypto.h b/include/m_crypto.h index b16bf2c35c..870bbce929 100644 --- a/include/m_crypto.h +++ b/include/m_crypto.h @@ -36,8 +36,8 @@ struct MICryptoEngine // get/set the instance key
STDMETHOD_(size_t, getKeyLength)(void) PURE;
- STDMETHOD_(bool, getKey)(BYTE *pKey, size_t cbKeyLen) PURE;
- STDMETHOD_(bool, setKey)(const char *pszPassword, const BYTE *pKey, size_t cbKeyLen) PURE;
+ STDMETHOD_(bool, getKey)(uint8_t *pKey, size_t cbKeyLen) PURE;
+ STDMETHOD_(bool, setKey)(const char *pszPassword, const uint8_t *pKey, size_t cbKeyLen) PURE;
STDMETHOD_(bool, generateKey)(void)PURE; // creates a new key inside
STDMETHOD_(void, purgeKey)(void)PURE; // purges a key from memory
@@ -46,13 +46,13 @@ struct MICryptoEngine STDMETHOD_(bool, checkPassword)(const char *pszPassword) PURE;
STDMETHOD_(void, setPassword)(const char *pszPassword) PURE;
- // result must be freed using mir_free or assigned to mir_ptr<BYTE>
- STDMETHOD_(BYTE*, encodeString)(const char *src, size_t *cbResultLen) PURE;
- STDMETHOD_(BYTE*, encodeBuffer)(const void *src, size_t cbLen, size_t *cbResultLen) PURE;
+ // result must be freed using mir_free or assigned to mir_ptr<uint8_t>
+ STDMETHOD_(uint8_t*, encodeString)(const char *src, size_t *cbResultLen) PURE;
+ STDMETHOD_(uint8_t*, encodeBuffer)(const void *src, size_t cbLen, size_t *cbResultLen) PURE;
// result must be freed using mir_free or assigned to ptrA/ptrT
- STDMETHOD_(char*, decodeString)(const BYTE *pBuf, size_t bufLen, size_t *cbResultLen) PURE;
- STDMETHOD_(void*, decodeBuffer)(const BYTE *pBuf, size_t bufLen, size_t *cbResultLen) PURE;
+ STDMETHOD_(char*, decodeString)(const uint8_t *pBuf, size_t bufLen, size_t *cbResultLen) PURE;
+ STDMETHOD_(void*, decodeBuffer)(const uint8_t *pBuf, size_t bufLen, size_t *cbResultLen) PURE;
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_database.h b/include/m_database.h index bf4e411815..838506f38d 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -143,9 +143,9 @@ EXTERN_C MIR_CORE_DLL(int) db_enum_settings(MCONTACT hContact, DBSETTINGENUMPROC struct DBVARIANT { - BYTE type; + uint8_t type; union { - BYTE bVal; char cVal; + uint8_t bVal; char cVal; WORD wVal; short sVal; DWORD dVal; long lVal; struct { @@ -157,7 +157,7 @@ struct DBVARIANT }; struct { WORD cpbVal; - BYTE *pbVal; + uint8_t *pbVal; }; }; }; @@ -382,7 +382,7 @@ EXTERN_C MIR_CORE_DLL(int) db_get_static_utf(MCONTACT hContact, const char EXTERN_C MIR_CORE_DLL(int) db_get_wstatic(MCONTACT hContact, const char *szModule, const char *szSetting, wchar_t *pDest, int cbDest); EXTERN_C MIR_CORE_DLL(INT_PTR) db_set(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv); -EXTERN_C MIR_CORE_DLL(INT_PTR) db_set_b(MCONTACT hContact, const char *szModule, const char *szSetting, BYTE val); +EXTERN_C MIR_CORE_DLL(INT_PTR) db_set_b(MCONTACT hContact, const char *szModule, const char *szSetting, uint8_t val); EXTERN_C MIR_CORE_DLL(INT_PTR) db_set_w(MCONTACT hContact, const char *szModule, const char *szSetting, WORD val); EXTERN_C MIR_CORE_DLL(INT_PTR) db_set_dw(MCONTACT hContact, const char *szModule, const char *szSetting, DWORD val); EXTERN_C MIR_CORE_DLL(INT_PTR) db_set_s(MCONTACT hContact, const char *szModule, const char *szSetting, const char *val); @@ -647,9 +647,9 @@ EXTERN_C MIR_APP_DLL(wchar_t*) DbEvent_GetString(DBEVENTINFO *dbei, const char * ///////////////////////////////////////////////////////////////////////////////////////// inlined range tolerate versions */ -__inline BYTE DBGetContactSettingRangedByte(MCONTACT hContact, const char *szModule, const char *szSetting, BYTE errorValue, BYTE minValue, BYTE maxValue) +__inline uint8_t DBGetContactSettingRangedByte(MCONTACT hContact, const char *szModule, const char *szSetting, uint8_t errorValue, uint8_t minValue, uint8_t maxValue) { - BYTE bVal = db_get_b(hContact, szModule, szSetting, errorValue); + uint8_t bVal = db_get_b(hContact, szModule, szSetting, errorValue); return (bVal < minValue || bVal > maxValue) ? errorValue : bVal; } @@ -707,7 +707,7 @@ namespace DB ~AUTH_BLOB(); __forceinline operator char*() { return (char*)makeBlob(); } - __forceinline operator BYTE*() { return makeBlob(); } + __forceinline operator uint8_t*() { return makeBlob(); } __forceinline DWORD size() const { return m_size; } diff --git a/include/m_fontservice.h b/include/m_fontservice.h index 61ac81df28..3d4746dff9 100644 --- a/include/m_fontservice.h +++ b/include/m_fontservice.h @@ -62,8 +62,8 @@ struct FontSettings {
COLORREF colour;
char size;
- BYTE style; // see the DBFONTF_* flags above
- BYTE charset;
+ uint8_t style; // see the DBFONTF_* flags above
+ uint8_t charset;
char szFace[LF_FACESIZE];
};
@@ -71,8 +71,8 @@ struct FontSettingsW {
COLORREF colour;
char size;
- BYTE style; // see the DBFONTF_* flags above
- BYTE charset;
+ uint8_t style; // see the DBFONTF_* flags above
+ uint8_t charset;
wchar_t szFace[LF_FACESIZE];
};
@@ -180,7 +180,7 @@ __forceinline COLORREF Colour_GetW(ColourIDW &p) struct FONTEFFECT
{
- BYTE effectIndex;
+ uint8_t effectIndex;
DWORD baseColour; // ARGB
DWORD secondaryColour; // ARGB
};
diff --git a/include/m_gui.h b/include/m_gui.h index b7510ab504..537507f54b 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -50,7 +50,7 @@ struct CMDBTraits template<> struct CMDBTraits<1> { - typedef BYTE DBType; + typedef uint8_t DBType; enum { DBTypeId = DBVT_BYTE }; static __forceinline DBType Get(const char *szModule, const char *szSetting, DBType value) { @@ -246,13 +246,13 @@ private: class MIR_CORE_EXPORT CDataLink { protected: - BYTE m_type; + uint8_t m_type; public: - __inline CDataLink(BYTE type) : m_type(type) {} + __inline CDataLink(uint8_t type) : m_type(type) {} virtual ~CDataLink() {} - __inline BYTE GetDataType() const { return m_type; } + __inline uint8_t GetDataType() const { return m_type; } virtual DWORD LoadInt() = 0; virtual void SaveInt(DWORD value) = 0; @@ -272,8 +272,8 @@ class MIR_CORE_EXPORT CDbLink : public CDataLink DBVARIANT dbv; public: - CDbLink(const char *szModule, const char *szSetting, BYTE type, DWORD iValue); - CDbLink(const char *szModule, const char *szSetting, BYTE type, wchar_t *szValue); + CDbLink(const char *szModule, const char *szSetting, uint8_t type, DWORD iValue); + CDbLink(const char *szModule, const char *szSetting, uint8_t type, wchar_t *szValue); ~CDbLink(); DWORD LoadInt() override; @@ -371,7 +371,7 @@ protected: bool m_bExiting = false; // window received WM_CLOSE and gonna die soon enum { CLOSE_ON_OK = 0x1, CLOSE_ON_CANCEL = 0x2 }; - BYTE m_autoClose; // automatically close dialog on IDOK/CANCEL commands. default: CLOSE_ON_OK|CLOSE_ON_CANCEL + uint8_t m_autoClose; // automatically close dialog on IDOK/CANCEL commands. default: CLOSE_ON_OK|CLOSE_ON_CANCEL CMPluginBase &m_pPlugin; @@ -403,7 +403,7 @@ protected: void RemoveTimer(UINT_PTR idEvent); // options support - void CreateLink(class CCtrlData& ctrl, const char *szSetting, BYTE type, DWORD iValue); + void CreateLink(class CCtrlData& ctrl, const char *szSetting, uint8_t type, DWORD iValue); void CreateLink(class CCtrlData& ctrl, const char *szSetting, wchar_t *szValue); template<class T> @@ -690,7 +690,7 @@ public: DWORD GetExStyle() const; DWORD GetExpand(HANDLE hItem) const; int GetExtraColumns() const; - BYTE GetExtraImage(HANDLE hItem, int iColumn) const; + uint8_t GetExtraImage(HANDLE hItem, int iColumn) const; HIMAGELIST GetExtraImageList() const; HFONT GetFont(int iFontId) const; bool GetHideOfflineRoot() const; @@ -746,7 +746,7 @@ public: CCtrlData(CDlgBase *dlg, int ctrlId); ~CCtrlData(); - void CreateDbLink(const char* szModuleName, const char* szSetting, BYTE type, DWORD iValue); + void CreateDbLink(const char* szModuleName, const char* szSetting, uint8_t type, DWORD iValue); void CreateDbLink(const char* szModuleName, const char* szSetting, wchar_t* szValue); void CreateDbLink(CDataLink *link) { m_dbLink = link; } @@ -755,7 +755,7 @@ public: protected: CDataLink *m_dbLink; - __inline BYTE GetDataType() { return m_dbLink ? m_dbLink->GetDataType() : DBVT_DELETED; } + __inline uint8_t GetDataType() { return m_dbLink ? m_dbLink->GetDataType() : DBVT_DELETED; } __inline DWORD LoadInt() { return m_dbLink ? m_dbLink->LoadInt() : 0; } __inline void SaveInt(DWORD value) { if (m_dbLink) m_dbLink->SaveInt(value); } __inline const wchar_t *LoadText() { return m_dbLink ? m_dbLink->LoadText() : L""; } @@ -1451,7 +1451,7 @@ class MIR_APP_EXPORT CProtoIntDlgBase : public CDlgBase public: CProtoIntDlgBase(PROTO_INTERFACE *proto, int idDialog); - void CreateLink(CCtrlData &ctrl, const char *szSetting, BYTE type, DWORD iValue); + void CreateLink(CCtrlData &ctrl, const char *szSetting, uint8_t type, DWORD iValue); void CreateLink(CCtrlData &ctrl, const char *szSetting, wchar_t *szValue); template<class T> diff --git a/include/m_netlib.h b/include/m_netlib.h index 8c3e1e1d24..161c1056c4 100644 --- a/include/m_netlib.h +++ b/include/m_netlib.h @@ -724,7 +724,7 @@ struct NETLIBPACKETRECVER int bytesUsed; // fill before calling. This many bytes are removed from the start of the buffer. Set to 0 on return int bytesAvailable; // equal to the return value, unless the return value is 0 int bufferSize; // same as parameter to MS_NETLIB_CREATEPACKETRECVER - BYTE *buffer; // contains the recved data + uint8_t *buffer; // contains the recved data }; EXTERN_C MIR_APP_DLL(int) Netlib_GetMorePackets(HANDLE hReceiver, NETLIBPACKETRECVER *nlprParam); diff --git a/include/m_protoint.h b/include/m_protoint.h index 352f4d3574..6f41d51de3 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -109,9 +109,9 @@ public: __forceinline bool isChatRoom(MCONTACT hContact) { return getBool(hContact, "ChatRoom", false); } - __forceinline int getByte(const char *name, BYTE defaultValue = 0) { + __forceinline int getByte(const char *name, uint8_t defaultValue = 0) { return db_get_b(0, m_szModuleName, name, defaultValue); } - __forceinline int getByte(MCONTACT hContact, const char *name, BYTE defaultValue = 0) { + __forceinline int getByte(MCONTACT hContact, const char *name, uint8_t defaultValue = 0) { return db_get_b(hContact, m_szModuleName, name, defaultValue); } __forceinline int getWord(const char *name, WORD defaultValue = 0) { @@ -164,8 +164,8 @@ public: __forceinline CMStringW getMStringW(MCONTACT hContact, const char *name, const wchar_t *szValue = nullptr) { return db_get_wsm(hContact, m_szModuleName, name, szValue); } - __forceinline void setByte(const char *name, BYTE value) { db_set_b(0, m_szModuleName, name, value); } - __forceinline void setByte(MCONTACT hContact, const char *name, BYTE value) { db_set_b(hContact, m_szModuleName, name, value); } + __forceinline void setByte(const char *name, uint8_t value) { db_set_b(0, m_szModuleName, name, value); } + __forceinline void setByte(MCONTACT hContact, const char *name, uint8_t value) { db_set_b(hContact, m_szModuleName, name, value); } __forceinline void setWord(const char *name, WORD value) { db_set_w(0, m_szModuleName, name, value); } __forceinline void setWord(MCONTACT hContact, const char *name, WORD value) { db_set_w(hContact, m_szModuleName, name, value); } diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index 99369c026d..9e29313d7a 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -61,7 +61,7 @@ struct CustomButtonData : public MZeroedObject bool m_bIMButton, m_bChatButton; bool m_bCanBeHidden, m_bCantBeHidden, m_bHidden, m_bSeparator, m_bDisabled, m_bPushButton; bool m_bRSided; - BYTE m_opFlags; + uint8_t m_opFlags; HPLUGIN m_pPlugin; DWORD m_dwOrigPosition; struct THotkeyItem *m_hotkey; @@ -214,7 +214,7 @@ protected: // user typing support; DWORD m_nLastTyping = 0; - BYTE m_bShowTyping = 0; + uint8_t m_bShowTyping = 0; int m_nTypeSecs = 0, m_nTypeMode = 0; const USERINFO* m_pUserTyping = nullptr; @@ -279,7 +279,7 @@ class CMsgDialog : public CSrmmBaseDialog {}; ///////////////////////////////////////////////////////////////////////////////////////// // receives LOGSTREAMDATA* as the first parameter -EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_LogStreamCallback(DWORD_PTR dwCookie, BYTE *pbBuff, LONG cb, LONG *pcb); +EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_LogStreamCallback(DWORD_PTR dwCookie, uint8_t *pbBuff, LONG cb, LONG *pcb); ///////////////////////////////////////////////////////////////////////////////////////// // sends a message to all SRMM windows diff --git a/include/m_system.h b/include/m_system.h index 5162b82692..753498b2df 100644 --- a/include/m_system.h +++ b/include/m_system.h @@ -449,7 +449,7 @@ class T2Utf : public ptrA { public: __forceinline T2Utf(const wchar_t *str) : ptrA(mir_utf8encodeW(str)) {} - __forceinline operator BYTE *() const { return (BYTE *)data; } + __forceinline operator uint8_t*() const { return (uint8_t*)data; } #ifdef _XSTRING_ std::string str() const { return std::string(data); } #endif diff --git a/include/m_types.h b/include/m_types.h index 8740be7f30..c01c838de2 100644 --- a/include/m_types.h +++ b/include/m_types.h @@ -54,9 +54,8 @@ using namespace std; typedef void *HANDLE; typedef int BOOL, SOCKET; -typedef uint8_t BYTE; typedef uint16_t WORD; -typedef uint32_t DWORD, UINT, COLORREF; +typedef uint32_t UINT, COLORREF; typedef intptr_t WPARAM, LPARAM, INT_PTR; typedef uintptr_t UINT_PTR, DWORD_PTR, LRESULT; typedef char *LPSTR; diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 33394bbfa3..ee0cc479bb 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -106,7 +106,7 @@ struct PLUGININFOEX char *author; char *copyright; char *homepage; - BYTE flags; // right now the only flag, UNICODE_AWARE, is recognized here + uint8_t flags; // right now the only flag, UNICODE_AWARE, is recognized here MUUID uuid; // plugin's unique identifier }; @@ -334,11 +334,11 @@ public: return db_get_wsm(hContact, m_szModuleName, name, szValue); } - __forceinline void setByte(const char *name, BYTE value) + __forceinline void setByte(const char *name, uint8_t value) { db_set_b(0, m_szModuleName, name, value); } - __forceinline void setByte(MCONTACT hContact, const char *name, BYTE value) + __forceinline void setByte(MCONTACT hContact, const char *name, uint8_t value) { db_set_b(hContact, m_szModuleName, name, value); } |