64-bit fixes from lucho

This commit is contained in:
rsc 2005-01-14 03:33:11 +00:00
parent 93aa30a8df
commit 2634795b5f
4 changed files with 13 additions and 11 deletions

View file

@ -126,7 +126,7 @@ mod(long x, long y)
long z;
z = x%y;
if((long)(((u32int)z)^((u32int)y)) > 0 || z == 0)
if((long)(((ulong)z)^((ulong)y)) > 0 || z == 0)
return z;
return z + y;
}
@ -134,7 +134,7 @@ mod(long x, long y)
static long
sdiv(long x, long y)
{
if((long)(((u32int)x)^((u32int)y)) >= 0 || x == 0)
if((long)(((ulong)x)^((ulong)y)) >= 0 || x == 0)
return x/y;
return (x+((y>>30)|1))/y-1;