summaryrefslogtreecommitdiff
path: root/plugins/IEHistory/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-20 13:34:45 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-20 13:34:45 +0300
commite96132b4d5344d2d58d247906bcaefccfb9d5253 (patch)
tree24a9524e4900547f2ba3a461e228fd3c98c0410d /plugins/IEHistory/src
parent4dac8bd56f9116ac76423b2664286ed894ca80c2 (diff)
DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get()
Diffstat (limited to 'plugins/IEHistory/src')
-rw-r--r--plugins/IEHistory/src/dlgHandlers.cpp6
-rw-r--r--plugins/IEHistory/src/utils.cpp6
2 files changed, 6 insertions, 6 deletions
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) {