From e7d15e07f8cbe0998fbc318413d5367398195b12 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 5 Jul 2019 18:41:09 -0400 Subject: Fix LGTM warning --- src/lib/math/mp/mp_core.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lib/math') diff --git a/src/lib/math/mp/mp_core.h b/src/lib/math/mp/mp_core.h index 300ee7889..4f9a412bd 100644 --- a/src/lib/math/mp/mp_core.h +++ b/src/lib/math/mp/mp_core.h @@ -19,9 +19,7 @@ namespace Botan { -const word MP_WORD_MASK = ~static_cast(0); -const word MP_WORD_TOP_BIT = static_cast(1) << (8*sizeof(word) - 1); -const word MP_WORD_MAX = MP_WORD_MASK; +const word MP_WORD_MAX = ~static_cast(0); /* * If cond == 0, does nothing. @@ -731,7 +729,7 @@ inline word bigint_divop(word n1, word n0, word d) for(size_t i = 0; i != BOTAN_MP_WORD_BITS; ++i) { - word high_top_bit = (high & MP_WORD_TOP_BIT); + const word high_top_bit = high >> (BOTAN_MP_WORD_BITS-1); high <<= 1; high |= (n0 >> (BOTAN_MP_WORD_BITS-1-i)) & 1; -- cgit v1.2.3