summaryrefslogtreecommitdiff
path: root/src/options.h
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-08-21 13:52:25 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2010-08-21 13:52:25 +0000
commit3f375e63e26172b3c81f019055c4dfe606f99e63 (patch)
tree4173ad82b98203336ae4c82db2a183b3bdd2f0aa /src/options.h
parentc81f5795de828ab88232f5a7481437f17b9e6831 (diff)
downloadeterm-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 'src/options.h')
-rw-r--r--src/options.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/options.h b/src/options.h
index 00c3fdf..2acb680 100644
--- a/src/options.h
+++ b/src/options.h
@@ -83,7 +83,7 @@
} while (0)
#define CHECK_VALID_INDEX(i) (((i) >= image_bg) && ((i) < image_max))
-#define RESET_AND_ASSIGN(var, val) do {if ((var) != NULL) FREE(var); (var) = (val);} while (0)
+#define RESET_AND_ASSIGN(var, val) do {if ((var)) FREE(var); (var) = (val);} while (0)
#define BITFIELD_SET(var, field) ((var) |= (field))
#define BITFIELD_CLEAR(var, field) ((var) &= ~(field))