projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix various assumptions about mpw sizes.
[u/mdw/catacomb]
/
mp-arith.c
diff --git
a/mp-arith.c
b/mp-arith.c
index
3af1447
..
9cb5178
100644
(file)
--- 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;
}
}