r2272 - in trunk/varnish-cache: bin/varnishd include

des at projects.linpro.no des at projects.linpro.no
Tue Nov 20 15:58:51 CET 2007


Author: des
Date: 2007-11-20 15:58:51 +0100 (Tue, 20 Nov 2007)
New Revision: 2272

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/include/libvarnish.h
Log:
Many of our assertions have side effects, so the condition needs to be
evaluated even if we don't bother to check the result.  We should trust
the compiler to eliminate code that has no effect.


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2007-11-20 14:56:21 UTC (rev 2271)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2007-11-20 14:58:51 UTC (rev 2272)
@@ -669,7 +669,7 @@
 }
 
 #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 *, ...);

Modified: trunk/varnish-cache/include/libvarnish.h
===================================================================
--- trunk/varnish-cache/include/libvarnish.h	2007-11-20 14:56:21 UTC (rev 2271)
+++ trunk/varnish-cache/include/libvarnish.h	2007-11-20 14:58:51 UTC (rev 2272)
@@ -63,7 +63,7 @@
  */
 
 #ifdef WITHOUT_ASSERTS
-#define assert(e)	((void)0)
+#define assert(e)	((void)(e))
 #else /* WITH_ASSERTS */
 #define assert(e)							\
 do { 									\




More information about the varnish-commit mailing list