On Fri, Jun 01, 2007 at 07:53:35PM -0500, Andy Lester wrote: > From include/parrot/parrot.h: > > /* weird architectures might need this, s. C-FAQ 5.17 > * > * the SET_NULL macros are only for system, where a NULL pointer > * isn't represented by zeroes, so don't use these, for resetting > * non-null pointers > */ > > #ifdef HAS_NON_ZERO_NULL > # define SET_NULL(x) x = NULL > # define SET_NULL_P(x, s) x = (s)NULL > #else > # define SET_NULL(x) > # define SET_NULL_P(x, s) > #endif /* HAS_NON_ZERO_NULL */ > > > This seems very wrong. SET_NULL() isn't actually setting any values > if not HAS_NON_ZERO_NULL. Is there some reason it's not actually > > # define SET_NULL(x) x = 0 > # define SET_NULL_P(x, s) x = (s)NULL > > And for that matter, what's wrong with just using x = NULL > everywhere? Why do we need a macro to do this? >
I can't see any need for such a macro other than for the minor obfuscation that it allows. For most of the Parrot code, I haven't SET_NULL() used, and I haven't used it myself. I'm a bit curious how much it is actually used. Steve Peters [EMAIL PROTECTED]