I see. And compilers won't flip out and do funny code from the necessary casts to offset a pointer like that?
foo = ((struct object *) ((char *) ptr - 1))->foo;
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-29 21:11: Subject: zero_type();
It's better to use *zero* in the least significant bit mean that it's an integer.
Then you can do simple add and substract on integers with no extra fuzz. And for pointers, using a small constant offset when dereferencing is free in most cases on most architectures.
/ Niels Möller (igelkottsräddare)