diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 20:31:39 +0300 |
commit | cddcd7483a7c472598af098e759e5d309024f606 (patch) | |
tree | b0a227d6e087c41958cc84d27bc323353248aae5 /plugins/UserInfoEx/src/ex_import | |
parent | 1039b2829a264280493ba0fa979214fe024dc70c (diff) |
DWORD -> uint32_t
Diffstat (limited to 'plugins/UserInfoEx/src/ex_import')
13 files changed, 44 insertions, 44 deletions
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 429b4225ff..50903e7681 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -319,7 +319,7 @@ void CExImContactBase::toIni(FILE *file, int modCount) uint8_t CExImContactBase::compareUID(DBVARIANT *dbv) { - DWORD hash = 0; + uint32_t hash = 0; switch (dbv->type) { case DBVT_BYTE: if (dbv->bVal == _dbvUID.bVal) { diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index 741182c913..ad173a1402 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -33,7 +33,7 @@ protected: LPSTR _pszProto;
LPSTR _pszProtoOld;
LPSTR _pszUIDKey;
- DWORD _dbvUIDHash;
+ uint32_t _dbvUIDHash;
DBVARIANT _dbvUID;
MCONTACT _hContact;
uint8_t _isNewContact; // is this contact a new one?
@@ -55,8 +55,8 @@ public: __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(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 = (uint16_t)len; }
+ __inline void uid(uint32_t val) { _dbvUID.type = DBVT_DWORD; _dbvUID.dVal = val; }
+ __inline void uidn(uint8_t *val, uint32_t 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 7b31b83f26..6827856ce7 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -67,7 +67,7 @@ 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
- const DWORD dwCiHash[] = {
+ const uint32_t dwCiHash[] = {
0x6576F145,0x65780A70,0x6719120C,0x6776F145,0x67780A70,0x6EDB33D7,0x6F0466B5,
0x739B6915,0x73B11E48,0x760D8AD5,0x786A70D0,0x8813C350,0x88641AF8,0x8ED5652D,
0x96D64541,0x97768A14,0x9B786F9C,0x9B7889F9,0x9C26E6ED,0xA6675748,0xA813C350,
@@ -83,7 +83,7 @@ uint8_t CExImContactXML::IsContactInfo(LPCSTR pszKey) if (pszKey && *pszKey) {
char buf[MAXSETTING];
// convert to hash and make bsearch as it is much faster then working with strings
- const DWORD dwHash = mir_hashstr(_strlwr(mir_strncpy(buf, pszKey, _countof(buf))));
+ const uint32_t dwHash = mir_hashstr(_strlwr(mir_strncpy(buf, pszKey, _countof(buf))));
return bsearch(&dwHash, dwCiHash, _countof(dwCiHash), sizeof(dwCiHash[0]), (int(*)(const void *, const void *))SortProc) != nullptr;
}
return FALSE;
@@ -444,7 +444,7 @@ uint8_t CExImContactXML::ExportEvents() * return: nothing
**/
-void CExImContactXML::CountKeys(DWORD &numSettings, DWORD &numEvents)
+void CExImContactXML::CountKeys(uint32_t &numSettings, uint32_t &numEvents)
{
numSettings = numEvents = 0;
@@ -531,7 +531,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) uid((uint16_t)atoi(pUID));
break;
case 'd':
- uid((DWORD)_atoi64(pUID));
+ uid((uint32_t)_atoi64(pUID));
break;
case 's':
// utf8 -> asci
@@ -545,7 +545,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) {
uint8_t *pbVal = (uint8_t*)mir_base64_decode(pUID, &valLen);
if (pbVal != nullptr)
- uidn(pbVal, (DWORD)valLen);
+ uidn(pbVal, (uint32_t)valLen);
}
break;
default:
@@ -576,7 +576,7 @@ int CExImContactXML::ImportContact() _hEvent = NULL;
// count settings and events and init progress dialog
- DWORD numSettings, numEvents;
+ uint32_t numSettings, numEvents;
CountKeys(numSettings, numEvents);
_pXmlFile->_progress.SetSettingsCount(numSettings + numEvents);
_pXmlFile->_numSettingsTodo += numSettings;
@@ -854,7 +854,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr break;
case 'd': //'d' dVal and lVal are valid
dbv.type = DBVT_DWORD;
- dbv.dVal = (DWORD)_atoi64(value + 1);
+ dbv.dVal = (uint32_t)_atoi64(value + 1);
break;
case 's': //'s' pszVal is valid
dbv.type = DBVT_ASCIIZ;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index cd2343f967..f1a5e8793d 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -67,7 +67,7 @@ class CExImContactXML : public CExImContactBase int ImportContact();
int ImportNormalContact();
int ImportMetaSubContact(CExImContactXML *pMetaContact);
- void CountKeys(DWORD &numSettings, DWORD &numEvents);
+ void CountKeys(uint32_t &numSettings, uint32_t &numEvents);
// private exporting methods
int ExportModule(LPCSTR pszModule);
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index 29d48a95b5..c0a1310f87 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -49,15 +49,15 @@ static void InitAlteredPlacesBar() result = RegCreateKey(HKEY_CURRENT_USER, HKEY_WINPOL_PLACESBAR, &hkPlacesBar);
// install the places bar
if (SUCCEEDED(result)) {
- DWORD dwFolderID;
+ uint32_t dwFolderID;
LPSTR p;
CHAR szMirandaPath[MAX_PATH];
CHAR szProfilePath[MAX_PATH];
// default places: Desktop, My Documents, My Computer
- 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));
+ dwFolderID = 0; RegSetValueEx(hkPlacesBar, L"Place0", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(uint32_t));
+ dwFolderID = 5; RegSetValueEx(hkPlacesBar, L"Place1", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(uint32_t));
+ dwFolderID = 17; RegSetValueEx(hkPlacesBar, L"Place2", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(uint32_t));
// Miranda's installation path
GetModuleFileNameA(GetModuleHandleA("mir_app.mir"), szMirandaPath, _countof(szMirandaPath));
@@ -68,7 +68,7 @@ static void InitAlteredPlacesBar() // Miranda's profile path
if (!Profile_GetPathA(_countof(szProfilePath), szProfilePath)) {
// only add if different from profile path
- RegSetValueExA(hkPlacesBar, "Place4", 0, REG_SZ, (uint8_t*)szProfilePath, (DWORD)mir_strlen(szProfilePath) + 1);
+ RegSetValueExA(hkPlacesBar, "Place4", 0, REG_SZ, (uint8_t*)szProfilePath, (uint32_t)mir_strlen(szProfilePath) + 1);
}
RegCloseKey(hkPlacesBar);
@@ -278,7 +278,7 @@ int DlgExIm_OpenFileName(HWND hWndParent, const wchar_t *pszTitle, const wchar_t InitOpenFileNameStruct(&ofn, hWndParent, pszTitle, pszFilter, szInitialDir, pszFile);
ofn.Flags |= OFN_PATHMUSTEXIST;
if (!GetOpenFileNameW(&ofn)) {
- DWORD dwError = CommDlgExtendedError();
+ uint32_t dwError = CommDlgExtendedError();
if (dwError) MsgErr(ofn.hwndOwner, LPGENW("The OpenFileDialog returned an error: %d!"), dwError);
return -1;
}
@@ -304,7 +304,7 @@ int DlgExIm_SaveFileName(HWND hWndParent, const wchar_t *pszTitle, const wchar_t ofn.Flags |= OFN_OVERWRITEPROMPT;
if (!GetSaveFileNameW(&ofn)) {
- DWORD dwError = CommDlgExtendedError();
+ uint32_t dwError = CommDlgExtendedError();
if (dwError)
MsgErr(ofn.hwndOwner, LPGENW("The SaveFileDialog returned an error: %d!"), dwError);
return -1;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp index f70df32bb6..f16f5048e5 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp @@ -114,7 +114,7 @@ CProgress::~CProgress() * return: nothing
**/
-void CProgress::SetContactCount(DWORD numContacts)
+void CProgress::SetContactCount(uint32_t numContacts)
{
if (_hDlg) {
HWND hProgress = GetDlgItem(_hDlg, IDC_PROGRESS2);
@@ -131,7 +131,7 @@ void CProgress::SetContactCount(DWORD numContacts) * return: nothing
**/
-void CProgress::SetSettingsCount(DWORD numSettings)
+void CProgress::SetSettingsCount(uint32_t numSettings)
{
if (_hDlg) {
HWND hProgress = 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 c6d72d2cb8..408df14ad6 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CProgress
{
HWND _hDlg;
- DWORD _dwStartTime;
+ uint32_t _dwStartTime;
uint8_t Update();
@@ -37,8 +37,8 @@ public: void Hide();
- void SetContactCount(DWORD numContacts);
- void SetSettingsCount(DWORD numSettings);
+ void SetContactCount(uint32_t numContacts);
+ void SetSettingsCount(uint32_t numSettings);
uint8_t UpdateContact(LPCTSTR pszFormat, ...);
uint8_t UpdateSetting(LPCTSTR pszFormat, ...);
diff --git a/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h b/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h index 8c131bc17b..562a6037d7 100644 --- a/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h +++ b/plugins/UserInfoEx/src/ex_import/mir_rfcCodecs.h @@ -49,7 +49,7 @@ inline INT_PTR QPDecodeGetRequiredLength(INT_PTR nSrcLen) return nSrcLen;
}
-inline BOOL QPEncode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, uint8_t *bEncoded, DWORD dwFlags = 0)
+inline BOOL QPEncode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR *pnDestLen, uint8_t *bEncoded, uint32_t dwFlags = 0)
{
//The hexadecimal character set
static const CHAR s_chHexChars[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
@@ -111,7 +111,7 @@ inline BOOL QPEncode(uint8_t *pbSrcData, INT_PTR nSrcLen, LPSTR szDest, INT_PTR return TRUE;
}
-inline BOOL QPDecode(uint8_t *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, uint32_t dwFlags = 0)
{
if (!pbSrcData || !szDest || !pnDestLen) {
return FALSE;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index 854c2ad622..d86e3f3d5c 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -175,7 +175,7 @@ int SvcExImINI_Export(lpExImParam ExImContact, const wchar_t *pszFileName) * importing stuff ***********************************************************************************************************/ -LPSTR strnrchr(LPSTR string, int ch, DWORD len) +LPSTR strnrchr(LPSTR string, int ch, uint32_t len) { LPSTR start = (LPSTR)string; string += len; /* find end of string */ @@ -195,9 +195,9 @@ LPSTR strnrchr(LPSTR string, int ch, DWORD len) * return: pointer to the buffer on success or NULL on error **/ -static DWORD ImportreadLine(FILE *file, LPSTR &str) +static uint32_t ImportreadLine(FILE *file, LPSTR &str) { - DWORD l = 0; + uint32_t l = 0; bool bComment = false; str[0] = 0; @@ -329,7 +329,7 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) if (size_t brk = strspn(value, "0123456789-")) *(value + brk) = 0; dbv.type = DBVT_DWORD; - dbv.dVal = (DWORD)_atoi64(value); + dbv.dVal = (uint32_t)_atoi64(value); break; case 's': @@ -403,7 +403,7 @@ int SvcExImINI_Import(MCONTACT hContact, const wchar_t *pszFileName) } MCONTACT hNewContact = INVALID_CONTACT_ID; - DWORD end, numLines = 0; + uint32_t end, numLines = 0; CHAR szModule[MAXSETTING] = { 0 }; int numContactsInFile = 0; // number of contacts in the inifile int numContactsAdded = 0; // number of contacts, that were added to the database diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 9a48a5e3fe..f7cba427a6 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -285,7 +285,7 @@ size_t CLineBuffer::operator + (const LONG lVal) * return: length of the string, added
**/
-size_t CLineBuffer::operator + (const DWORD dVal)
+size_t CLineBuffer::operator + (const uint32_t dVal)
{
size_t cbLength = 10;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index 1cbb11ac3c..2a21d3f9ba 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -44,7 +44,7 @@ public: size_t operator + (const SHORT sVal);
size_t operator + (const uint16_t wVal);
size_t operator + (const LONG lVal);
- size_t operator + (const DWORD dVal);
+ size_t operator + (const uint32_t dVal);
size_t GetLength();
LPCSTR GetBuffer();
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index d5a9b3b9e9..1d008719ad 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -91,7 +91,7 @@ int CFileXml::Export(lpExImParam ExImContact, const wchar_t *pszFileName) {
DB::CEnumList Modules;
- DWORD result = (DWORD)DialogBox(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXPORT_DATAHISTORY), nullptr, DlgProc_DataHistory);
+ uint32_t result = (uint32_t)DialogBox(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXPORT_DATAHISTORY), nullptr, DlgProc_DataHistory);
if (LOWORD(result) != IDOK)
return 0;
@@ -284,9 +284,9 @@ int CFileXml::ImportContacts(const TiXmlElement *xmlParent) * return: nothing
**/
-DWORD CFileXml::CountContacts(const TiXmlElement *xmlParent)
+uint32_t CFileXml::CountContacts(const TiXmlElement *xmlParent)
{
- DWORD dwCount = 0;
+ uint32_t dwCount = 0;
// count contacts in file for progress bar
for (auto *xContact : TiXmlEnum(xmlParent))
if (!mir_strcmpi(xContact->Name(), XKEY_CONTACT) || !mir_strcmpi(xContact->Name(), XKEY_OWNER))
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h index 0152fcac9b..e0508eb82f 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CFileXml {
friend class CExImContactXML;
- DWORD _numContactsTodo;
- DWORD _numContactsDone;
- DWORD _numSettingsTodo;
- DWORD _numSettingsDone;
- DWORD _numEventsTodo;
- DWORD _numEventsDone;
- DWORD _numEventsDuplicated;
+ uint32_t _numContactsTodo;
+ uint32_t _numContactsDone;
+ uint32_t _numSettingsTodo;
+ uint32_t _numSettingsDone;
+ uint32_t _numEventsTodo;
+ uint32_t _numEventsDone;
+ uint32_t _numEventsDuplicated;
MCONTACT _hContactToWorkOn; // contact to ex/import (NULL=owner|INVALID_HANDLE_VALUE=all|HADNLE=one user)
@@ -46,7 +46,7 @@ class CFileXml { int ImportOwner(const TiXmlElement* xmlContact);
int ImportContacts(const TiXmlElement* xmlParent);
- DWORD CountContacts(const TiXmlElement* xmlParent);
+ uint32_t CountContacts(const TiXmlElement* xmlParent);
/*
int ExportOwner(FILE *xmlfile, uint8_t bExportEvents);
|