diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-05 00:48:27 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-05 00:48:27 +0000 |
commit | 54c6f7d1ff97104322d14684644cbdeb04e85b57 (patch) | |
tree | df8fd8915033aa036ece8bd1da09cb5f0ba2dc64 /include/libcss/fpmath.h | |
parent | 9a346eeda5ae9c43219000c695f881924fad5c1d (diff) | |
download | libcss-54c6f7d1ff97104322d14684644cbdeb04e85b57.tar.gz libcss-54c6f7d1ff97104322d14684644cbdeb04e85b57.tar.bz2 |
Force use of 64bit arithmetic when multiplying/dividing.
svn path=/trunk/libcss/; revision=8318
Diffstat (limited to 'include/libcss/fpmath.h')
-rw-r--r-- | include/libcss/fpmath.h | 4 |
1 files changed, 2 insertions, 2 deletions
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)) |