X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fbignum.h;h=4bda99d42515d31bb409df2dc89a446a2cc3063b;hp=35708406c6fdea749bece72d3e947ef0eed696be;hb=32b53bb54ee7591fd47dd1ee24e05b73337f40b5;hpb=e69d227d0d466a1426be560b628cf788eb09835a 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");