diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-27 11:35:18 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-03-27 11:35:18 -0700 |
commit | d97e5d680391ee4346d86451594df746167698aa (patch) | |
tree | 709726f9699492167ffe0de5328dfa79fb2ba5ca | |
parent | 2fe534b06cd4baa61aad8bb3efc8f2b0daaf1ed3 (diff) | |
download | abc-d97e5d680391ee4346d86451594df746167698aa.tar.gz abc-d97e5d680391ee4346d86451594df746167698aa.tar.bz2 abc-d97e5d680391ee4346d86451594df746167698aa.zip |
Added Max/Min/Abs as static inline functions.
-rw-r--r-- | src/misc/util/abc_global.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index 1321f028..3e9241df 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -236,6 +236,17 @@ ABC_NAMESPACE_HEADER_START ((type *) Util_MemRecAlloc(malloc(sizeof(type) * (num))))) #endif +static inline int Abc_AbsInt( int a ) { return a < 0 ? -a : a; } +static inline int Abc_MaxInt( int a, int b ) { return a > b ? a : b; } +static inline int Abc_MinInt( int a, int b ) { return a < b ? a : b; } +static inline word Abc_MaxWord( word a, word b ) { return a > b ? a : b; } +static inline word Abc_MinWord( word a, word b ) { return a < b ? a : b; } +static inline float Abc_AbsFloat( float a ) { return a < 0 ? -a : a; } +static inline float Abc_MaxFloat( float a, float b ) { return a > b ? a : b; } +static inline float Abc_MinFloat( float a, float b ) { return a < b ? a : b; } +static inline double Abc_AbsDouble( double a ) { return a < 0 ? -a : a; } +static inline double Abc_MaxDouble( double a, double b ) { return a > b ? a : b; } +static inline double Abc_MinDouble( double a, double b ) { return a < b ? a : b; } enum Abc_VerbLevel { |