r213 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Jun 20 21:31:46 CEST 2006


Author: phk
Date: 2006-06-20 21:31:46 +0200 (Tue, 20 Jun 2006)
New Revision: 213

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_main.c
   trunk/varnish-cache/bin/varnishd/cache_pipe.c
   trunk/varnish-cache/bin/varnishd/cache_shmlog.c
   trunk/varnish-cache/bin/varnishd/cli_event.c
   trunk/varnish-cache/bin/varnishd/flint.lnt
   trunk/varnish-cache/bin/varnishd/storage_file.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Polish things to silence FlexeLint a bit


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-06-20 19:31:46 UTC (rev 213)
@@ -60,7 +60,6 @@
 /* Storage -----------------------------------------------------------*/
 
 struct sess;
-typedef void sesscb_f(struct sess *sp);
 
 #define VCA_ADDRBUFSIZE		32
 
@@ -99,8 +98,6 @@
 
 	TAILQ_ENTRY(sess)	list;
 
-	sesscb_f		*sesscb;
-
 	struct backend		*backend;
 	struct object		*obj;
 	struct VCL_conf		*vcl;
@@ -113,12 +110,14 @@
 struct backend {
 	const char	*hostname;
 	const char	*portname;
-	struct addrinfo	*addr;
 	unsigned	ip;
+#if 0
+	struct addrinfo	*addr;
 	double		responsetime;
 	double		timeout;
 	double		bandwidth;
 	int		down;
+#endif
 
 	/* internal stuff */
 	struct vbe	*vbe;
@@ -138,7 +137,6 @@
 /* cache_backend.c */
 void VBE_Init(void);
 int VBE_GetFd(struct backend *bp, void **ptr);
-void VBE_Pass(struct sess *sp);
 void VBE_ClosedFd(void *ptr);
 void VBE_RecycleFd(void *ptr);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -78,7 +78,7 @@
  * be a good thing in that case.
  */
 
-void
+static void
 connect_to_backend(struct vbe_conn *vc, struct backend *bp)
 {
 	struct addrinfo *res, *res0, hint;

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -139,6 +139,7 @@
 			i = bp - q;
 			if (i == 0) {
 			} else if (v > i) {
+				assert(i > 0);
 				memcpy(p, q, i);
 				p += i;
 				st->len += i;

Modified: trunk/varnish-cache/bin/varnishd/cache_main.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_main.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cache_main.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -35,7 +35,7 @@
 timer_keepalive(int a, short b, void *c)
 {
 
-	printf("%s(%d, %d, %p)\n", __func__, a, b, c);
+	printf("%s(%d, %d, %p)\n", __func__, a, (int)b, c);
 	printf("Heeellloooo ?   Ohh bother...\n");
 	exit (1);
 }

Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -44,7 +44,7 @@
 void
 PipeSession(struct worker *w, struct sess *sp)
 {
-	int fd, i, j;
+	int fd, i;
 	void *fd_token;
 	struct edir e1, e2;
 
@@ -55,13 +55,15 @@
 	i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
 	assert(i == sbuf_len(w->sb));
 	assert(__LINE__ == 0);
+#if 0
+	{ int j;
 	j = 0;
-#if 0
 	i = sp->rcv_len - sp->rcv_ptr;
 	if (i > 0) {
 		j = write(sp->fd, sp->rcv + sp->rcv_ptr, i);
 		assert(j == i);
 	}
+	}
 #endif
 
 	e1.fd = fd;

Modified: trunk/varnish-cache/bin/varnishd/cache_shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_shmlog.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cache_shmlog.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -23,7 +23,6 @@
 void
 VSLR(enum shmlogtag tag, unsigned id, const char *b, const char *e)
 {
-	va_list ap;
 	unsigned char *p, *q;
 
 	assert(b != NULL);
@@ -58,8 +57,6 @@
 	loghead->ptr = (p + 4 + (e - b)) - logstart;
 	
 	/* XXX: Unlock */
-
-	va_end(ap);
 }
 
 

Modified: trunk/varnish-cache/bin/varnishd/cli_event.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cli_event.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/cli_event.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -120,7 +120,7 @@
 static void
 excb(struct bufferevent *bev, short what, void *arg)
 {
-	printf("%s(%p, %d, %p)\n", __func__, (void*)bev, what, arg);
+	printf("%s(%p, %d, %p)\n", __func__, (void*)bev, (int)what, arg);
 }
 
 struct cli *

Modified: trunk/varnish-cache/bin/varnishd/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/varnishd/flint.lnt	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/flint.lnt	2006-06-20 19:31:46 UTC (rev 213)
@@ -4,6 +4,7 @@
 
 -printf_code( H, void *, unsigned)
 -printf_code( ju, long long unsigned)
+-printf_code( jx, long long unsigned)
 
 -e763	// Redundant declaration for symbol '...' previously declared
 

Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -48,7 +48,7 @@
 struct smf_sc {
 	char			*filename;
 	int			fd;
-	int			pagesize;
+	unsigned		pagesize;
 	uintmax_t		filesize;
 	struct smfhead		order;
 	struct smfhead		free;
@@ -481,7 +481,7 @@
 {
 	struct smf *smf;
 
-	smf = s->priv;
+	smf = (struct smf *)(s->priv);
 	free_smf(smf);
 }
 

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2006-06-20 11:39:20 UTC (rev 212)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2006-06-20 19:31:46 UTC (rev 213)
@@ -38,7 +38,7 @@
  * Generic passthrough for CLI functions
  */
 
-void
+static void
 cli_passthrough_cb(unsigned u, const char *r, void *priv)
 {
 	struct cli *cli = priv;
@@ -319,11 +319,13 @@
 	const char *p, *q;
 	struct stevedore *stp;
 
-	q = p = strchr(sflag, ',');
+	p = strchr(sflag, ',');
 	if (p == NULL)
 		q = p = strchr(sflag, '\0');
 	else
-		q++;
+		q = p + 1;
+	assert(p != NULL);
+	assert(q != NULL);
 	if (!cmp_storage(&sma_stevedore, sflag, p)) {
 		stp = &sma_stevedore;
 	} else if (!cmp_storage(&smf_stevedore, sflag, p)) {




More information about the varnish-commit mailing list