[experimental-ims] 919696b More include file cleanup
Geoff Simmons
geoff at varnish-cache.org
Mon Jan 9 21:52:39 CET 2012
commit 919696b0d969c7e2400434344c3c0658942160c8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Nov 16 06:30:16 2011 +0000
More include file cleanup
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 129dbf0..bae2572 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -114,15 +114,6 @@ struct worker;
#define DIGEST_LEN 32
-/*--------------------------------------------------------------------
- * Pointer aligment magic
- */
-
-#define PALGN (sizeof(void *) - 1)
-#define PAOK(p) (((uintptr_t)(p) & PALGN) == 0)
-#define PRNDDN(p) ((uintptr_t)(p) & ~PALGN)
-#define PRNDUP(p) (((uintptr_t)(p) + PALGN) & ~PALGN)
-
/*--------------------------------------------------------------------*/
typedef struct {
@@ -138,6 +129,9 @@ enum step {
#undef STEP
};
+/*--------------------------------------------------------------------*/
+struct lock { void *priv; }; // Opaque
+
/*--------------------------------------------------------------------
* Workspace structure for quick memory allocation.
*/
diff --git a/bin/varnishd/common/common.h b/bin/varnishd/common/common.h
index f59cfc9..8e32ec9 100644
--- a/bin/varnishd/common/common.h
+++ b/bin/varnishd/common/common.h
@@ -55,13 +55,9 @@ extern char *PAN_panicstr;
extern unsigned PAN_panicstr_len;
/* varnishd.c */
-struct vsb;
-extern struct vsb *vident;
+extern struct vsb *vident; // XXX: -> heritage ?
int Symbol_Lookup(struct vsb *vsb, void *ptr);
-#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr))
-
-
/* Help shut up FlexeLint */
#define __match_proto__(xxx) /*lint -e{818} */
@@ -97,9 +93,6 @@ void VSM__Clean(void);
#define VSM_CLASS_MARK "MgrCld"
#define VSM_COOL_TIME 5
-/* cache_lck.c */
-struct lock { void *priv; }; // Opaque
-
/*---------------------------------------------------------------------
* Generic power-2 rounding macros
*/
@@ -107,3 +100,17 @@ struct lock { void *priv; }; // Opaque
#define PWR2(x) ((((x)-1)&(x))==0) /* Is a power of two */
#define RDN2(x, y) ((x)&(~((y)-1))) /* if y is powers of two */
#define RUP2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
+
+/*--------------------------------------------------------------------
+ * Pointer aligment magic
+ */
+
+#define PALGN (sizeof(void *) - 1) /* size of alignment */
+#define PAOK(p) (((uintptr_t)(p) & PALGN) == 0) /* is aligned */
+#define PRNDDN(p) ((uintptr_t)(p) & ~PALGN) /* Round down */
+#define PRNDUP(p) (((uintptr_t)(p) + PALGN) & ~PALGN) /* Round up */
+
+/*--------------------------------------------------------------------
+ * To be used as little as possible to wash off const/volatile etc.
+ */
+#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr))
More information about the varnish-commit
mailing list