From 1748fe674c6b264e5160f8c0de647a7001146f79 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 1 Feb 2022 19:47:30 +0100 Subject: [PATCH] Use `std::`-prefix for all std-types used in headers --- lmdb-typed.hh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lmdb-typed.hh b/lmdb-typed.hh index ff17400..42d5ddd 100644 --- a/lmdb-typed.hh +++ b/lmdb-typed.hh @@ -66,12 +66,12 @@ template struct LMDB_SAFE_EXPORT L : d_parent(parent) { } - void put(MDBRWTransaction &txn, const Class &t, uint32_t id, unsigned int flags = 0) + void put(MDBRWTransaction &txn, const Class &t, std::uint32_t id, unsigned int flags = 0) { txn->put(d_idx, keyConv(d_parent->getMember(t)), id, flags); } - void del(MDBRWTransaction &txn, const Class &t, uint32_t id) + void del(MDBRWTransaction &txn, const Class &t, std::uint32_t id) { if (const auto rc = txn->del(d_idx, keyConv(d_parent->getMember(t)), id)) { throw LMDBError("Error deleting from index: ", rc); @@ -174,7 +174,7 @@ public: } //! Number of entries in main database - size_t size() + std::size_t size() { MDB_stat stat; mdb_stat(**d_parent.d_txn, d_parent.d_parent->d_main, &stat); @@ -182,7 +182,7 @@ public: } //! Number of entries in the various indexes - should be the same - template size_t size() + template std::size_t size() { MDB_stat stat; mdb_stat(**d_parent.d_txn, std::get(d_parent.d_parent->d_tuple).d_idx, &stat); @@ -190,7 +190,7 @@ public: } //! Get item with id, from main table directly - bool get(uint32_t id, T &t) + bool get(std::uint32_t id, T &t) { MDBOutVal data; if ((*d_parent.d_txn)->get(d_parent.d_parent->d_main, id, data)) @@ -201,23 +201,23 @@ public: } //! Get item through index N, then via the main database - template uint32_t get(const index_t &key, T &out) + template std::uint32_t get(const index_t &key, T &out) { MDBOutVal id; if (!(*d_parent.d_txn)->get(std::get(d_parent.d_parent->d_tuple).d_idx, keyConv(key), id)) { - if (get(id.get(), out)) - return id.get(); + if (get(id.get(), out)) + return id.get(); } return 0; } //! Cardinality of index N - template uint32_t cardinality() + template std::uint32_t cardinality() { auto cursor = (*d_parent.d_txn)->getCursor(std::get(d_parent.d_parent->d_tuple).d_idx); bool first = true; MDBOutVal key, data; - uint32_t count = 0; + std::uint32_t count = 0; while (!cursor.get(key, data, first ? MDB_FIRST : MDB_NEXT_NODUP)) { ++count; first = false; @@ -357,12 +357,12 @@ public: } // get ID this iterator points to - uint32_t getID() + std::uint32_t getID() { if (d_on_index) - return d_id.get(); + return d_id.get(); else - return d_key.get(); + return d_key.get(); } const MDBOutVal &getKey() @@ -554,7 +554,7 @@ public: } // insert something, with possibly a specific id - uint32_t put(const T &t, uint32_t id = 0) + std::uint32_t put(const T &t, std::uint32_t id = 0) { unsigned int flags = 0; if (!id) { @@ -567,7 +567,7 @@ public: } // modify an item 'in place', plus update indexes - void modify(uint32_t id, std::function func) + void modify(std::uint32_t id, std::function func) { T t; if (!this->get(id, t)) @@ -579,7 +579,7 @@ public: } //! delete an item, and from indexes - void del(uint32_t id) + void del(std::uint32_t id) { T t; if (!this->get(id, t)) @@ -619,7 +619,7 @@ public: private: // clear this ID from all indexes - void clearIndex(uint32_t id, const T &t) + void clearIndex(std::uint32_t id, const T &t) { d_parent->forEachIndex([&](auto &&i) { i.del(*d_txn, t, id); }); }