From fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 15:58:40 +0300 Subject: PBYTE -> uint8_t* --- plugins/UserInfoEx/src/ex_import/classExImContactBase.h | 2 +- plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp | 6 +++--- .../UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp | 10 +++++----- plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 4 ++-- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp | 16 ++++++++-------- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h | 4 ++-- plugins/UserInfoEx/src/mir_db.cpp | 2 +- plugins/UserInfoEx/src/svc_refreshci.cpp | 12 ++++++------ 8 files changed, 28 insertions(+), 28 deletions(-) (limited to 'plugins/UserInfoEx/src') diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index b99e28d3b5..c681198129 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -56,7 +56,7 @@ public: __inline void uid(BYTE 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(PBYTE 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 = (WORD)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 bc50caf32e..3bc587b868 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -543,7 +543,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) case 'n': size_t valLen; { - PBYTE pbVal = (PBYTE)mir_base64_decode(pUID, &valLen); + uint8_t *pbVal = (uint8_t*)mir_base64_decode(pUID, &valLen); if (pbVal != nullptr) uidn(pbVal, (DWORD)valLen); } @@ -866,7 +866,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr break; case 'n': dbv.type = DBVT_BLOB; - dbv.pbVal = (PBYTE)mir_base64_decode(value + 1, &baselen); + dbv.pbVal = (uint8_t*)mir_base64_decode(value + 1, &baselen); if (dbv.pbVal != nullptr) dbv.cpbVal = (WORD)baselen; else { @@ -924,7 +924,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, const TiXmlElement *xmlEvent) return ERROR_INVALID_VALUE; size_t baselen; - mir_ptr tmpVal((PBYTE)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/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index 11e97c3862..29d48a95b5 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -55,20 +55,20 @@ static void InitAlteredPlacesBar() CHAR szProfilePath[MAX_PATH]; // default places: Desktop, My Documents, My Computer - dwFolderID = 0; RegSetValueEx(hkPlacesBar, L"Place0", 0, REG_DWORD, (PBYTE)&dwFolderID, sizeof(DWORD)); - dwFolderID = 5; RegSetValueEx(hkPlacesBar, L"Place1", 0, REG_DWORD, (PBYTE)&dwFolderID, sizeof(DWORD)); - dwFolderID = 17; RegSetValueEx(hkPlacesBar, L"Place2", 0, REG_DWORD, (PBYTE)&dwFolderID, sizeof(DWORD)); + dwFolderID = 0; RegSetValueEx(hkPlacesBar, L"Place0", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(DWORD)); + dwFolderID = 5; RegSetValueEx(hkPlacesBar, L"Place1", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(DWORD)); + dwFolderID = 17; RegSetValueEx(hkPlacesBar, L"Place2", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(DWORD)); // Miranda's installation path GetModuleFileNameA(GetModuleHandleA("mir_app.mir"), szMirandaPath, _countof(szMirandaPath)); p = mir_strrchr(szMirandaPath, '\\'); if (p) - RegSetValueExA(hkPlacesBar, "Place3", 0, REG_SZ, (PBYTE)szMirandaPath, (p - szMirandaPath) + 1); + RegSetValueExA(hkPlacesBar, "Place3", 0, REG_SZ, (uint8_t*)szMirandaPath, (p - szMirandaPath) + 1); // Miranda's profile path if (!Profile_GetPathA(_countof(szProfilePath), szProfilePath)) { // only add if different from profile path - RegSetValueExA(hkPlacesBar, "Place4", 0, REG_SZ, (PBYTE)szProfilePath, (DWORD)mir_strlen(szProfilePath) + 1); + RegSetValueExA(hkPlacesBar, "Place4", 0, REG_SZ, (uint8_t*)szProfilePath, (DWORD)mir_strlen(szProfilePath) + 1); } RegCloseKey(hkPlacesBar); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index a83438b9ad..b19edc5a4f 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -365,10 +365,10 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) case 'n': case 'N': - PBYTE dest; + uint8_t *dest; dbv.type = DBVT_BLOB; dbv.cpbVal = (WORD)mir_strlen(value) / 3; - dbv.pbVal = (PBYTE)value; + dbv.pbVal = (uint8_t*)value; for (dest = dbv.pbVal, value = strtok(value, " "); value && *value; value = strtok(nullptr, " ")) diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 17cb4a180f..8a7eff65c8 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BYTE IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer) { BYTE c; - PBYTE s = (PBYTE)pBuffer; + uint8_t *s = (uint8_t*)pBuffer; BYTE bIsUTF = 0; if (s == nullptr) return 1; @@ -49,7 +49,7 @@ BYTE IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer) if (!pcbBuffer) return 0; bIsUTF = 1; } - if (pcbBuffer) *pcbBuffer = s - (PBYTE)pBuffer; + if (pcbBuffer) *pcbBuffer = s - (uint8_t*)pBuffer; return !bIsUTF; } @@ -100,7 +100,7 @@ CLineBuffer::~CLineBuffer() BYTE CLineBuffer::_resizeBuf(const size_t cbReq) { if (cbReq > _cbVal - _cbUsed) { - if (!(_pVal = (PBYTE)mir_realloc(_pVal, BLOCKSIZE + _cbVal + 1))) { + if (!(_pVal = (uint8_t*)mir_realloc(_pVal, BLOCKSIZE + _cbVal + 1))) { _cbVal = 0; _cbUsed = 0; return FALSE; @@ -404,7 +404,7 @@ void CLineBuffer::fput(FILE *outfile) void CLineBuffer::fputEncoded(FILE *outFile) { - PBYTE pVal = _pVal; + uint8_t *pVal = _pVal; if (pVal && _cbUsed > 0) { _pVal[_cbUsed] = 0; @@ -507,7 +507,7 @@ int CLineBuffer::fgetEncoded(FILE *inFile) size_t CLineBuffer::GetTokenFirst(const CHAR delim, CLineBuffer *pBuf) { - PBYTE here; + uint8_t *here; size_t wLength; _pTok = _pVal; @@ -543,7 +543,7 @@ size_t CLineBuffer::GetTokenFirst(const CHAR delim, CLineBuffer *pBuf) size_t CLineBuffer::GetTokenNext(const CHAR delim, CLineBuffer *pBuf) { - PBYTE here; + uint8_t *here; size_t wLength; if (!_pTok || !*_pTok) @@ -581,7 +581,7 @@ size_t CLineBuffer::GetTokenNext(const CHAR delim, CLineBuffer *pBuf) int CLineBuffer::DBWriteTokenFirst(MCONTACT hContact, const CHAR *pszModule, const CHAR *pszSetting, const CHAR delim) { - PBYTE here; + uint8_t *here; int iRet = 1; _pTok = _pVal; @@ -619,7 +619,7 @@ int CLineBuffer::DBWriteTokenFirst(MCONTACT hContact, const CHAR *pszModule, con int CLineBuffer::DBWriteTokenNext(MCONTACT hContact, const CHAR *pszModule, const CHAR *pszSetting, const CHAR delim) { - PBYTE here; + uint8_t *here; int iRet = 1; if (_pTok && *_pTok) { diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index cea4cc9067..090308b5fd 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CLineBuffer { private: - PBYTE _pVal; - PBYTE _pTok; + uint8_t *_pVal; + uint8_t *_pTok; size_t _cbVal; size_t _cbUsed; diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index cb69877cfb..30ea296ae7 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -536,7 +536,7 @@ bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei) dbei->cbBlob = (size != -1) ? (DWORD)size : 0; } if (dbei->cbBlob) { - dbei->pBlob = (PBYTE) mir_alloc(dbei->cbBlob); + dbei->pBlob = (uint8_t*) mir_alloc(dbei->cbBlob); if (dbei->pBlob == nullptr) dbei->cbBlob = 0; } diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index b5d3ebaab9..813b24af56 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -453,11 +453,11 @@ public: class CContactUpdater : public CContactQueue { - CUpdProgress* _pProgress; // pointer to the progress dialog/popup - HANDLE _hProtoAckEvent; // handle to protocol ack notification - MCONTACT _hContact; // current contact being refreshed - PBYTE _hContactAcks; // array of acknoledgements for the current contact to wait for - INT_PTR _nContactAcks; // number of acknoledgements for the current contact to wait for + CUpdProgress *_pProgress; // pointer to the progress dialog/popup + HANDLE _hProtoAckEvent; // handle to protocol ack notification + MCONTACT _hContact; // current contact being refreshed + uint8_t *_hContactAcks; // array of acknoledgements for the current contact to wait for + INT_PTR _nContactAcks; // number of acknoledgements for the current contact to wait for MIRANDA_CPP_PLUGIN_API(CContactUpdater); @@ -518,7 +518,7 @@ class CContactUpdater : public CContactQueue if (ack->hProcess || ack->lParam) { if (!_hContactAcks) { _nContactAcks = (INT_PTR)ack->hProcess; - _hContactAcks = (PBYTE)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess); + _hContactAcks = (uint8_t*)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess); } if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) -- cgit v1.2.3