diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Dbx_mdb/src/dbcontacts.cpp | 3 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/dbevents.cpp | 10 | ||||
-rw-r--r-- | plugins/Dbx_mdb/src/dbmodulechain.cpp | 1 |
3 files changed, 6 insertions, 8 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp index 7c225f25d0..c0c07f0240 100644 --- a/plugins/Dbx_mdb/src/dbcontacts.cpp +++ b/plugins/Dbx_mdb/src/dbcontacts.cpp @@ -106,7 +106,8 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID) }
DBEventSortingKey keyVal = { 0, 0, contactID };
- key = { sizeof(keyVal), &keyVal }; MDB_val data;
+ key.mv_size = sizeof(keyVal); key.mv_data = &keyVal;
+ MDB_val data;
txn_ptr trnlck(m_pMdbEnv, true);
cursor_ptr cursor(trnlck, m_dbEventsSort);
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index 0214a3f2d8..580b4d0d62 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -136,7 +136,7 @@ STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent) mir_cslockfull lck(m_csDbAccess);
- for (bool bContactDecremented = false; ; [=](){ if (bContactDecremented) cc->Revert(); }(), Remap())
+ for (cc->Snapshot();; cc->Revert(), Remap())
{
txn_ptr txn(m_pMdbEnv);
MDB_val key = { sizeof(MEVENT), &hDbEvent }, data;
@@ -157,19 +157,17 @@ STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent) }
// remove a event
- key = { sizeof(MEVENT), &hDbEvent };
+ key.mv_size = sizeof(MEVENT); key.mv_data = &hDbEvent;
MDB_CHECK(mdb_del(txn, m_dbEvents, &key, &data), 1);
// update a contact
- key.mv_size = sizeof(int); key.mv_data = &contactID;
+ key.mv_size = sizeof(MCONTACT); key.mv_data = &contactID;
- cc->Snapshot();
cc->dbc.dwEventCount--;
- bContactDecremented = true;
if (cc->dbc.dwFirstUnread == hDbEvent)
FindNextUnread(txn, cc, key2);
- data = { sizeof(DBContact), &cc->dbc };
+ data.mv_size = sizeof(DBContact); data.mv_data = &cc->dbc;
MDB_CHECK(mdb_put(txn, m_dbContacts, &key, &data, 0), 1);
diff --git a/plugins/Dbx_mdb/src/dbmodulechain.cpp b/plugins/Dbx_mdb/src/dbmodulechain.cpp index 77ad7c8481..e18179ebf6 100644 --- a/plugins/Dbx_mdb/src/dbmodulechain.cpp +++ b/plugins/Dbx_mdb/src/dbmodulechain.cpp @@ -105,7 +105,6 @@ DWORD CDbxMdb::GetModuleNameOfs(const char *szName) for (;; Remap()) {
txn_ptr trnlck(m_pMdbEnv);
- mdb_open(trnlck, "modules", MDB_INTEGERKEY, &m_dbModules);
MDB_CHECK(mdb_put(trnlck, m_dbModules, &key, &data, 0), -1);
if (trnlck.commit())
break;
|