From 37e328c73949dfaca559abbbd3f3ecf4aff1790c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 28 Jul 2018 14:51:48 +0100 Subject: Fixed point: Squash undefined left shift of -ve value error. include/libcss/fpmath.h:60:27: runtime error: left shift of negative value -2611200 --- include/libcss/fpmath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3