diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-21 15:04:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-21 15:04:18 +0000 |
commit | f9e33a21e734d927f224cf93fd7be05dce3f7391 (patch) | |
tree | 12e52da87181c0725aa9d7740c09d7315d4fb533 /plugins/Db3x_mmap/src/dbtool/eventchain.cpp | |
parent | 310cdd11d658f232ab9b05a7b39cc9c3d9a00436 (diff) |
- CDb3Mmap::FillContacts(): returned support for the old contact's format;
- CDb3Mmap::AdaptEvent: fast enough method to unify old & new event's formats;
- CDb3Mmap::m_csDbAccess finally switched to mir_cs;
- code cleaning;
- pre-release version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@11556 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbtool/eventchain.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbtool/eventchain.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp index 1b0ea041be..67a9a613ac 100644 --- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp @@ -102,19 +102,19 @@ void CDb3Mmap::FinishUp(DWORD ofsLast, DBContact *dbc) }
}
-DWORD CDb3Mmap::PeekEvent(DWORD ofs, DWORD dwContactID, DBEvent *dbe)
+DWORD CDb3Mmap::PeekEvent(DWORD ofs, DWORD dwContactID, DBEvent &dbe)
{
- if (m_dbHeader.version == DB_095_1_VERSION)
- return PeekSegment(ofs, dbe, sizeof(DBEvent));
+ if (m_dbHeader.version >= DB_095_1_VERSION)
+ return PeekSegment(ofs, &dbe, sizeof(DBEvent));
DBEvent_094 oldEvent;
DWORD ret = PeekSegment(ofs, &oldEvent, sizeof(oldEvent));
if (ret != ERROR_SUCCESS)
return ret;
- dbe->signature = oldEvent.signature;
- dbe->contactID = dwContactID;
- memcpy(&dbe->ofsPrev, &oldEvent.ofsPrev, sizeof(oldEvent) - sizeof(DWORD));
+ dbe.signature = oldEvent.signature;
+ dbe.contactID = dwContactID;
+ memcpy(&dbe.ofsPrev, &oldEvent.ofsPrev, sizeof(oldEvent) - sizeof(DWORD));
return ERROR_SUCCESS;
}
@@ -166,7 +166,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) if (!backLookup && ofsTmp) {
backLookup = 1;
while (SignatureValid(ofsTmp, DBEVENT_SIGNATURE)) {
- if (PeekEvent(ofsTmp, dbc->dwContactID, &dbeOld) != ERROR_SUCCESS)
+ if (PeekEvent(ofsTmp, dbc->dwContactID, dbeOld) != ERROR_SUCCESS)
break;
ofsNew = ofsTmp;
ofsTmp = dbeOld.ofsPrev;
@@ -183,7 +183,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) }
}
- if (PeekEvent(ofsThisEvent, dbc->dwContactID, &dbeOld) != ERROR_SUCCESS) {
+ if (PeekEvent(ofsThisEvent, dbc->dwContactID, dbeOld) != ERROR_SUCCESS) {
FinishUp(ofsDestPrevEvent, dbc);
return ERROR_NO_MORE_ITEMS;
}
@@ -292,7 +292,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) if (cb->bCheckOnly) {
if (!cb->bAggressive) {
ofsTmp = dbeOld.ofsPrev;
- while (PeekEvent(ofsTmp, dbc->dwContactID, &dbeTmp) == ERROR_SUCCESS) {
+ while (PeekEvent(ofsTmp, dbc->dwContactID, dbeTmp) == ERROR_SUCCESS) {
if (dbeTmp.ofsPrev == ofsContact) {
found = 1;
break;
|