On Fri, Apr 24, 2009 at 5:49 PM, Viktor Kojouharov
<vkojouha...@gmail.com> wrote:
> On Fri, 2009-04-24 at 17:01 -0300, Gustavo Sverzut Barbieri wrote:
>> On Fri, Apr 24, 2009 at 3:53 PM, Enlightenment SVN
>> <no-re...@enlightenment.org> wrote:
>> > +EAPI void
>> > +ethumb_file_get(Ethumb *e, const char **path, const char **key)
>> > +{
>> > +   EINA_SAFETY_ON_NULL_RETURN_VAL(e, NULL);
>>
>> ooops! returns NULL on void?
>>
>> BTW, on such functions that are getters and values are returned on
>> parameters it's better to NULL/zero pointers before returning, at
>> least most efl apis do that.
>>
>
> How would I do that with the EINA_SAFETY_ macro?
>
> Looking at evas, its macro opens a block in which you can null the
> values. Not sure how to do that with the eina macro

not possible with EINA_SAFETY_ macros now... probably need to do one
that checks and reports, either with _BEGIN, _END like evas, which I
dislike, or giving the macro a block, not that better. Summary:

EINA_SAFETY_ON_NULL_BEGIN(e)
   if (path) *path = NULL;
   if (key) *key = NULL;
EINA_SAFETY_ON_NULL_END

or:

EINA_SAFETY_ON_NULL_DO(e, {
   if (path) *path = NULL;
   if (key) *key = NULL;
})


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to