]> err.no Git - varnish/commitdiff
Add a VALID_OBJ() predicate macro.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 15 Nov 2007 15:07:15 +0000 (15:07 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 15 Nov 2007 15:07:15 +0000 (15:07 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2253 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/miniobj.h

index a620f8f95d74b214a319e8f2bda2790951c178a9..2565f10225257795ac983d1e2a360ddf7607e23f 100644 (file)
@@ -12,6 +12,9 @@
                free(to);                                               \
        } while (0)
 
+#define VALID_OBJ(ptr, type_magic)                                     \
+       ((ptr) != NULL && (ptr)->magic == (type_magic))
+
 #define CHECK_OBJ(ptr, type_magic)                                     \
        do {                                                            \
                assert((ptr)->magic == type_magic);                     \