On Mar 11, 09 08:13:54 -0700, Yang Zhao wrote:
2009/3/11 Matthias Hopf
: -#define OFFSET_X(x) (x) +#define OFFSET_X(x) (((x) >= 0) ? ((x) & 0x0f) : (((-(x)-1) & 0x0f) ^ 0x1f))
Shouldn't
#define OFFSET_X(x) ((x) & 0x1f) /* 5 bit signed two's complement -16..15 */
be enough?...
Hm, you're right. I wrote this pretty early in the morning, and apparently didn't think it through enough.
Not exactly. Your version is the only one 100% correct, and I'm *really*
unsure whether we should go for the 100% correct or the more readable
version here :-]
Anyway, committing the updated version now, if you think we should go
for the 100% correct way, we can change later ;)
CU
Matthias
--
Matthias Hopf