X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/15f2115520c175d46988d9a63602c3a2d84a2826..ffec48800022b6872951eca188d2ceedef8dd5c8:/mp-arith.c diff --git a/mp-arith.c b/mp-arith.c index 3af1447..9cb5178 100644 --- a/mp-arith.c +++ b/mp-arith.c @@ -652,16 +652,16 @@ mp *mp_odd(mp *d, mp *m, size_t *s) ss = 0; else { mpw x = *v; - mpw mask = MPW_MAX; - unsigned z = MPW_BITS / 2; + unsigned z = MPW_P2; + mpw mask = ((mpw)1 << z) - 1; while (z) { - mask >>= z; if (!(x & mask)) { x >>= z; ss += z; } z >>= 1; + mask >>= z; } }