Commit 919696b0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

More include file cleanup

parent ceaf73d7
...@@ -114,15 +114,6 @@ struct worker; ...@@ -114,15 +114,6 @@ struct worker;
#define DIGEST_LEN 32 #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 { typedef struct {
...@@ -138,6 +129,9 @@ enum step { ...@@ -138,6 +129,9 @@ enum step {
#undef STEP #undef STEP
}; };
/*--------------------------------------------------------------------*/
struct lock { void *priv; }; // Opaque
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
* Workspace structure for quick memory allocation. * Workspace structure for quick memory allocation.
*/ */
......
...@@ -55,13 +55,9 @@ extern char *PAN_panicstr; ...@@ -55,13 +55,9 @@ extern char *PAN_panicstr;
extern unsigned PAN_panicstr_len; extern unsigned PAN_panicstr_len;
/* varnishd.c */ /* varnishd.c */
struct vsb; extern struct vsb *vident; // XXX: -> heritage ?
extern struct vsb *vident;
int Symbol_Lookup(struct vsb *vsb, void *ptr); int Symbol_Lookup(struct vsb *vsb, void *ptr);
#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr))
/* Help shut up FlexeLint */ /* Help shut up FlexeLint */
#define __match_proto__(xxx) /*lint -e{818} */ #define __match_proto__(xxx) /*lint -e{818} */
...@@ -97,9 +93,6 @@ void VSM__Clean(void); ...@@ -97,9 +93,6 @@ void VSM__Clean(void);
#define VSM_CLASS_MARK "MgrCld" #define VSM_CLASS_MARK "MgrCld"
#define VSM_COOL_TIME 5 #define VSM_COOL_TIME 5
/* cache_lck.c */
struct lock { void *priv; }; // Opaque
/*--------------------------------------------------------------------- /*---------------------------------------------------------------------
* Generic power-2 rounding macros * Generic power-2 rounding macros
*/ */
...@@ -107,3 +100,17 @@ struct lock { void *priv; }; // Opaque ...@@ -107,3 +100,17 @@ struct lock { void *priv; }; // Opaque
#define PWR2(x) ((((x)-1)&(x))==0) /* Is a power of two */ #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 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 */ #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))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment