On Sun, May 03, 2009 at 11:27:14AM +0100, Jeremy Henty wrote:
I've noticed that a_Url_free() and a_Image_unref() both guard against being passed a NULL argument, yet in several cases the code that calls these functions also checks for a NULL, which is redundant. I think that if the API officially accepts NULL then code that calls the API shouldn't be checking for it. Conversely, if the API does not accept NULL then its implementation shouldn't be checking for it. So I would suggest we remove the redundancy by eliminating the NULL check from either the callers or the API implementation. Thoughts? I'll provide patches if people agree and decide whether or not these APIs should support NULL.
In general the API accepts NULL (e.g. dlib), so please remove the redundant checks outside it. -- Cheers Jorge.-