diff options
author | Michael Meeks <michael.meeks@novell.com> | 2010-10-08 14:26:28 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-08 14:26:28 +0100 |
commit | 2f0803e5869dd2d45c8d4b407017f053e83ed601 (patch) | |
tree | 41c3ca82f3fa20228246e53485e0d6f0ad2835c6 | |
parent | d08754a8446f4d32f8d59d953b02ac856ccb54d5 (diff) |
remove unused macros, and add SAL_N_ELEMENTS
-rw-r--r-- | sal/inc/sal/macros.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sal/inc/sal/macros.h b/sal/inc/sal/macros.h index 800629ab095d..f88b1091856e 100644 --- a/sal/inc/sal/macros.h +++ b/sal/inc/sal/macros.h @@ -29,23 +29,19 @@ #define _SAL_MACROS_H_ #ifndef SAL_MAX -# define SAL_MAX(a,b) (((a) > (b)) ? (a) : (b)) +# define SAL_MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif + #ifndef SAL_MIN -# define SAL_MIN(a,b) (((a) < (b)) ? (a) : (b)) +# define SAL_MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif #ifndef SAL_FIELDOFFSET -# define SAL_FIELDOFFSET(type, field) ((sal_Int32)(&((type *)16)->field) - 16) -#endif - -#ifndef SAL_BOUND -# define SAL_BOUND(x,l,h) ((x) <= (l) ? (l) : ((x) >= (h) ? (h) : (x))) +# define SAL_FIELDOFFSET(type, field) ((sal_Int32)(&((type *)16)->field) - 16) #endif -#ifndef SAL_SWAP -# define SAL_SWAP(a,b) ((a) ^= (b) ^= (a) ^= (b)) +#ifndef SAL_N_ELEMENTS +# define SAL_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0])) #endif - #endif |