Fix typos, fix some warnings, added more compile options, moved to forgejo CI
This commit is contained in:
parent
3ae1fd15c0
commit
1585b8e4f5
15 changed files with 204 additions and 120 deletions
|
@ -34,7 +34,17 @@ public:
|
|||
return value;
|
||||
};
|
||||
void deserialize(const MDB_val& data, QByteArray& result) {
|
||||
result.setRawData((char*)data.mv_data, data.mv_size);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
if (data.mv_size > static_cast<size_t>(std::numeric_limits<qsizetype>::max()))
|
||||
throw std::runtime_error("Data size exceeds QByteArray capacity");
|
||||
|
||||
result.setRawData(static_cast<char *>(data.mv_data), static_cast<qsizetype>(data.mv_size));
|
||||
#else
|
||||
if (data.mv_size > static_cast<size_t>(std::numeric_limits<uint>::max()))
|
||||
throw std::runtime_error("Data size exceeds QByteArray capacity");
|
||||
|
||||
result.setRawData(static_cast<char *>(data.mv_data), static_cast<uint>(data.mv_size));
|
||||
#endif
|
||||
}
|
||||
MDB_val setData(const QByteArray& data) {
|
||||
value = data;
|
||||
|
@ -43,7 +53,7 @@ public:
|
|||
MDB_val getData() {
|
||||
MDB_val result;
|
||||
result.mv_data = value.data();
|
||||
result.mv_size = value.size();
|
||||
result.mv_size = static_cast<size_t>(value.size());
|
||||
return result;
|
||||
};
|
||||
void clear() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue