diff options
Diffstat (limited to 'plugins/Import')
-rw-r--r-- | plugins/Import/src/dbrw/dbevents.cpp | 8 | ||||
-rw-r--r-- | plugins/Import/src/dbrw/dbsettings.cpp | 2 | ||||
-rw-r--r-- | plugins/Import/src/import.cpp | 8 | ||||
-rw-r--r-- | plugins/Import/src/mcontacts.cpp | 6 | ||||
-rw-r--r-- | plugins/Import/src/patterns.cpp | 4 | ||||
-rw-r--r-- | plugins/Import/src/stdafx.h | 4 | ||||
-rw-r--r-- | plugins/Import/src/textjson.cpp | 8 | ||||
-rw-r--r-- | plugins/Import/src/utils.cpp | 4 |
8 files changed, 22 insertions, 22 deletions
diff --git a/plugins/Import/src/dbrw/dbevents.cpp b/plugins/Import/src/dbrw/dbevents.cpp index 59dccc99ce..2d18cb6528 100644 --- a/plugins/Import/src/dbrw/dbevents.cpp +++ b/plugins/Import/src/dbrw/dbevents.cpp @@ -80,12 +80,12 @@ STDMETHODIMP_(BOOL) CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) if (sql_step(stmt) == SQLITE_ROW) { const void *blob = sqlite3_column_blob(stmt, 4); - dbei->timestamp = (DWORD)sqlite3_column_int(stmt, 1); - dbei->flags = (DWORD)sqlite3_column_int(stmt, 2); + dbei->timestamp = (uint32_t)sqlite3_column_int(stmt, 1); + dbei->flags = (uint32_t)sqlite3_column_int(stmt, 2); dbei->eventType = (uint16_t)sqlite3_column_int(stmt, 3); dbei->szModule = mir_strdup((char*)sqlite3_column_text(stmt, 7)); - DWORD cbBlob = sqlite3_column_int(stmt, 5); + uint32_t cbBlob = sqlite3_column_int(stmt, 5); size_t bytesToCopy = cbBlob; if (dbei->cbBlob == -1) dbei->pBlob = (uint8_t*)mir_calloc(cbBlob + 2); @@ -136,7 +136,7 @@ STDMETHODIMP_(MEVENT) CDbxSQLite::FindFirstUnreadEvent(MCONTACT contactID) mir_cslock lock(m_csDbAccess); int res = 0; - DWORD flags = 0; + uint32_t flags = 0; sqlite3_bind_int(evt_stmts_prep[SQL_EVT_STMT_FINDFIRSTUNREAD], 1, contactID); while (sql_step(evt_stmts_prep[SQL_EVT_STMT_FINDFIRSTUNREAD]) == SQLITE_ROW) { flags = sqlite3_column_int(evt_stmts_prep[SQL_EVT_STMT_FINDFIRSTUNREAD], 0); diff --git a/plugins/Import/src/dbrw/dbsettings.cpp b/plugins/Import/src/dbrw/dbsettings.cpp index 1002a8ff60..531b656b45 100644 --- a/plugins/Import/src/dbrw/dbsettings.cpp +++ b/plugins/Import/src/dbrw/dbsettings.cpp @@ -103,7 +103,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::GetContactSettingWorker(MCONTACT contactID, LPCS dbv->wVal = (uint16_t)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 1); break; case DBVT_DWORD: - dbv->dVal = (DWORD)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 1); + dbv->dVal = (uint32_t)sqlite3_column_int(set_stmts_prep[SQL_SET_STMT_READ], 1); break; case DBVT_UTF8: case DBVT_ASCIIZ: diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 2e5a8616d8..28e72d389d 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -109,7 +109,7 @@ MCONTACT CImportBatch::HContactFromChatID(const char *pszProtoName, const wchar_ return INVALID_CONTACT_ID;
}
-MCONTACT CImportBatch::HContactFromNumericID(const char *pszProtoName, const char *pszSetting, DWORD dwID)
+MCONTACT CImportBatch::HContactFromNumericID(const char *pszProtoName, const char *pszSetting, uint32_t dwID)
{
for (MCONTACT hContact = dstDb->FindFirstContact(pszProtoName); hContact; hContact = dstDb->FindNextContact(hContact, pszProtoName))
if (db_get_dw(hContact, pszProtoName, pszSetting, 0) == dwID)
@@ -879,7 +879,7 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int else hDst = NULL;
bool bSkipAll = false;
- DWORD cbAlloc = 4096;
+ uint32_t cbAlloc = 4096;
uint8_t *eventBuf = (uint8_t*)mir_alloc(cbAlloc);
// Get the start of the event chain
@@ -918,7 +918,7 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int if (!bSkipThis) {
bool bIsSent = (dbei.flags & DBEF_SENT) != 0;
- if (dbei.timestamp < (DWORD)m_dwSinceDate)
+ if (dbei.timestamp < (uint32_t)m_dwSinceDate)
bSkipThis = true;
if (!bSkipThis) {
@@ -1033,7 +1033,7 @@ void CImportBatch::DoImport() dstDb->SetCacheSafetyMode(FALSE);
// Start benchmark timer
- DWORD dwTimer = time(0);
+ uint32_t dwTimer = time(0);
OBJLIST<char> arSkippedAccs(1, CompareModules);
arSkippedAccs.insert(newStr("CListGroups"));
diff --git a/plugins/Import/src/mcontacts.cpp b/plugins/Import/src/mcontacts.cpp index 415f580ca9..8afe075d87 100644 --- a/plugins/Import/src/mcontacts.cpp +++ b/plugins/Import/src/mcontacts.cpp @@ -75,8 +75,8 @@ class CDbxMc : public MDatabaseReadonly, public MZeroedObject MC_FileHeader m_hdr; - std::vector<DWORD> m_events; - std::vector<DWORD>::iterator m_curr; + std::vector<uint32_t> m_events; + std::vector<uint32_t>::iterator m_curr; CMStringA readString() { @@ -228,7 +228,7 @@ public: else return 1; if (dbei->cbBlob && cbLen) { - DWORD copySize = min(DWORD(cbLen), dbei->cbBlob-1); + uint32_t copySize = min(uint32_t(cbLen), dbei->cbBlob-1); if (!ReadFile(m_hFile, dbei->pBlob, copySize, &dwRead, 0) || dwRead != copySize) return 0; diff --git a/plugins/Import/src/patterns.cpp b/plugins/Import/src/patterns.cpp index 0d6a40938d..6e1e3b4a39 100644 --- a/plugins/Import/src/patterns.cpp +++ b/plugins/Import/src/patterns.cpp @@ -151,7 +151,7 @@ class CDbxPattern : public MDatabaseReadonly, public MZeroedObject const uint8_t *m_pFile = 0; int m_iFileVersion = 0, m_iMsgHeaderSize = 0; - std::vector<DWORD> m_events; + std::vector<uint32_t> m_events; std::vector<CMStringW> m_files; bool CheckContact(MCONTACT hContact) @@ -354,7 +354,7 @@ public: auto *pPattern = g_pBatch->m_pPattern; // create a mask for loading multiple data files for a folder - DWORD dwAttr = GetFileAttributesW(profile); + uint32_t dwAttr = GetFileAttributesW(profile); if (dwAttr & FILE_ATTRIBUTE_DIRECTORY) { wszBaseFolder = profile; m_folder.AppendFormat(L"%s\\*.%s", profile, pPattern->wszExt.c_str()); diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h index dd75756bb0..795ecf189c 100644 --- a/plugins/Import/src/stdafx.h +++ b/plugins/Import/src/stdafx.h @@ -267,7 +267,7 @@ class CImportBatch : public MZeroedObject OBJLIST<ContactMap> m_contacts;
LIST<DBCachedContact> m_metas;
- DWORD nDupes, nContactsCount, nMessagesCount, nGroupsCount, nSkippedEvents, nSkippedContacts;
+ uint32_t nDupes, nContactsCount, nMessagesCount, nGroupsCount, nSkippedEvents, nSkippedContacts;
MDatabaseCommon *srcDb, *dstDb;
bool ImportAccounts(OBJLIST<char> &arSkippedModules);
@@ -285,7 +285,7 @@ class CImportBatch : public MZeroedObject MCONTACT HContactFromID(const char *pszProtoName, const char *pszSetting, wchar_t *pwszID);
MCONTACT HContactFromChatID(const char *pszProtoName, const wchar_t *pszChatID);
- MCONTACT HContactFromNumericID(const char *pszProtoName, const char *pszSetting, DWORD dwID);
+ MCONTACT HContactFromNumericID(const char *pszProtoName, const char *pszSetting, uint32_t dwID);
public:
CImportBatch();
diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp index c6cb30efb9..733d8cfa9b 100644 --- a/plugins/Import/src/textjson.cpp +++ b/plugins/Import/src/textjson.cpp @@ -161,7 +161,7 @@ public: dbei->flags |= DBEF_UTF; MBinBuffer buf; - DWORD tmp = 0; + uint32_t tmp = 0; buf.append(&tmp, sizeof(tmp)); buf.append(szFile.c_str(), szFile.size()); if (!szDescr.empty()) { @@ -181,11 +181,11 @@ public: switch (dbei->eventType) { case EVENTTYPE_ADDED: case EVENTTYPE_FILE: - offset = sizeof(DWORD); + offset = sizeof(uint32_t); break; case EVENTTYPE_AUTHREQUEST: - offset = sizeof(DWORD) * 2; + offset = sizeof(uint32_t) * 2; break; default: @@ -193,7 +193,7 @@ public: } dbei->flags |= DBEF_UTF; - dbei->cbBlob = (DWORD)szBody.size() + offset; + dbei->cbBlob = (uint32_t)szBody.size() + offset; dbei->pBlob = (uint8_t*)mir_calloc(dbei->cbBlob + 1); memcpy(dbei->pBlob + offset, szBody.c_str(), szBody.size()); dbei->pBlob[dbei->cbBlob] = 0; diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 04e7861949..b96ab1281f 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -51,7 +51,7 @@ int CreateGroup(const wchar_t *group, MCONTACT hContact) // Returns TRUE if the event already exist in the database
bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei)
{
- static DWORD dwPreviousTimeStamp = -1;
+ static uint32_t dwPreviousTimeStamp = -1;
static MCONTACT hPreviousContact = INVALID_CONTACT_ID;
static MEVENT hPreviousDbEvent = NULL;
@@ -62,7 +62,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) DBEVENTINFO dbeiExisting = {};
db_event_get(hExistingDbEvent, &dbeiExisting);
- DWORD dwEventTimeStamp = dbeiExisting.timestamp;
+ uint32_t dwEventTimeStamp = dbeiExisting.timestamp;
// compare with last timestamp
if (dbei.timestamp > dwEventTimeStamp) {
|