From: hno <> Date: Fri, 29 Jun 2001 20:48:06 +0000 (+0000) Subject: Hack to allow safe_free to be called on const pointers. X-Git-Tag: SQUID_3_0_PRE1~1477 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7106f62f7ab6f1d48459f45fe925e4b326f798a;p=thirdparty%2Fsquid.git Hack to allow safe_free to be called on const pointers. --- diff --git a/include/util.h b/include/util.h index c76386a4d2..65fd301308 100644 --- a/include/util.h +++ b/include/util.h @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.59 2001/02/07 18:56:50 hno Exp $ + * $Id: util.h,v 1.60 2001/06/29 14:48:07 hno Exp $ * * AUTHOR: Harvest Derived * @@ -80,7 +80,7 @@ extern void *xmalloc(size_t); extern void *xrealloc(void *, size_t); extern void Tolower(char *); extern void xfree(void *); -extern void xxfree(void *); +extern void xxfree(const void *); /* rfc1738.c */ extern char *rfc1738_escape(const char *); diff --git a/lib/util.c b/lib/util.c index 7f2633c3b3..abc6b6fd13 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.78 2001/04/10 17:00:50 hno Exp $ + * $Id: util.c,v 1.79 2001/06/29 14:48:06 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -487,8 +487,9 @@ xfree(void *s) /* xxfree() - like xfree(), but we already know s != NULL */ void -xxfree(void *s) +xxfree(const void *s_const) { + void *s = (void *)s_const; #if XMALLOC_TRACE xmalloc_show_trace(s, -1); #endif diff --git a/src/structs.h b/src/structs.h index 775436f0e0..675cd6d559 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.391 2001/06/29 14:37:51 hno Exp $ + * $Id: structs.h,v 1.392 2001/06/29 14:48:06 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1455,7 +1455,7 @@ struct _MemObject { #if URL_CHECKSUM_DEBUG unsigned int chksum; #endif - char *vary_headers; + const char *vary_headers; }; struct _StoreEntry { @@ -1608,7 +1608,7 @@ struct _request_t { err_type err_type; char *peer_login; /* Configured peer login:password */ time_t lastmod; /* Used on refreshes */ - char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */ + const char *vary_headers; /* Used when varying entities are detected. Changes how the store key is calculated */ }; struct _cachemgr_passwd {