diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-08-21 13:52:25 +0000 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-08-21 13:52:25 +0000 |
commit | 3f375e63e26172b3c81f019055c4dfe606f99e63 (patch) | |
tree | 4173ad82b98203336ae4c82db2a183b3bdd2f0aa /utils | |
parent | c81f5795de828ab88232f5a7481437f17b9e6831 (diff) | |
download | eterm-3f375e63e26172b3c81f019055c4dfe606f99e63.tar.gz |
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
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Esetroot.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |