summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-07 14:08:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-07 14:08:15 +0000
commit7b8b7fa685ea5de62002d5637b4c34e19dfedeee (patch)
treee56c7f34d2470edc5cf40dea77d8e6ca0f6a17ac /plugins/Db3x_mmap/src/dbtool/eventchain.cpp
parent7f2e5db6faeded54a61e9e1595d6d1596647db4d (diff)
- the internal DBContact structure extended to hold one more DWORD: contact ID;
- when called from dbchecker, mmap now refuses to check the old versions of database; - old classes hierarchy removed, all classes were merged into one due to the death of db3x & mmap_sa; - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@8061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbtool/eventchain.cpp')
-rw-r--r--plugins/Db3x_mmap/src/dbtool/eventchain.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
index 9062d2f389..362f86436d 100644
--- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
@@ -36,7 +36,7 @@ static DWORD memsize = 0;
static DBEvent* memblock = NULL;
static DBEvent* dbePrevEvent = NULL;
-void CDb3Base::ConvertOldEvent(DBEvent*& dbei)
+void CDb3Mmap::ConvertOldEvent(DBEvent*& dbei)
{
int msglen = (int)strlen((char*)dbei->blob) + 1, msglenW = 0;
if (msglen != (int)dbei->cbBlob) {
@@ -71,7 +71,7 @@ void CDb3Base::ConvertOldEvent(DBEvent*& dbei)
}
}
-void CDb3Base::WriteOfsNextToPrevious(DWORD ofsPrev, DBContact *dbc, DWORD ofsNext)
+void CDb3Mmap::WriteOfsNextToPrevious(DWORD ofsPrev, DBContact *dbc, DWORD ofsNext)
{
if (ofsPrev)
WriteSegment(ofsPrev + offsetof(DBEvent, ofsNext), &ofsNext, sizeof(DWORD));
@@ -79,7 +79,7 @@ void CDb3Base::WriteOfsNextToPrevious(DWORD ofsPrev, DBContact *dbc, DWORD ofsNe
dbc->ofsFirstEvent = ofsNext;
}
-void CDb3Base::FinishUp(DWORD ofsLast, DBContact *dbc)
+void CDb3Mmap::FinishUp(DWORD ofsLast, DBContact *dbc)
{
WriteOfsNextToPrevious(ofsLast, dbc, 0);
if (eventCount != dbc->eventCount)
@@ -101,7 +101,7 @@ void CDb3Base::FinishUp(DWORD ofsLast, DBContact *dbc)
}
}
-DWORD CDb3Base::WriteEvent(DBEvent *dbe)
+DWORD CDb3Mmap::WriteEvent(DBEvent *dbe)
{
DWORD ofs = WriteSegment(WSOFS_END, dbe, offsetof(DBEvent, blob) + dbe->cbBlob);
if (ofs == WS_ERROR) {
@@ -113,7 +113,7 @@ DWORD CDb3Base::WriteEvent(DBEvent *dbe)
return ofs;
}
-int CDb3Base::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
+int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
{
DBEvent *dbeNew, dbeOld;
DBEvent *dbePrev = NULL;
@@ -239,12 +239,12 @@ int CDb3Base::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
DWORD oldSize = dbeNew->cbBlob;
BYTE* pOldMemo = (BYTE*)_alloca(dbeNew->cbBlob);
memcpy(pOldMemo, dbeNew->blob, dbeNew->cbBlob);
- DecodeCopyMemory(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // decode
+ MoveMemory(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // decode
ConvertOldEvent(dbeNew);
if (dbeNew->cbBlob > oldSize)
pOldMemo = (BYTE*)_alloca(dbeNew->cbBlob);
memcpy(pOldMemo, dbeNew->blob, dbeNew->cbBlob);
- EncodeCopyMemory(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // encode
+ MoveMemory(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // encode
}
if (dbePrev) {