From 40fbc56ba745322ed75ac12c5551ce6b9bcb1cc4 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 7 Aug 2018 11:02:00 +0200 Subject: Store revisions as size_t --- common/storage/key.h | 4 ++-- common/utils.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/common/storage/key.h b/common/storage/key.h index baabe38..acd81cf 100644 --- a/common/storage/key.h +++ b/common/storage/key.h @@ -67,7 +67,7 @@ public: static const constexpr size_t INTERNAL_REPR_SIZE = 19; static const constexpr size_t DISPLAY_REPR_SIZE = 19; - Revision(qint64 rev) : rev(rev) {} + Revision(size_t rev) : rev(rev) {} QByteArray toInternalByteArray() const; static Revision fromInternalByteArray(const QByteArray &bytes); @@ -84,7 +84,7 @@ public: bool operator!=(const Revision &other) const; private: - qint64 rev; + size_t rev; }; class Key diff --git a/common/utils.h b/common/utils.h index 7066d79..ec1d5b1 100644 --- a/common/utils.h +++ b/common/utils.h @@ -26,6 +26,15 @@ namespace Sink { QByteArray createUuid(); +template +static QByteArray padNumber(T number); + +template <> +QByteArray padNumber(size_t number) +{ + return padNumber(number); +} + template static QByteArray padNumber(T number) { -- cgit v1.2.3