From 1039b2829a264280493ba0fa979214fe024dc70c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 17:06:04 +0300 Subject: WORD -> uint16_t --- plugins/UserInfoEx/src/Flags/svc_flags.cpp | 2 +- plugins/UserInfoEx/src/classMAnnivDate.cpp | 34 +++++++++--------- plugins/UserInfoEx/src/classMAnnivDate.h | 26 +++++++------- plugins/UserInfoEx/src/classMTime.cpp | 24 ++++++------- plugins/UserInfoEx/src/classMTime.h | 42 +++++++++++----------- plugins/UserInfoEx/src/classPsTree.cpp | 10 +++--- plugins/UserInfoEx/src/classPsTreeItem.cpp | 4 +-- plugins/UserInfoEx/src/ctrl_annivedit.cpp | 26 +++++++------- plugins/UserInfoEx/src/ctrl_annivedit.h | 22 ++++++------ plugins/UserInfoEx/src/ctrl_base.cpp | 8 ++--- plugins/UserInfoEx/src/ctrl_base.h | 18 +++++----- plugins/UserInfoEx/src/ctrl_button.cpp | 4 +-- plugins/UserInfoEx/src/ctrl_combo.cpp | 12 +++---- plugins/UserInfoEx/src/ctrl_combo.h | 8 ++--- plugins/UserInfoEx/src/ctrl_contact.cpp | 22 ++++++------ plugins/UserInfoEx/src/ctrl_contact.h | 10 +++--- plugins/UserInfoEx/src/ctrl_edit.cpp | 10 +++--- plugins/UserInfoEx/src/ctrl_edit.h | 10 +++--- plugins/UserInfoEx/src/ctrl_tzcombo.cpp | 6 ++-- plugins/UserInfoEx/src/ctrl_tzcombo.h | 8 ++--- plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 18 +++++----- plugins/UserInfoEx/src/dlg_propsheet.cpp | 6 ++-- plugins/UserInfoEx/src/dlg_propsheet.h | 6 ++-- .../src/ex_import/classExImContactBase.h | 4 +-- .../src/ex_import/classExImContactXML.cpp | 8 ++--- plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 6 ++-- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp | 8 ++--- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h | 8 ++--- plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp | 2 +- plugins/UserInfoEx/src/ex_import/svc_ExImXML.h | 2 +- plugins/UserInfoEx/src/mir_db.cpp | 8 ++--- plugins/UserInfoEx/src/mir_db.h | 10 +++--- plugins/UserInfoEx/src/mir_icolib.h | 2 +- plugins/UserInfoEx/src/psp_options.cpp | 12 +++---- plugins/UserInfoEx/src/psp_profile.cpp | 6 ++-- plugins/UserInfoEx/src/svc_reminder.cpp | 24 ++++++------- 36 files changed, 218 insertions(+), 218 deletions(-) (limited to 'plugins/UserInfoEx/src') diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index cc162d86ff..8b694f83a0 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -43,7 +43,7 @@ static LIST gMsgWndList(10, NumericKeySortT); static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM) { - WORD countryNumber; + uint16_t countryNumber; char *pszProto = Proto_GetBaseAccountName(wParam); /* UserinfoEx */ if (countryNumber = db_get_w(wParam, USERINFO, SET_CONTACT_ORIGIN_COUNTRY, 0)) diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index adce05f464..cd3e87ab53 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -63,7 +63,7 @@ void MAnnivDate::Clear() _strModule.clear(); _wFlags = MADF_NONE; _bRemind = BST_INDETERMINATE; - _wDaysEarlier = (WORD)-1; + _wDaysEarlier = (uint16_t)-1; } /** @@ -171,9 +171,9 @@ DWORD MAnnivDate::DateStamp() const **/ void MAnnivDate::DateStamp(const DWORD dwStamp) { - Day((const WORD)((dwStamp & 0xFF000000) >> 24)); - Month((const WORD)((dwStamp & 0x00FF0000) >> 16)); - Year((const WORD)(dwStamp & 0x0000FFFF)); + Day((const uint16_t)((dwStamp & 0xFF000000) >> 24)); + Month((const uint16_t)((dwStamp & 0x00FF0000) >> 16)); + Year((const uint16_t)(dwStamp & 0x0000FFFF)); } /** @@ -212,8 +212,8 @@ int MAnnivDate::Age(MTime *pNow) struct { - WORD startDays; - WORD endDays; + uint16_t startDays; + uint16_t endDays; LPCTSTR szZodiac; int szZodiacIcon; } @@ -236,7 +236,7 @@ static zodiac[] = { MZodiac MAnnivDate::Zodiac() { - const WORD wDays = DayOfYear(); + const uint16_t wDays = DayOfYear(); int i; for (i = 0; i < 13 && (wDays < zodiac[i].startDays || wDays > zodiac[i].endDays); i++); @@ -265,7 +265,7 @@ int MAnnivDate::DBGetReminderOpts(MCONTACT hContact) if (_wID == ANID_BIRTHDAY) { _bRemind = db_get_b(hContact, USERINFO, SET_REMIND_BIRTHDAY_ENABLED, BST_INDETERMINATE); - _wDaysEarlier = db_get_w(hContact, USERINFO, SET_REMIND_BIRTHDAY_OFFSET, (WORD)-1); + _wDaysEarlier = db_get_w(hContact, USERINFO, SET_REMIND_BIRTHDAY_OFFSET, (uint16_t)-1); } else if (_wID <= ANID_LAST) { char pszSetting[MAXSETTING]; @@ -275,11 +275,11 @@ int MAnnivDate::DBGetReminderOpts(MCONTACT hContact) _bRemind = db_get_b(hContact, Module(), pszSetting, BST_INDETERMINATE); // read offset mir_snprintf(pszSetting, "Anniv%dOffset", _wID); - _wDaysEarlier = db_get_w(hContact, Module(), pszSetting, (WORD)-1); + _wDaysEarlier = db_get_w(hContact, Module(), pszSetting, (uint16_t)-1); } else { _bRemind = BST_INDETERMINATE; - _wDaysEarlier = (WORD)-1; + _wDaysEarlier = (uint16_t)-1; } return 0; } @@ -302,7 +302,7 @@ int MAnnivDate::DBWriteReminderOpts(MCONTACT hContact) else db_set_b(hContact, USERINFO, SET_REMIND_BIRTHDAY_ENABLED, _bRemind); - if (_wDaysEarlier == (WORD)-1) + if (_wDaysEarlier == (uint16_t)-1) db_unset(hContact, USERINFO, SET_REMIND_BIRTHDAY_OFFSET); else db_set_w(hContact, USERINFO, SET_REMIND_BIRTHDAY_OFFSET, _wDaysEarlier); @@ -318,7 +318,7 @@ int MAnnivDate::DBWriteReminderOpts(MCONTACT hContact) // read offset mir_snprintf(pszSetting, "Anniv%dOffset", _wID); - if (_wDaysEarlier == (WORD)-1) + if (_wDaysEarlier == (uint16_t)-1) db_unset(hContact, USERINFO, pszSetting); else db_set_w(hContact, USERINFO, pszSetting, _wDaysEarlier); @@ -345,7 +345,7 @@ int MAnnivDate::DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPC { ZeroDate(); - WORD wtmp = db_get_w(hContact, pszModule, szYear, 0); + uint16_t wtmp = db_get_w(hContact, pszModule, szYear, 0); Year(wtmp); wtmp = db_get_w(hContact, pszModule, szMonth, 0); @@ -620,7 +620,7 @@ int MAnnivDate::DBDeleteBirthDate(MCONTACT hContact) * return: 0 on success, 1 otherwise **/ -int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) +int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, uint16_t iIndex) { Clear(); @@ -652,7 +652,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) * pszProto - basic protocol module * return: 0 on success, 1 otherwise **/ -int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) +int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, uint16_t wIndex) { // date can only be written to db as anniversary if it is not marked as birthday if (wIndex <= ANID_LAST && _wID != ANID_BIRTHDAY) { @@ -676,7 +676,7 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) * automatic backup service ***********************************************************************************************************/ -static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNewProtoDate) +static uint16_t AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNewProtoDate) { MSGBOX MB; wchar_t szMsg[MAXDATASIZE]; @@ -753,7 +753,7 @@ int MAnnivDate::BackupBirthday(MCONTACT hContact, LPSTR pszProto, const uint8_t } if (bWantBackup) { if (!lastAnswer || *lastAnswer != IDALL) { - WORD rc = AskUser(hContact, this, &mdbNewProto); + uint16_t rc = AskUser(hContact, this, &mdbNewProto); if (lastAnswer) *lastAnswer = rc; diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index a4d0e1b04b..b11713e235 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -43,12 +43,12 @@ public: } EFlags; private: - WORD _wID; // index to anniversary in database or ANID_BIRTHDAY + uint16_t _wID; // index to anniversary in database or ANID_BIRTHDAY wstring _strDesc; // descripes the anniversary (e.g. birthday) string _strModule; // the module the anniversary has been read from - WORD _wFlags; // the flags + uint16_t _wFlags; // the flags 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 + uint16_t _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); int DBDeleteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear) const; @@ -64,10 +64,10 @@ public: __inline void Module(LPCSTR pszModule) { if (pszModule) _strModule = pszModule; else _strModule.clear(); }; __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; }; - __inline void Id(WORD wId) { if (_wID == ANID_NONE) _wID = wId; }; + __inline uint16_t RemindOffset() const { return _wDaysEarlier; }; + __inline void RemindOffset(uint16_t wOffset) { _wDaysEarlier = wOffset; }; + __inline uint16_t Id() const { return _wID; }; + __inline void Id(uint16_t wId) { if (_wID == ANID_NONE) _wID = wId; }; DWORD DateStamp() const; void DateStamp(const DWORD dwStamp); @@ -80,10 +80,10 @@ public: uint8_t IsEqual(const SYSTEMTIME &st) const; // handling flags - __inline WORD Flags() const { return _wFlags; }; - __inline void Flags(WORD wFlags) { _wFlags = wFlags; }; - __inline void SetFlags(WORD wFlag) { _wFlags |= wFlag; }; - __inline void RemoveFlags(WORD wFlag) { _wFlags &= ~wFlag; }; + __inline uint16_t Flags() const { return _wFlags; }; + __inline void Flags(uint16_t wFlags) { _wFlags = wFlags; }; + __inline void SetFlags(uint16_t wFlag) { _wFlags |= wFlag; }; + __inline void RemoveFlags(uint16_t wFlag) { _wFlags &= ~wFlag; }; // return diffence of days, ignoring the date int CompareDays(MTime mt) const; @@ -95,13 +95,13 @@ public: // read date from database int DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear); int DBGetDateStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting); - int DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex); + int DBGetAnniversaryDate(MCONTACT hContact, uint16_t iIndex); int DBGetBirthDate(MCONTACT hContact, LPSTR pszProto = nullptr); int DBGetReminderOpts(MCONTACT hContact); // write date to database int DBWriteDateStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting); - int DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex); + int DBWriteAnniversaryDate(MCONTACT hContact, uint16_t wIndex); int DBWriteBirthDate(MCONTACT hContact); int DBWriteReminderOpts(MCONTACT hContact); diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index f727c79b07..e78d76192f 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -287,23 +287,23 @@ DWORD MTime::TimeStamp() const return (DWORD)li.QuadPart; } -WORD MTime::DaysInMonth(const WORD &wMonth) const +uint16_t MTime::DaysInMonth(const uint16_t &wMonth) const { - static const WORD wDaysInMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + static const uint16_t wDaysInMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if (wMonth > 12) return 0; return (IsLeapYear() && wMonth == 2) ? wDaysInMonth[wMonth] + 1 : wDaysInMonth[wMonth]; } -WORD MTime::DaysInYear(uint8_t bIgnoreLeap) const +uint16_t MTime::DaysInYear(uint8_t bIgnoreLeap) const { return ((!bIgnoreLeap && IsLeapYear()) ? 366 : 365); }; -WORD MTime::DayOfYear() const +uint16_t MTime::DayOfYear() const { - WORD daysResult = 0; - WORD i; + uint16_t daysResult = 0; + uint16_t i; for (i = 0; i < _SysTime.wMonth; i++) daysResult += DaysInMonth(i); @@ -311,7 +311,7 @@ WORD MTime::DayOfYear() const return daysResult; } -WORD MTime::AdjustYear(const int nDiffDays) +uint16_t MTime::AdjustYear(const int nDiffDays) { const int nDay = DayOfYear() + nDiffDays; @@ -322,7 +322,7 @@ WORD MTime::AdjustYear(const int nDiffDays) return _SysTime.wYear; } -WORD MTime::TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat) +uint16_t MTime::TimeFormat(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat) { if (!ptszTimeFormat || !cchTimeFormat) return 0; @@ -333,7 +333,7 @@ WORD MTime::TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat) return cchTimeFormat; } -WORD MTime::DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat) +uint16_t MTime::DateFormat(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat) { if (!ptszTimeFormat || !cchTimeFormat) return 0; @@ -344,12 +344,12 @@ WORD MTime::DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat) return cchTimeFormat; } -WORD MTime::DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat) +uint16_t MTime::DateFormatAlt(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat) { if (!ptszTimeFormat || !cchTimeFormat) return 0; - WORD wRes = DateFormat(ptszTimeFormat, cchTimeFormat); + uint16_t wRes = DateFormat(ptszTimeFormat, cchTimeFormat); if (wRes != 0) return wRes; @@ -377,7 +377,7 @@ WORD MTime::DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat) return cchTimeFormat; } -WORD MTime::DateFormatLong(LPTSTR ptszTimeFormat, WORD cchTimeFormat) +uint16_t MTime::DateFormatLong(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat) { if (!ptszTimeFormat || !cchTimeFormat) return 0; diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index 19fb811cf3..eaf5508130 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -53,31 +53,31 @@ public: DWORD TimeStamp() const; SYSTEMTIME SystemTime() const { return _SysTime; } - WORD DaysInMonth(const WORD &wMonth) const; - WORD DaysInYear(uint8_t bIgnoreLeap = FALSE) const; - WORD DayOfYear() const; - WORD AdjustYear(const int nDiffDays); - - WORD TimeFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat); - WORD DateFormat(LPTSTR ptszTimeFormat, WORD cchTimeFormat); - WORD DateFormatAlt(LPTSTR ptszTimeFormat, WORD cchTimeFormat); - WORD DateFormatLong(LPTSTR ptszTimeFormat, WORD cchTimeFormat); + uint16_t DaysInMonth(const uint16_t &wMonth) const; + uint16_t DaysInYear(uint8_t bIgnoreLeap = FALSE) const; + uint16_t DayOfYear() const; + uint16_t AdjustYear(const int nDiffDays); + + uint16_t TimeFormat(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat); + uint16_t DateFormat(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat); + uint16_t DateFormatAlt(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat); + uint16_t DateFormatLong(LPTSTR ptszTimeFormat, uint16_t cchTimeFormat); // return single attributes - __inline WORD DayOfWeek() const { return _SysTime.wDayOfWeek; } - __inline WORD Day() const { return _SysTime.wDay; } - __inline WORD Month() const { return _SysTime.wMonth; } - __inline WORD Year() const { return _SysTime.wYear; } - __inline WORD Hour() const { return _SysTime.wHour; } - __inline WORD Minute() const { return _SysTime.wMinute; } - __inline WORD Second() const { return _SysTime.wSecond; } + __inline uint16_t DayOfWeek() const { return _SysTime.wDayOfWeek; } + __inline uint16_t Day() const { return _SysTime.wDay; } + __inline uint16_t Month() const { return _SysTime.wMonth; } + __inline uint16_t Year() const { return _SysTime.wYear; } + __inline uint16_t Hour() const { return _SysTime.wHour; } + __inline uint16_t Minute() const { return _SysTime.wMinute; } + __inline uint16_t Second() const { return _SysTime.wSecond; } // set single values - __inline void Minute(const WORD wMinute) { if (wMinute <= 59) _SysTime.wMinute = wMinute; } - __inline void Hour(const WORD wHour) { if (wHour <= 24) _SysTime.wHour = wHour; } - __inline void Day(const WORD wDay) { if (wDay <= 31) _SysTime.wDay = wDay; } - __inline void Month(const WORD wMonth) { if (wMonth <= 12) _SysTime.wMonth = wMonth; } - __inline void Year(const WORD wYear) { _SysTime.wYear = wYear; } + __inline void Minute(const uint16_t wMinute) { if (wMinute <= 59) _SysTime.wMinute = wMinute; } + __inline void Hour(const uint16_t wHour) { if (wHour <= 24) _SysTime.wHour = wHour; } + __inline void Day(const uint16_t wDay) { if (wDay <= 31) _SysTime.wDay = wDay; } + __inline void Month(const uint16_t wMonth) { if (wMonth <= 12) _SysTime.wMonth = wMonth; } + __inline void Year(const uint16_t wYear) { _SysTime.wYear = wYear; } // set value to class void ZeroDate(); diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 3d809a064e..f4b55fa027 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -380,7 +380,7 @@ HTREEITEM CPsTree::ShowItem(const int iPageIndex, LPWORD needWidth) // calculate width of treeview if (needWidth && TreeView_GetItemRect(_hWndTree, pti->Hti(), &rc, TRUE) && rc.right > *needWidth) { - *needWidth = (WORD)rc.right; + *needWidth = (uint16_t)rc.right; } } return tvii.itemex.hItem; @@ -483,7 +483,7 @@ HTREEITEM CPsTree::MoveItem(HTREEITEM hItem, HTREEITEM hInsertAfter, uint8_t bAs * return: 0 on success or 1 otherwise **/ -WORD CPsTree::SaveItemsState(LPCSTR pszGroup, HTREEITEM hRootItem, int& iItem) +uint16_t CPsTree::SaveItemsState(LPCSTR pszGroup, HTREEITEM hRootItem, int& iItem) { TVITEMEX tvi; tvi.mask = TVIF_CHILDREN|TVIF_STATE|TVIF_PARAM; @@ -492,7 +492,7 @@ WORD CPsTree::SaveItemsState(LPCSTR pszGroup, HTREEITEM hRootItem, int& iItem) tvi.lParam = (LPARAM)-1; // save all visible items - WORD numErrors = 0; + uint16_t numErrors = 0; for (tvi.hItem = TreeView_GetChild(_hWndTree, hRootItem); TreeView_GetItem(_hWndTree, &tvi); tvi.hItem = TreeView_GetNextSibling(_hWndTree, tvi.hItem)) { auto &it = _pages[tvi.lParam]; numErrors += it.DBSaveItemState(pszGroup, iItem++, tvi.state, _dwFlags); @@ -518,7 +518,7 @@ void CPsTree::SaveState() int iItem = 0; // save all visible items - WORD numErrors = SaveItemsState(TREE_ROOTITEM, TVGN_ROOT, iItem); + uint16_t numErrors = SaveItemsState(TREE_ROOTITEM, TVGN_ROOT, iItem); // save all invisible items of the current subtree for (auto &it : _pages) { @@ -662,7 +662,7 @@ int CPsTree::EndLabelEdit(const uint8_t bSave) { wchar_t szEdit[MAX_TINAME]; TVITEM tvi; - WORD cchEdit; + uint16_t cchEdit; if (bSave && (cchEdit = Edit_GetText(_hLabelEdit, szEdit, MAX_TINAME)) > 0) { diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 7d3a5d2c9f..4a25156767 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -467,9 +467,9 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) * dwFlags - tells what to save * return: handle to new (moved) treeitem if successful or NULL otherwise **/ -WORD CPsTreeItem::DBSaveItemState(LPCSTR pszGroup, int iItemPosition, UINT iState, DWORD dwFlags) +uint16_t CPsTreeItem::DBSaveItemState(LPCSTR pszGroup, int iItemPosition, UINT iState, DWORD dwFlags) { - WORD numErrors = 0; + uint16_t numErrors = 0; // save group if ((dwFlags & PSTVF_GROUPS) && (dwFlags & PSTVF_POS_CHANGED)) diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index b8ac49d503..bc19dd5b55 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" -CBaseCtrl* CAnnivEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) +CBaseCtrl* CAnnivEditCtrl::CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting) { CAnnivEditCtrl *ctrl = nullptr; @@ -32,7 +32,7 @@ CBaseCtrl* CAnnivEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) return (ctrl); } -CAnnivEditCtrl::CAnnivEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) +CAnnivEditCtrl::CAnnivEditCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting) : CBaseCtrl(hDlg, idCtrl, pszSetting) { _hwndDlg = hDlg; @@ -67,7 +67,7 @@ CAnnivEditCtrl::CAnnivEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) CAnnivEditCtrl::~CAnnivEditCtrl() { - WORD i; + uint16_t i; if (_pDates != nullptr) { @@ -93,7 +93,7 @@ void CAnnivEditCtrl::Release() * param: wIndex - index to desired item * return: TRUE if item is valid, FALSE otherwise **/ -uint8_t CAnnivEditCtrl::ItemValid(WORD wIndex) const +uint8_t CAnnivEditCtrl::ItemValid(uint16_t wIndex) const { return (_pDates != nullptr && wIndex < _numDates && _pDates[wIndex] != nullptr); } @@ -164,9 +164,9 @@ void CAnnivEditCtrl::EnableCurrentItem() * return: if an date with the wId was found - iterator to item, * NULL otherwise **/ -MAnnivDate* CAnnivEditCtrl::FindDateById(const WORD wId) +MAnnivDate* CAnnivEditCtrl::FindDateById(const uint16_t wId) { - WORD i; + uint16_t i; if (_pDates != nullptr) { for (i = 0; i < _numDates; i++) { @@ -225,7 +225,7 @@ INT_PTR CAnnivEditCtrl::AddDate(MAnnivDate &mda) * wIndex - index of the item to delete * return: 0 on success 1 otherwise **/ -INT_PTR CAnnivEditCtrl::DeleteDate(WORD wIndex) +INT_PTR CAnnivEditCtrl::DeleteDate(uint16_t wIndex) { if (!ItemValid(wIndex)) return 1; @@ -246,7 +246,7 @@ INT_PTR CAnnivEditCtrl::DeleteDate(WORD wIndex) } _pDates[wIndex]->RemindOption(BST_INDETERMINATE); - _pDates[wIndex]->RemindOffset((WORD)-1); + _pDates[wIndex]->RemindOffset((uint16_t)-1); _pDates[wIndex]->RemoveFlags(MAnnivDate::MADF_HASCUSTOM); _pDates[wIndex]->SetFlags(MAnnivDate::MADF_CHANGED|MAnnivDate::MADF_REMINDER_CHANGED); @@ -292,7 +292,7 @@ INT_PTR CAnnivEditCtrl::DBGetAnniversaries(MCONTACT hContact) { MAnnivDate mda; - WORD i; + uint16_t i; uint8_t bChanged = FALSE; for (i = 0; i < ANID_LAST && !mda.DBGetAnniversaryDate(hContact, i); i++) { @@ -348,7 +348,7 @@ INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(MCONTACT hContact) { const LPCSTR szPrefix[] = { "Reminder", "Offset", "Desc", "Day", "Month", "Year", "Stamp", "Date" }; CHAR szSet0[MAXSETTING]; - WORD i, ret, ofs, wIndex = 0; + uint16_t i, ret, ofs, wIndex = 0; for (i = 0; i < _numDates; i++) { if ( @@ -381,7 +381,7 @@ INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(MCONTACT hContact) * wIndex - index of the item to delete * return: 0 on success 1 otherwise **/ -INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex) +INT_PTR CAnnivEditCtrl::SetCurSel(uint16_t wIndex) { uint8_t bEnabled = ItemValid(wIndex); @@ -431,7 +431,7 @@ void CAnnivEditCtrl::OnMenuPopup() POINT pt = { 0, 0 }; RECT rc; HMENU hMenu; - WORD i; + uint16_t i; if (hMenu = CreatePopupMenu()) { SetFocus(_hBtnMenu); @@ -545,7 +545,7 @@ void CAnnivEditCtrl::OnReminderChecked() } else if (IsDlgButtonChecked(_hwndDlg, RADIO_REMIND2)) { - if (pCurrent->RemindOffset() == (WORD)-1) + if (pCurrent->RemindOffset() == (uint16_t)-1) { _itow(g_plugin.getByte(SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), buf, 10); } diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.h b/plugins/UserInfoEx/src/ctrl_annivedit.h index 520dd525db..bccfa3e134 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.h +++ b/plugins/UserInfoEx/src/ctrl_annivedit.h @@ -36,10 +36,10 @@ class CAnnivEditCtrl : public CBaseCtrl uint8_t _ReminderEnabled; MAnnivDate** _pDates; - WORD _numDates; - WORD _curDate; + uint16_t _numDates; + uint16_t _curDate; - uint8_t ItemValid(WORD wIndex) const; + uint8_t ItemValid(uint16_t wIndex) const; uint8_t CurrentItemValid() const; INT_PTR DBGetBirthDay(MCONTACT hContact, LPCSTR pszProto); @@ -48,25 +48,25 @@ class CAnnivEditCtrl : public CBaseCtrl INT_PTR DBGetAnniversaries(MCONTACT hContact); INT_PTR DBWriteAnniversaries(MCONTACT hContact); - CAnnivEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting); + CAnnivEditCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting); ~CAnnivEditCtrl(); public: MAnnivDate* Current() { return CurrentItemValid() ? _pDates[_curDate] : nullptr; }; - WORD CurrentIndex() const { return _curDate; }; - WORD NumDates() const { return _numDates; }; + uint16_t CurrentIndex() const { return _curDate; }; + uint16_t NumDates() const { return _numDates; }; uint8_t ReminderEnabled() const { return _ReminderEnabled; }; - MAnnivDate* FindDateById(const WORD wId); + MAnnivDate* FindDateById(const uint16_t wId); void EnableCurrentItem(); void EnableReminderCtrl(uint8_t bEnabled); - INT_PTR SetCurSel(WORD wIndex); + INT_PTR SetCurSel(uint16_t wIndex); INT_PTR AddDate(MAnnivDate &mda); - INT_PTR DeleteDate(WORD wIndex); + INT_PTR DeleteDate(uint16_t wIndex); void SetZodiacAndAge(MAnnivDate *mt); @@ -81,10 +81,10 @@ public: **/ static FORCEINLINE CAnnivEditCtrl* GetObj(HWND hCtrl) { return (CAnnivEditCtrl*) GetUserData(hCtrl); } - static FORCEINLINE CAnnivEditCtrl* GetObj(HWND hDlg, WORD idCtrl) + static FORCEINLINE CAnnivEditCtrl* GetObj(HWND hDlg, uint16_t idCtrl) { return GetObj(GetDlgItem(hDlg, idCtrl)); } - static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting); + static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting); virtual void Release(); virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto); diff --git a/plugins/UserInfoEx/src/ctrl_base.cpp b/plugins/UserInfoEx/src/ctrl_base.cpp index cc278096ef..9a2780cf60 100644 --- a/plugins/UserInfoEx/src/ctrl_base.cpp +++ b/plugins/UserInfoEx/src/ctrl_base.cpp @@ -40,7 +40,7 @@ void Ctrl_InitTextColours() clrMeta = g_plugin.getDword(SET_PROPSHEET_CLRMETA, RGB(120, 40, 130)); } -INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, WORD wFlags) +INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, uint16_t wFlags) { // OLD stuff SetTextColor(hdc, @@ -82,7 +82,7 @@ CBaseCtrl::CBaseCtrl() * * **/ -CBaseCtrl::CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) +CBaseCtrl::CBaseCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting) { memset(this, 0, sizeof(*this)); _cbSize = sizeof(CBaseCtrl); @@ -98,7 +98,7 @@ CBaseCtrl::CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) * * **/ -CBaseCtrl::CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting) +CBaseCtrl::CBaseCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting) { memset(this, 0, sizeof(*this)); _cbSize = sizeof(CBaseCtrl); @@ -255,7 +255,7 @@ void CCtrlList::OnApply(MCONTACT hContact, LPCSTR pszProto) * * **/ -void CCtrlList::OnChangedByUser(WORD idCtrl, WORD wChangedMsg) +void CCtrlList::OnChangedByUser(uint16_t idCtrl, uint16_t wChangedMsg) { // prefilter messages to avoid unessesary search operations switch (wChangedMsg) diff --git a/plugins/UserInfoEx/src/ctrl_base.h b/plugins/UserInfoEx/src/ctrl_base.h index fe9c7fe99f..5cdab6cdb1 100644 --- a/plugins/UserInfoEx/src/ctrl_base.h +++ b/plugins/UserInfoEx/src/ctrl_base.h @@ -43,12 +43,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct TCtrlInfo { uint8_t nType; - WORD wFlags; + uint16_t wFlags; } CTRL, *LPCTRL; // for compatibility with old styled controls void Ctrl_InitTextColours(); -INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, WORD wFlags); +INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, uint16_t wFlags); /*********************************************************************************************************** * CBaseCtrl declaration @@ -56,7 +56,7 @@ INT_PTR CALLBACK Ctrl_SetTextColour(HDC hdc, WORD wFlags); union CCtrlFlags { - WORD W; + uint16_t W; struct CBits { bool hasChanged : 1; @@ -82,7 +82,7 @@ protected: CCtrlFlags _Flags; HWND _hwnd; - WORD _idCtrl; + uint16_t _idCtrl; LPCSTR _pszModule; LPCSTR _pszSetting; LPTSTR _pszValue; @@ -95,8 +95,8 @@ protected: * @return nothing **/ CBaseCtrl(); - CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting); - CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting); + CBaseCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting); + CBaseCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting); /** * Private constructure is to force the class used as base class only. @@ -120,7 +120,7 @@ public: * * **/ - static FORCEINLINE CBaseCtrl* GetObj(HWND hDlg, WORD idCtrl) + static FORCEINLINE CBaseCtrl* GetObj(HWND hDlg, uint16_t idCtrl) { return GetObj(GetDlgItem(hDlg, idCtrl)); } /** @@ -172,7 +172,7 @@ public: * * @return nothing **/ - virtual void OnChangedByUser(WORD) { } + virtual void OnChangedByUser(uint16_t) { } virtual void OnReset() { } @@ -209,7 +209,7 @@ public: void OnReset(); BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto); void OnApply(MCONTACT hContact, LPCSTR pszProto); - void OnChangedByUser(WORD idCtrl, WORD wChangedMsg); + void OnChangedByUser(uint16_t idCtrl, uint16_t wChangedMsg); INT_PTR OnSetTextColour(HWND hCtrl, HDC hdc); }; diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index a6028aa75a..cffd91bd88 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -156,7 +156,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien { RECT rcText = { 0, 0, 0, 0 }; wchar_t wszText[MAX_PATH] = { 0 }; - WORD ccText; + uint16_t ccText; // Draw the flat button if ((ctl->dwStyle & MBS_FLAT) && ctl->hThemeToolbar) { @@ -255,7 +255,7 @@ static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient) { RECT rcText = { 0, 0, 0, 0 }; wchar_t szText[MAX_PATH] = { 0 }; - WORD ccText; + uint16_t ccText; // Draw the flat button if (ctl->dwStyle & MBS_FLAT) { diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index b686f41664..e2d7bdeaf1 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * @param hDlg - HWND of the owning propertysheet page * @param idCtrl - the ID of the control to associate with this class's instance * @param pszSetting - the database setting to be handled by this class - * @param bDBDataType - datatype of of the associated database setting (WORD, DWORD, ...) + * @param bDBDataType - datatype of of the associated database setting (uint16_t, DWORD, ...) * @param pList - pointer to a LPIDSTRLIST list, which holds the items to insert into the combobox. * @param nListCount - number of items in the list * * @return pointer of the newly created CCombo object. **/ -CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount) +CBaseCtrl* CCombo::CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount) { return new CCombo(hDlg, idCtrl, pszSetting, bDBDataType, pList, nListCount); } @@ -45,13 +45,13 @@ CBaseCtrl* CCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t * @param hDlg - HWND of the owning propertysheet page * @param idCtrl - the ID of the control to associate with this class's instance * @param pszSetting - the database setting to be handled by this class - * @param bDBDataType - datatype of of the associated database setting (WORD, DWORD, ...) + * @param bDBDataType - datatype of of the associated database setting (uint16_t, DWORD, ...) * @param pList - pointer to a LPIDSTRLIST list, which holds the items to insert into the combobox. * @param nListCount - number of items in the list * * @return nothing **/ -CCombo::CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount) +CCombo::CCombo(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount) : CBaseCtrl(hDlg, idCtrl, pszSetting) { _curSel = CB_ERR; @@ -172,7 +172,7 @@ BOOL CCombo::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) db_free(&dbv); ComboBox_SetCurSel(_hwnd, iVal); _curSel = ComboBox_GetCurSel(_hwnd); - SendMessage(GetParent(_hwnd), WM_COMMAND, MAKEWPARAM((WORD)this->_idCtrl, (WORD)CBN_SELCHANGE), (LPARAM)_hwnd); + SendMessage(GetParent(_hwnd), WM_COMMAND, MAKEWPARAM((uint16_t)this->_idCtrl, (uint16_t)CBN_SELCHANGE), (LPARAM)_hwnd); } return _Flags.B.hasChanged; } @@ -229,7 +229,7 @@ void CCombo::OnApply(MCONTACT hContact, LPCSTR pszProto) * The user changed combobox selection, so mark it changed. * **/ -void CCombo::OnChangedByUser(WORD wChangedMsg) +void CCombo::OnChangedByUser(uint16_t wChangedMsg) { if (wChangedMsg == CBN_SELCHANGE) { int c = ComboBox_GetCurSel(_hwnd); diff --git a/plugins/UserInfoEx/src/ctrl_combo.h b/plugins/UserInfoEx/src/ctrl_combo.h index 9bb5bb5348..618a5441fa 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.h +++ b/plugins/UserInfoEx/src/ctrl_combo.h @@ -40,7 +40,7 @@ class CCombo : public CBaseCtrl * * @return nothing **/ - CCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount); + CCombo(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount); int Find(int nIndex) const; int Find(LPTSTR ptszItemLabel) const; @@ -55,15 +55,15 @@ public: **/ static FORCEINLINE CCombo* GetObj(HWND hCtrl) { return (CCombo*) GetUserData(hCtrl); } - static FORCEINLINE CCombo* GetObj(HWND hDlg, WORD idCtrl) + static FORCEINLINE CCombo* GetObj(HWND hDlg, uint16_t idCtrl) { return GetObj(GetDlgItem(hDlg, idCtrl)); } - static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount); + static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t bDBDataType, LPIDSTRLIST pList, int nListCount); virtual void Release(); virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto); virtual void OnApply(MCONTACT hContact, LPCSTR pszProto); - virtual void OnChangedByUser(WORD wChangedMsg); + virtual void OnChangedByUser(uint16_t wChangedMsg); }; #endif /* _UI_CTRL_COMBO_INCLUDE_ */ \ No newline at end of file diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index e5a970fe72..df0651487d 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -32,8 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct TCbExItem { - WORD wMask; - WORD wFlags; + uint16_t wMask; + uint16_t wFlags; DWORD dwID; wchar_t szCat[MAX_CAT]; LPTSTR pszVal; @@ -68,7 +68,7 @@ static int compareProc(LPCVOID cbi1, LPCVOID cbi2) return mir_wstrcmp(((LPCBEXITEMINTERN)cbi1)->szCat, ((LPCBEXITEMINTERN)cbi2)->szCat); } -static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, WORD cchNumber, int& errorPos) +static int CheckPhoneSyntax(LPTSTR pszSrc, LPTSTR szNumber, uint16_t cchNumber, int& errorPos) { int lenNum = 0; uint8_t hasLeftBreaket = FALSE, @@ -440,9 +440,9 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L **/ case WM_CREATE: { - WORD wHeight = (WORD)(cbex->rect.bottom - cbex->rect.top); - WORD wWidth = 130; - WORD x = 0; + uint16_t wHeight = (uint16_t)(cbex->rect.bottom - cbex->rect.top); + uint16_t wWidth = 130; + uint16_t x = 0; if (!(cbex->hBtnEdit = CreateWindowEx(WS_EX_NOPARENTNOTIFY, UINFOBUTTONCLASS, @@ -471,7 +471,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return FALSE; } x += wWidth + 2; - wWidth = (WORD)(cbex->rect.right - cbex->rect.left - x - (2 * (wHeight + 2))); + wWidth = (uint16_t)(cbex->rect.right - cbex->rect.left - x - (2 * (wHeight + 2))); if (!(cbex->hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"Edit", nullptr, @@ -661,7 +661,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case BTN_ADD: if (HIWORD(wParam) == BN_CLICKED) { DLGPROC dlgProc; - WORD dlgID; + uint16_t dlgID; wchar_t szCat[MAX_CAT] = { 0 }; wchar_t szVal[MAXDATASIZE] = { 0 }; CBEXITEM cbi; @@ -718,7 +718,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case BTN_EDIT: if (HIWORD(wParam) == BN_CLICKED) { DLGPROC dlgProc; - WORD dlgID; + uint16_t dlgID; wchar_t szCat[MAX_CAT] = { 0 }; wchar_t szVal[MAXDATASIZE] = { 0 }; CBEXITEM cbi; @@ -1331,7 +1331,7 @@ int CtrlContactAddItemFromDB( int CtrlContactAddMyItemsFromDB( HWND hCtrl, int iIcon, - WORD wForcedFlags, + uint16_t wForcedFlags, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, @@ -1341,7 +1341,7 @@ int CtrlContactAddMyItemsFromDB( CBEXITEM cbi; DBVARIANT dbv; CHAR pszSetting[MAXSETTING]; - WORD i; + uint16_t i; LPTSTR sms; int bAnyItemIsChanged = 0; diff --git a/plugins/UserInfoEx/src/ctrl_contact.h b/plugins/UserInfoEx/src/ctrl_contact.h index df3e9f8858..1313428b6a 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.h +++ b/plugins/UserInfoEx/src/ctrl_contact.h @@ -56,21 +56,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CBEXITEM { - WORD wMask; // determines which element of this structure is valid - WORD wFlags; // standard control flags + uint16_t wMask; // determines which element of this structure is valid + uint16_t wFlags; // standard control flags int iItem; // position of the item in the data array DWORD dwID; // unique number for each setting read from db to identify it, new entries have dwID = 0 LPTSTR pszCat; // pointer to a descriptive category string to set or retrieve for the data entry - WORD ccCat; + uint16_t ccCat; LPTSTR pszVal; - WORD ccVal; + uint16_t ccVal; int iIcon; }; int CtrlContactLoadModule(); int CtrlContactUnLoadModule(); int CtrlContactAddItemFromDB(HWND hCtrl, int iIcon, LPTSTR szItem, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szSettingVal); -int CtrlContactAddMyItemsFromDB(HWND hCtrl, int iIcon, WORD wForcedFlags, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal); +int CtrlContactAddMyItemsFromDB(HWND hCtrl, int iIcon, uint16_t wForcedFlags, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal); int CtrlContactWriteItemToDB(HWND hCtrl, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting); int CtrlContactWriteMyItemsToDB(HWND hCtrl, int iFirstItem, MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal); diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index e0af506783..12537bbfcd 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, uint8_t dbType) +CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, uint16_t 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, uint8 * @return This static method returns the pointer of the created object. **/ -CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType) +CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType) { CEditCtrl *ctrl = new CEditCtrl(hDlg, idCtrl, pszModule, pszSetting); if (ctrl) @@ -66,7 +66,7 @@ CBaseCtrl* CEditCtrl::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR * * **/ -CEditCtrl::CEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting) +CEditCtrl::CEditCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting) : CBaseCtrl(hDlg, idCtrl, pszModule, pszSetting) { SendDlgItemMessage(hDlg, idCtrl, EM_LIMITTEXT, 0x7fFFffFF, 0L); @@ -183,7 +183,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) break; case DBVT_WORD: - dbv.wVal = (WORD)wcstol(val, nullptr, 10); + dbv.wVal = (uint16_t)wcstol(val, nullptr, 10); break; case DBVT_DWORD: @@ -232,7 +232,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) * * @return nothing **/ -void CEditCtrl::OnChangedByUser(WORD wChangedMsg) +void CEditCtrl::OnChangedByUser(uint16_t wChangedMsg) { if ((wChangedMsg == EN_UPDATE) || (wChangedMsg == EN_CHANGE)) { DWORD cch = GetWindowTextLength(_hwnd); diff --git a/plugins/UserInfoEx/src/ctrl_edit.h b/plugins/UserInfoEx/src/ctrl_edit.h index a384bafbe6..773f5e1efc 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.h +++ b/plugins/UserInfoEx/src/ctrl_edit.h @@ -39,7 +39,7 @@ class CEditCtrl : public CBaseCtrl * * @return nothing **/ - CEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting); + CEditCtrl(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting); public: @@ -49,17 +49,17 @@ public: **/ static FORCEINLINE CEditCtrl* GetObj(HWND hCtrl) { return (CEditCtrl*) GetUserData(hCtrl); } - static FORCEINLINE CEditCtrl* GetObj(HWND hDlg, WORD idCtrl) + static FORCEINLINE CEditCtrl* GetObj(HWND hDlg, uint16_t idCtrl) { return GetObj(GetDlgItem(hDlg, idCtrl)); } - 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); + static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting, uint8_t dbType); + static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszModule, LPCSTR pszSetting, uint8_t dbType); virtual void Release(); virtual void OnReset(); virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto); virtual void OnApply(MCONTACT hContact, LPCSTR pszProto); - virtual void OnChangedByUser(WORD wChangedMsg); + virtual void OnChangedByUser(uint16_t wChangedMsg); void OpenUrl(); LRESULT LinkNotificationHandler(ENLINK* lnk); diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp index 12d41473f7..f28c7812a0 100644 --- a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp +++ b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * @return CTzCombo* **/ -CBaseCtrl* CTzCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) +CBaseCtrl* CTzCombo::CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting) { HWND hCtrl = GetDlgItem(hDlg, idCtrl); @@ -58,7 +58,7 @@ CTzCombo::CTzCombo() : CBaseCtrl() * * **/ -CTzCombo::CTzCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) +CTzCombo::CTzCombo(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting) : CBaseCtrl(hDlg, idCtrl, pszSetting) { _curSel = CB_ERR; @@ -159,7 +159,7 @@ void CTzCombo::OnApply(MCONTACT hContact, LPCSTR pszProto) * * @return nothing **/ -void CTzCombo::OnChangedByUser(WORD wChangedMsg) +void CTzCombo::OnChangedByUser(uint16_t wChangedMsg) { if (wChangedMsg == CBN_SELCHANGE) { int c = ComboBox_GetCurSel(_hwnd); diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.h b/plugins/UserInfoEx/src/ctrl_tzcombo.h index daa48907bd..4eba24f871 100644 --- a/plugins/UserInfoEx/src/ctrl_tzcombo.h +++ b/plugins/UserInfoEx/src/ctrl_tzcombo.h @@ -30,7 +30,7 @@ class CTzCombo : public CBaseCtrl int _curSel; //selectet combo index CTzCombo(); - CTzCombo(HWND hDlg, WORD idCtrl, LPCSTR pszSetting); + CTzCombo(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting); int Find(LPTIME_ZONE_INFORMATION pTimeZone) const; //new core tz interface @@ -38,16 +38,16 @@ public: static FORCEINLINE CTzCombo* GetObj(HWND hCtrl) { return (CTzCombo*) GetUserData(hCtrl); } - static FORCEINLINE CTzCombo* GetObj(HWND hDlg, WORD idCtrl) + static FORCEINLINE CTzCombo* GetObj(HWND hDlg, uint16_t idCtrl) { return GetObj(GetDlgItem(hDlg, idCtrl)); } - static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting); + static CBaseCtrl* CreateObj(HWND hDlg, uint16_t idCtrl, LPCSTR pszSetting); virtual void Release(); // virtual void OnReset() {}; virtual BOOL OnInfoChanged(MCONTACT hContact, LPCSTR pszProto); virtual void OnApply(MCONTACT hContact, LPCSTR pszProto); - virtual void OnChangedByUser(WORD wChangedMsg); + virtual void OnChangedByUser(uint16_t wChangedMsg); void GetTime(LPTSTR szTime, int cchTime); }; diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 86a6fe9dc1..de64451ba9 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -75,7 +75,7 @@ class CAnnivList struct CFilter { - WORD wDaysBefore = (WORD)-1; + uint16_t wDaysBefore = (uint16_t)-1; uint8_t bFilterIndex = 0; LPSTR pszProto = nullptr; LPTSTR pszAnniv = nullptr; @@ -85,7 +85,7 @@ class CAnnivList { MCONTACT _hContact; MAnnivDate _pDate; - WORD _wDaysBefore; + uint16_t _wDaysBefore; uint8_t _wReminderState; CItemData(MCONTACT hContact, MAnnivDate &date) : @@ -187,7 +187,7 @@ class CAnnivList EndDeferWindowPos(_hdWnds); } - void MoveCtrl(WORD idCtrl, int anchors) + void MoveCtrl(uint16_t idCtrl, int anchors) { if (!(_wndPos->flags & SWP_NOSIZE)) { HWND hCtrl = GetDlgItem(_wndPos->hwnd, idCtrl); @@ -433,7 +433,7 @@ class CAnnivList // number of days to remind in advance is edited case EDIT_REMIND: if (pid && pDlg->_bRemindEnable && HIWORD(wParam) == EN_CHANGE) { - WORD wDaysBefore = GetDlgItemInt(hDlg, LOWORD(wParam), nullptr, FALSE); + uint16_t wDaysBefore = GetDlgItemInt(hDlg, LOWORD(wParam), nullptr, FALSE); if (pid->_wReminderState == BST_CHECKED && pid->_wDaysBefore != wDaysBefore) { pid->_wDaysBefore = wDaysBefore; } @@ -447,7 +447,7 @@ class CAnnivList 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; + pDlg->_filter.wDaysBefore = isChecked ? GetDlgItemInt(hDlg, EDIT_DAYS, nullptr, FALSE) : (uint16_t)-1; pDlg->RebuildList(); } break; @@ -455,7 +455,7 @@ class CAnnivList // the number of days a contact must have an anniversary in advance to be displayed is edited case EDIT_DAYS: if (HIWORD(wParam) == EN_CHANGE) { - WORD wNewDays = GetDlgItemInt(hDlg, LOWORD(wParam), nullptr, FALSE); + uint16_t wNewDays = GetDlgItemInt(hDlg, LOWORD(wParam), nullptr, FALSE); if (wNewDays != pDlg->_filter.wDaysBefore) { pDlg->_filter.wDaysBefore = wNewDays; pDlg->RebuildList(); @@ -657,7 +657,7 @@ class CAnnivList ad.DBGetReminderOpts(hContact); if ((_filter.bFilterIndex != FILTER_DISABLED_REMINDER) || (ad.RemindOption() == BST_UNCHECKED)) { // set default offset if required - if (ad.RemindOffset() == (WORD)-1) { + if (ad.RemindOffset() == (uint16_t)-1) { ad.RemindOffset(wDaysBefore); // create data object @@ -810,7 +810,7 @@ class CAnnivList void SaveFilter() { if (_hDlg) { - g_plugin.setWord(SET_ANNIVLIST_FILTER_DAYS, (WORD)GetDlgItemInt(_hDlg, EDIT_DAYS, nullptr, FALSE)); + g_plugin.setWord(SET_ANNIVLIST_FILTER_DAYS, (uint16_t)GetDlgItemInt(_hDlg, EDIT_DAYS, nullptr, FALSE)); 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))); } @@ -857,7 +857,7 @@ public: for (c = 0; c < cc; c++) { mir_snprintf(pszSetting, "AnnivDlg_Col%d", c); - g_plugin.setWord(pszSetting, (WORD)ListView_GetColumnWidth(_hList, c)); + g_plugin.setWord(pszSetting, (uint16_t)ListView_GetColumnWidth(_hList, c)); } DeleteAllItems(); } diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index a1a1068f5f..d6d5acd4e8 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -614,7 +614,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar pPs->hBoldFont = CreateFontIndirect(&lf); // initialize the optionpages and tree control - WORD needWidth = 0; + uint16_t needWidth = 0; if (!pPs->pTree->InitTreeItems(&needWidth)) return FALSE; @@ -663,8 +663,8 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // move and resize the rest of the controls if (addWidth > 0) { - static const WORD idResize[] = { IDC_HEADERBAR, STATIC_LINE2 }; - static const WORD idMove[] = { IDC_PAGETITLE, IDC_PAGETITLEBG, IDC_PAGETITLEBG2, IDOK, IDCANCEL, IDAPPLY }; + static const uint16_t idResize[] = { IDC_HEADERBAR, STATIC_LINE2 }; + static const uint16_t idMove[] = { IDC_PAGETITLE, IDC_PAGETITLEBG, IDC_PAGETITLEBG2, IDOK, IDCANCEL, IDAPPLY }; HWND hCtrl; for (auto &it : idResize) { diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h index 6e1c1735ae..dec1525be7 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.h +++ b/plugins/UserInfoEx/src/dlg_propsheet.h @@ -96,7 +96,7 @@ public: LPSTR ParentItemName(); HWND CreateWnd(LPPS pPs); - WORD DBSaveItemState(LPCSTR pszGroup, int iItemPosition, UINT iState, DWORD dwFlags); + uint16_t DBSaveItemState(LPCSTR pszGroup, int iItemPosition, UINT iState, DWORD dwFlags); // notification handlers void OnInfoChanged(); @@ -145,7 +145,7 @@ class CPsTree bool _isDragging = false; LPPS _pPs = nullptr; - WORD SaveItemsState(LPCSTR pszGroup, HTREEITEM hRootItem, int& iItem); + uint16_t SaveItemsState(LPCSTR pszGroup, HTREEITEM hRootItem, int& iItem); public: CPsTree(LPPS pPs); @@ -223,7 +223,7 @@ struct CPsHdr LPCSTR _pszProto = 0; // owning contact's protocol LPCSTR _pszPrefix = 0; // name prefix for treeitem settings CPsTreeItem** _pPages = 0; // the pages - WORD _numPages = 0; // number of pages + uint16_t _numPages = 0; // number of pages DWORD _dwFlags = 0; // some option flags HIMAGELIST _hImages = 0; // the imagelist with all tree item icons LIST _ignore; // list of skipped items when adding metasubcontacts pages diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index 8ac4701159..741182c913 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -54,9 +54,9 @@ public: __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(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(uint16_t 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; } + __inline void uidn(uint8_t *val, DWORD len) { _dbvUID.type = DBVT_BLOB; _dbvUID.pbVal = val; _dbvUID.cpbVal = (uint16_t)len; } __inline void uida(LPCSTR val) { _dbvUID.type = (_dbvUID.pszVal = mir_utf8decodeA(val)) ? DBVT_ASCIIZ : DBVT_DELETED; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index c6abf8dc13..7b31b83f26 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -528,7 +528,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) uid((uint8_t)atoi(pUID)); break; case 'w': - uid((WORD)atoi(pUID)); + uid((uint16_t)atoi(pUID)); break; case 'd': uid((DWORD)_atoi64(pUID)); @@ -850,7 +850,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr break; case 'w': //'w' wVal and sVal are valid dbv.type = DBVT_WORD; - dbv.wVal = (WORD)atoi(value + 1); + dbv.wVal = (uint16_t)atoi(value + 1); break; case 'd': //'d' dVal and lVal are valid dbv.type = DBVT_DWORD; @@ -868,7 +868,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr dbv.type = DBVT_BLOB; dbv.pbVal = (uint8_t*)mir_base64_decode(value + 1, &baselen); if (dbv.pbVal != nullptr) - dbv.cpbVal = (WORD)baselen; + dbv.cpbVal = (uint16_t)baselen; else { mir_free(dbv.pbVal); return ERROR_NOT_ADDED; @@ -928,7 +928,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, const TiXmlElement *xmlEvent) if (tmpVal != NULL) { // event owning module dbei.pBlob = tmpVal; - dbei.cbBlob = (WORD)baselen; + dbei.cbBlob = (uint16_t)baselen; dbei.szModule = (LPSTR)pszModule; dbei.eventType = xmlEvent->IntAttribute("type"); dbei.flags = xmlEvent->IntAttribute("flag"); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index dfc3b85940..854c2ad622 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -85,7 +85,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++) + for (uint16_t j = 0; j < dbv.cpbVal; j++) fprintf(file, "%02X ", (uint8_t)dbv.pbVal[j]); fputc('\n', file); break; @@ -321,7 +321,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) if (size_t brk = strspn(value, "0123456789-")) *(value + brk) = 0; dbv.type = DBVT_WORD; - dbv.wVal = (WORD)atoi(value); + dbv.wVal = (uint16_t)atoi(value); break; case 'd': @@ -367,7 +367,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) case 'N': uint8_t *dest; dbv.type = DBVT_BLOB; - dbv.cpbVal = (WORD)mir_strlen(value) / 3; + dbv.cpbVal = (uint16_t)mir_strlen(value) / 3; dbv.pbVal = (uint8_t*)value; for (dest = dbv.pbVal, value = strtok(value, " "); value && *value; diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index b0272ff998..9a48a5e3fe 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -245,7 +245,7 @@ size_t CLineBuffer::operator + (const SHORT sVal) * return: length of the string, added **/ -size_t CLineBuffer::operator + (const WORD wVal) +size_t CLineBuffer::operator + (const uint16_t wVal) { size_t cbLength = 5; @@ -460,7 +460,7 @@ int CLineBuffer::fgetEncoded(FILE *inFile) { int c; CHAR hex[3]; - WORD wAdd = 0; + uint16_t wAdd = 0; hex[2] = 0; @@ -1138,7 +1138,7 @@ uint8_t CVCardFileVCF::Export(uint8_t bExportUtf) * return: number of characters read from the file or EOF **/ -int CVCardFileVCF::readLine(LPSTR szVCFSetting, WORD cchSetting) +int CVCardFileVCF::readLine(LPSTR szVCFSetting, uint16_t cchSetting) { LPSTR here; int c; @@ -1234,7 +1234,7 @@ uint8_t CVCardFileVCF::Import() memcpy(buf, _clVal.GetBuffer(), 4); buf[4] = 0; - db_set_w(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHYEAR, (WORD)strtol(buf, nullptr, 10)); + db_set_w(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHYEAR, (uint16_t)strtol(buf, nullptr, 10)); memcpy(buf, _clVal.GetBuffer() + 4, 2); buf[2] = 0; db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHMONTH, (uint8_t)strtol(buf, nullptr, 10)); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index e2f833df48..1cbb11ac3c 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -42,7 +42,7 @@ public: size_t operator + (const CHAR cVal); size_t operator + (const uint8_t bVal); size_t operator + (const SHORT sVal); - size_t operator + (const WORD wVal); + size_t operator + (const uint16_t wVal); size_t operator + (const LONG lVal); size_t operator + (const DWORD dVal); @@ -71,9 +71,9 @@ private: FILE* _pFile; MCONTACT _hContact; const CHAR* _pszBaseProto; - WORD _cbRew; + uint16_t _cbRew; uint8_t _useUtf8; - WORD _hasUtf8; + uint16_t _hasUtf8; size_t packList(LPIDSTRLIST pList, UINT nList, int iID, size_t *cbRew = nullptr); uint8_t GetSetting(const CHAR *pszModule, const CHAR *pszSetting, DBVARIANT *dbv); @@ -82,7 +82,7 @@ private: void writeLine(const CHAR *szSet, size_t *cbRew = nullptr); void writeLineEncoded(const CHAR *szSet, size_t *cbRew = nullptr); - int readLine(LPSTR szVCFSetting, WORD cchSetting); + int readLine(LPSTR szVCFSetting, uint16_t cchSetting); public: CVCardFileVCF(); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 09e8040a50..d5a9b3b9e9 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -61,7 +61,7 @@ INT_PTR CALLBACK DlgProc_DataHistory(HWND hDlg, UINT msg, WPARAM wParam, LPARAM break; case IDOK: - WORD hiWord = 0; + uint16_t hiWord = 0; if (IsDlgButtonChecked(hDlg, IDC_CHECK1)) hiWord |= EXPORT_DATA; if (IsDlgButtonChecked(hDlg, IDC_CHECK2)) diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h index eb1bb6328c..0152fcac9b 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h @@ -39,7 +39,7 @@ class CFileXml { MCONTACT _hContactToWorkOn; // contact to ex/import (NULL=owner|INVALID_HANDLE_VALUE=all|HADNLE=one user) - WORD _wExport; + uint16_t _wExport; CProgress _progress; diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 34f2050c52..83867be920 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -242,12 +242,12 @@ uint8_t GetEx(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSe * @param pszSetting - the setting to read * @param destType - desired string type (DBVT_ASCIIZ, DBVT_WCHAR, DBVT_UTF8) * -* @return This function returns the WORD which contains the source of information. +* @return This function returns the uint16_t which contains the source of information. **/ -WORD GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType) +uint16_t GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t destType) { - WORD wFlags = 0; + uint16_t wFlags = 0; // read setting from given module if (hContact && pszModule && *pszModule && !Get(hContact, pszModule, pszSetting, dbv, destType)) { @@ -421,7 +421,7 @@ uint8_t ConvertString(DBVARIANT* dbv, const uint8_t destType) /** * This function completely converts a DBVARIANT to the destination string type. -* It includes uint8_t, WORD, DWORD and all string types +* It includes uint8_t, uint16_t, 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) * diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index ea2f1d00ad..61f8c86fba 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -69,14 +69,14 @@ 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 uint8_t nType); - static FORCEINLINE WORD GetAsIsCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) + uint16_t GetCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const uint8_t nType); + static FORCEINLINE uint16_t 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) + static FORCEINLINE uint16_t GetAStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_ASCIIZ); } - static FORCEINLINE WORD GetWStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) + static FORCEINLINE uint16_t GetWStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_WCHAR); } - static FORCEINLINE WORD GetUStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) + static FORCEINLINE uint16_t GetUStringCtrl(MCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_UTF8); } #define GetTString GetWString diff --git a/plugins/UserInfoEx/src/mir_icolib.h b/plugins/UserInfoEx/src/mir_icolib.h index 3d1fc2d30e..342af48002 100644 --- a/plugins/UserInfoEx/src/mir_icolib.h +++ b/plugins/UserInfoEx/src/mir_icolib.h @@ -38,7 +38,7 @@ struct ICONCTRL { int iIcon; UINT Message; - WORD idCtrl; + uint16_t idCtrl; }; LPTSTR IcoLib_GetDefaultIconFileName(); diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 6cc3131c86..46bd0f9d64 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -201,7 +201,7 @@ static uint8_t DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, u } /** - * This function writes a WORD to database according to the value + * This function writes a uint16_t to database according to the value * read from the edit control identified by 'idCtrl'. * * @param hWnd - the dialog's window handle @@ -213,12 +213,12 @@ static uint8_t DBWriteEditByte(HWND hDlg, const int idCtrl, LPCSTR pszSetting, u * @retval TRUE - the database value was updated * @retval FALSE - no database update needed **/ -static uint8_t DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, WORD defVal) +static uint8_t DBWriteEditWord(HWND hDlg, const int idCtrl, LPCSTR pszSetting, uint16_t defVal) { - WORD v; + uint16_t v; BOOL t; - v = (WORD)GetDlgItemInt(hDlg, idCtrl, &t, FALSE); + v = (uint16_t)GetDlgItemInt(hDlg, idCtrl, &t, FALSE); if (t && (v != g_plugin.getWord(pszSetting, defVal))) { g_plugin.setWord(pszSetting, v); return true; @@ -688,7 +688,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam case EDIT_REMIND: if (bInitialized && HIWORD(wParam) == EN_UPDATE) { BOOL t; - WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE); + uint16_t v = (uint16_t)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE); if (t && (v != g_plugin.getWord(SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET))) NotifyParentOfChange(hDlg); } @@ -708,7 +708,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam case EDIT_REMIND2: if (bInitialized && HIWORD(wParam) == EN_UPDATE) { BOOL t; - WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE); + uint16_t v = (uint16_t)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE); if (t && (v != g_plugin.getWord(SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL))) NotifyParentOfChange(hDlg); } diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index 73840c48d0..db61cce98b 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -208,7 +208,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, uint8_t bSave) pList->labelEdit.hEdit = nullptr; if (bSave != FALSE && pList->labelEdit.pItem) { - WORD ccText; + uint16_t ccText; LPTSTR szEdit = nullptr; uint8_t bChanged = FALSE; @@ -474,7 +474,7 @@ static int ProfileList_AddItemlistFromDB( LPCSTR pszModule, LPCSTR szCatFormat, LPCSTR szValFormat, - WORD wFlags) + uint16_t wFlags) { DBVARIANT dbvVal, dbvCat; LPLCITEM pItem; @@ -519,7 +519,7 @@ static int ProfileList_AddItemlistFromDB( continue; break; case DBVT_WORD: - if (dbvCat.wVal != (WORD)idList[j].nID) + if (dbvCat.wVal != (uint16_t)idList[j].nID) continue; break; case DBVT_DWORD: diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index e3f8ed65a2..55443210fb 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -34,17 +34,17 @@ struct CEvent enum EType { NONE, BIRTHDAY, ANNIVERSARY }; EType _eType; - WORD _wDaysLeft; + uint16_t _wDaysLeft; CEvent(); - CEvent(EType eType, WORD wDaysLeft); + CEvent(EType eType, uint16_t wDaysLeft); uint8_t operator << (const CEvent& e); }; typedef struct _REMINDEROPTIONS { - WORD wDaysEarlier; + uint16_t wDaysEarlier; uint8_t bPopups; uint8_t bCListExtraIcon; uint8_t bFlashCList; @@ -98,7 +98,7 @@ CEvent::CEvent() * @return nothing **/ -CEvent::CEvent(EType eType, WORD wDaysLeft) +CEvent::CEvent(EType eType, uint16_t wDaysLeft) { _wDaysLeft = wDaysLeft; _eType = eType; @@ -369,8 +369,8 @@ static uint8_t CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, ui mta.DBGetReminderOpts(hContact); if (mta.RemindOption() != BST_UNCHECKED) { - WORD wDaysEarlier = (mta.RemindOption() == BST_CHECKED) ? mta.RemindOffset() : -1; - if (wDaysEarlier == (WORD)-1) + uint16_t wDaysEarlier = (mta.RemindOption() == BST_CHECKED) ? mta.RemindOffset() : -1; + if (wDaysEarlier == (uint16_t)-1) wDaysEarlier = gRemindOpts.wDaysEarlier; Diff = mta.CompareDays(Now); @@ -454,8 +454,8 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bN mtb.BackupBirthday(hContact, nullptr, 0, LastAnwer); if (mtb.RemindOption() != BST_UNCHECKED) { - WORD wDaysEarlier = (mtb.RemindOption() == BST_CHECKED) ? mtb.RemindOffset() : -1; - if (wDaysEarlier == (WORD)-1) + uint16_t wDaysEarlier = (mtb.RemindOption() == BST_CHECKED) ? mtb.RemindOffset() : -1; + if (wDaysEarlier == (uint16_t)-1) wDaysEarlier = gRemindOpts.wDaysEarlier; Diff = mtb.CompareDays(Now); @@ -467,7 +467,7 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, uint8_t bN if (bNotify) { wchar_t szMsg[MAXDATASIZE]; - WORD cchMsg = 0; + uint16_t cchMsg = 0; switch (Diff) { case 0: @@ -553,7 +553,7 @@ void SvcReminderCheckAll(const ENotify notify) // walk through all the contacts stored in the DB CEvent evt; - WORD a1 = 0; + uint16_t a1 = 0; for (auto &hContact : Contacts()) CheckContact(hContact, now, evt, notify != NOTIFY_CLIST, &a1); @@ -646,7 +646,7 @@ static int OnContactSettingChanged(MCONTACT hContact, DBCONTACTWRITESETTING* pdb MTime now; now.GetLocalTime(); if (!mir_strcmp(pdbcws->szModule, SvcReminderGetMyBirthdayModule())) { - WORD LastAnswer = IDNONE; + uint16_t LastAnswer = IDNONE; CheckContact(hContact, now, evt, FALSE, &LastAnswer); } else CheckContact(hContact, now, evt, FALSE, nullptr); @@ -692,7 +692,7 @@ static INT_PTR BackupBirthdayService(WPARAM hContact, LPARAM lParam) mdb.BackupBirthday(hContact, nullptr, TRUE); } else { - WORD a1 = 0; + uint16_t a1 = 0; // walk through all the contacts stored in the DB for (auto &cc : Contacts()) -- cgit v1.2.3