Convert (hopefully) all comparisons to NULL
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 21 Aug 2010 13:52:25 +0000 (13:52 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 21 Aug 2010 13:52:25 +0000 (13:52 +0000)
commit76f9452985b3b5a553bdb0d9e0fa9c439ecd16c5
tree5e55efcefd0d66eba239e80fd387f355d61f256b
parentd41cfd5ca7fd82801634444fcd2d5740bb3e567b
Convert (hopefully) all comparisons to NULL

Apply badzero.cocci, badnull.coci and badnull2.cocci

This should convert all cases where there's a comparison to NULL to simpler
forms. This patch applies the following transformations:

code before patch               ||code after patch
===============================================================

return a == NULL;                 return !a;

return a != NULL;                 return !!a;

func(a == NULL);                  func(!a);

func(a != NULL);                  func(!!a);

b = a == NULL;                    b = !a;

b = a != NULL;                    b = !!a;

b = a == NULL ? c : d;            b = !a ? c : d;

b = a != NULL ? c : d;            b = a ? c : d;

other cases:

a == NULL                         !a
a != NULL                         a

SVN revision: 51487
src/bin/test_panel.c
src/lib/elc_fileselector.c
src/lib/elm_label.c
src/lib/elm_list.c
src/lib/elm_main.c
src/lib/elm_win.c