# HG changeset patch # User lbessard # Date 1244211085 -7200 # Node ID f2cd0b5236f7b9598c661f24d04f45186a7366eb # Parent f0a41f731cea6cb85eeec873fa7225514fe71359 Warning when compiling abs functions for unsigned integer fixed diff -r f0a41f731cea -r f2cd0b5236f7 lib/iec_std_lib.h --- a/lib/iec_std_lib.h Fri Jun 05 14:06:53 2009 +0200 +++ b/lib/iec_std_lib.h Fri Jun 05 16:11:25 2009 +0200 @@ -969,14 +969,22 @@ /**************/ /* ABS */ /**************/ -#define __abs_(TYPENAME) \ +#define __abs_signed(TYPENAME) \ static inline TYPENAME __abs_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ TEST_EN(TYPENAME)\ if (op < 0)\ return -op;\ return op;\ } -ANY_NUM(__abs_) +ANY_REAL(__abs_signed) +ANY_SINT(__abs_signed) + +#define __abs_unsigned(TYPENAME) \ +static inline TYPENAME __abs_##TYPENAME(EN_ENO_PARAMS, TYPENAME op){\ + TEST_EN(TYPENAME)\ + return op;\ +} +ANY_UINT(__abs_unsigned) /**************/ /* SQRT */