From 0bac8935f42efa1e1152fd09a04d95b76d8c5eb3 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 8 Mar 2016 10:39:59 +0000 Subject: dbx_lmdb: more fixes & optimizations git-svn-id: http://svn.miranda-ng.org/main/trunk@16446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbevents.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbevents.cpp') diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index a69b57a5bf..466cd3b452 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -215,7 +215,7 @@ STDMETHODIMP_(LONG) CDbxMdb::GetBlobSize(MEVENT hDbEvent) if (mdb_get(txn, m_dbEvents, &key, &data) != MDB_SUCCESS) return -1; - DBEvent *dbe = (DBEvent*)data.mv_data; + const DBEvent *dbe = (const DBEvent*)data.mv_data; return (dbe->dwSignature == DBEVENT_SIGNATURE) ? dbe->cbBlob : 0; } @@ -347,7 +347,7 @@ STDMETHODIMP_(MCONTACT) CDbxMdb::GetEventContact(MEVENT hDbEvent) if (mdb_get(txn, m_dbEvents, &key, &data) != MDB_SUCCESS) return INVALID_CONTACT_ID; - DBEvent *dbe = (DBEvent*)data.mv_data; + const DBEvent *dbe = (const DBEvent*)data.mv_data; return (dbe->dwSignature == DBEVENT_SIGNATURE) ? dbe->contactID : INVALID_CONTACT_ID; } @@ -362,7 +362,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstEvent(MCONTACT contactID) cursor_ptr_ro cursor(m_curEventsSort); mdb_cursor_get(cursor, &key, &data, MDB_SET_RANGE); - DBEventSortingKey *pKey = (DBEventSortingKey*)key.mv_data; + const DBEventSortingKey *pKey = (const DBEventSortingKey*)key.mv_data; m_tsLast = pKey->ts; return m_evLast = (pKey->dwContactId == contactID) ? pKey->dwEventId : 0; } @@ -386,7 +386,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindLastEvent(MCONTACT contactID) if (mdb_cursor_get(cursor, &key, &data, MDB_PREV) != MDB_SUCCESS) return m_evLast = 0; - DBEventSortingKey *pKey = (DBEventSortingKey*)key.mv_data; + const DBEventSortingKey *pKey = (const DBEventSortingKey*)key.mv_data; m_tsLast = pKey->ts; return m_evLast = (pKey->dwContactId == contactID) ? pKey->dwEventId : 0; } @@ -420,7 +420,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent if (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) != MDB_SUCCESS) return m_evLast = 0; - DBEventSortingKey *pKey = (DBEventSortingKey*)key.mv_data; + const DBEventSortingKey *pKey = (const DBEventSortingKey*)key.mv_data; m_tsLast = pKey->ts; return m_evLast = (pKey->dwContactId == contactID) ? pKey->dwEventId : 0; } @@ -454,7 +454,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent if (mdb_cursor_get(cursor, &key, &data, MDB_PREV) != MDB_SUCCESS) return m_evLast = 0; - DBEventSortingKey *pKey = (DBEventSortingKey*)key.mv_data; + const DBEventSortingKey *pKey = (const DBEventSortingKey*)key.mv_data; m_tsLast = pKey->ts; return m_evLast = (pKey->dwContactId == contactID) ? pKey->dwEventId : 0; } -- cgit v1.2.3