r3345 - in trunk/varnish-cache/lib: libvarnish libvarnishcompat

des at projects.linpro.no des at projects.linpro.no
Wed Oct 22 13:33:58 CEST 2008


Author: des
Date: 2008-10-22 13:33:58 +0200 (Wed, 22 Oct 2008)
New Revision: 3345

Modified:
   trunk/varnish-cache/lib/libvarnish/tcp.c
   trunk/varnish-cache/lib/libvarnish/vsb.c
   trunk/varnish-cache/lib/libvarnishcompat/strndup.c
Log:
Get rid of <strings.h>.


Modified: trunk/varnish-cache/lib/libvarnish/tcp.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/tcp.c	2008-10-20 20:19:12 UTC (rev 3344)
+++ trunk/varnish-cache/lib/libvarnish/tcp.c	2008-10-22 11:33:58 UTC (rev 3345)
@@ -102,7 +102,7 @@
 	struct accept_filter_arg afa;
 	int i;
 
-	bzero(&afa, sizeof(afa));
+	memset(&afa, 0, sizeof(afa));
 	strcpy(afa.af_name, "httpready");
 	errno = 0;
 	i = setsockopt(sock, SOL_SOCKET, SO_ACCEPTFILTER,

Modified: trunk/varnish-cache/lib/libvarnish/vsb.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/vsb.c	2008-10-20 20:19:12 UTC (rev 3344)
+++ trunk/varnish-cache/lib/libvarnish/vsb.c	2008-10-22 11:33:58 UTC (rev 3345)
@@ -36,7 +36,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <strings.h>
 
 #include "libvarnish.h"
 #include "vsb.h"
@@ -137,7 +136,7 @@
 	newbuf = (char *)SBMALLOC(newsize);
 	if (newbuf == NULL)
 		return (-1);
-	bcopy(s->s_buf, newbuf, s->s_size);
+	memcpy(newbuf, s->s_buf, s->s_size);
 	if (VSB_ISDYNAMIC(s))
 		SBFREE(s->s_buf);
 	else
@@ -165,12 +164,12 @@
 		s = (struct vsb *)SBMALLOC(sizeof *s);
 		if (s == NULL)
 			return (NULL);
-		bzero(s, sizeof *s);
+		memset(s, 0, sizeof *s);
 		s->s_flags = flags;
 		s->s_magic = VSB_MAGIC;
 		VSB_SETFLAG(s, VSB_DYNSTRUCT);
 	} else {
-		bzero(s, sizeof *s);
+		memset(s, 0, sizeof *s);
 		s->s_flags = flags;
 		s->s_magic = VSB_MAGIC;
 	}
@@ -466,7 +465,7 @@
 	if (VSB_ISDYNAMIC(s))
 		SBFREE(s->s_buf);
 	isdyn = VSB_ISDYNSTRUCT(s);
-	bzero(s, sizeof *s);
+	memset(s, 0, sizeof *s);
 	if (isdyn)
 		SBFREE(s);
 }

Modified: trunk/varnish-cache/lib/libvarnishcompat/strndup.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishcompat/strndup.c	2008-10-20 20:19:12 UTC (rev 3344)
+++ trunk/varnish-cache/lib/libvarnishcompat/strndup.c	2008-10-22 11:33:58 UTC (rev 3345)
@@ -36,7 +36,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <strings.h>
 
 #ifndef HAVE_STRLCPY
 #include "compat/strlcpy.h"




More information about the varnish-commit mailing list