[master] e40edce now that txt is const, fm can be, too

Nils Goroll nils.goroll at uplex.de
Sun Sep 28 20:04:35 CEST 2014


commit e40edceffff77d0578237a85cf5109cd0d069599
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun Sep 28 20:04:31 2014 +0200

    now that txt is const, fm can be, too

diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index d38519e..05de39f 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -786,8 +786,6 @@ HTTP_Encode(const struct http *fm, uint8_t *p0, unsigned l, unsigned how)
 
 /*--------------------------------------------------------------------
  * Decode byte string into http struct
- *
- * XXX: cannot make fm const because to->hd isn't.
  */
 
 int
@@ -808,9 +806,9 @@ HTTP_Decode(struct http *to, const uint8_t *fm)
 		}
 		if (*fm == '\0')
 			return (0);
-		to->hd[to->nhd].b = (void*)fm;
-		fm = (void*)strchr((void*)fm, '\0');
-		to->hd[to->nhd].e = (void*)fm;
+		to->hd[to->nhd].b = fm;
+		fm = strchr(fm, '\0');
+		to->hd[to->nhd].e = fm;
 		fm++;
 		if (to->vsl != NULL)
 			http_VSLH(to, to->nhd);



More information about the varnish-commit mailing list