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 /plugins/UserInfoEx | |
parent | fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 (diff) |
BYTE -> uint8_t
Diffstat (limited to 'plugins/UserInfoEx')
49 files changed, 295 insertions, 295 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 25679f7c29..8dbf01f9ec 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -187,7 +187,7 @@ FIBITMAP *LoadResource(UINT ID, LPTSTR lpType) HRSRC hResInfo = FindResource(g_plugin.getInst(), MAKEINTRESOURCE(ID), lpType);
DWORD ResSize = SizeofResource(g_plugin.getInst(), hResInfo);
HGLOBAL hRes = LoadResource(g_plugin.getInst(), hResInfo);
- BYTE *buffer = (BYTE *)LockResource(hRes);
+ uint8_t *buffer = (uint8_t *)LockResource(hRes);
if (buffer) {
// attach the binary data to a memory stream
FIMEMORY *hmem = FreeImage_OpenMemory(buffer, ResSize);
@@ -307,7 +307,7 @@ void InitIcons() int bytespp = FreeImage_GetLine(dib_ico) / w;
// set alpha schannel
for (unsigned y = 0; y < h; y++) {
- BYTE *bits = FreeImage_GetScanLine(dib_ico, y);
+ uint8_t *bits = FreeImage_GetScanLine(dib_ico, y);
for (unsigned x = 0; x < w; x++) {
bits[FI_RGBA_ALPHA] = (y < t || y >= b) ? 0 : 255;
// jump to next pixel
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 1916ce8d35..adce05f464 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -106,7 +106,7 @@ void MAnnivDate::SetDate(const MAnnivDate &mda) * param: st - SYSTEMTIME to compare with
* return: number of days the st differs from the class value
**/
-__inline BYTE MAnnivDate::IsValid() const
+__inline uint8_t MAnnivDate::IsValid() const
{
return (
Month() > 0 && Month() < 13 &&
@@ -134,7 +134,7 @@ int MAnnivDate::CompareDays(MTime mt) const * param: st - SYSTEMTIME to compare with
* return: number of days the st differs from the class value
**/
-BYTE MAnnivDate::IsEqual(const SYSTEMTIME &st) const
+uint8_t MAnnivDate::IsEqual(const SYSTEMTIME &st) const
{
return (
Day() == st.wDay &&
@@ -378,8 +378,8 @@ int MAnnivDate::DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPC int MAnnivDate::DBWriteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear)
{
return
- db_set_b(hContact, pszModule, szDay, (BYTE)Day()) ||
- db_set_b(hContact, pszModule, szMonth, (BYTE)Month()) ||
+ db_set_b(hContact, pszModule, szDay, (uint8_t)Day()) ||
+ db_set_b(hContact, pszModule, szMonth, (uint8_t)Month()) ||
db_set_w(hContact, pszModule, szYear, Year());
}
@@ -525,7 +525,7 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) * return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBMoveBirthDate(MCONTACT hContact, BYTE bOld, BYTE)
+int MAnnivDate::DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t)
{
Clear();
switch(bOld) {
@@ -710,7 +710,7 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p * return: 0 if backup was done, 1 otherwise
**/
-int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDontIgnoreAnything, PWORD lastAnswer)
+int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const uint8_t bDontIgnoreAnything, PWORD lastAnswer)
{
if (!hContact)
return 1;
@@ -731,14 +731,14 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const BYTE bDo pszProto = Proto_GetBaseAccountName(hContact);
if (pszProto) {
- BYTE bIsMeta = DB::Module::IsMeta(pszProto);
- BYTE bIsMetaSub = !bIsMeta && db_mc_isSub(hContact);
+ uint8_t bIsMeta = DB::Module::IsMeta(pszProto);
+ uint8_t bIsMetaSub = !bIsMeta && db_mc_isSub(hContact);
MAnnivDate mdbNewProto;
MAnnivDate mdbIgnore;
const int nSubContactCount = (bIsMeta) ? db_mc_getSubCount(hContact) : 0;
- BYTE bWantBackup = !mdbNewProto.DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)
+ uint8_t bWantBackup = !mdbNewProto.DBGetDate(hContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)
&& !IsEqual(mdbNewProto.SystemTime())
&& (bDontIgnoreAnything || (db_get_dw(hContact, USERINFO, SET_REMIND_BIRTHDAY_IGNORED, 0) != mdbNewProto.DateStamp()))
&& !bIsMetaSub;
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index 1dcfda6124..a4d0e1b04b 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -47,7 +47,7 @@ private: wstring _strDesc; // descripes the anniversary (e.g. birthday)
string _strModule; // the module the anniversary has been read from
WORD _wFlags; // the flags
- BYTE _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
+ uint8_t _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
WORD _wDaysEarlier; // number of days to the anniversary the user wants to be reminded of this anniversary
int DBWriteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
@@ -62,8 +62,8 @@ public: __inline void Description(LPCTSTR pszDesc) { if (pszDesc) _strDesc = pszDesc; };
__inline LPCSTR Module() const { return _strModule.c_str(); };
__inline void Module(LPCSTR pszModule) { if (pszModule) _strModule = pszModule; else _strModule.clear(); };
- __inline BYTE RemindOption() const { return _bRemind; };
- __inline void RemindOption(BYTE bRemind) { if (bRemind <= BST_INDETERMINATE) _bRemind = bRemind; };
+ __inline uint8_t RemindOption() const { return _bRemind; };
+ __inline void RemindOption(uint8_t bRemind) { if (bRemind <= BST_INDETERMINATE) _bRemind = bRemind; };
__inline WORD RemindOffset() const { return _wDaysEarlier; };
__inline void RemindOffset(WORD wOffset) { _wDaysEarlier = wOffset; };
__inline WORD Id() const { return _wID; };
@@ -73,11 +73,11 @@ public: void DateStamp(const DWORD dwStamp);
// basic checks
- __inline BYTE IsValid() const;
- __inline BYTE IsChanged() const { return (_wFlags & MADF_CHANGED); };
- __inline BYTE IsReminderChanged() const { return (_wFlags & MADF_REMINDER_CHANGED); };
- __inline BYTE IsEqual(const MAnnivDate &mda) const { return IsEqual(mda.SystemTime()); };
- BYTE IsEqual(const SYSTEMTIME &st) const;
+ __inline uint8_t IsValid() const;
+ __inline uint8_t IsChanged() const { return (_wFlags & MADF_CHANGED); };
+ __inline uint8_t IsReminderChanged() const { return (_wFlags & MADF_REMINDER_CHANGED); };
+ __inline uint8_t IsEqual(const MAnnivDate &mda) const { return IsEqual(mda.SystemTime()); };
+ uint8_t IsEqual(const SYSTEMTIME &st) const;
// handling flags
__inline WORD Flags() const { return _wFlags; };
@@ -108,15 +108,15 @@ public: // delete date from database
int DBDeleteBirthDate(MCONTACT hContact);
- int DBMoveBirthDate(MCONTACT hContact, BYTE bOld, BYTE bNew);
- int BackupBirthday (MCONTACT hContact, LPSTR pszProto = nullptr, const BYTE bDontIgnoreAnything = FALSE, PWORD lastAnswer = nullptr);
+ int DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t bNew);
+ int BackupBirthday (MCONTACT hContact, LPSTR pszProto = nullptr, const uint8_t bDontIgnoreAnything = FALSE, PWORD lastAnswer = nullptr);
// setting values
void SetDate(const SYSTEMTIME &st);
void SetDate(const MAnnivDate &mda);
- BYTE operator == (const SYSTEMTIME &st) { return IsEqual(st); };
- BYTE operator == (const MAnnivDate &mda) { return IsEqual(mda); };
+ uint8_t operator == (const SYSTEMTIME &st) { return IsEqual(st); };
+ uint8_t operator == (const MAnnivDate &mda) { return IsEqual(mda); };
void operator=(SYSTEMTIME &st) { SetDate(st); };
void operator=(MAnnivDate &mda) { SetDate(mda); };
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index c1591cba80..f727c79b07 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -77,7 +77,7 @@ void MTime::ZeroDate() * validation / checks
*********************************************/
-BYTE MTime::IsValid() const
+uint8_t MTime::IsValid() const
{
return (
_SysTime.wYear > 1600 &&
@@ -88,7 +88,7 @@ BYTE MTime::IsValid() const _SysTime.wSecond < 60 );
}
-BYTE MTime::IsLeapYear() const
+uint8_t MTime::IsLeapYear() const
{
return (!(((_SysTime.wYear) % 4 != 0) || (((_SysTime.wYear) % 100 == 0) && ((_SysTime.wYear) % 400 != 0))));
}
@@ -295,7 +295,7 @@ WORD MTime::DaysInMonth(const WORD &wMonth) const return (IsLeapYear() && wMonth == 2) ? wDaysInMonth[wMonth] + 1 : wDaysInMonth[wMonth];
}
-WORD MTime::DaysInYear(BYTE bIgnoreLeap) const
+WORD MTime::DaysInYear(uint8_t bIgnoreLeap) const
{
return ((!bIgnoreLeap && IsLeapYear()) ? 366 : 365);
};
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index eff510421a..19fb811cf3 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -38,8 +38,8 @@ public: // checks
__inline bool IsLocal() const { return _isLocal; }
- BYTE IsValid() const;
- BYTE IsLeapYear() const;
+ uint8_t IsValid() const;
+ uint8_t IsLeapYear() const;
// compare by seconds
LONG Compare(SYSTEMTIME st) const;
@@ -54,7 +54,7 @@ public: SYSTEMTIME SystemTime() const { return _SysTime; }
WORD DaysInMonth(const WORD &wMonth) const;
- WORD DaysInYear(BYTE bIgnoreLeap = FALSE) const;
+ WORD DaysInYear(uint8_t bIgnoreLeap = FALSE) const;
WORD DayOfYear() const;
WORD AdjustYear(const int nDiffDays);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index cd800ff5a2..3d809a064e 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -70,9 +70,9 @@ CPsTree::~CPsTree() * param: none * return: none **/ -BYTE CPsTree::Create(HWND hWndTree, CPsHdr* pPsh) +uint8_t CPsTree::Create(HWND hWndTree, CPsHdr* pPsh) { - BYTE rc; + uint8_t rc; if (hWndTree && pPsh->_hImages && pPsh->_pPages && pPsh->_numPages) { @@ -154,7 +154,7 @@ void CPsTree::Remove(HINSTANCE hInst) * param: needWidth - width to expand the tree by * return: TRUE if initialization is ok, FALSE otherwise **/ -BYTE CPsTree::InitTreeItems(LPWORD needWidth) +uint8_t CPsTree::InitTreeItems(LPWORD needWidth) { if (!_hWndTree || !_pages.getCount()) return FALSE; @@ -396,7 +396,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth) * bAsChild - tells, whether to try to add hItem as child of hInsertAfter or not * return: handle to new (moved) treeitem if successful or NULL otherwise **/ -HTREEITEM CPsTree::MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BYTE bAsChild) +HTREEITEM CPsTree::MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, uint8_t bAsChild) { TVINSERTSTRUCT tvis; HTREEITEM hParent, hChild, hNewItem; @@ -658,7 +658,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem) * return: 0 **/ -int CPsTree::EndLabelEdit(const BYTE bSave) +int CPsTree::EndLabelEdit(const uint8_t bSave) { wchar_t szEdit[MAX_TINAME]; TVITEM tvi; @@ -808,10 +808,10 @@ void CPsTree::OnIconsChanged() * return: TRUE if any page holds changed information **/ -BYTE CPsTree::OnInfoChanged() +uint8_t CPsTree::OnInfoChanged() { PSHNOTIFY pshn; - BYTE bChanged = 0; + uint8_t bChanged = 0; pshn.hdr.idFrom = 0; pshn.hdr.code = PSN_INFOCHANGED; @@ -836,7 +836,7 @@ BYTE CPsTree::OnInfoChanged() * param: none * return: nothing **/ -BYTE CPsTree::OnSelChanging() +uint8_t CPsTree::OnSelChanging() { CPsTreeItem *pti = CurrentItem(); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index fa09565ef9..7d3a5d2c9f 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -170,7 +170,7 @@ LPSTR CPsTreeItem::ParentItemName() * bIsUnicode - if TRUE the title is unicode
* return: 0 on success, 1 to 4 indicating the failed operation
**/
-int CPsTreeItem::Name(LPTSTR ptszTitle, const BYTE bIsUnicode)
+int CPsTreeItem::Name(LPTSTR ptszTitle, const uint8_t bIsUnicode)
{
// convert title to utf8
_pszName = (bIsUnicode) ? mir_utf8encodeW((LPWSTR)ptszTitle) : mir_utf8encode((LPSTR)ptszTitle);
@@ -196,7 +196,7 @@ int CPsTreeItem::Name(LPTSTR ptszTitle, const BYTE bIsUnicode) * params: pszName - the name to match the item with
* return: nothing
**/
-BYTE CPsTreeItem::HasName(const LPCSTR pszName) const
+uint8_t CPsTreeItem::HasName(const LPCSTR pszName) const
{
return !mir_strcmpi(_pszName, pszName);
};
@@ -236,7 +236,7 @@ void CPsTreeItem::Rename(const LPTSTR pszLabel) * param: pszName - uniquely identifiing string for a propertypage encoded with utf8 (e.g.: {group\item})
* return: Label in a newly allocated piece of memory
**/
-int CPsTreeItem::ItemLabel(const BYTE bReadDBValue)
+int CPsTreeItem::ItemLabel(const uint8_t bReadDBValue)
{
DBVARIANT dbv;
@@ -298,7 +298,7 @@ HICON CPsTreeItem::ProtoIcon() * hDefaultIcon - default icon to use
* return: nothing
**/
-int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOnly)
+int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, uint8_t bInitIconsOnly)
{
// check parameter
if (!_pszName || !odp)
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index a7fdec5079..b8ac49d503 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -93,7 +93,7 @@ void CAnnivEditCtrl::Release() * param: wIndex - index to desired item
* return: TRUE if item is valid, FALSE otherwise
**/
-BYTE CAnnivEditCtrl::ItemValid(WORD wIndex) const
+uint8_t CAnnivEditCtrl::ItemValid(WORD wIndex) const
{
return (_pDates != nullptr && wIndex < _numDates && _pDates[wIndex] != nullptr);
}
@@ -105,7 +105,7 @@ BYTE CAnnivEditCtrl::ItemValid(WORD wIndex) const * param: none
* return: TRUE if item is valid, FALSE otherwise
**/
-BYTE CAnnivEditCtrl::CurrentItemValid() const
+uint8_t CAnnivEditCtrl::CurrentItemValid() const
{
return ItemValid(_curDate);
}
@@ -117,7 +117,7 @@ BYTE CAnnivEditCtrl::CurrentItemValid() const * param: none
* return: TRUE if item is valid, FALSE otherwise
**/
-void CAnnivEditCtrl::EnableReminderCtrl(BYTE bEnabled)
+void CAnnivEditCtrl::EnableReminderCtrl(uint8_t bEnabled)
{
bEnabled &= _ReminderEnabled != REMIND_OFF;
EnableWindow(GetDlgItem(_hwndDlg, RADIO_REMIND1), bEnabled);
@@ -144,7 +144,7 @@ void CAnnivEditCtrl::EnableCurrentItem() PSGetContact(_hwndDlg, hContact);
- const BYTE bEnabled
+ const uint8_t bEnabled
= !hContact ||
(pCurrent->Flags() & CTRLF_HASCUSTOM) ||
!(pCurrent->Flags() & (CTRLF_HASPROTO|CTRLF_HASMETA)) ||
@@ -189,7 +189,7 @@ INT_PTR CAnnivEditCtrl::AddDate(MAnnivDate &mda) {
// if a date with wID exists, replace it
if (MAnnivDate *pmda = FindDateById(mda.Id())) {
- BYTE bChanged = pmda->IsChanged(),
+ uint8_t bChanged = pmda->IsChanged(),
bRemindChanged = pmda->IsReminderChanged();
if (!bChanged) {
@@ -293,7 +293,7 @@ INT_PTR CAnnivEditCtrl::DBGetAnniversaries(MCONTACT hContact) MAnnivDate mda;
WORD i;
- BYTE bChanged = FALSE;
+ uint8_t bChanged = FALSE;
for (i = 0; i < ANID_LAST && !mda.DBGetAnniversaryDate(hContact, i); i++) {
mda.DBGetReminderOpts(hContact);
@@ -383,7 +383,7 @@ INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(MCONTACT hContact) **/
INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex)
{
- BYTE bEnabled = ItemValid(wIndex);
+ uint8_t bEnabled = ItemValid(wIndex);
EnableWindow(_hwndDate, bEnabled);
EnableWindow(_hBtnEdit, bEnabled);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.h b/plugins/UserInfoEx/src/ctrl_annivedit.h index f8656aefc3..520dd525db 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.h +++ b/plugins/UserInfoEx/src/ctrl_annivedit.h @@ -33,14 +33,14 @@ class CAnnivEditCtrl : public CBaseCtrl HWND _hBtnAdd; // add anniversary button
HWND _hBtnDel; // delete anniversary button
- BYTE _ReminderEnabled;
+ uint8_t _ReminderEnabled;
MAnnivDate** _pDates;
WORD _numDates;
WORD _curDate;
- BYTE ItemValid(WORD wIndex) const;
- BYTE CurrentItemValid() const;
+ uint8_t ItemValid(WORD wIndex) const;
+ uint8_t CurrentItemValid() const;
INT_PTR DBGetBirthDay(MCONTACT hContact, LPCSTR pszProto);
INT_PTR DBWriteBirthDay(MCONTACT hContact);
@@ -56,12 +56,12 @@ public: MAnnivDate* Current() { return CurrentItemValid() ? _pDates[_curDate] : nullptr; };
WORD CurrentIndex() const { return _curDate; };
WORD NumDates() const { return _numDates; };
- BYTE ReminderEnabled() const { return _ReminderEnabled; };
+ uint8_t ReminderEnabled() const { return _ReminderEnabled; };
MAnnivDate* FindDateById(const WORD wId);
void EnableCurrentItem();
- void EnableReminderCtrl(BYTE bEnabled);
+ void EnableReminderCtrl(uint8_t bEnabled);
INT_PTR SetCurSel(WORD wIndex);
diff --git a/plugins/UserInfoEx/src/ctrl_base.h b/plugins/UserInfoEx/src/ctrl_base.h index 4d5fbe6139..fe9c7fe99f 100644 --- a/plugins/UserInfoEx/src/ctrl_base.h +++ b/plugins/UserInfoEx/src/ctrl_base.h @@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CTRL_LIST_ITEM 7
typedef struct TCtrlInfo {
- BYTE nType;
+ uint8_t nType;
WORD wFlags;
} CTRL, *LPCTRL;
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index 4db6ec100a..a6028aa75a 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -36,7 +36,7 @@ typedef struct TMBCtrl{ HFONT hFont; // font
DWORD dwStyle;
- BYTE bFocus;
+ uint8_t bFocus;
int stateId; // button state
int defbutton; // default button
@@ -576,7 +576,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L break;
case WM_LBUTTONUP:
if (bct->stateId != PBS_DISABLED) { // don't change states if disabled
- BYTE bPressed = bct->stateId == PBS_PRESSED;
+ uint8_t bPressed = bct->stateId == PBS_PRESSED;
if (bct->dwStyle & MBS_PUSHBUTTON) {
if (bct->pbState) bct->pbState = 0;
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index 6c4d152a64..b686f41664 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* @return pointer of the newly created CCombo object.
**/
-CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount)
+CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount)
{
return new CCombo(hDlg, idCtrl, pszSetting, bDBDataType, pList, nListCount);
}
@@ -51,7 +51,7 @@ CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDB *
* @return nothing
**/
-CCombo::CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount)
+CCombo::CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount)
: CBaseCtrl(hDlg, idCtrl, pszSetting)
{
_curSel = CB_ERR;
diff --git a/plugins/UserInfoEx/src/ctrl_combo.h b/plugins/UserInfoEx/src/ctrl_combo.h index ad4aa1273b..9bb5bb5348 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.h +++ b/plugins/UserInfoEx/src/ctrl_combo.h @@ -30,7 +30,7 @@ class CCombo : public CBaseCtrl int _curSel;
LPIDSTRLIST _pList;
int _nList;
- BYTE _bDataType;
+ uint8_t _bDataType;
/**
* Private constructure is to force to use static member 'Create'
@@ -40,7 +40,7 @@ class CCombo : public CBaseCtrl *
* @return nothing
**/
- CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount);
+ CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount);
int Find(int nIndex) const;
int Find(LPTSTR ptszItemLabel) const;
@@ -58,7 +58,7 @@ public: static FORCEINLINE CCombo* GetObj(HWND hDlg, WORD idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
- static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount);
+ static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount);
virtual void Release();
virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 95abf7ae15..e5a970fe72 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -48,9 +48,9 @@ typedef struct TComboEx int numOther;
int iSelectedItem;
- BYTE bIsChanged;
- BYTE bLocked;
- BYTE bIsEditChanged;
+ uint8_t bIsChanged;
+ uint8_t bLocked;
+ uint8_t bIsEditChanged;
HINSTANCE hInstance;
HFONT hFont;
@@ -71,7 +71,7 @@ static int compareProc(LPCVOID cbi1, LPCVOID cbi2) static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& errorPos)
{
int lenNum = 0;
- BYTE hasLeftBreaket = FALSE,
+ uint8_t hasLeftBreaket = FALSE,
hasRightBreaket = FALSE;
if (!szNumber || !pszSrc || !*pszSrc || !cchNumber) return 0;
@@ -1130,7 +1130,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case CBEXM_ENABLEITEM:
if (cbex->iSelectedItem >= 0 && cbex->iSelectedItem < cbex->numItems) {
MCONTACT hContact;
- BYTE bEnabled;
+ uint8_t bEnabled;
PSGetContact(GetParent(hwnd), hContact);
@@ -1170,7 +1170,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L * name: CBEXM_SETCURSEL
* desc: selects a certain item
* param: wParam - index of the item to select
- * lParam - (BYTE)bValid - if TRUE, the next item with a value is selected
+ * lParam - (uint8_t)bValid - if TRUE, the next item with a value is selected
* return: always FALSE
**/
case CBEXM_SETCURSEL:
@@ -1181,7 +1181,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if ((int)wParam < 0 || (int)wParam >= cbex->numItems) wParam = max(cbex->iSelectedItem, 0);
cbex->bLocked = 1;
- if ((BYTE)lParam == TRUE) {
+ if ((uint8_t)lParam == TRUE) {
i = (int)wParam;
cbex->iSelectedItem = (int)wParam;
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index db9efe21ea..e0af506783 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * @return This static method returns the pointer of the created object. **/ -CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE dbType) +CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t dbType) { CEditCtrl *ctrl = new CEditCtrl(hDlg, idCtrl, USERINFO, pszSetting); if (ctrl) @@ -53,7 +53,7 @@ CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE * @return This static method returns the pointer of the created object. **/ -CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, BYTE dbType) +CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType) { CEditCtrl *ctrl = new CEditCtrl(hDlg, idCtrl, pszModule, pszSetting); if (ctrl) @@ -179,7 +179,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) dbv.type = _dbType; switch (_dbType) { case DBVT_BYTE: - dbv.bVal = (BYTE)wcstol(val, nullptr, 10); + dbv.bVal = (uint8_t)wcstol(val, nullptr, 10); break; case DBVT_WORD: @@ -241,7 +241,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg) _Flags.B.hasCustom = (cch > 0); if (!_Flags.B.hasChanged && _Flags.B.hasCustom) { - BYTE need_free = 0; + uint8_t need_free = 0; LPTSTR szText; __try { @@ -275,7 +275,7 @@ void CEditCtrl::OpenUrl() { int lenUrl = 1 + Edit_GetTextLength(_hwnd); LPTSTR szUrl; - BYTE need_free = 0; + uint8_t need_free = 0; __try { szUrl = (LPTSTR)alloca((8 + lenUrl) * sizeof(wchar_t)); @@ -306,7 +306,7 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk) case WM_LBUTTONUP: TEXTRANGE tr; - BYTE need_free = 0; + uint8_t need_free = 0; // do not call function if user selected some chars of the url string SendMessage(_hwnd, EM_EXGETSEL, NULL, (LPARAM)&tr.chrg); diff --git a/plugins/UserInfoEx/src/ctrl_edit.h b/plugins/UserInfoEx/src/ctrl_edit.h index 3a03956cf4..a384bafbe6 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.h +++ b/plugins/UserInfoEx/src/ctrl_edit.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **/
class CEditCtrl : public CBaseCtrl
{
- BYTE _dbType;
+ uint8_t _dbType;
/**
* Private constructure is to force to use static member 'Create'
@@ -52,8 +52,8 @@ public: static FORCEINLINE CEditCtrl* GetObj(HWND hDlg, WORD idCtrl)
{ return GetObj(GetDlgItem(hDlg, idCtrl)); }
- static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE dbType);
- static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, BYTE dbType);
+ static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t dbType);
+ static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType);
virtual void Release();
virtual void OnReset();
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 86817fcb89..86a6fe9dc1 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -49,7 +49,7 @@ class CAnnivList int _sortHeader;
int _curSel;
int _numRows;
- BYTE _bRemindEnable;
+ uint8_t _bRemindEnable;
HANDLE _mHookExit;
bool _wmINIT;
@@ -76,7 +76,7 @@ class CAnnivList struct CFilter
{
WORD wDaysBefore = (WORD)-1;
- BYTE bFilterIndex = 0;
+ uint8_t bFilterIndex = 0;
LPSTR pszProto = nullptr;
LPTSTR pszAnniv = nullptr;
} _filter;
@@ -86,7 +86,7 @@ class CAnnivList MCONTACT _hContact;
MAnnivDate _pDate;
WORD _wDaysBefore;
- BYTE _wReminderState;
+ uint8_t _wReminderState;
CItemData(MCONTACT hContact, MAnnivDate &date) :
_pDate(date)
@@ -421,7 +421,7 @@ class CAnnivList // enable/disable reminder checkbox is clicked
case CHECK_REMIND:
if (pDlg->_bRemindEnable && HIWORD(wParam) == BN_CLICKED) {
- BYTE checkState = Button_GetCheck((HWND)lParam);
+ uint8_t checkState = Button_GetCheck((HWND)lParam);
EnableWindow(GetDlgItem(hDlg, EDIT_REMIND), checkState == BST_CHECKED);
EnableWindow(GetDlgItem(hDlg, SPIN_REMIND), checkState == BST_CHECKED);
@@ -444,7 +444,7 @@ class CAnnivList // period of time is enabled/disabled
case CHECK_DAYS:
if (HIWORD(wParam) == BN_CLICKED) {
- BYTE isChecked = Button_GetCheck((HWND)lParam);
+ uint8_t isChecked = Button_GetCheck((HWND)lParam);
EnableWindow(GetDlgItem(hDlg, EDIT_DAYS), isChecked);
EnableWindow(GetDlgItem(hDlg, TXT_DAYS), isChecked);
pDlg->_filter.wDaysBefore = isChecked ? GetDlgItemInt(hDlg, EDIT_DAYS, nullptr, FALSE) : (WORD)-1;
@@ -569,7 +569,7 @@ class CAnnivList * @retval 0 if successful
* @retval 1 if failed
**/
- BYTE AddColumn(int iSubItem, LPCTSTR pszText, int defaultWidth)
+ uint8_t AddColumn(int iSubItem, LPCTSTR pszText, int defaultWidth)
{
LVCOLUMN lvc;
CHAR pszSetting[MAXSETTING];
@@ -592,7 +592,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddSubItem(int iItem, int iSubItem, LPTSTR pszText)
+ uint8_t AddSubItem(int iItem, int iSubItem, LPTSTR pszText)
{
LVITEM lvi;
if (iSubItem > 0) {
@@ -614,7 +614,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddItem(LPTSTR pszText, LPARAM lParam)
+ uint8_t AddItem(LPTSTR pszText, LPARAM lParam)
{
LVITEM lvi;
@@ -641,7 +641,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, int wDaysBefore)
+ uint8_t AddRow(MCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, int wDaysBefore)
{
wchar_t szText[MAX_PATH];
int diff, iItem = -1;
@@ -811,8 +811,8 @@ class CAnnivList {
if (_hDlg) {
g_plugin.setWord(SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, nullptr, FALSE));
- g_plugin.setByte(SET_ANNIVLIST_FILTER_DAYSENABLED, (BYTE)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
- g_plugin.setByte(SET_ANNIVLIST_FILTER_INDEX, (BYTE)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
+ g_plugin.setByte(SET_ANNIVLIST_FILTER_DAYSENABLED, (uint8_t)Button_GetCheck(GetDlgItem(_hDlg, CHECK_DAYS)));
+ g_plugin.setByte(SET_ANNIVLIST_FILTER_INDEX, (uint8_t)ComboBox_GetCurSel(GetDlgItem(_hDlg, EDIT_DAYS)));
}
}
@@ -862,7 +862,7 @@ public: DeleteAllItems();
}
// remember popup setting
- g_plugin.setByte(SET_ANNIVLIST_POPUP, (BYTE)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
+ g_plugin.setByte(SET_ANNIVLIST_POPUP, (uint8_t)IsDlgButtonChecked(_hDlg, CHECK_POPUP));
// save window position, size and column widths
Utils_SaveWindowPosition(_hDlg, NULL, MODULENAME, "AnnivDlg_");
SaveFilter();
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 4267b8ab0e..a1a1068f5f 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -56,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
// internal variables
-static BYTE bInitIcons = INIT_ICONS_NONE;
+static uint8_t bInitIcons = INIT_ICONS_NONE;
static MWindowList g_hWindowList = nullptr;
static HANDLE g_hDetailsInitEvent = nullptr;
@@ -98,7 +98,7 @@ public: private:
PROTOACCOUNT **_pPd;
int _numProto;
- BYTE _bExitAfterUploading;
+ uint8_t _bExitAfterUploading;
HANDLE _hUploading;
LPPS _pPs;
@@ -130,7 +130,7 @@ public: // @param pPs - the owning propertysheet
// @param bExitAfter - whether the dialog is to close after upload or not
- CPsUpload(LPPS pPs, BYTE bExitAfter)
+ CPsUpload(LPPS pPs, uint8_t bExitAfter)
{
_pPs = pPs;
_pPd = nullptr;
@@ -314,7 +314,7 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) odp->flags = odp->flags > (ODPF_UNICODE | ODPF_BOLDGROUPS | ODPF_ICON | PSPF_PROTOPREPENDED) ? 0 : odp->flags;
if (pPsh->_dwFlags & (PSF_PROTOPAGESONLY | PSF_PROTOPAGESONLY_INIT)) {
- BYTE bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
+ uint8_t bIsUnicode = (odp->flags & ODPF_UNICODE) == ODPF_UNICODE;
wchar_t *ptszTitle = bIsUnicode ? mir_wstrdup(odp->szTitle.w) : mir_a2u(odp->szTitle.a);
// avoid adding pages for a meta subcontact, which have been added for a metacontact.
@@ -382,7 +382,7 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) {
CPsHdr *pPsh = (CPsHdr *)wParam;
if (!(pPsh->_dwFlags & PSF_PROTOPAGESONLY)) {
- BYTE bChangeDetailsEnabled = myGlobals.CanChangeDetails && g_plugin.getByte(SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
+ uint8_t bChangeDetailsEnabled = myGlobals.CanChangeDetails && g_plugin.getByte(SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
if (lParam || bChangeDetailsEnabled) {
OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_ICON | ODPF_UNICODE;
@@ -823,14 +823,14 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case PSM_ISLOCKED: // returns the lock state of the propertysheetpage
{
- BYTE bLocked = (pPs->dwFlags & PSF_LOCKED) == PSF_LOCKED;
+ uint8_t bLocked = (pPs->dwFlags & PSF_LOCKED) == PSF_LOCKED;
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, bLocked);
return bLocked;
}
case PSM_FORCECHANGED: // force all propertysheetpages to update their controls with new values from the database
if (!(pPs->dwFlags & PSF_LOCKED)) {
- BYTE bChanged;
+ uint8_t bChanged;
pPs->dwFlags |= PSF_LOCKED;
if (bChanged = pPs->pTree->OnInfoChanged())
@@ -865,9 +865,9 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case PSM_ISAEROMODE:
{
- BYTE bIsAeroMode = IsAeroMode();
+ uint8_t bIsAeroMode = IsAeroMode();
if (lParam)
- *(BYTE *)lParam = bIsAeroMode;
+ *(uint8_t *)lParam = bIsAeroMode;
return (INT_PTR)bIsAeroMode;
}
@@ -1172,7 +1172,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // check where over the item, the pointer is
RECT rc;
if (TreeView_GetItemRect(pPs->pTree->Window(), hti.hItem, &rc, FALSE)) {
- BYTE height = (BYTE)(rc.bottom - rc.top);
+ uint8_t height = (uint8_t)(rc.bottom - rc.top);
if (hti.pt.y - (height / 3) < rc.top) {
SetCursor(LoadCursor(nullptr, IDC_ARROW));
@@ -1227,7 +1227,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pPs->pTree->EndDrag();
break;
}
- BYTE height = (BYTE)(rc.bottom - rc.top);
+ uint8_t height = (uint8_t)(rc.bottom - rc.top);
if (hti.pt.y - (height / 3) < rc.top) {
HTREEITEM hItem = hti.hItem;
@@ -1308,7 +1308,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar }
if (pPs->nSubContacts != 0) {
- BYTE bDo = FALSE;
+ uint8_t bDo = FALSE;
// call the services
for (int i = 0; i < pPs->nSubContacts; i++)
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h index 7272ffa403..6e1c1735ae 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.h +++ b/plugins/UserInfoEx/src/dlg_propsheet.h @@ -47,15 +47,15 @@ class CPsTreeItem HTREEITEM _hItem; // handle to the treeview item if visible (NULL if this item is hidden)
int _iParent; // index of the owning tree item
int _iImage; // index of treeview item's image
- BYTE _bState; // initial state of this treeitem
+ uint8_t _bState; // initial state of this treeitem
LPSTR _pszName; // original name, given by plugin (not customized)
LPTSTR _ptszLabel; // string to setting in db holding information about this treeitem
LPCSTR GlobalName();
- int Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOnly);
- int ItemLabel(const BYTE bReadDBValue);
- int Name(LPTSTR pszTitle, const BYTE bIsUnicode);
+ int Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, uint8_t bInitIconsOnly);
+ int ItemLabel(const uint8_t bReadDBValue);
+ int Name(LPTSTR pszTitle, const uint8_t bIsUnicode);
HICON ProtoIcon();
public:
@@ -76,7 +76,7 @@ public: __inline int Image() const { return _iImage; };
__inline int Pos() const { return _iPosition; };
- __inline BYTE State() const { return _bState; };
+ __inline uint8_t State() const { return _bState; };
__inline HTREEITEM Hti() const { return _hItem; };
__inline void Hti(HTREEITEM hti) { _hItem = hti; };
__inline int Parent() const { return _iParent; };
@@ -87,7 +87,7 @@ public: __inline void AddFlags(DWORD dwFlags) { _dwFlags |= dwFlags; };
__inline void RemoveFlags(DWORD dwFlags) { _dwFlags &= ~dwFlags; };
- BYTE HasName(const LPCSTR pszName) const;
+ uint8_t HasName(const LPCSTR pszName) const;
LPCSTR PropertyKey(LPCSTR pszProperty);
LPCSTR GlobalPropertyKey(LPCSTR pszProperty);
@@ -164,7 +164,7 @@ public: __inline int NumItems() const { return _pages.getCount(); }
__inline HWND Window() const { return _hWndTree; }
__inline HIMAGELIST ImageList() const { return _hImages; }
- __inline BYTE IsIndexValid(const int index) const { return (index >= 0 && index < _pages.getCount()); }
+ __inline uint8_t IsIndexValid(const int index) const { return (index >= 0 && index < _pages.getCount()); }
__inline CPsTreeItem* TreeItem(int index) const { return (IsIndexValid(index) ? &_pages[index] : nullptr); };
__inline HTREEITEM TreeItemHandle(int index) const { return (IsIndexValid(index) ? _pages[index].Hti() : nullptr); };
@@ -173,14 +173,14 @@ public: __inline CPsTreeItem* CurrentItem() const { return TreeItem(CurrentItemIndex()); };
int AddDummyItem(LPCSTR pszGroup);
- BYTE Create(HWND hWndTree, CPsHdr *pPsh);
- BYTE InitTreeItems(LPWORD needWidth);
+ uint8_t Create(HWND hWndTree, CPsHdr *pPsh);
+ uint8_t InitTreeItems(LPWORD needWidth);
void Remove(HINSTANCE);
void HideItem(const int iPageIndex);
HTREEITEM ShowItem(const int iPageIndex, LPWORD needWidth);
- HTREEITEM MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, BYTE bAsChild = FALSE);
+ HTREEITEM MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, uint8_t bAsChild = FALSE);
void SaveState();
void DBResetState();
@@ -193,12 +193,12 @@ public: CPsTreeItem *FindItemByResource(HINSTANCE hInst, int idDlg);
int BeginLabelEdit(HTREEITEM hItem);
- int EndLabelEdit(const BYTE bSave);
+ int EndLabelEdit(const uint8_t bSave);
void PopupMenu();
void OnIconsChanged();
- BYTE OnInfoChanged();
- BYTE OnSelChanging();
+ uint8_t OnInfoChanged();
+ uint8_t OnSelChanging();
void OnSelChanged(LPNMTREEVIEW lpnmtv);
void OnCancel();
int OnApply();
@@ -256,7 +256,7 @@ struct TPropSheet HFONT hCaptionFont;
HFONT hBoldFont;
RECT rcDisplay;
- BYTE updateAnimFrame;
+ uint8_t updateAnimFrame;
CHAR szUpdating[64];
DWORD dwFlags;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index f7a760cdff..429b4225ff 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -73,10 +73,10 @@ CExImContactBase::~CExImContactBase() * return: TRUE if successful or FALSE otherwise **/ -BYTE CExImContactBase::fromDB(MCONTACT hContact) +uint8_t CExImContactBase::fromDB(MCONTACT hContact) { - BYTE ret = FALSE; - BYTE isChatRoom = FALSE; + uint8_t ret = FALSE; + uint8_t isChatRoom = FALSE; LPSTR pszProto; LPCSTR uidSetting; DBVARIANT dbv; @@ -160,7 +160,7 @@ BYTE CExImContactBase::fromDB(MCONTACT hContact) * return: TRUE if successful or FALSE otherwise **/ -BYTE CExImContactBase::fromIni(LPSTR &row) +uint8_t CExImContactBase::fromIni(LPSTR &row) { LPSTR p1, p2 = nullptr; LPSTR pszUIDValue, pszUIDSetting, pszProto = nullptr; @@ -317,7 +317,7 @@ void CExImContactBase::toIni(FILE *file, int modCount) } } -BYTE CExImContactBase::compareUID(DBVARIANT *dbv) +uint8_t CExImContactBase::compareUID(DBVARIANT *dbv) { DWORD hash = 0; switch (dbv->type) { @@ -363,7 +363,7 @@ BYTE CExImContactBase::compareUID(DBVARIANT *dbv) return FALSE; } -LPSTR CExImContactBase::uid2String(BYTE bPrependType) +LPSTR CExImContactBase::uid2String(uint8_t bPrependType) { CHAR szUID[4096]; LPSTR ptr = szUID; @@ -437,7 +437,7 @@ LPSTR CExImContactBase::uid2String(BYTE bPrependType) memset(r, 0, baselen); ptr = r; for (SIZE_T j = 0; j < _dbvUID.cpbVal; j++, ptr += 3) { - mir_snprintf(ptr, ((r + baselen) - ptr), "%02X ", (BYTE)_dbvUID.pbVal[j]); + mir_snprintf(ptr, ((r + baselen) - ptr), "%02X ", (uint8_t)_dbvUID.pbVal[j]); } return r; } @@ -448,16 +448,16 @@ LPSTR CExImContactBase::uid2String(BYTE bPrependType) return mir_strdup(szUID); } -BYTE CExImContactBase::isMeta() const +uint8_t CExImContactBase::isMeta() const { return DB::Module::IsMeta(_pszProto); } -BYTE CExImContactBase::isHandle(MCONTACT hContact) +uint8_t CExImContactBase::isHandle(MCONTACT hContact) { LPCSTR pszProto; DBVARIANT dbv; - BYTE isEqual = FALSE; + uint8_t isEqual = FALSE; // owner contact ? if (!_pszProto) return hContact == NULL; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index c681198129..8ac4701159 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CExImContactBase
{
- BYTE compareUID(DBVARIANT *dbv);
+ uint8_t compareUID(DBVARIANT *dbv);
protected:
LPSTR _pszNick; // utf8 encoded
@@ -36,7 +36,7 @@ protected: DWORD _dbvUIDHash;
DBVARIANT _dbvUID;
MCONTACT _hContact;
- BYTE _isNewContact; // is this contact a new one?
+ uint8_t _isNewContact; // is this contact a new one?
MCONTACT findHandle();
@@ -53,7 +53,7 @@ public: __inline void proto(LPCSTR val) { _pszProto = val ? mir_strdup(val) : nullptr; }
__inline void ampro(LPCSTR val) { _pszAMPro = val ? mir_strdup(val) : nullptr; }
__inline void uidk(LPCSTR val) { _pszUIDKey = val ? mir_strdup(val) : nullptr; }
- __inline void uid(BYTE val) { _dbvUID.type = DBVT_BYTE; _dbvUID.bVal = val; }
+ __inline void uid(uint8_t val) { _dbvUID.type = DBVT_BYTE; _dbvUID.bVal = val; }
__inline void uid(WORD val) { _dbvUID.type = DBVT_WORD; _dbvUID.wVal = val; }
__inline void uid(DWORD val) { _dbvUID.type = DBVT_DWORD; _dbvUID.dVal = val; }
__inline void uidn(uint8_t *val, DWORD len) { _dbvUID.type = DBVT_BLOB; _dbvUID.pbVal = val; _dbvUID.cpbVal = (WORD)len; }
@@ -70,16 +70,16 @@ public: mir_free(temp);
}
- BYTE isHandle(MCONTACT hContact);
- BYTE isMeta() const;
+ uint8_t isHandle(MCONTACT hContact);
+ uint8_t isMeta() const;
- LPSTR uid2String(BYTE bPrependType);
+ LPSTR uid2String(uint8_t bPrependType);
- BYTE fromDB(MCONTACT hContact);
- BYTE fromIni(LPSTR &row);
+ uint8_t fromDB(MCONTACT hContact);
+ uint8_t fromIni(LPSTR &row);
MCONTACT toDB();
void toIni(FILE *file, int modCount);
- BYTE operator=(MCONTACT hContact) { return fromDB(hContact); }
+ uint8_t operator=(MCONTACT hContact) { return fromDB(hContact); }
};
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 3bc587b868..c6abf8dc13 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -63,7 +63,7 @@ CExImContactXML::CExImContactXML(CFileXml *pXmlFile) * return: TRUE if pszKey is a valid contact information
**/
-BYTE CExImContactXML::IsContactInfo(LPCSTR pszKey)
+uint8_t CExImContactXML::IsContactInfo(LPCSTR pszKey)
{
// This is a sorted list of all hashvalues of the contact information.
// This is the same as the szCiKey[] array below but sorted
@@ -381,7 +381,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP * return: TRUE on success, FALSE otherwise
**/
-BYTE CExImContactXML::ExportEvents()
+uint8_t CExImContactXML::ExportEvents()
{
int dwNumEvents = db_event_count(_hContact);
if (dwNumEvents == 0)
@@ -525,7 +525,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) if (pUID != nullptr) {
switch (*(pUID++)) {
case 'b':
- uid((BYTE)atoi(pUID));
+ uid((uint8_t)atoi(pUID));
break;
case 'w':
uid((WORD)atoi(pUID));
@@ -636,7 +636,7 @@ int CExImContactXML::ImportNormalContact() * return: ERROR_OK on success or any other error number otherwise
**/
-int CExImContactXML::Import(BYTE keepMetaSubContact)
+int CExImContactXML::Import(uint8_t keepMetaSubContact)
{
// xml contact contains subcontacts?
const TiXmlElement *xContact = _xmlReader->FirstChildElement("CONTACT");
@@ -771,8 +771,8 @@ int CExImContactXML::ImportModule(const TiXmlElement *xmlModule) // import setting
if (!mir_strcmpi(xKey->Value(), XKEY_SET)) {
// check if the module to import is the contact's protocol module
- BYTE isProtoModule = !mir_strcmpi(pszModule, _pszProto)/* || DB::Module::IsMeta(pszModule)*/;
- BYTE isMetaModule = DB::Module::IsMeta(pszModule);
+ uint8_t isProtoModule = !mir_strcmpi(pszModule, _pszProto)/* || DB::Module::IsMeta(pszModule)*/;
+ uint8_t isMetaModule = DB::Module::IsMeta(pszModule);
// just ignore MetaModule on normal contact to avoid errors (only keys)
if (!isProtoModule && isMetaModule)
@@ -846,7 +846,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr switch (value[0]) {
case 'b': //'b' bVal and cVal are valid
dbv.type = DBVT_BYTE;
- dbv.bVal = (BYTE)atoi(value + 1);
+ dbv.bVal = (uint8_t)atoi(value + 1);
break;
case 'w': //'w' wVal and sVal are valid
dbv.type = DBVT_WORD;
@@ -924,7 +924,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, const TiXmlElement *xmlEvent) return ERROR_INVALID_VALUE;
size_t baselen;
- mir_ptr<BYTE> tmpVal((uint8_t*)mir_base64_decode(tmp, &baselen));
+ mir_ptr<uint8_t> tmpVal((uint8_t*)mir_base64_decode(tmp, &baselen));
if (tmpVal != NULL) {
// event owning module
dbei.pBlob = tmpVal;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index 7ac1c98946..cd2343f967 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -58,7 +58,7 @@ class CExImContactXML : public CExImContactBase MEVENT _hEvent;
- BYTE IsContactInfo(LPCSTR pszKey);
+ uint8_t IsContactInfo(LPCSTR pszKey);
// private importing methods
int ImportModule(const TiXmlElement *xmlModule);
@@ -72,7 +72,7 @@ class CExImContactXML : public CExImContactBase // private exporting methods
int ExportModule(LPCSTR pszModule);
int ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LPCSTR pszSetting);
- BYTE ExportEvents();
+ uint8_t ExportEvents();
int ExportContact(DB::CEnumList *pModules);
int ExportSubContact(CExImContactXML *vMetaContact, DB::CEnumList *pModules);
@@ -86,7 +86,7 @@ public: // importing stuff
int LoadXmlElement(const TiXmlElement *xContact);
- int Import(BYTE keepMetaSubContact = FALSE);
+ int Import(uint8_t keepMetaSubContact = FALSE);
};
#endif /* _CLASS_EXIM_CONTACT_XML_INCLUDED_ */
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index ec1cb4b629..105c770ddb 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -108,7 +108,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) * return: return handle to added treeitem
**/
-HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE bUseImages, BYTE bState)
+HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, uint8_t bUseImages, uint8_t bState)
{
TVINSERTSTRUCTA tvii;
HTREEITEM hItem = nullptr;
@@ -143,7 +143,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar switch (uMsg) {
case WM_INITDIALOG:
{
- BYTE bImagesLoaded = 0;
+ uint8_t bImagesLoaded = 0;
// get tree handle and set treeview style
HWND hTree = GetDlgItem(hDlg, IDC_TREE);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index 6b25adda9a..f70df32bb6 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -161,7 +161,7 @@ void CProgress::Hide() * return: FALSE if user pressed cancel, TRUE otherwise
**/
-BYTE CProgress::Update()
+uint8_t CProgress::Update()
{
MSG msg;
@@ -189,7 +189,7 @@ BYTE CProgress::Update() * return: FALSE if user pressed cancel, TRUE otherwise
**/
-BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...)
+uint8_t CProgress::UpdateContact(LPCTSTR pszFormat, ...)
{
if (_hDlg != nullptr) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS2);
@@ -216,7 +216,7 @@ BYTE CProgress::UpdateContact(LPCTSTR pszFormat, ...) * return: FALSE if user pressed cancel, TRUE otherwise
**/
-BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
+uint8_t CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
{
if (_hDlg != nullptr) {
HWND hProg = GetDlgItem(_hDlg, IDC_PROGRESS);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h index fe4bc542b2..c6d72d2cb8 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h @@ -29,7 +29,7 @@ class CProgress HWND _hDlg;
DWORD _dwStartTime;
- BYTE Update();
+ uint8_t Update();
public:
CProgress();
@@ -40,8 +40,8 @@ public: void SetContactCount(DWORD numContacts);
void SetSettingsCount(DWORD numSettings);
- BYTE UpdateContact(LPCTSTR pszFormat, ...);
- BYTE UpdateSetting(LPCTSTR pszFormat, ...);
+ uint8_t UpdateContact(LPCTSTR pszFormat, ...);
+ uint8_t UpdateSetting(LPCTSTR pszFormat, ...);
};
#endif /* _DLG_EXIMPROGRESS_H_ */
diff --git a/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h b/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h index 644cb55e0f..8c131bc17b 100644 --- a/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h +++ b/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h @@ -49,14 +49,14 @@ inline INT_PTR QPDecodeGetRequiredLength(INT_PTR nSrcLen) return nSrcLen;
}
-inline BOOL QPEncode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, BYTE *bEncoded, DWORD dwFlags = 0)
+inline BOOL QPEncode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, uint8_t *bEncoded, DWORD dwFlags = 0)
{
//The hexadecimal character set
static const CHAR s_chHexChars[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F' };
INT_PTR nRead = 0, nWritten = 0, nLineLen = 0;
CHAR ch;
- BYTE bChanged = FALSE;
+ uint8_t bChanged = FALSE;
if (!pbSrcData || !szDest || !pnDestLen)
@@ -111,7 +111,7 @@ inline BOOL QPEncode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pn return TRUE;
}
-inline BOOL QPDecode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, DWORD dwFlags = 0)
+inline BOOL QPDecode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, DWORD dwFlags = 0)
{
if (!pbSrcData || !szDest || !pnDestLen) {
return FALSE;
@@ -131,7 +131,7 @@ inline BOOL QPDecode(BYTE *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pn szBuf[1] = *pbSrcData++;
szBuf[2] = '\0';
char *tmp = '\0';
- *szDest++ = (BYTE)strtoul(szBuf, &tmp, 16);
+ *szDest++ = (uint8_t)strtoul(szBuf, &tmp, 16);
nWritten++;
nRead += 2;
continue;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index b19edc5a4f..dfc3b85940 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -86,7 +86,7 @@ static void ExportModule(MCONTACT hContact, LPCSTR pszModule, FILE *file) case DBVT_BLOB: fprintf(file, "%s=n", it); for (WORD j = 0; j < dbv.cpbVal; j++) - fprintf(file, "%02X ", (BYTE)dbv.pbVal[j]); + fprintf(file, "%02X ", (uint8_t)dbv.pbVal[j]); fputc('\n', file); break; } @@ -104,7 +104,7 @@ static void ExportModule(MCONTACT hContact, LPCSTR pszModule, FILE *file) * file - ini file to write the contact to **/ -static BYTE ExportContact(MCONTACT hContact, DB::CEnumList *pModules, FILE *file) +static uint8_t ExportContact(MCONTACT hContact, DB::CEnumList *pModules, FILE *file) { CExImContactBase vcc; @@ -255,7 +255,7 @@ static DWORD ImportreadLine(FILE *file, LPSTR &str) * return: handle to the contact that matches the information or NULL if no match **/ -static MCONTACT ImportFindContact(MCONTACT, LPSTR &strBuf, BYTE bCanCreate) +static MCONTACT ImportFindContact(MCONTACT, LPSTR &strBuf, uint8_t bCanCreate) { CExImContactBase vcc; @@ -313,7 +313,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) if (size_t brk = strspn(value, "0123456789-")) *(value + brk) = 0; dbv.type = DBVT_BYTE; - dbv.bVal = (BYTE)atoi(value); + dbv.bVal = (uint8_t)atoi(value); break; case 'w': @@ -372,7 +372,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) for (dest = dbv.pbVal, value = strtok(value, " "); value && *value; value = strtok(nullptr, " ")) - *(dest++) = (BYTE)strtol(value, nullptr, 16); + *(dest++) = (uint8_t)strtol(value, nullptr, 16); *dest = 0; break; diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 8a7eff65c8..b0272ff998 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -37,11 +37,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * return TRUE or FALSE
**/
-BYTE IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer)
+uint8_t IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer)
{
- BYTE c;
+ uint8_t c;
uint8_t *s = (uint8_t*)pBuffer;
- BYTE bIsUTF = 0;
+ uint8_t bIsUTF = 0;
if (s == nullptr) return 1;
while ((c = *s++) != 0) {
@@ -97,7 +97,7 @@ CLineBuffer::~CLineBuffer() * return: TRUE if reallocation successful or memoryblock is large enough, FALSE otherwise
**/
-BYTE CLineBuffer::_resizeBuf(const size_t cbReq)
+uint8_t CLineBuffer::_resizeBuf(const size_t cbReq)
{
if (cbReq > _cbVal - _cbUsed) {
if (!(_pVal = (uint8_t*)mir_realloc(_pVal, BLOCKSIZE + _cbVal + 1))) {
@@ -205,7 +205,7 @@ size_t CLineBuffer::operator + (const CHAR cVal) * return: length of the string, added
**/
-size_t CLineBuffer::operator + (const BYTE bVal)
+size_t CLineBuffer::operator + (const uint8_t bVal)
{
size_t cbLength = 3;
@@ -479,7 +479,7 @@ int CLineBuffer::fgetEncoded(FILE *inFile) case '=':
if (_resizeBuf(1)) {
fread(hex, 2, 1, inFile);
- *(_pVal + _cbUsed++) = (BYTE)strtol(hex, nullptr, 16);
+ *(_pVal + _cbUsed++) = (uint8_t)strtol(hex, nullptr, 16);
wAdd++;
}
break;
@@ -716,7 +716,7 @@ size_t CVCardFileVCF::packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *c * return value type
**/
-BYTE CVCardFileVCF::GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv)
+uint8_t CVCardFileVCF::GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv)
{
int type = _useUtf8 ? DBVT_UTF8 : DBVT_ASCIIZ;
dbv->pszVal = nullptr;
@@ -779,7 +779,7 @@ size_t CVCardFileVCF::packDB(const CHAR *pszModule, const CHAR *pszSetting, size * return number of bytes, added to the linebuffer
**/
-size_t CVCardFileVCF::packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, BYTE bSigned, size_t *cbRew)
+size_t CVCardFileVCF::packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, uint8_t bSigned, size_t *cbRew)
{
DBVARIANT dbv;
UINT nList;
@@ -880,7 +880,7 @@ void CVCardFileVCF::writeLineEncoded(const CHAR *szSet, size_t *cbRew) * return TRUE or FALSE
**/
-BYTE CVCardFileVCF::Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode)
+uint8_t CVCardFileVCF::Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode)
{
if (!(_pFile = _wfopen(pszFileName, pszMode)))
return FALSE;
@@ -916,7 +916,7 @@ void CVCardFileVCF::Close(void) * return TRUE or FALSE
**/
-BYTE CVCardFileVCF::Export(BYTE bExportUtf)
+uint8_t CVCardFileVCF::Export(uint8_t bExportUtf)
{
size_t cbRew = 0;
@@ -1073,7 +1073,7 @@ BYTE CVCardFileVCF::Export(BYTE bExportUtf) // gender
//
{
- BYTE gender = db_get_b(_hContact, USERINFO, SET_CONTACT_GENDER, 0);
+ uint8_t gender = db_get_b(_hContact, USERINFO, SET_CONTACT_GENDER, 0);
if (!gender) gender = db_get_b(_hContact, _pszBaseProto, SET_CONTACT_GENDER, 0);
switch (gender) {
case 'F':
@@ -1171,12 +1171,12 @@ int CVCardFileVCF::readLine(LPSTR szVCFSetting, WORD cchSetting) * return: number of characters read from the file or EOF
**/
-BYTE CVCardFileVCF::Import()
+uint8_t CVCardFileVCF::Import()
{
CHAR szEnt[MAX_PATH];
LPSTR pszParam;
int cbLine;
- BYTE numEmails = 0;
+ uint8_t numEmails = 0;
while (EOF != (cbLine = readLine(szEnt, MAX_PATH))) {
@@ -1237,10 +1237,10 @@ BYTE CVCardFileVCF::Import() db_set_w(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHYEAR, (WORD)strtol(buf, nullptr, 10));
memcpy(buf, _clVal.GetBuffer() + 4, 2);
buf[2] = 0;
- db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHMONTH, (BYTE)strtol(buf, nullptr, 10));
+ db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHMONTH, (uint8_t)strtol(buf, nullptr, 10));
memcpy(buf, _clVal.GetBuffer() + 6, 2);
buf[2] = 0;
- db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, (BYTE)strtol(buf, nullptr, 10));
+ db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, (uint8_t)strtol(buf, nullptr, 10));
}
}
continue;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index 090308b5fd..e2f833df48 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -29,7 +29,7 @@ private: size_t _cbVal;
size_t _cbUsed;
- BYTE _resizeBuf(const size_t cbReq);
+ uint8_t _resizeBuf(const size_t cbReq);
public:
CLineBuffer();
@@ -40,7 +40,7 @@ public: size_t operator + (const CHAR *szVal);
size_t operator + (const wchar_t *wszVal);
size_t operator + (const CHAR cVal);
- size_t operator + (const BYTE bVal);
+ size_t operator + (const uint8_t bVal);
size_t operator + (const SHORT sVal);
size_t operator + (const WORD wVal);
size_t operator + (const LONG lVal);
@@ -72,13 +72,13 @@ private: MCONTACT _hContact;
const CHAR* _pszBaseProto;
WORD _cbRew;
- BYTE _useUtf8;
+ uint8_t _useUtf8;
WORD _hasUtf8;
size_t packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *cbRew = nullptr);
- BYTE GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv);
+ uint8_t GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv);
size_t packDB(const CHAR *pszModule, const CHAR *pszSetting, size_t *cbRew = nullptr);
- size_t packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, BYTE bSigned = FALSE, size_t *cbRew = nullptr);
+ size_t packDBList(const CHAR *pszModule, const CHAR *pszSetting, MIRANDASERVICE GetList, uint8_t bSigned = FALSE, size_t *cbRew = nullptr);
void writeLine(const CHAR *szSet, size_t *cbRew = nullptr);
void writeLineEncoded(const CHAR *szSet, size_t *cbRew = nullptr);
@@ -87,8 +87,8 @@ private: public:
CVCardFileVCF();
- BYTE Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode);
+ uint8_t Open(MCONTACT hContact, const wchar_t *pszFileName, const wchar_t *pszMode);
void Close(void);
- BYTE Export(BYTE bExportUtf);
- BYTE Import();
+ uint8_t Export(uint8_t bExportUtf);
+ uint8_t Import();
};
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h index 390029db60..eb1bb6328c 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h @@ -49,9 +49,9 @@ class CFileXml { DWORD CountContacts(const TiXmlElement* xmlParent);
/*
- int ExportOwner(FILE *xmlfile, BYTE bExportEvents);
- int ExportContact(FILE *xmlfile, MCONTACT hContact, BYTE bExportEvents, LPENUMLIST pModules);
- int ExportSubContact(TiXmlElement *xContact, MCONTACT hContact, BYTE bExportEvents);
+ int ExportOwner(FILE *xmlfile, uint8_t bExportEvents);
+ int ExportContact(FILE *xmlfile, MCONTACT hContact, uint8_t bExportEvents, LPENUMLIST pModules);
+ int ExportSubContact(TiXmlElement *xContact, MCONTACT hContact, uint8_t bExportEvents);
*/
public:
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.h b/plugins/UserInfoEx/src/ex_import/svc_ExImport.h index 0cf893fa03..c4f0b3ed3b 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct
{
- BYTE Typ;
+ uint8_t Typ;
union {
MCONTACT hContact;
LPSTR pszName;
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 30ea296ae7..34f2050c52 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -134,10 +134,10 @@ namespace Setting { * @retval 1 - error
**/
-BYTE Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+uint8_t Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType)
{
// read value without translation to specific type
- BYTE result = db_get_s(hContact, pszModule, pszSetting, dbv, 0) != 0;
+ uint8_t result = db_get_s(hContact, pszModule, pszSetting, dbv, 0) != 0;
// Is value read successfully and destination type set?
if (!result && destType)
@@ -200,9 +200,9 @@ LPWSTR GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting) * @retval 1 - error
**/
-BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+uint8_t GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType)
{
- BYTE result = !pszModule || Get(hContact, pszModule, pszSetting, dbv, destType);
+ uint8_t result = !pszModule || Get(hContact, pszModule, pszSetting, dbv, destType);
// try to read setting from the contact's protocol module
if (result && pszProto) {
result = Get(hContact, pszProto, pszSetting, dbv, destType) != 0;
@@ -245,7 +245,7 @@ BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetti * @return This function returns the WORD which contains the source of information.
**/
-WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType)
{
WORD wFlags = 0;
@@ -307,7 +307,7 @@ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR ps * @retval FALSE - setting does not exist
**/
-BYTE Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
+uint8_t Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
if (pszModule && pszSetting) {
CHAR szDummy[1];
@@ -349,7 +349,7 @@ namespace Variant { * @retval 1 - error
**/
-BYTE ConvertString(DBVARIANT* dbv, const BYTE destType)
+uint8_t ConvertString(DBVARIANT* dbv, const uint8_t destType)
{
if (dbv == nullptr)
return 1;
@@ -421,7 +421,7 @@ BYTE ConvertString(DBVARIANT* dbv, const BYTE destType) /**
* This function completely converts a DBVARIANT to the destination string type.
-* It includes BYTE, WORD, DWORD and all string types
+* It includes uint8_t, WORD, DWORD and all string types
* @param dbv - pointer to DBVARIANT structure which is to manipulate
* @param destType - one of (DBVT_ASCIIZ, DBVT_UTF8 or DBVT_WCHAR)
*
@@ -429,7 +429,7 @@ BYTE ConvertString(DBVARIANT* dbv, const BYTE destType) * @retval 1 - error
**/
-BYTE dbv2String(DBVARIANT* dbv, const BYTE destType)
+uint8_t dbv2String(DBVARIANT* dbv, const uint8_t destType)
{
if (dbv == nullptr)
return 1;
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index 3289d35405..ea2f1d00ad 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -45,22 +45,22 @@ namespace Module { **/
namespace Setting {
- BYTE Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE BYTE GetAsIs(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t Get(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
+ static FORCEINLINE uint8_t GetAsIs(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, 0); }
- static FORCEINLINE BYTE GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE uint8_t GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_ASCIIZ); }
LPSTR GetAString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE BYTE GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE uint8_t GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_WCHAR); }
LPWSTR GetWString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE BYTE GetUString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE uint8_t GetUString(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_UTF8); }
- BYTE GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE BYTE GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ uint8_t GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
+ static FORCEINLINE uint8_t GetAsIsEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
static FORCEINLINE LPSTR GetAStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : nullptr; }
@@ -69,7 +69,7 @@ namespace Setting { static FORCEINLINE LPSTR GetUStringEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : nullptr; }
- WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType);
static FORCEINLINE WORD GetAsIsCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, 0); }
static FORCEINLINE WORD GetAStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
@@ -87,14 +87,14 @@ namespace Setting { /**
* misc operations
**/
- BYTE Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ uint8_t Exists(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
void DeleteArray(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart);
} /* namespace Setting */
namespace Variant {
- BYTE ConvertString(DBVARIANT* dbv, const BYTE destType);
- BYTE dbv2String(DBVARIANT* dbv, const BYTE destType);
+ uint8_t ConvertString(DBVARIANT* dbv, const uint8_t destType);
+ uint8_t dbv2String(DBVARIANT* dbv, const uint8_t destType);
} /* namespace Variant */
namespace Event {
diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 1e649580b7..941fd25a4c 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -178,7 +178,7 @@ static HINSTANCE IcoLib_CheckIconPackVersion(wchar_t *szIconPack) /////////////////////////////////////////////////////////////////////////////////////////
// Set the icon of each control in the list
-void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, BYTE numCtrls)
+void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL *pCtrl, uint8_t numCtrls)
{
for (int i = 0; i < numCtrls; i++) {
HICON hIcon = g_plugin.getIcon(pCtrl[i].iIcon);
diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index e632d47394..3d1fc2d30e 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -42,7 +42,7 @@ struct ICONCTRL };
LPTSTR IcoLib_GetDefaultIconFileName();
-void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, BYTE numCtrls);
+void IcoLib_SetCtrlIcons(HWND hDlg, const ICONCTRL* pCtrl, uint8_t numCtrls);
void IcoLib_LoadModule();
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index f3c1c6200c..4e5544934f 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -159,7 +159,7 @@ void RebuildContact() **/
void RebuildMain()
{
- BYTE item = 0;
+ uint8_t item = 0;
HGENMENU mhRoot = nullptr;
HGENMENU mhExIm = nullptr;
@@ -239,7 +239,7 @@ void RebuildMain() // reminder
mi.root = mhRoot;
- const BYTE bRemindMenus =
+ const uint8_t bRemindMenus =
g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) &&
g_plugin.getByte(SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
if (bRemindMenus) {
@@ -293,7 +293,7 @@ void RebuildMain() void RebuildGroup()
{
int flag = 0;
- BYTE item = 0;
+ uint8_t item = 0;
HGENMENU mhRoot = nullptr;
HGENMENU mhExIm = nullptr;
@@ -383,7 +383,7 @@ void RebuildGroup() void RebuildSubGroup()
{
int flag = 0;
- BYTE item = 0;
+ uint8_t item = 0;
GroupMenuParam gmp = { 0 };
HGENMENU mhRoot = nullptr;
@@ -484,8 +484,8 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) if (Miranda_IsTerminated())
return 0;
- const BYTE mItems = 3; // menuitems to create
- BYTE item = 0;
+ const uint8_t mItems = 3; // menuitems to create
+ uint8_t item = 0;
// on call by hook or first start
if (!lParam || !hMenuItemAccount) {
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index 0a2f3c857e..f4e8b4ef65 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -77,7 +77,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE bChanged = 0;
+ uint8_t bChanged = 0;
if (!PSGetBaseProto(hDlg, pszProto) || *pszProto == 0)
break;
@@ -221,7 +221,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE bChanged = 0;
+ uint8_t bChanged = 0;
if (!PSGetBaseProto(hDlg, pszProto) || *pszProto == 0)
break;
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp index fbfc25c044..05c8d229fd 100644 --- a/plugins/UserInfoEx/src/psp_general.cpp +++ b/plugins/UserInfoEx/src/psp_general.cpp @@ -80,7 +80,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE bEnable;
+ uint8_t bEnable;
DBVARIANT dbv;
CCtrlFlags Flags;
@@ -109,7 +109,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // gender
{
- BYTE gender
+ uint8_t gender
= IsDlgButtonChecked(hDlg, RADIO_FEMALE)
? 'F'
: IsDlgButtonChecked(hDlg, RADIO_MALE)
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 439245a2c3..6cc3131c86 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -64,7 +64,7 @@ static void FORCEINLINE ComboBox_AddItemWithData(HWND hCombo, LPTSTR ptszText, L * @retval TRUE on success
* @retval FALSE on failure
**/
-static BYTE EnableDlgItem(HWND hDlg, const int idCtrl, BYTE bEnabled)
+static uint8_t EnableDlgItem(HWND hDlg, const int idCtrl, uint8_t bEnabled)
{
return EnableWindow(GetDlgItem(hDlg, idCtrl), bEnabled);
}
@@ -79,7 +79,7 @@ static BYTE EnableDlgItem(HWND hDlg, const int idCtrl, BYTE bEnabled) *
* @return bEnabled
**/
-static BYTE InitialEnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEnabled)
+static uint8_t InitialEnableControls(HWND hDlg, const int *idCtrl, int countCtrl, uint8_t bEnabled)
{
HWND hCtrl;
@@ -100,7 +100,7 @@ static BYTE InitialEnableControls(HWND hDlg, const int *idCtrl, int countCtrl, B *
* @return bEnabled
**/
-static BYTE EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEnabled)
+static uint8_t EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, uint8_t bEnabled)
{
while (countCtrl-- > 0)
EnableDlgItem(hDlg, idCtrl[countCtrl], bEnabled);
@@ -117,9 +117,9 @@ static BYTE EnableControls(HWND hDlg, const int *idCtrl, int countCtrl, BYTE bEn *
* @return This function returns the value from database or the default value.
**/
-static BYTE DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE bDefault)
+static uint8_t DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint8_t bDefault)
{
- BYTE val = (g_plugin.getByte(pszSetting, bDefault) & 1) == 1;
+ uint8_t val = (g_plugin.getByte(pszSetting, bDefault) & 1) == 1;
CheckDlgButton(hDlg, idCtrl, val ? BST_CHECKED : BST_UNCHECKED);
return val;
}
@@ -134,9 +134,9 @@ static BYTE DBGetCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE b *
* @return checkstate
**/
-static BYTE DBWriteCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting)
+static uint8_t DBWriteCheckBtn(HWND hDlg, const int idCtrl, LPCSTR pszSetting)
{
- BYTE val = IsDlgButtonChecked(hDlg, idCtrl);
+ uint8_t val = IsDlgButtonChecked(hDlg, idCtrl);
int Temp = g_plugin.getByte(pszSetting, 0);
Temp &= ~1;
g_plugin.setByte(pszSetting, Temp |= val);
@@ -175,7 +175,7 @@ static void DBWriteColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting) }
/**
- * This function writes a BYTE to database according to the value
+ * This function writes a uint8_t to database according to the value
* read from the edit control identified by 'idCtrl'.
*
* @param hWnd - the dialog's window handle
@@ -187,12 +187,12 @@ static void DBWriteColor(HWND hDlg, const int idCtrl, LPCSTR pszSetting) * @retval TRUE - the database value was updated
* @retval FALSE - no database update needed
**/
-static BYTE DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE defVal)
+static uint8_t DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint8_t defVal)
{
- BYTE v;
+ uint8_t v;
BOOL t;
- v = (BYTE)GetDlgItemInt(hDlg, idCtrl, &t, FALSE);
+ v = (uint8_t)GetDlgItemInt(hDlg, idCtrl, &t, FALSE);
if (t && (v != g_plugin.getByte(pszSetting, defVal))) {
g_plugin.setByte(pszSetting, v);
return true;
@@ -213,7 +213,7 @@ static BYTE DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE * @retval TRUE - the database value was updated
* @retval FALSE - no database update needed
**/
-static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD defVal)
+static uint8_t DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD defVal)
{
WORD v;
BOOL t;
@@ -227,7 +227,7 @@ static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD }
/**
- * This function writes a BYTE to database according to the currently
+ * This function writes a uint8_t to database according to the currently
* selected item of a combobox identified by 'idCtrl'.
*
* @param hWnd - the dialog's window handle
@@ -239,11 +239,11 @@ static BYTE DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD * @retval TRUE - the database value was updated
* @retval FALSE - no database update needed
**/
-static BYTE DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYTE defVal)
+static uint8_t DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint8_t defVal)
{
- BYTE v;
+ uint8_t v;
- v = (BYTE)SendDlgItemMessage(hDlg, idCtrl, CB_GETCURSEL, NULL, NULL);
+ v = (uint8_t)SendDlgItemMessage(hDlg, idCtrl, CB_GETCURSEL, NULL, NULL);
if (v != g_plugin.getByte(pszSetting, defVal)) {
g_plugin.setByte(pszSetting, v);
return true;
@@ -253,7 +253,7 @@ static BYTE DBWriteComboByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, BYT static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -295,7 +295,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, flag |= IsDlgButtonChecked(hDlg, it.idNONE) ? 2 : 0;
flag |= IsDlgButtonChecked(hDlg, it.idALL) ? 4 : 0;
flag |= IsDlgButtonChecked(hDlg, it.idEXIMPORT) ? 8 : 0;
- g_plugin.setByte(it.pszKey, (BYTE)flag);
+ g_plugin.setByte(it.pszKey, (uint8_t)flag);
}
RebuildMenu();
@@ -323,7 +323,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, UpdateStatusIcons();
// misc
- BYTE bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
+ uint8_t bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
g_plugin.setByte(SET_ZODIAC_AVATARS, bEnabled);
NServices::NAvatar::Enable(bEnabled);
}
@@ -374,7 +374,7 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -414,7 +414,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam break;
case BTN_OPT_RESET:
- BYTE WantReset = MsgBox(hDlg,
+ uint8_t WantReset = MsgBox(hDlg,
MB_ICON_WARNING | MB_YESNO,
LPGENW("Question"),
LPGENW("Reset factory defaults"),
@@ -462,7 +462,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam static INT_PTR CALLBACK DlgProc_DetailsDlgOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -542,7 +542,7 @@ static INT_PTR CALLBACK DlgProc_DetailsDlgOpts(HWND hDlg, UINT uMsg, WPARAM wPar static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -574,7 +574,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam bInitialized = 0;
{
// set reminder options
- BYTE bEnabled = g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
+ uint8_t bEnabled = g_plugin.getByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_SETCURSEL, bEnabled, NULL);
DlgProc_ReminderOpts(hDlg, WM_COMMAND, MAKEWPARAM(EDIT_REMIND_ENABLED, CBN_SELCHANGE),
(LPARAM)GetDlgItem(hDlg, EDIT_REMIND_ENABLED));
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- BYTE bReminderCheck = FALSE;
+ uint8_t bReminderCheck = FALSE;
// save checkbox options
DBWriteCheckBtn(hDlg, CHECK_REMIND_MI, SET_REMIND_MENUENABLED);
@@ -621,8 +621,8 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam bReminderCheck = DBWriteEditWord(hDlg, EDIT_REMIND, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
// save primary birthday module
- BYTE bOld = g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
- BYTE bNew = (BYTE)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
+ uint8_t bOld = g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
+ uint8_t bNew = (uint8_t)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
if (bOld != bNew) {
// keep the database clean
DBWriteComboByte(hDlg, EDIT_BIRTHMODULE, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE);
@@ -634,7 +634,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam }
// update current reminder state
- BYTE bNewVal = (BYTE)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
+ uint8_t bNewVal = (uint8_t)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
if (g_plugin.getByte(SET_REMIND_ENABLED, 1) != bNewVal) {
g_plugin.setByte(SET_REMIND_ENABLED, bNewVal);
if (bNewVal == REMIND_OFF) {
@@ -698,7 +698,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam case EDIT_REMIND_SOUNDOFFSET:
if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
BOOL t;
- BYTE v = (BYTE)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
+ uint8_t v = (uint8_t)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
if (t && (v != g_plugin.getByte(SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET)))
NotifyParentOfChange(hDlg);
}
@@ -719,7 +719,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static BYTE bInitialized = 0;
+ static uint8_t bInitialized = 0;
switch (uMsg) {
case WM_INITDIALOG:
@@ -733,7 +733,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR EnableDlgItem(hDlg, CHECK_OPT_POPUP_MSGBOX, FALSE);
// enable/disable popups
- BYTE isEnabled = DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
+ uint8_t isEnabled = DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ENABLED, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, CHECK_OPT_POPUP_ENABLED));
// set colortype checkboxes and color controls
@@ -763,7 +763,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ADEFCLR, BN_CLICKED), NULL);
}
// set delay values
- BYTE bDelay = g_plugin.getByte(SET_POPUP_DELAY, 0);
+ uint8_t bDelay = g_plugin.getByte(SET_POPUP_DELAY, 0);
switch (bDelay) {
case 0:
CheckDlgButton(hDlg, RADIO_OPT_POPUP_DEFAULT, BST_CHECKED);
@@ -818,7 +818,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR else if (IsDlgButtonChecked(hDlg, RADIO_OPT_POPUP_CUSTOM)) {
wchar_t szDelay[4];
GetDlgItemText(hDlg, EDIT_DELAY, szDelay, _countof(szDelay));
- g_plugin.setByte(SET_POPUP_DELAY, (BYTE)wcstol(szDelay, nullptr, 10));
+ g_plugin.setByte(SET_POPUP_DELAY, (uint8_t)wcstol(szDelay, nullptr, 10));
}
else
g_plugin.delSetting(SET_POPUP_DELAY);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index 1123c8ad51..73840c48d0 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -196,7 +196,7 @@ static void ProfileList_Clear(HWND hList) * bSave - tells, whether to save changes (TRUE) or not (FALSE)
* return: returns 0 on success or nonzero
**/
-static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave)
+static int ProfileList_EndLabelEdit(LPLISTCTRL pList, uint8_t bSave)
{
HWND hEdit;
@@ -210,7 +210,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) if (bSave != FALSE && pList->labelEdit.pItem) {
WORD ccText;
LPTSTR szEdit = nullptr;
- BYTE bChanged = FALSE;
+ uint8_t bChanged = FALSE;
// an list element was selected
if (pList->labelEdit.iSubItem && pList->labelEdit.dropDown.iItem != pList->labelEdit.pItem->iListItem && pList->labelEdit.dropDown.iItem >= 0 && pList->labelEdit.dropDown.iItem < pList->labelEdit.pItem->idstrListCount) {
@@ -257,7 +257,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) return 0;
}
-static int ProfileList_EndLabelEdit(HWND hList, BYTE bSave)
+static int ProfileList_EndLabelEdit(HWND hList, uint8_t bSave)
{
return ProfileList_EndLabelEdit((LPLISTCTRL)GetUserData(hList), bSave);
}
@@ -419,7 +419,7 @@ static int ProfileList_GetInsertIndex(HWND hList, LPTSTR pszGroup) *
* return: TRUE or FALSE
**/
-static BYTE ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENTRY *pEntry)
+static uint8_t ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENTRY *pEntry)
{
LPLCITEM pItem;
LVITEM lvi;
@@ -515,7 +515,7 @@ static int ProfileList_AddItemlistFromDB( for (j = 0; j < nList; j++) {
switch (dbvCat.type) {
case DBVT_BYTE:
- if (dbvCat.bVal != (BYTE)idList[j].nID)
+ if (dbvCat.bVal != (uint8_t)idList[j].nID)
continue;
break;
case DBVT_WORD:
@@ -655,7 +655,7 @@ static LRESULT CALLBACK ProfileList_LabelEditProc(HWND hwnd, UINT msg, WPARAM wP return 0;
case VK_RETURN:
{
- BYTE bEditNext;
+ uint8_t bEditNext;
int iItem;
if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_WANTRETURN && !(GetKeyState(VK_CONTROL) & 0x8000))
@@ -1115,10 +1115,10 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR switch (((LPNMHDR)lParam)->code) {
case PSN_INFOCHANGED:
{
- BYTE msgResult = 0;
+ uint8_t msgResult = 0;
LPIDSTRLIST idList;
UINT nList;
- BYTE i;
+ uint8_t i;
int iItem = 0, iGrp = 0, numProtoItems, numUserItems;
if (!(pList->wFlags & CTRLF_CHANGED) && PSGetBaseProto(hDlg, pszProto) && *pszProto != 0) {
@@ -1175,7 +1175,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // user selected to apply settings to the database
case PSN_APPLY:
if (pList->wFlags & CTRLF_CHANGED) {
- BYTE iFmt = -1;
+ uint8_t iFmt = -1;
int iItem;
LVITEM lvi;
wchar_t szGroup[MAX_PATH];
diff --git a/plugins/UserInfoEx/src/stdafx.h b/plugins/UserInfoEx/src/stdafx.h index 79494a1969..8fef10991d 100644 --- a/plugins/UserInfoEx/src/stdafx.h +++ b/plugins/UserInfoEx/src/stdafx.h @@ -161,10 +161,10 @@ struct CMPlugin : public PLUGIN<CMPlugin> typedef struct _MGLOBAL
{
- BYTE CanChangeDetails : 1; // is service to upload own contact information for icq present?
- BYTE TzIndexExist : 1; // Win Reg has Timzone Index Info
- BYTE ShowPropsheetColours : 1; // cached SET_PROPSHEET_SHOWCOLOURS database value
- BYTE WantAeroAdaption : 1; // reserved for later use
+ uint8_t CanChangeDetails : 1; // is service to upload own contact information for icq present?
+ uint8_t TzIndexExist : 1; // Win Reg has Timzone Index Info
+ uint8_t ShowPropsheetColours : 1; // cached SET_PROPSHEET_SHOWCOLOURS database value
+ uint8_t WantAeroAdaption : 1; // reserved for later use
} MGLOBAL, *LPMGLOBAL;
extern MGLOBAL myGlobals;
@@ -214,7 +214,7 @@ static FORCEINLINE BOOL IsProtoAccountEnabled(PROTOACCOUNT *pAcc) typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
extern pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
-static FORCEINLINE BYTE IsAeroMode()
+static FORCEINLINE uint8_t IsAeroMode()
{
BOOL result;
return myGlobals.WantAeroAdaption && dwmIsCompositionEnabled && (dwmIsCompositionEnabled(&result) == S_OK) && result;
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index e8f80dd237..1f1f771d93 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -93,7 +93,7 @@ namespace NServices return 0;
}
- void Enable(BYTE bEnable)
+ void Enable(uint8_t bEnable)
{
DBVARIANT dbv;
@@ -103,7 +103,7 @@ namespace NServices for (auto &hContact : Contacts()) {
// don't set if avatar is locked!
if (!db_get_b(hContact, "ContactPhoto", "Locked", 0)) {
- BYTE bInvalidAvatar = TRUE;
+ uint8_t bInvalidAvatar = TRUE;
// the relative file is valid
if (!DB::Setting::GetAString(hContact, "ContactPhoto", "RFile", &dbv)) {
diff --git a/plugins/UserInfoEx/src/svc_avatar.h b/plugins/UserInfoEx/src/svc_avatar.h index 1e92275c67..488a5c287f 100644 --- a/plugins/UserInfoEx/src/svc_avatar.h +++ b/plugins/UserInfoEx/src/svc_avatar.h @@ -26,7 +26,7 @@ namespace NServices {
namespace NAvatar
{
- void Enable (BYTE bEnable);
+ void Enable (uint8_t bEnable);
void OnModulesLoaded ();
}
} /* namespace NServices */
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index 64de29720f..a5e899b576 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto)
+uint8_t GenderOf(MCONTACT hContact, LPCSTR pszProto)
{
DBVARIANT dbv;
if (DB::Setting::GetAsIsEx(hContact, USERINFO, pszProto, SET_CONTACT_GENDER, &dbv) == 0) {
@@ -44,7 +44,7 @@ BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto) * @retval 0 - contact does not provide its gender
**/
-BYTE GenderOf(MCONTACT hContact)
+uint8_t GenderOf(MCONTACT hContact)
{
return GenderOf(hContact, Proto_GetBaseAccountName(hContact));
}
diff --git a/plugins/UserInfoEx/src/svc_gender.h b/plugins/UserInfoEx/src/svc_gender.h index ec7d9b734e..b99436000e 100644 --- a/plugins/UserInfoEx/src/svc_gender.h +++ b/plugins/UserInfoEx/src/svc_gender.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _UINFOEX_SVCGENDER_H_INCLUDED_
#define _UINFOEX_SVCGENDER_H_INCLUDED_
-BYTE GenderOf(MCONTACT hContact, LPCSTR pszProto);
-BYTE GenderOf(MCONTACT hContact);
+uint8_t GenderOf(MCONTACT hContact, LPCSTR pszProto);
+uint8_t GenderOf(MCONTACT hContact);
#endif /* _UINFOEX_SVCGENDER_H_INCLUDED_ */
\ No newline at end of file diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 813b24af56..4f36b7dede 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -32,8 +32,8 @@ typedef INT_PTR(*PUpdCallback) (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar class CUpdProgress
{
protected:
- BYTE _bBBCode; // TRUE if text renderer can handle BBCodes
- BYTE _bIsCanceled; // is set to TRUE upon click on the CANCEL button
+ uint8_t _bBBCode; // TRUE if text renderer can handle BBCodes
+ uint8_t _bIsCanceled; // is set to TRUE upon click on the CANCEL button
PUpdCallback _pFnCallBack; // a pointer to a callback function, which can be used
// to catch several messages by the caller.
PVOID _pData; // application defined data
@@ -88,7 +88,7 @@ public: virtual void SetTitle(LPCTSTR szText) = 0;
virtual void SetText(LPCTSTR szText) = 0;
- BYTE IsVisible() const
+ uint8_t IsVisible() const
{
return _hWnd != nullptr;
}
@@ -96,7 +96,7 @@ public: *
*
**/
- BYTE IsCanceled() const
+ uint8_t IsCanceled() const
{
return _bIsCanceled;
}
@@ -518,7 +518,7 @@ class CContactUpdater : public CContactQueue if (ack->hProcess || ack->lParam) {
if (!_hContactAcks) {
_nContactAcks = (INT_PTR)ack->hProcess;
- _hContactAcks = (uint8_t*)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess);
+ _hContactAcks = (uint8_t*)mir_calloc(sizeof(uint8_t) * (INT_PTR)ack->hProcess);
}
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED)
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 6a02c83877..e3f8ed65a2 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -39,17 +39,17 @@ struct CEvent CEvent();
CEvent(EType eType, WORD wDaysLeft);
- BYTE operator << (const CEvent& e);
+ uint8_t operator << (const CEvent& e);
};
typedef struct _REMINDEROPTIONS
{
WORD wDaysEarlier;
- BYTE bPopups;
- BYTE bCListExtraIcon;
- BYTE bFlashCList;
- BYTE bCheckVisibleOnly;
- BYTE RemindState;
+ uint8_t bPopups;
+ uint8_t bCListExtraIcon;
+ uint8_t bFlashCList;
+ uint8_t bCheckVisibleOnly;
+ uint8_t RemindState;
CEvent evt;
}
REMINDEROPTIONS, *LPREMINDEROPTIONS;
@@ -69,7 +69,7 @@ HANDLE ghCListBirthdayIcons[11]; static REMINDEROPTIONS gRemindOpts;
-static void UpdateTimer(BYTE bStartup);
+static void UpdateTimer(uint8_t bStartup);
/***********************************************************************************************************
* struct CEvent
@@ -114,7 +114,7 @@ CEvent::CEvent(EType eType, WORD wDaysLeft) * @retval FALSE - The values are not assigned.
**/
-BYTE CEvent::operator << (const CEvent& evt)
+uint8_t CEvent::operator << (const CEvent& evt)
{
if (_wDaysLeft > evt._wDaysLeft) {
_wDaysLeft = evt._wDaysLeft;
@@ -337,7 +337,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) * @retval 1 otherwise
**/
-static BYTE NotifyWithSound(const CEvent &evt)
+static uint8_t NotifyWithSound(const CEvent &evt)
{
if (evt._wDaysLeft <= min(g_plugin.getByte(SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), gRemindOpts.wDaysEarlier)) {
switch (evt._eType) {
@@ -357,7 +357,7 @@ static BYTE NotifyWithSound(const CEvent &evt) * "check for anniversary" functions
***********************************************************************************************************/
-static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify)
+static uint8_t CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bNotify)
{
int numAnniversaries = 0;
int Diff = 0;
@@ -440,7 +440,7 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE * @retval FALSE - contact has no birthday or it is not within the desired period of time.
**/
-static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer)
+static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bNotify, PWORD LastAnwer)
{
if (gRemindOpts.RemindState == REMIND_BIRTH || gRemindOpts.RemindState == REMIND_ALL) {
MAnnivDate mtb;
@@ -520,7 +520,7 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti * @return nothing
**/
-static void CheckContact(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer = nullptr)
+static void CheckContact(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bNotify, PWORD LastAnwer = nullptr)
{
// ignore meta subcontacts here as their birthday information are collected explicitly
if (hContact && (!gRemindOpts.bCheckVisibleOnly || !Contact_IsHidden(hContact)) && !db_mc_isSub(hContact)) {
@@ -775,7 +775,7 @@ static void CALLBACK TimerProc_Check(HWND, UINT, UINT_PTR, DWORD) * @return nothing
**/
-static void UpdateTimer(BYTE bStartup)
+static void UpdateTimer(uint8_t bStartup)
{
LONG wNotifyInterval = 60 * 60 * (LONG)g_plugin.getWord(SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
MTime now, last;
@@ -804,7 +804,7 @@ static void UpdateTimer(BYTE bStartup) * module loading & unloading
***********************************************************************************************************/
-void SvcReminderEnable(BYTE bEnable)
+void SvcReminderEnable(uint8_t bEnable)
{
if (bEnable) { // Reminder is on
// init hooks
diff --git a/plugins/UserInfoEx/src/svc_reminder.h b/plugins/UserInfoEx/src/svc_reminder.h index 88f3f45075..c8ebc1164f 100644 --- a/plugins/UserInfoEx/src/svc_reminder.h +++ b/plugins/UserInfoEx/src/svc_reminder.h @@ -101,7 +101,7 @@ LPCSTR SvcReminderGetMyBirthdayModule(void); void SvcReminderOnTopToolBarLoaded(void);
void SvcReminderOnModulesLoaded(void);
-void SvcReminderEnable(BYTE bEnable);
+void SvcReminderEnable(uint8_t bEnable);
void SvcReminderLoadModule(void);
void SvcReminderUnloadModule(void);
|