summaryrefslogtreecommitdiff
path: root/legacy/eina/src/include/eina_safety_checks.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
commit5a8a8c90140aa18bde2c1696eb7d2da1c978e15e (patch)
treeb9d11055f743cd53a3895501ed9a6203062bbe60 /legacy/eina/src/include/eina_safety_checks.h
parent8b3511109441c22a2664665efe00892dc44fcf6c (diff)
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 '')
-rw-r--r--legacy/eina/src/include/eina_safety_checks.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/legacy/eina/src/include/eina_safety_checks.h b/legacy/eina/src/include/eina_safety_checks.h
index 79ebc54fd3..29ebba07d3 100644
--- a/legacy/eina/src/include/eina_safety_checks.h
+++ b/legacy/eina/src/include/eina_safety_checks.h
@@ -196,10 +196,10 @@ EAPI extern Eina_Error EINA_ERROR_SAFETY_FAILED;
196#else /* no safety checks */ 196#else /* no safety checks */
197 197
198#define EINA_SAFETY_ON_NULL_RETURN(exp) \ 198#define EINA_SAFETY_ON_NULL_RETURN(exp) \
199 do { (void)((exp) == NULL); } while (0) 199 do { (void)(!(exp)); } while (0)
200 200
201#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \ 201#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
202 do { if (0 && (exp) == NULL) { (void)val; } } while (0) 202 do { if (0 && !(exp)) { (void)val; } } while (0)
203 203
204#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \ 204#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
205 do { if (0 && (exp) == NULL) { goto label; } } while (0) 205 do { if (0 && (exp) == NULL) { goto label; } } while (0)