On 23 Feb 2009, at 1:55 AM, Adam R. Maxwell wrote:

> A couple of points based on the commit feed, since I needed a  
> diversion from report writing:
>
> - NULL for callbacks is perfectly fine if you want pointer equality  
> and no retain/release; the debug description will just be generic

I know, but it's also a matter of documenting what kind of content is  
expected.

>
> - CFRetain/CFRelease callbacks work fine for NSObjects
> - using malloc for integer callbacks is unnecessary (not to mention  
> wasteful)
>
> The DictionaryExample.c in /Developer/Examples/CoreFoundation shows  
> how to use a CFDictionary for integers.  If you want to make it 64  
> bit clean, use long/uintptr_t/intptr_t instead of int.  For integer  
> arrays or sets, STL is probably a better choice...
>

The CFDictionary code is very old, and in view of the 64 bit docs  
wrong, so that's not a relevant reference, IMHO. Using things like  
intptr etc generally I consider hackish, you always have to be very  
careful with sizes. This method is always valid, and is really the way  
CF collections are designed.

> Oh, and Omni's SHA1 signature didn't work with +[NSData  
> dataWithContentsOfMappedFile:], so make really sure that works...I  
> tried it back when we first added that SHA1 check but there was some  
> problem with the way Omni was using -bytes and it crashed.  I use  
> mmap() directly and it works great [1].

I'm not using Omni's version of sha1. I was using something more like  
the file version. In fact, I've just changed it by using generic  
versions of open, read, and close functions (as for  
openReadOnlyStandardIOFile) for either file descriptors or data. Which  
means that for files it will be equivalent to what it did before.

> FWIW...now back to work :(.
>

Good luck!

> [1] 
> http://tcobrowser.svn.sourceforge.net/viewvc/tcobrowser/trunk/bibdesk/NSData_BDSKExtensions.m?revision=1036&view=markup

Christiaan


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to