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/IEHistory/src/dlgHandlers.cpp | 6 +++--- plugins/IEHistory/src/utils.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/IEHistory/src') diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 6f1625b111..967444332f 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -132,7 +132,7 @@ void FillIEViewInfo(IEVIEWEVENTDATA *fillData, DBEVENTINFO dbInfo, uint8_t *blob fillData->bIsMe = (dbInfo.flags & DBEF_SENT); fillData->dwFlags = (dbInfo.flags & DBEF_SENT) ? IEEDF_SENT : 0; fillData->time = dbInfo.timestamp; - size_t len = mir_strlen((char *)blob) + 1; + int len = (int)mir_strlen((char *)blob) + 1; uint8_t *pos; fillData->szText.a = (char *)blob; @@ -164,7 +164,7 @@ uint32_t WINAPI WorkerThread(LPVOID lpvData) ieEvent.iType = IEE_LOG_MEM_EVENTS; ieEvent.eventData = ieData; DBEVENTINFO dbInfo = {}; - uint8_t *buffer = nullptr; + char *buffer = nullptr; int newSize, oldSize = 0; while (count < target) { cLoad = (count + LOAD_COUNT > target) ? target - count : LOAD_COUNT; @@ -173,7 +173,7 @@ uint32_t WINAPI WorkerThread(LPVOID lpvData) for (i = 0; i < cLoad; i++) { newSize = db_event_getBlobSize(dbEvent); if (newSize > oldSize) { - buffer = (uint8_t*)realloc(buffer, newSize); + buffer = (char*)realloc(buffer, newSize); dbInfo.pBlob = buffer; oldSize = newSize; } diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index c96baeff7c..c9e2e2a5a7 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -123,7 +123,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat int index = 0; MEVENT hEvent = hFirstEvent; - void *buffer = nullptr; + char *buffer = nullptr; bool found = false; int oldSize, newSize; oldSize = newSize = 0; @@ -132,10 +132,10 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat while ((!found) && (hEvent)) { newSize = db_event_getBlobSize(hEvent); if (newSize > oldSize) { - buffer = (wchar_t *)realloc(buffer, newSize); + buffer = (char *)realloc(buffer, newSize); oldSize = newSize; } - dbEvent.pBlob = (uint8_t*)buffer; + dbEvent.pBlob = buffer; dbEvent.cbBlob = newSize; if (db_event_get(hEvent, &dbEvent) == 0) { //successful switch (type) { -- cgit v1.2.3