Warning when compiling abs functions for unsigned integer fixed
authorlbessard
Fri, 05 Jun 2009 16:11:25 +0200
changeset 187 f2cd0b5236f7
parent 186 f0a41f731cea
child 188 b4d81d21b8d3
Warning when compiling abs functions for unsigned integer fixed
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    */