Fix typos, fix some warnings, added more compile options, moved to forgejo CI
Some checks failed
Main LMDBAL workflow / Test LMDBAL with qt5 (push) Has been cancelled
Main LMDBAL workflow / Test LMDBAL with qt6 (push) Has been cancelled
Main LMDBAL workflow / Release documentation (push) Has been cancelled

This commit is contained in:
Blue 2025-05-02 18:19:06 +03:00
parent 3ae1fd15c0
commit 1585b8e4f5
Signed by: blue
GPG key ID: 9B203B252A63EE38
15 changed files with 204 additions and 120 deletions

View file

@ -48,7 +48,7 @@ template <class K, class V>
class Cache;
typedef MDB_txn* TransactionID; /**<\brief I'm going to use transaction pointers as transaction IDs*/
typedef uint32_t SizeType; /**<\brief All LMDBAL sizes are uint32_t*/
typedef uint32_t SizeType; /**<\brief All LMDBAL sizes are uint32*/
class Base {
friend class StorageCommon;
@ -135,8 +135,8 @@ LMDBAL::Storage<K, V>* LMDBAL::Base::addStorage(const std::string& storageName,
if (opened)
throw Opened(name, "add storage " + storageName);
Storage<K, V>* storage = new Storage<K, V>(this, storageName, duplicates);
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(storageName, (StorageCommon *)storage));
auto storage = new Storage<K, V>(this, storageName, duplicates);
std::pair<Storages::const_iterator, bool> pair = storages.emplace(storageName, static_cast<StorageCommon *>(storage));
if (!pair.second)
throw StorageDuplicate(name, storageName);
@ -163,8 +163,8 @@ LMDBAL::Cache<K, V> * LMDBAL::Base::addCache(const std::string& storageName) {
if (opened)
throw Opened(name, "add cache " + storageName);
Cache<K, V>* cache = new Cache<K, V>(this, storageName, false);
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(storageName, (StorageCommon *)cache));
auto cache = new Cache<K, V>(this, storageName, false);
std::pair<Storages::const_iterator, bool> pair = storages.emplace(storageName, static_cast<StorageCommon *>(cache));
if (!pair.second)
throw StorageDuplicate(name, storageName);