From 1c2b95f759ac4d0261369f6d36c55e0a1294c8da Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Mon, 20 Mar 2006 22:43:25 +0000 Subject: [PATCH] Fixed abs(), min(), max(), constrain() macros (were incorrectly parenthesized). --- targets/arduino/wiring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/targets/arduino/wiring.h b/targets/arduino/wiring.h index c4ba02382..6cbfd132e 100755 --- a/targets/arduino/wiring.h +++ b/targets/arduino/wiring.h @@ -45,10 +45,10 @@ extern "C"{ #define SERIAL 0x0 #define DISPLAY 0x1 -#define min(a,b) ((ab)?(a):(b)) -#define abs(x) ((x>0)?(x):(-x)) -#define constrain(amt,low,high) ((amthigh)?(high):(amt))) +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) +#define abs(x) ((x)>0?(x):-(x)) +#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) #define radians(deg) ((deg)*DEG_TO_RAD) #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x))