diff options
author | Adrian Lees <adrian@aemulor.com> | 2009-01-24 00:57:14 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2009-01-24 00:57:14 +0000 |
commit | 83e47dfd5b5774762ca53f2aaf29a3fd8cb27ae4 (patch) | |
tree | 5fbe3cc9c9ed7faf4155a4e38ed9a20311c0faae /test/number.c | |
parent | 9227f97cdf1f782ca759219eb7e94b2ee0772dd0 (diff) | |
download | libcss-83e47dfd5b5774762ca53f2aaf29a3fd8cb27ae4.tar.gz libcss-83e47dfd5b5774762ca53f2aaf29a3fd8cb27ae4.tar.bz2 |
Fix handling of max -ve numbers
svn path=/trunk/libcss/; revision=6214
Diffstat (limited to 'test/number.c')
-rw-r--r-- | test/number.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/number.c b/test/number.c index 46b2fda..dd44730 100644 --- a/test/number.c +++ b/test/number.c @@ -127,7 +127,7 @@ void run_test(const uint8_t *data, size_t len, const char *exp, size_t explen) void print_fixed(char *buf, size_t len, fixed f) { -#define ABS(x) ((x) < 0 ? -(x) : (x)) +#define ABS(x) (uint32_t)((x) < 0 ? -(x) : (x)) uint32_t uintpart = FIXTOINT(ABS(f)); /* + 500 to ensure round to nearest (division will truncate) */ uint32_t fracpart = ((ABS(f) & 0x3ff) * 1000 + 500) / (1 << 10); |