From: wessels <> Date: Sat, 3 Jan 1998 06:41:02 +0000 (+0000) Subject: make some cbdata function args const X-Git-Tag: SQUID_3_0_PRE1~4270 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2480550a92165f2aa029f0f47760b52e529c13e9;p=thirdparty%2Fsquid.git make some cbdata function args const --- diff --git a/src/cbdata.cc b/src/cbdata.cc index 7ddf5bc784..b31ebaf7b5 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -1,7 +1,7 @@ /* - * $Id: cbdata.cc,v 1.11 1997/12/02 00:17:31 wessels Exp $ + * $Id: cbdata.cc,v 1.12 1998/01/02 23:41:02 wessels Exp $ * * DEBUG: section 45 Callback Data Registry * AUTHOR: Duane Wessels @@ -68,7 +68,7 @@ static hash_table *htable = NULL; static int cbdataCount = 0; typedef struct _cbdata { - void *key; + const void *key; struct _cbdata *next; int valid; int locks; @@ -103,9 +103,9 @@ cbdataInit(void) void #if CBDATA_DEBUG -cbdataAddDbg(void *p, const char *file, int line) +cbdataAddDbg(const void *p, const char *file, int line) #else -cbdataAdd(void *p) +cbdataAdd(const void *p) #endif { cbdata *c; @@ -145,7 +145,7 @@ cbdataFree(void *p) } void -cbdataLock(void *p) +cbdataLock(const void *p) { cbdata *c; if (p == NULL) @@ -157,7 +157,7 @@ cbdataLock(void *p) } void -cbdataUnlock(void *p) +cbdataUnlock(const void *p) { cbdata *c; if (p == NULL) @@ -173,11 +173,11 @@ cbdataUnlock(void *p) cbdataCount--; xfree(c); debug(45, 3) ("cbdataUnlock: Freeing %p\n", p); - xfree(p); + xfree((void *)p); } int -cbdataValid(void *p) +cbdataValid(const void *p) { cbdata *c; if (p == NULL) diff --git a/src/protos.h b/src/protos.h index 265f43aefe..80d363d37b 100644 --- a/src/protos.h +++ b/src/protos.h @@ -55,14 +55,14 @@ extern void configFreeMemory(void); extern void cbdataInit(void); #if CBDATA_DEBUG -extern void cbdataAddDbg(void *p, const char *, int); +extern void cbdataAddDbg(const void *p, const char *, int); #else -extern void cbdataAdd(void *p); +extern void cbdataAdd(const void *p); #endif extern void cbdataFree(void *p); -extern void cbdataLock(void *p); -extern void cbdataUnlock(void *p); -extern int cbdataValid(void *p); +extern void cbdataLock(const void *p); +extern void cbdataUnlock(const void *p); +extern int cbdataValid(const void *p); extern void cbdataDump(StoreEntry *); extern void clientdbInit(void);