diff options
author | Lee Clagett <code@leeclagett.com> | 2020-03-19 19:49:51 -0400 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2020-03-19 19:49:51 -0400 |
commit | ad13a4b2aceb22979bfd513508b2699ab65e9671 (patch) | |
tree | 0c25c1554fd61d27e23c3e56c128840d2198e5ac /src/serialization/json_object.cpp | |
parent | Merge pull request #6388 (diff) | |
download | monero-ad13a4b2aceb22979bfd513508b2699ab65e9671.tar.xz |
Fixing static_asserts in ZMQ JSON
Diffstat (limited to 'src/serialization/json_object.cpp')
-rw-r--r-- | src/serialization/json_object.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/serialization/json_object.cpp b/src/serialization/json_object.cpp index e98ba0483..51cd3daf5 100644 --- a/src/serialization/json_object.cpp +++ b/src/serialization/json_object.cpp @@ -190,7 +190,7 @@ void fromJsonValue(const rapidjson::Value& val, int& i) void toJsonValue(rapidjson::Writer<rapidjson::StringBuffer>& dest, const unsigned long long i) { - static_assert(std::numeric_limits<unsigned long long>::max() <= std::numeric_limits<std::uint64_t>::max(), "bad uint64 conversion"); + static_assert(!precision_loss<unsigned long long, std::uint64_t>(), "bad uint64 conversion"); dest.Uint64(i); } @@ -201,8 +201,7 @@ void fromJsonValue(const rapidjson::Value& val, unsigned long long& i) void toJsonValue(rapidjson::Writer<rapidjson::StringBuffer>& dest, const long long i) { - static_assert(std::numeric_limits<std::uint64_t>::min() <= std::numeric_limits<long long>::min(), "bad int64 conversion"); - static_assert(std::numeric_limits<long long>::max() <= std::numeric_limits<std::uint64_t>::max(), "bad int64 conversion"); + static_assert(!precision_loss<long long, std::int64_t>(), "bad int64 conversion"); dest.Int64(i); } |