aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaëtan Harter <gaetan.harter@fu-berlin.de>2017-09-28 17:03:01 +0200
committerGaëtan Harter <gaetan.harter@fu-berlin.de>2017-09-28 17:06:54 +0200
commitf8596fbadae5465d1fcabef0a3a0bfb1570a7cb0 (patch)
treece54e4141c77d51e25556f65d29257bf4e3620e0
parent6928e2f76d9a4eb978191cc254a0dcadef124092 (diff)
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
-rw-r--r--libfixmath/fix16.h2
1 files changed, 1 insertions, 1 deletions
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) \
) \
)