Fix fixed point percentage macro not to overflow. Thanks to jmb and vince.

svn path=/trunk/netsurf/; revision=11702
This commit is contained in:
Michael Drake 2011-02-16 20:41:55 +00:00
parent 7d03e1f969
commit bbdb7cd440

View File

@ -59,9 +59,7 @@
#define AUTO INT_MIN
/* Fixed point value percentage of an integer, to an integer */
#define FPCT_OF_INT_TOINT(a, b) (a < 0) ? \
(FIXTOFLT(a) * b) / 100 : \
FIXTOINT(FDIVI(FMULI(a, b), 100))
#define FPCT_OF_INT_TOINT(a, b) FIXTOINT(FMULI(FDIVI(a, 100), b))
static bool layout_block_context(struct box *block, int viewport_height,