diff options
author | aiju <devnull@localhost> | 2016-08-28 11:38:29 +0200 |
---|---|---|
committer | aiju <devnull@localhost> | 2016-08-28 11:38:29 +0200 |
commit | 344ff48512561b57022c1f686005b3283da07cc5 (patch) | |
tree | 520f78eafc19d6077671a4f8079e486627b75ba2 /sys/src/libmp | |
parent | cf2f2a884137b589f502ffc7af9de5ca78634356 (diff) |
mp: fix mptov and mptouv
Diffstat (limited to 'sys/src/libmp')
-rw-r--r-- | sys/src/libmp/port/mptouv.c | 4 | ||||
-rw-r--r-- | sys/src/libmp/port/mptov.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/libmp/port/mptouv.c b/sys/src/libmp/port/mptouv.c index 9e52a357f..760b38fb5 100644 --- a/sys/src/libmp/port/mptouv.c +++ b/sys/src/libmp/port/mptouv.c @@ -14,10 +14,10 @@ uvtomp(uvlong v, mpint *b) int s; if(b == nil){ - b = mpnew(VLDIGITS*sizeof(mpdigit)); + b = mpnew(VLDIGITS*Dbits); setmalloctag(b, getcallerpc(&v)); }else - mpbits(b, VLDIGITS*sizeof(mpdigit)); + mpbits(b, VLDIGITS*Dbits); b->sign = 1; for(s = 0; s < VLDIGITS; s++){ b->p[s] = v; diff --git a/sys/src/libmp/port/mptov.c b/sys/src/libmp/port/mptov.c index b1b3e93f7..2c76dc6c0 100644 --- a/sys/src/libmp/port/mptov.c +++ b/sys/src/libmp/port/mptov.c @@ -15,10 +15,10 @@ vtomp(vlong v, mpint *b) uvlong uv; if(b == nil){ - b = mpnew(VLDIGITS*sizeof(mpdigit)); + b = mpnew(VLDIGITS*Dbits); setmalloctag(b, getcallerpc(&v)); }else - mpbits(b, VLDIGITS*sizeof(mpdigit)); + mpbits(b, VLDIGITS*Dbits); b->sign = (v >> (sizeof(v)*8 - 1)) | 1; uv = v * b->sign; for(s = 0; s < VLDIGITS; s++){ |