diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-21 13:57:29 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-21 13:57:29 +0000 |
commit | c435188487f1e89942b6ada46808b9103f3f25cd (patch) | |
tree | 07c01909fa4ef0540827da9dab4724da3a3f6fff /plugins/Dbx_mdb/src/dbevents.cpp | |
parent | 5380ed0fad80744e3093a6fb6f13f8d8a7b2e03a (diff) |
dbx_lmdb: VS2010 compilation fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@16318 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbevents.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbevents.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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);
|