X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fbignum.h;h=4bda99d42515d31bb409df2dc89a446a2cc3063b;hb=2404891de8ac5b357d0abde90f2e286a3153fdef;hp=35708406c6fdea749bece72d3e947ef0eed696be;hpb=e69d227d0d466a1426be560b628cf788eb09835a;p=novacoin.git diff --git a/src/bignum.h b/src/bignum.h index 3570840..4bda99d 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -188,7 +188,7 @@ public: pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; - BN_mpi2bn(pch, p - pch, this); + BN_mpi2bn(pch, (int)(p - pch), this); } uint64_t getuint64() @@ -206,10 +206,13 @@ public: return n; } + //supress msvc C4127: conditional expression is constant + inline bool check(bool value) {return value;} + void setuint64(uint64_t n) { // Use BN_set_word if word size is sufficient for uint64_t - if (sizeof(n) <= sizeof(BN_ULONG)) + if (check(sizeof(n) <= sizeof(BN_ULONG))) { if (!BN_set_word(this, (BN_ULONG)n)) throw bignum_error("CBigNum conversion from uint64_t : BN_set_word failed");