From: Andrew G. <ag...@em...> - 2004-08-26 14:48:24
|
On Aug 26, 2004, at 01:50, Richard Clark wrote: > I had to back away earlier due to workload issues. I'm making a new > attempt using the latest shipping xcode, though it's slow going. There > will need to be a couple of casts to hush the compiler (it doesn't > like "return nil" when the return type is ZRef<...>). Here's the comment from zconfigl.h that explains nil's provenance: /* We use the macro 'nil' extensively in ZooLib. It's something of a historical accident, basically the result of an early collaborator Cyrus Ghalambor having previously worked in a pascal-centric environment. NULL might more normally be expected, but its official C definition makes it problematic as a subsitute for a null pointer. And there's a problem with having nil be simply zero, in that it then cannot be distinguished from a zero integer. Herb Sutter's column in C/C++ User's Journal, May 2004 discusses 'nullptr', which will likely end up part of C++ in the next standardization cycle. In the meantime I'm re-defining nil from being zero to something like nullptr. */ I've sucked all of ZooLib into XCode and compiled everything, although I haven't actually built a running app of any sort yet. Doing so threw up a few mistakes, and also a few situations where I had not corrected the use of nil. Some places we were passing nil when a zero integer was expected. In other cases we were returning nil when a default-constructed ZRef<XX> was required. The code that's in cvs should already have all those fixes in place (I just now checked in a handful more). A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. vox: +1 (831) 621 1822 |