reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 66b727ed15ca45822f4600d0a91b5edf5f591047
parent 1b0c479d4d850e7254e045395f8a389ff5965c25
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Wed, 16 Dec 2015 17:11:03 -0500

always store version codes as 64-bit integers

Diffstat:
Msrc/registry.cpp | 2+-
Msrc/registry.hpp | 3++-
Msrc/version.cpp | 2+-
Msrc/version.hpp | 5+++--
4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/registry.cpp b/src/registry.cpp @@ -34,7 +34,7 @@ Registry::QueryResult Registry::query(Package *pkg) const const Status status = it->second == lastVer->name() ? UpToDate : UpdateAvailable; - size_t versionCode = 0; + uint64_t versionCode = 0; try { if(status == UpdateAvailable) diff --git a/src/registry.hpp b/src/registry.hpp @@ -1,6 +1,7 @@ #ifndef REAPACK_REGISTRY_HPP #define REAPACK_REGISTRY_HPP +#include <cstdint> #include <map> #include <string> @@ -18,7 +19,7 @@ public: struct QueryResult { Status status; - size_t versionCode; + uint64_t versionCode; }; void push(Package *pkg); diff --git a/src/version.cpp b/src/version.cpp @@ -31,7 +31,7 @@ Version::Version(const std::string &str) if(match.size() > 4) throw reapack_error("version component overflow"); - m_code += stoi(match) * (size_t)pow(10000, size - index - 1); + m_code += stoi(match) * (uint64_t)pow(10000, size - index - 1); } } diff --git a/src/version.hpp b/src/version.hpp @@ -1,6 +1,7 @@ #ifndef REAPACK_VERSION_HPP #define REAPACK_VERSION_HPP +#include <cstdint> #include <set> #include <string> @@ -15,7 +16,7 @@ public: const std::string &name() const { return m_name; } std::string fullName() const; - size_t code() const { return m_code; } + uint64_t code() const { return m_code; } void setPackage(Package *pkg) { m_package = pkg; } Package *package() const { return m_package; } @@ -33,7 +34,7 @@ public: private: std::string m_name; - size_t m_code; + uint64_t m_code; Package *m_package;