From 3f375e63e26172b3c81f019055c4dfe606f99e63 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sat, 21 Aug 2010 13:52:25 +0000 Subject: 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 --- utils/Esetroot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/Esetroot.c b/utils/Esetroot.c index dbe6b37..137987e 100644 --- a/utils/Esetroot.c +++ b/utils/Esetroot.c @@ -181,7 +181,7 @@ main(int argc, char *argv[]) imlib_context_set_display(Xdisplay); imlib_context_set_visual(DefaultVisual(Xdisplay, DefaultScreen(Xdisplay))); im = imlib_load_image_immediately(fname); - if (im == NULL) { + if (!im) { fprintf(stderr, "%s: Unable to load image file \"%s\".\n", *argv, fname); exit(1); } else if (debug) { -- cgit v1.2.1