On Mon, 29 Dec 2008 16:52:43 +0100 "Cedric BAIL" <cedric.b...@free.fr> babbled:

> On Mon, Dec 29, 2008 at 2:53 PM, Gustavo Sverzut Barbieri
> <barbi...@profusion.mobi> wrote:
> > On Mon, Dec 29, 2008 at 11:38 AM, Cedric BAIL <cedric.b...@free.fr> wrote:
> >> On Mon, Dec 29, 2008 at 2:02 PM, Gustavo Sverzut Barbieri
> >> <barbi...@profusion.mobi> wrote:
> >>> On Mon, Dec 29, 2008 at 10:41 AM, Enlightenment SVN
> >>> <no-re...@enlightenment.org> wrote:
> >>>> Log:
> >>>>  Don't generate warning in some little case.
> >>>
> >>> I strongly disagree with this patch. Eina Hash is not like Evas Hash,
> >>> by hiding this "warnings in some little case" we're hiding bugs. It's
> >>> better to fix those bugs and not hide these warnings.
> >>
> >>> We add these safety checks to avoid our libraries crashing badly on
> >>> users, not because API should really support these NULL pointers,
> >>> they're invalid values. It's like strlen(NULL), it does not make
> >>> sense.
> >>
> >> That's the typical case I want to avoid adding extra if around place
> >> where returning 0 would have make sense. I didn't remove all check
> >> only on find and population, typically used by cache system.
> >
> > it's not a useless if, it's a error handling if, you must do it.
> >
> > and this error checking should be done after eina_hash_new() and like,
> > not before these other calls, unless you can work without the hash, in
> > tha case you must do this special case anyway.
> >
> > if people start to use few eina_hash_new() as it is supposed to be
> > instead of delete it when it's empty and create it before each add,
> > then this will be one if at the constructor and that's all.
> 
> It's not always possible to do so. For example eet doesn't initialize
> part of a structure if it doesn't find any element for it and I don't
> see an easy way to fix that.

well.. it does initialise it to NULL... or 0... guaranteed. :)


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to