From 54c6f7d1ff97104322d14684644cbdeb04e85b57 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 5 Jul 2009 00:48:27 +0000 Subject: Force use of 64bit arithmetic when multiplying/dividing. svn path=/trunk/libcss/; revision=8318 --- include/libcss/fpmath.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h index 6373125..8b867f8 100644 --- a/include/libcss/fpmath.h +++ b/include/libcss/fpmath.h @@ -18,9 +18,9 @@ typedef int32_t css_fixed; /* Subtract two fixed point values */ #define FSUB(a, b) ((a) - (b)) /* Multiply two fixed point values */ -#define FMUL(a, b) (((a) * (b)) >> 10) +#define FMUL(a, b) ((((int64_t) (a)) * ((int64_t) (b))) >> 10) /* Divide two fixed point values */ -#define FDIV(a, b) (((a) << 10) / (b)) +#define FDIV(a, b) ((((int64_t) (a)) << 10) / (b)) /* Add an integer to a fixed point value */ #define FADDI(a, b) ((a) + ((b) << 10)) -- cgit v1.2.3