signed. pdiff() makes sure we never get a negative value.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2016
d4fa192b-c00b-0410-8231-
f00ffab90ce4
__func__, __FILE__, __LINE__); \
} while (0);
#endif
+
+/*
+ * A normal pointer difference is signed, but we never want a negative value
+ * so this little tool will make sure we don't get that.
+ */
+
+static inline unsigned
+pdiff(const void *b, const void *e)
+{
+
+ assert(b <= e);
+ return
+ ((unsigned)((const unsigned char *)e - (const unsigned char *)b));
+}