Workarround for gcc 2.60 expression evaluation bug.

This commit is contained in:
Paul Traina 1996-09-08 00:34:04 +00:00
parent 7c8f1b02e3
commit 0ab452aa42
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18132

View File

@ -194,7 +194,11 @@ static int scale_round(int n, int x, int y)
}
else {
if (-(unsigned)n <= (-(unsigned)INT_MIN - y2)/x)
return (n*x - y2)/y;
{
// XXX simplify expression to work around bug in gcc-2.6.0
int tmp = n*x - y2;
return tmp/y;
}
return int(n*double(x)/double(y) - .5);
}
}