From f9e33a21e734d927f224cf93fd7be05dce3f7391 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 21 Dec 2014 15:04:18 +0000 Subject: - 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 --- plugins/Db3x_mmap/src/dbtool/eventchain.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbtool/eventchain.cpp') 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; -- cgit v1.2.3