diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-02-16 20:41:55 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-02-16 20:41:55 +0000 |
commit | bbdb7cd440accc92fd9bfaf8c4821bba2844e3e5 (patch) | |
tree | 01f5e97024fe96e32b4e07a6a24e946d97b9a12e | |
parent | 7d03e1f969a58db91a16fe8467549c8e5eea4a5c (diff) | |
download | netsurf-bbdb7cd440accc92fd9bfaf8c4821bba2844e3e5.tar.gz netsurf-bbdb7cd440accc92fd9bfaf8c4821bba2844e3e5.tar.bz2 |
Fix fixed point percentage macro not to overflow. Thanks to jmb and vince.
svn path=/trunk/netsurf/; revision=11702
-rw-r--r-- | render/layout.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/render/layout.c b/render/layout.c index fc0f22b98..02c162b2d 100644 --- a/render/layout.c +++ b/render/layout.c @@ -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, |