Convert (hopefully) all comparisons to NULL
authorlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 21 Aug 2010 13:52:25 +0000 (13:52 +0000)
committerlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 21 Aug 2010 13:52:25 +0000 (13:52 +0000)
commitd2b110d8b155ee1325ef0f4714889e2dd0d9627c
treee8a4a1ee8b895e8c3c7e02e83c648cb756285681
parent0a36f5bdd603626c3484febe4d38f0b2b7648726
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

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@51487 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
25 files changed:
src/include/eina_safety_checks.h
src/lib/eina_file.c
src/lib/eina_hash.c
src/lib/eina_inlist.c
src/lib/eina_list.c
src/lib/eina_log.c
src/lib/eina_matrixsparse.c
src/lib/eina_rbtree.c
src/lib/eina_share_common.c
src/lib/eina_tiler.c
src/tests/ecore_list.c
src/tests/eina_bench.c
src/tests/eina_suite.c
src/tests/eina_test_binshare.c
src/tests/eina_test_hash.c
src/tests/eina_test_list.c
src/tests/eina_test_matrixsparse.c
src/tests/eina_test_mempool.c
src/tests/eina_test_rbtree.c
src/tests/eina_test_str.c
src/tests/eina_test_strbuf.c
src/tests/eina_test_stringshare.c
src/tests/eina_test_ustr.c
src/tests/eina_test_ustringshare.c
src/tests/evas_list.c