diff options
author | George Hazan <ghazan@miranda.im> | 2017-11-24 18:18:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-11-24 18:18:59 +0300 |
commit | 0ad50afcb9b77a5d92ccade06a443552f702bdc3 (patch) | |
tree | ceb8d6c1c5027f811c6ed6efec6d2c0eccece569 /plugins/Dbx_mdb/src/dbcrypt.cpp | |
parent | baa0c8ab5a4e5dc7a94a6bb0b8be095a760f48d0 (diff) |
Dbx_mdb:
- fix for settings sorting order;
- warning fixes
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcrypt.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbcrypt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/Dbx_mdb/src/dbcrypt.cpp b/plugins/Dbx_mdb/src/dbcrypt.cpp index 9e382ae84d..8b67755711 100644 --- a/plugins/Dbx_mdb/src/dbcrypt.cpp +++ b/plugins/Dbx_mdb/src/dbcrypt.cpp @@ -156,10 +156,10 @@ int CDbxMdb::EnableEncryption(bool bEncrypted) return 0;
{
- txn_ptr_ro txn(m_txn);
+ txn_ptr_ro txnro(m_txn);
MDBX_stat st;
- mdbx_dbi_stat(txn, m_dbEvents, &st, sizeof(st));
+ mdbx_dbi_stat(txnro, m_dbEvents, &st, sizeof(st));
std::vector<MEVENT> lstEvents;
lstEvents.reserve(st.ms_entries);
@@ -175,7 +175,7 @@ int CDbxMdb::EnableEncryption(bool bEncrypted) for (auto it = lstEvents.begin(); it != lstEvents.end(); ++it) {
MEVENT &hDbEvent = *it;
MDBX_val key = { &hDbEvent, sizeof(MEVENT) }, data;
- mdbx_get(txn, m_dbEvents, &key, &data);
+ mdbx_get(txnro, m_dbEvents, &key, &data);
const DBEvent *dbEvent = (const DBEvent*)data.iov_base;
const BYTE *pBlob = (BYTE*)(dbEvent + 1);
@@ -201,7 +201,7 @@ int CDbxMdb::EnableEncryption(bool bEncrypted) DBEvent *pNewDBEvent = (DBEvent *)data.iov_base;
*pNewDBEvent = *dbEvent;
- pNewDBEvent->cbBlob = nNewBlob;
+ pNewDBEvent->cbBlob = (uint16_t)nNewBlob;
pNewDBEvent->flags = dwNewFlags;
memcpy(pNewDBEvent + 1, pNewBlob, nNewBlob);
|