From e96132b4d5344d2d58d247906bcaefccfb9d5253 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Dec 2023 13:34:45 +0300 Subject: DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get() --- plugins/Import/src/dbrw/dbevents.cpp | 2 +- plugins/Import/src/import.cpp | 2 +- plugins/Import/src/patterns.cpp | 2 +- plugins/Import/src/textjson.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/Import') diff --git a/plugins/Import/src/dbrw/dbevents.cpp b/plugins/Import/src/dbrw/dbevents.cpp index 95fc34eca3..1fbea90b86 100644 --- a/plugins/Import/src/dbrw/dbevents.cpp +++ b/plugins/Import/src/dbrw/dbevents.cpp @@ -88,7 +88,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) uint32_t cbBlob = sqlite3_column_int(stmt, 5); size_t bytesToCopy = cbBlob; if (dbei->cbBlob == -1) - dbei->pBlob = (uint8_t*)mir_calloc(cbBlob + 2); + dbei->pBlob = (char *)mir_calloc(cbBlob + 2); else if (dbei->cbBlob < cbBlob) bytesToCopy = dbei->cbBlob; diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index e743d13cc8..659189da72 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -888,7 +888,7 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int // Copy the event and import it DB::EventInfo dbei; dbei.cbBlob = srcDb->GetBlobSize(hEvent); - dbei.pBlob = (uint8_t*)mir_alloc(dbei.cbBlob+1); + dbei.pBlob = (char *)mir_alloc(dbei.cbBlob+1); bool bSkipThis = false; if (!srcDb->GetEvent(hEvent, &dbei)) { diff --git a/plugins/Import/src/patterns.cpp b/plugins/Import/src/patterns.cpp index 9dadce018c..3cb29d2ad1 100644 --- a/plugins/Import/src/patterns.cpp +++ b/plugins/Import/src/patterns.cpp @@ -567,7 +567,7 @@ public: dbei->timestamp = RLInteger(&pMsg[0x12]); dbei->timestamp -= TimeZone_ToLocal(dbei->timestamp) - dbei->timestamp; // deduct time zone offset from timestamp dbei->cbBlob = RLWord(&pMsg[m_iMsgHeaderSize - 2]); - dbei->pBlob = (uint8_t*)mir_alloc(dbei->cbBlob + 1); + dbei->pBlob = (char *)mir_alloc(dbei->cbBlob + 1); memcpy(dbei->pBlob, pMsg + m_iMsgHeaderSize, dbei->cbBlob); if (m_iFileVersion != 1) for (int i = 0; i < dbei->cbBlob; i++) { diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp index 39b2768787..db0adcd73d 100644 --- a/plugins/Import/src/textjson.cpp +++ b/plugins/Import/src/textjson.cpp @@ -190,7 +190,7 @@ public: dbei->flags |= DBEF_UTF; dbei->cbBlob = (uint32_t)szBody.size() + offset; - dbei->pBlob = (uint8_t*)mir_calloc(dbei->cbBlob + 1); + dbei->pBlob = (char *)mir_calloc(dbei->cbBlob + 1); memcpy(dbei->pBlob + offset, szBody.c_str(), szBody.size()); dbei->pBlob[dbei->cbBlob] = 0; } -- cgit v1.2.3