From fe27b2dfe4551bc841b4edb833f13c7f72095faa Mon Sep 17 00:00:00 2001 From: svost Date: Thu, 17 Mar 2016 09:53:21 +0300 Subject: [PATCH] Fix msvc c4127 warning --- src/bignum.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/bignum.h b/src/bignum.h index 7f02fd5..4bda99d 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -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"); -- 1.7.1