diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-10-22 18:10:35 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-10-22 18:10:35 +0800 |
commit | a879755b4645100ded1dc8c8fa9c8bdbc0a76408 (patch) | |
tree | f9eb86964bfb76503ff8ef4ee1dd99a6a880f8d0 | |
parent | 9501612d5598557bfd57b7be526549f996058555 (diff) | |
download | tangerine-mcl-a879755b4645100ded1dc8c8fa9c8bdbc0a76408.tar.gz tangerine-mcl-a879755b4645100ded1dc8c8fa9c8bdbc0a76408.tar.zst tangerine-mcl-a879755b4645100ded1dc8c8fa9c8bdbc0a76408.zip |
remove warning by clang
-rw-r--r-- | include/mcl/ec.hpp | 9 | ||||
-rw-r--r-- | include/mcl/operator.hpp | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/mcl/ec.hpp b/include/mcl/ec.hpp index 91508d2..66ccffc 100644 --- a/include/mcl/ec.hpp +++ b/include/mcl/ec.hpp @@ -588,14 +588,13 @@ public: } static inline void mul(EcT& z, const EcT& x, int64_t y) { + const uint64_t u = std::abs(y); #if MCL_SIZEOF_UNIT == 8 - const fp::Unit u = abs(y); mulArray(z, x, &u, 1, y < 0); #else - uint64_t ua = std::abs(y); - Unit u[2] = { uint32_t(ua), uint32_t(ua >> 32) }; - size_t un = u[1] ? 2 : 1; - mulArray(z, u, un, y < 0); + uint32_t ua[2] = { uint32_t(u), uint32_t(u >> 32) }; + size_t un = ua[1] ? 2 : 1; + mulArray(z, ua, un, y < 0); #endif } static inline void mul(EcT& z, const EcT& x, const mpz_class& y) diff --git a/include/mcl/operator.hpp b/include/mcl/operator.hpp index c14c9d1..3acd6c6 100644 --- a/include/mcl/operator.hpp +++ b/include/mcl/operator.hpp @@ -63,14 +63,13 @@ struct Operator : E { } static void pow(T& z, const T& x, int64_t y) { + const uint64_t u = std::abs(y); #if MCL_SIZEOF_UNIT == 8 - const Unit u = abs(y); powArray(z, x, &u, 1, y < 0, false); #else - uint64_t ua = std::abs(y); - Unit u[2] = { uint32_t(ua), uint32_t(ua >> 32) }; - size_t un = u[1] ? 2 : 1; - powArray(z, x, u, un, y < 0, false); + uint32_t ua[2] = { uint32_t(u), uint32_t(u >> 32) }; + size_t un = ua[1] ? 2 : 1; + powArray(z, x, ua, un, y < 0, false); #endif } static void pow(T& z, const T& x, const mpz_class& y) |