equal
deleted
inserted
replaced
55 /* OPT: optimized into an unsigned comparison */ |
55 /* OPT: optimized into an unsigned comparison */ |
56 //#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size)) |
56 //#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size)) |
57 #define IS_INSIDE_1D(x, base, size) ( (uint)((x) - (base)) < ((uint)(size)) ) |
57 #define IS_INSIDE_1D(x, base, size) ( (uint)((x) - (base)) < ((uint)(size)) ) |
58 |
58 |
59 |
59 |
60 #define HASBIT(x,y) ((x) & (1 << (y))) |
60 #define HASBIT(x,y) (((x) & (1 << (y))) != 0) |
61 #define SETBIT(x,y) ((x) |= (1 << (y))) |
61 #define SETBIT(x,y) ((x) |= (1 << (y))) |
62 #define CLRBIT(x,y) ((x) &= ~(1 << (y))) |
62 #define CLRBIT(x,y) ((x) &= ~(1 << (y))) |
63 #define TOGGLEBIT(x,y) ((x) ^= (1 << (y))) |
63 #define TOGGLEBIT(x,y) ((x) ^= (1 << (y))) |
64 |
64 |
65 // checking more bits. Maybe unneccessary, but easy to use |
65 // checking more bits. Maybe unneccessary, but easy to use |