blob: 2b645c946c37d3b7879aa398820462d3334e4c02 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
 | #ifndef __GENERAL_H__
#define __GENERAL_H__
#define MAX(__a,__b) ((__a)<(__b)?(__b):(__a))
#define MIN(__a,__b) ((__a)>(__b)?(__b):(__a))
#define BITCOUNT(x)     (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
#define  BX_(x)         ((x) - (((x)>>1)&0x77777777)                    \
                             - (((x)>>2)&0x33333333)                    \
                             - (((x)>>3)&0x11111111))
#endif
 |