On Mon, 16 Aug 2010 19:15:02 -0300 Lucas De Marchi
<lucas.demar...@profusion.mobi> said:

> On Mon, Aug 16, 2010 at 9:48 AM, Carsten Haitzler <ras...@rasterman.com>
> wrote:
> >> Raster, k-s, others, what do you think? Can I apply for the other ones?
> > checking - this is a patch to go
> >  if (x == NULL) -> if (!x)
> > right? (and the inverse).
> >  if (x != NULL)  -> if (x)
> >
> > right?
> 
> right.

okie.

> What about these others?
> 
> char *a;
> ...
> 1) for ( ; a == NULL; )              => for ( ; !a; )
> 2) for ( ; a != NULL; )              => for ( ; a; )
> 3) for ( ; (a = func()) == NULL; )   => for ( ; !(a = func()); )
> 4) for ( ; (a = func()) != NULL; )   => for ( ; (a = func()); )

above look good.

> char *a;
> int i;
> 
> 6) i = a == NULL;                    => i = !a;
> 7) i = a != NULL;                    => i = !!a;

yes. above look good.

> Those four are valid also for while loops.
> 
>    Eina_Bool func(char *a)
>    {
> 8)    return a == NULL;            => return !a;
> 9)    return a != NULL;            => return !!a;
>    }

good.

> int func2(Eina_Bool b) { return 0; }
> 
> ...
> char *a;
> 
> 10) func2(a == NULL);                   => func2(!a);
> 11) func2(a != NULL);                   => func2(!!a);

good too. all good.

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


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to