ref: 8a8f35889ebf770278928ea72345306c5c7ccfbf
parent: 626403160fa0007b46465672f48b8db0f2b79b25
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Jan 12 17:39:41 EST 2025
mptod: fix the confusion with Dbits vs the actual type of v (uint64_t)
--- a/3rd/mp/mptod.c
+++ b/3rd/mp/mptod.c
@@ -31,12 +31,9 @@
else
w = a->p[i];
m = 54 - n;
- if(m > Dbits){
+ if(m > Dbits)
m = Dbits;
- v = 0;
- }else{
- v <<= m;
- }
+ v = m < 64 ? (v<<m) : 0;
s = (Dbits - m) & (Dbits - 1);
v |= w >> s;
r = w & ((1ULL<<s) - 1);