From 62a186697df33c96dc1a6dac0f4dfc38652fb96f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 16:39:04 +0300 Subject: BYTE -> uint8_t --- .../src/ex_import/classExImContactBase.cpp | 20 +++++++-------- .../src/ex_import/classExImContactBase.h | 18 ++++++------- .../src/ex_import/classExImContactXML.cpp | 16 ++++++------ .../UserInfoEx/src/ex_import/classExImContactXML.h | 6 ++--- .../UserInfoEx/src/ex_import/dlg_ExImModules.cpp | 4 +-- .../UserInfoEx/src/ex_import/dlg_ExImProgress.cpp | 6 ++--- .../UserInfoEx/src/ex_import/dlg_ExImProgress.h | 6 ++--- plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h | 8 +++--- plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 10 ++++---- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp | 30 +++++++++++----------- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h | 16 ++++++------ plugins/UserInfoEx/src/ex_import/svc_ExImXML.h | 6 ++--- plugins/UserInfoEx/src/ex_import/svc_ExImport.h | 2 +- 13 files changed, 74 insertions(+), 74 deletions(-) (limited to 'plugins/UserInfoEx/src/ex_import') 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 tmpVal((uint8_t*)mir_base64_decode(tmp, &baselen)); + mir_ptr 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; -- cgit v1.2.3