From 9f87eef80c4a91f6ef5d9d73adecd3cb687bfd0e Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sat, 21 Aug 2010 13:52:25 +0000 Subject: [PATCH] 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/e_mod_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/e_mod_main.c b/src/e_mod_main.c index f9b3420..c2c359c 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -660,7 +660,7 @@ _forecasts_parse(void *data) inst = data; if (!inst) return 0; - if (inst->buffer == NULL) + if (!inst->buffer) return 0; /* Location */