diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-23 21:25:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-23 21:25:36 +0300 |
commit | 7fec01783b89fabce955273d7452cebd16dc58b0 (patch) | |
tree | 3008fc4bfea8cb16b158230a4c86bbcdff8e3632 /plugins/Dbx_mdbx/src | |
parent | 80207f75648fad4294a77ff9ce50f0edaedffeca (diff) |
even more strict scope
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r-- | plugins/Dbx_mdbx/src/dbsettings.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/Dbx_mdbx/src/dbsettings.cpp b/plugins/Dbx_mdbx/src/dbsettings.cpp index 312d4aa68e..775e69b733 100644 --- a/plugins/Dbx_mdbx/src/dbsettings.cpp +++ b/plugins/Dbx_mdbx/src/dbsettings.cpp @@ -381,23 +381,24 @@ STDMETHODIMP_(BOOL) CDbxMDBX::DeleteContactSetting(MCONTACT contactID, LPCSTR sz STDMETHODIMP_(BOOL) CDbxMDBX::EnumContactSettings(MCONTACT hContact, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, void *param)
{
- int result = -1;
-
- DBSettingKey keyVal = { hContact, GetModuleID(szModule), 0 };
- txn_ptr_ro txn(m_txn_ro);
- cursor_ptr_ro cursor(m_curSettings);
-
LIST<char> arKeys(100);
- MDBX_val key = { &keyVal, sizeof(keyVal) }, data;
+ {
+ DBSettingKey keyVal = { hContact, GetModuleID(szModule), 0 };
+ txn_ptr_ro txn(m_txn_ro);
+ cursor_ptr_ro cursor(m_curSettings);
- for (int res = mdbx_cursor_get(cursor, &key, &data, MDBX_SET_RANGE); res == MDBX_SUCCESS; res = mdbx_cursor_get(cursor, &key, &data, MDBX_NEXT)) {
- const DBSettingKey *pKey = (const DBSettingKey*)key.iov_base;
- if (pKey->hContact != hContact || pKey->dwModuleId != keyVal.dwModuleId)
- break;
+ MDBX_val key = { &keyVal, sizeof(keyVal) }, data;
+
+ for (int res = mdbx_cursor_get(cursor, &key, &data, MDBX_SET_RANGE); res == MDBX_SUCCESS; res = mdbx_cursor_get(cursor, &key, &data, MDBX_NEXT)) {
+ const DBSettingKey *pKey = (const DBSettingKey*)key.iov_base;
+ if (pKey->hContact != hContact || pKey->dwModuleId != keyVal.dwModuleId)
+ break;
- arKeys.insert((char*)pKey->szSettingName);
+ arKeys.insert((char*)pKey->szSettingName);
+ }
}
+ int result = -1;
for (int i=0; i < arKeys.getCount(); i++)
result = pfnEnumProc(arKeys[i], param);
|