Use `std::`-prefix for a few more occurrences in standard types for consistency

This commit is contained in:
Martchus 2022-02-01 19:48:26 +01:00
parent 1748fe674c
commit 213dfb823d
3 changed files with 16 additions and 16 deletions

View File

@ -54,7 +54,7 @@ int main(int argc, char **)
cout << data.get<string_view>() << endl;
struct Bert {
uint16_t x, y;
std::uint16_t x, y;
};
auto b = data.get_struct<Bert>();
cout << b.x << " " << b.y << endl;
@ -64,7 +64,7 @@ int main(int argc, char **)
exit(1);
}
} else {
size_t size = 1ULL * 4096 * 244140ULL;
std::size_t size = 1ULL * 4096 * 244140ULL;
for (unsigned int n = 0;; ++n) {
if (!(n % 16384)) {
size += 16384;

View File

@ -11,18 +11,18 @@ using namespace std;
using namespace LMDBSafe;
struct DNSResourceRecord {
string qname; // index
uint16_t qtype{ 0 };
uint32_t domain_id{ 0 }; // index
string content;
uint32_t ttl{ 0 };
string ordername; // index
std::string qname; // index
std::uint16_t qtype{ 0 };
std::uint32_t domain_id{ 0 }; // index
std::string content;
std::uint32_t ttl{ 0 };
std::string ordername; // index
bool auth{ true };
};
struct DomainInfo {
string qname;
string master;
std::string qname;
std::string master;
};
template <class Archive> void serialize(Archive &ar, DomainInfo &g, const unsigned int version)
@ -47,7 +47,7 @@ struct compound {
std::string operator()(const DNSResourceRecord &rr)
{
std::string ret;
uint32_t id = htonl(rr.domain_id);
std::uint32_t id = htonl(rr.domain_id);
ret.assign(reinterpret_cast<char *>(&id), 4);
ret.append(rr.ordername);
return ret;
@ -56,8 +56,8 @@ struct compound {
int main()
{
TypedDBI<DNSResourceRecord, index_on<DNSResourceRecord, string, &DNSResourceRecord::qname>,
index_on<DNSResourceRecord, uint32_t, &DNSResourceRecord::domain_id>, index_on_function<DNSResourceRecord, string, compound>>
TypedDBI<DNSResourceRecord, index_on<DNSResourceRecord, std::string, &DNSResourceRecord::qname>,
index_on<DNSResourceRecord, std::uint32_t, &DNSResourceRecord::domain_id>, index_on_function<DNSResourceRecord, std::string, compound>>
tdbi(getMDBEnv("./typed.lmdb", MDB_NOSUBDIR, 0600), "records");
TypedDBI<DomainInfo, index_on<DomainInfo, string, &DomainInfo::qname>> tdomains(tdbi.getEnv(), "domains");

View File

@ -12,12 +12,12 @@ void countDB(MDBEnv &env, MDBROTransaction &txn, const std::string &dbname)
CPP_UTILITIES_UNUSED(env)
auto db = txn->openDB(dbname, 0);
auto cursor = txn->getCursor(db);
uint32_t count = 0;
std::uint32_t count = 0;
MDBOutVal key, val;
while (!cursor.get(key, val, count ? MDB_NEXT : MDB_FIRST)) {
cout << key.get<string>();
cout << key.get<std::string>();
if (key.d_mdbval.mv_size == 4)
cout << " " << key.get<uint32_t>();
cout << " " << key.get<std::uint32_t>();
cout << ": " << val.get<std::string>();
cout << "\n";
++count;