summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2018-07-28 14:51:48 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2018-07-28 14:51:48 +0100
commit37e328c73949dfaca559abbbd3f3ecf4aff1790c (patch)
treed7a3bf44f7433467525b66eca945362bfc087d8b
parent1d52e081bc36edef3f8503fae18db0291b186c68 (diff)
downloadlibcss-37e328c73949dfaca559abbbd3f3ecf4aff1790c.tar.gz
libcss-37e328c73949dfaca559abbbd3f3ecf4aff1790c.tar.bz2
Fixed point: Squash undefined left shift of -ve value error.
include/libcss/fpmath.h:60:27: runtime error: left shift of negative value -2611200
-rw-r--r--include/libcss/fpmath.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h
index 1e3fa43..2890da2 100644
--- a/include/libcss/fpmath.h
+++ b/include/libcss/fpmath.h
@@ -57,7 +57,7 @@ css_subtract_fixed(const css_fixed x, const css_fixed y) {
static inline css_fixed
css_divide_fixed(const css_fixed x, const css_fixed y) {
- int64_t xx = ((int64_t)x << CSS_RADIX_POINT) / y;
+ int64_t xx = ((int64_t)x * (1 << CSS_RADIX_POINT)) / y;
if (xx < INT_MIN)
xx = INT_MIN;