r1061 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Sep 18 09:36:33 CEST 2006


Author: phk
Date: 2006-09-18 09:36:33 +0200 (Mon, 18 Sep 2006)
New Revision: 1061

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/cache_pool.c
   trunk/varnish-cache/bin/varnishd/cache_session.c
   trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c
   trunk/varnish-cache/bin/varnishd/flint.lnt
   trunk/varnish-cache/bin/varnishd/mgt_child.c
   trunk/varnish-cache/bin/varnishd/mgt_param.c
   trunk/varnish-cache/bin/varnishd/shmlog.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Make flexelint happier


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-09-18 07:36:33 UTC (rev 1061)
@@ -124,8 +124,6 @@
 };
 
 struct workreq {
-	unsigned		magic;
-#define WORKREQ_MAGIC		0x5ccb4eb2
 	TAILQ_ENTRY(workreq)	list;
 	struct sess		*sess;
 };
@@ -342,7 +340,6 @@
 void http_FilterHeader(struct worker *w, int fd, struct http *to, struct http *fm, unsigned how);
 void http_PrintfHeader(struct worker *w, int fd, struct http *to, const char *fmt, ...);
 void http_SetHeader(struct worker *w, int fd, struct http *to, const char *hdr);
-int http_IsHdr(struct http_hdr *hh, char *hdr);
 void http_Setup(struct http *ht, void *space, unsigned len);
 int http_GetHdr(struct http *hp, const char *hdr, char **ptr);
 int http_GetHdrField(struct http *hp, const char *hdr, const char *field, char **ptr);
@@ -396,7 +393,6 @@
 void WSLR(struct worker *w, enum shmlogtag tag, unsigned id, const char *b, const char *e);
 void WSL(struct worker *w, enum shmlogtag tag, unsigned id, const char *fmt, ...);
 void WSL_Flush(struct worker *w);
-#define HERE() VSL(SLT_Debug, 0, "HERE: %s(%d)", __func__, __LINE__)
 #define INCOMPL() do {							\
 	VSL(SLT_Debug, 0, "INCOMPLETE AT: %s(%d)", __func__, __LINE__); \
 	fprintf(stderr,"INCOMPLETE AT: %s(%d)\n", (const char *)__func__, __LINE__);	\

Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -33,7 +33,7 @@
 static unsigned nki;
 
 static void
-vca_kq_sess(struct sess *sp, int arm)
+vca_kq_sess(struct sess *sp, short arm)
 {
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);

Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -35,7 +35,6 @@
 #include <unistd.h>
 
 #include "shmlog.h"
-#include "heritage.h"
 #include "vcl.h"
 #include "cache.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -58,9 +58,6 @@
 	return (logmtx[hp->logtag][t]);
 }
 
-#define VSLH(ax, bx, cx, dx) \
-	VSLR(T((cx), (ax)), (bx), (cx)->hd[(dx)].b, (cx)->hd[(dx)].e);
-
 #define WSLH(wx, ax, bx, cx, dx) \
 	WSLR(wx, T((cx), (ax)), (bx), (cx)->hd[(dx)].b, (cx)->hd[(dx)].e);
 
@@ -85,7 +82,7 @@
 /*--------------------------------------------------------------------*/
 
 
-int
+static int
 http_IsHdr(struct http_hdr *hh, char *hdr)
 {
 	unsigned l;

Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -240,7 +240,7 @@
 	struct worker *w;
 	pthread_t tp;
 	struct wq *qp;
-	static unsigned nq;
+	static unsigned nq = 0;
 	unsigned onq;
 
 	onq = nq + 1;

Modified: trunk/varnish-cache/bin/varnishd/cache_session.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_session.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache_session.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -76,7 +76,7 @@
 	MTX			mtx;
 } *srchash;
 	
-unsigned			nsrchash;
+static unsigned			nsrchash;
 static MTX			stat_mtx;
 
 /*--------------------------------------------------------------------

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -21,9 +21,9 @@
 #include <netinet/in.h>
 
 
-static unsigned ipv4mask[] = {
+static uint32_t ipv4mask[] = {
 	[0]	=	0xffffffff,
-#define M(n)	[n] = (0xffffffff << (32 - n))
+#define M(n)	[n] = (uint32_t)((uint64_t)0xffffffff << (32 - n))
         M( 1), M( 2), M( 3), M( 4), M( 5), M( 6), M( 7), M( 8), M( 9), M(10),
         M(11), M(12), M(13), M(14), M(15), M(16), M(17), M(18), M(19), M(20),
         M(21), M(22), M(23), M(24), M(25), M(26), M(27), M(28), M(29), M(30),

Modified: trunk/varnish-cache/bin/varnishd/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/varnishd/flint.lnt	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/flint.lnt	2006-09-18 07:36:33 UTC (rev 1061)
@@ -1,6 +1,7 @@
 -passes=3
 
 +libh mgt_event.h
++libh ../../config.h
 
 -header(../../config.h)
 
@@ -20,7 +21,9 @@
 -e786	// String concatenation within initializer
 
 -emacro(740, TAILQ_PREV) // Unusual pointer cast (incompatible indirect types)
+-emacro(740, TAILQ_LAST) // Unusual pointer cast (incompatible indirect types)
 -emacro((826), TAILQ_PREV) // Suspicious pointer-to-pointer conversion (area too small)
+-emacro((826), TAILQ_LAST) // Suspicious pointer-to-pointer conversion (area too small)
 
 
 -esym(534, printf)	// Ignoring return value of function

Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -97,6 +97,7 @@
 start_child(void)
 {
 	int i;
+	unsigned u;
 	char *p;
 	struct ev *e;
 
@@ -170,7 +171,7 @@
 	AZ(close(heritage.fds[2]));
 	heritage.fds[2] = -1;
 	child_pid = i;
-	if (mgt_push_vcls_and_start(&i, &p)) {
+	if (mgt_push_vcls_and_start(&u, &p)) {
 		fprintf(stderr, "Pushing vcls failed:\n%s\n", p);
 		free(p);
 		/* Pick up any stuff lingering on stdout/stderr */

Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -14,7 +14,6 @@
 #include "mgt.h"
 #include "mgt_cli.h"
 
-#include "vsb.h"
 #include "heritage.h"
 
 struct parspec;
@@ -308,10 +307,6 @@
 #define DELAYED_EFFECT \
 	"\nNB: This parameter will take some time to take effect.\n"
 
-#define SHOULD_RESTART \
-	"\nNB: This parameter will not take full effect until the " \
-	"child process has been restarted.\n"
-
 #define MUST_RESTART \
 	"\nNB: This parameter will not take any effect until the " \
 	"child process has been restarted.\n"

Modified: trunk/varnish-cache/bin/varnishd/shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/shmlog.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/shmlog.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -107,8 +107,7 @@
 
 	va_start(ap, fmt);
 
-	p = strchr(fmt, '%');
-	if (p == NULL) {
+	if (strchr(fmt, '%') == NULL) {
 		VSLR(tag, id, fmt, NULL);
 		return;
 	}
@@ -221,8 +220,7 @@
 
 	va_start(ap, fmt);
 
-	p = strchr(fmt, '%');
-	if (p == NULL) {
+	if (strchr(fmt, '%') == NULL) {
 		WSLR(w, tag, id, fmt, NULL);
 		return;
 	}

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2006-09-18 07:16:03 UTC (rev 1060)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2006-09-18 07:36:33 UTC (rev 1061)
@@ -347,9 +347,9 @@
 	setbuf(stderr, NULL);
 
 	memset(cli, 0, sizeof cli);
-	cli->sb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
-	XXXAN(cli->sb);
-	cli->result = CLIS_OK;
+	cli[0].sb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
+	XXXAN(cli[0].sb);
+	cli[0].result = CLIS_OK;
 
 	heritage.socket = -1;
 	memset(&param, 0, sizeof param);




More information about the varnish-commit mailing list