fix shift

This commit is contained in:
rsc 2005-12-30 17:06:50 +00:00
parent af79ebc2b6
commit 9e36143a34
2 changed files with 8 additions and 2 deletions

View file

@ -22,7 +22,10 @@ uvtomp(uvlong v, mpint *b)
return b;
for(s = 0; s < VLDIGITS && v != 0; s++){
b->p[s] = v;
v >>= sizeof(mpdigit)*8;
if(sizeof(mpdigit) == sizeof(uvlong))
v = 0;
else
v >>= sizeof(mpdigit)*8;
}
b->top = s;
return b;

View file

@ -28,7 +28,10 @@ vtomp(vlong v, mpint *b)
uv = v;
for(s = 0; s < VLDIGITS && uv != 0; s++){
b->p[s] = uv;
uv >>= sizeof(mpdigit)*8;
if(sizeof(mpdigit) == sizeof(uvlong))
uv = 0;
else
uv >>= sizeof(mpdigit)*8;
}
b->top = s;
return b;