diff options
author | luigi1111 <luigi1111w@gmail.com> | 2020-04-04 13:17:54 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2020-04-04 13:17:54 -0500 |
commit | bbceb310442a28fe772cdbd7a6395dab89064f76 (patch) | |
tree | 65181d4ae1a2e703225497dac850b7544c7683a1 | |
parent | Merge pull request #6387 (diff) | |
parent | Fixing static_asserts in ZMQ JSON (diff) | |
download | monero-bbceb310442a28fe772cdbd7a6395dab89064f76.tar.xz |
Merge pull request #6395
ad13a4b Fixing static_asserts in ZMQ JSON (vtnerd)
-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 926eb18c0..f20fd181a 100644 --- a/src/serialization/json_object.cpp +++ b/src/serialization/json_object.cpp @@ -207,7 +207,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); } @@ -218,8 +218,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); } |