From f8596fbadae5465d1fcabef0a3a0bfb1570a7cb0 Mon Sep 17 00:00:00 2001 From: Gaƫtan Harter Date: Thu, 28 Sep 2017 17:03:01 +0200 Subject: Fix '-Werror=shift-negative-value' for gcc 6 GCC 6 introduced warning for shift on negative value numbers. When F16C is called with a negative number it evaluates FIXMATH_COMBINE_I_M with both the positive and the negative value. Fixes #3 --- libfixmath/fix16.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfixmath/fix16.h b/libfixmath/fix16.h index 35e101d..8c5e9da 100644 --- a/libfixmath/fix16.h +++ b/libfixmath/fix16.h @@ -307,7 +307,7 @@ extern fix16_t fix16_from_str(const char *buf); ( \ (( #i[0] ) == '-') \ ? -FIXMATH_COMBINE_I_M((unsigned)( ( (i) * -1) ), m) \ - : FIXMATH_COMBINE_I_M(i, m) \ + : FIXMATH_COMBINE_I_M((unsigned)i, m) \ ) \ ) -- cgit v1.2.3