]> err.no Git - varnish/commitdiff
Many of our assertions have side effects, so the condition needs to be
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 14:58:51 +0000 (14:58 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 14:58:51 +0000 (14:58 +0000)
evaluated even if we don't bother to check the result.  We should trust
the compiler to eliminate code that has no effect.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2272 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/include/libvarnish.h

index 201b5e3e55792fd7e045db219d2b0278ae793bfe..46a95809dbfd9e9d850a23690a22bfbf6ae31f97 100644 (file)
@@ -669,7 +669,7 @@ Tlen(const txt t)
 }
 
 #ifdef WITHOUT_ASSERTS
-#define spassert(cond) ((void)0)
+#define spassert(cond) ((void)(cond))
 #else
 void panic(const char *, int, const char *,
     const struct sess *, const char *, ...);
index 70c30cc0613397011b5d0de61d0525f367a4030c..a01ca8808cb0dfd45fd3fbf5b2cb2025acff89f2 100644 (file)
@@ -63,7 +63,7 @@ int vtmpfile(char *);
  */
 
 #ifdef WITHOUT_ASSERTS
-#define assert(e)      ((void)0)
+#define assert(e)      ((void)(e))
 #else /* WITH_ASSERTS */
 #define assert(e)                                                      \
 do {                                                                   \