On Mon, Aug 16, 2010 at 9:48 AM, Carsten Haitzler <[email protected]> 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.
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()); )
char *a;
int i;
6) i = a == NULL; => i = !a;
7) i = a != NULL; => i = !!a;
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;
}
int func2(Eina_Bool b) { return 0; }
...
char *a;
10) func2(a == NULL); => func2(!a);
11) func2(a != NULL); => func2(!!a);
Lucas De Marchi
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel