r396 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Jul 10 11:47:57 CEST 2006


Author: phk
Date: 2006-07-10 11:47:56 +0200 (Mon, 10 Jul 2006)
New Revision: 396

Added:
   trunk/varnish-cache/bin/varnishd/cache_shmlog.h
Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_ban.c
   trunk/varnish-cache/bin/varnishd/cache_expire.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/cache_main.c
   trunk/varnish-cache/bin/varnishd/cache_pass.c
   trunk/varnish-cache/bin/varnishd/cache_pipe.c
   trunk/varnish-cache/bin/varnishd/cache_shmlog.c
   trunk/varnish-cache/bin/varnishd/cache_vcl.c
   trunk/varnish-cache/bin/varnishd/cli_event.c
   trunk/varnish-cache/bin/varnishd/mgt.h
   trunk/varnish-cache/bin/varnishd/mgt_child.c
   trunk/varnish-cache/bin/varnishd/tcp.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Fix a bunch warnings, all cosmetic.

I'm using __unused for now, if we need to use something different
we can do a find/replace.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-07-10 09:47:56 UTC (rev 396)
@@ -241,6 +241,8 @@
 void DealWithSession(void *arg);
 
 /* cache_shmlog.c */
+#include "cache_shmlog.h"
+
 void VSL_Init(void);
 #ifdef SHMLOGHEAD_MAGIC
 void VSLR(enum shmlogtag tag, unsigned id, const char *b, const char *e);
@@ -251,7 +253,6 @@
 	assert(__LINE__ == 0);						\
 	} while (0)
 #endif
-extern struct varnish_stats *VSL_stats;
 
 /* cache_response.c */
 void RES_Error(struct worker *w, struct sess *sp, int error, const char *msg);

Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -160,7 +160,7 @@
 /*--------------------------------------------------------------------*/
 
 static void
-vca_tick(int a, short b, void *c)
+vca_tick(int a __unused, short b __unused, void *c __unused)
 {
 	struct sess *sp, *sp2;
 	time_t t;
@@ -194,7 +194,7 @@
 }
 
 static void
-pipe_f(int fd, short event, void *arg)
+pipe_f(int fd, short event __unused, void *arg __unused)
 {
 	struct sess *sp;
 	int i;
@@ -207,7 +207,7 @@
 }
 
 static void
-accept_f(int fd, short event, void *arg)
+accept_f(int fd, short event __unused, void *arg __unused)
 {
 	socklen_t l;
 	struct sockaddr addr[2];
@@ -254,7 +254,7 @@
 }
 
 static void *
-vca_main(void *arg)
+vca_main(void *arg __unused)
 {
 	unsigned u;
 	struct event *ep;
@@ -292,8 +292,8 @@
 	}
 
 	event_base_loop(evb, 0);
-
-	return ("FOOBAR");
+	assert(0 == 1);
+	return (NULL);
 }
 
 /*--------------------------------------------------------------------*/

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -151,14 +151,11 @@
  */
 
 static void
-vbe_rdp(int fd, short event, void *arg)
+vbe_rdp(int fd, short event __unused, void *arg __unused)
 {
 	struct vbe_conn *vc;
 	int i;
 
-	(void)event;
-	(void)arg;
-
 	i = read(fd, &vc, sizeof vc);
 	assert(i == sizeof vc);
 	AZ(pthread_mutex_lock(&vbemtx));
@@ -181,13 +178,11 @@
  */
 
 static void
-vbe_rdf(int fd, short event, void *arg)
+vbe_rdf(int fd __unused, short event __unused, void *arg)
 {
 	struct vbe_conn *vc;
 	int j;
 
-	(void)event;
-
 	vc = arg;
 	AZ(pthread_mutex_lock(&vbemtx));
 	if (vc->inuse) {
@@ -207,12 +202,10 @@
 /* Backend monitoring thread -----------------------------------------*/
 
 static void *
-vbe_main(void *priv)
+vbe_main(void *priv __unused)
 {
 	struct event pev;
 
-	(void)priv;
-
 	vbe_evb = event_init();
 	assert(vbe_evb != NULL);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ban.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_ban.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -71,7 +71,7 @@
 }
 
 void
-cli_func_url_purge(struct cli *cli, char **av, void *priv)
+cli_func_url_purge(struct cli *cli, char **av, void *priv __unused)
 {
 
 	AddBan(av[2]);

Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -43,7 +43,7 @@
  */
 
 static void *
-exp_hangman(void *arg)
+exp_hangman(void *arg __unused)
 {
 	struct object *o;
 	time_t t;
@@ -84,7 +84,7 @@
  */
 
 static void *
-exp_prefetch(void *arg)
+exp_prefetch(void *arg __unused)
 {
 	struct object *o;
 	time_t t;
@@ -116,14 +116,12 @@
 		}
 		assert(sp.handling == VCL_RET_DISCARD);
 	}
-
-	return ("FOOBAR");
 }
 
 /*--------------------------------------------------------------------*/
 
 static int
-object_cmp(void *priv, void *a, void *b)
+object_cmp(void *priv __unused, void *a, void *b)
 {
 	struct object *aa, *bb;
 
@@ -133,7 +131,7 @@
 }
 
 static void
-object_update(void *priv, void *p, unsigned u)
+object_update(void *priv __unused, void *p, unsigned u)
 {
 	struct object *o = p;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -30,7 +30,7 @@
 
 /*--------------------------------------------------------------------*/
 static int
-fetch_straight(struct worker *w, struct sess *sp, int fd, struct http *hp, char *b)
+fetch_straight(struct sess *sp, int fd, struct http *hp, char *b)
 {
 	int i;
 	char *e;
@@ -70,7 +70,7 @@
 /* XXX: Cleanup.  It must be possible somehow :-( */
 
 static int
-fetch_chunked(struct worker *w, struct sess *sp, int fd, struct http *hp)
+fetch_chunked(struct sess *sp, int fd, struct http *hp)
 {
 	int i;
 	char *b, *q, *e;
@@ -180,7 +180,7 @@
 #include <errno.h>
 
 static int
-fetch_eof(struct worker *w, struct sess *sp, int fd, struct http *hp)
+fetch_eof(struct sess *sp, int fd, struct http *hp)
 {
 	int i;
 	char *b, *e;
@@ -273,11 +273,11 @@
 	http_BuildSbuf(sp->fd, Build_Reply, w->sb, hp);
 	if (body) {
 		if (http_GetHdr(hp, "Content-Length", &b))
-			cls = fetch_straight(w, sp, vc->fd, hp, b);
+			cls = fetch_straight(sp, vc->fd, hp, b);
 		else if (http_HdrIs(hp, "Transfer-Encoding", "chunked"))
-			cls = fetch_chunked(w, sp, vc->fd, hp);
+			cls = fetch_chunked(sp, vc->fd, hp);
 		else 
-			cls = fetch_eof(w, sp, vc->fd, hp);
+			cls = fetch_eof(sp, vc->fd, hp);
 		sbuf_printf(w->sb, "Content-Length: %u\r\n", sp->obj->len);
 	} else
 		cls = 0;

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -308,7 +308,7 @@
 #include <errno.h>
 
 static void
-http_read_f(int fd, short event, void *arg)
+http_read_f(int fd, short event __unused, void *arg)
 {
 	struct http *hp = arg;
 	unsigned l;

Modified: trunk/varnish-cache/bin/varnishd/cache_main.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_main.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_main.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -21,6 +21,7 @@
 struct stevedore	*stevedore;
 
 pthread_mutex_t	sessmtx;
+struct varnish_stats *VSL_stats;
 
 /*--------------------------------------------------------------------*/
 

Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -21,7 +21,7 @@
 /*--------------------------------------------------------------------*/
 
 static int
-pass_straight(struct worker *w, struct sess *sp, int fd, struct http *hp, char *bi)
+pass_straight(struct sess *sp, int fd, struct http *hp, char *bi)
 {
 	int i;
 	char *b, *e;
@@ -63,7 +63,7 @@
 /*--------------------------------------------------------------------*/
 
 static int
-pass_chunked(struct worker *w, struct sess *sp, int fd, struct http *hp)
+pass_chunked(struct sess *sp, int fd, struct http *hp)
 {
 	int i, j;
 	char *b, *q, *e;
@@ -175,11 +175,11 @@
 	vca_write(sp, sbuf_data(w->sb), sbuf_len(w->sb));
 
 	if (http_GetHdr(hp, "Content-Length", &b))
-		cls = pass_straight(w, sp, vc->fd, hp, b);
+		cls = pass_straight(sp, vc->fd, hp, b);
 	else if (http_HdrIs(hp, "Connection", "close"))
-		cls = pass_straight(w, sp, vc->fd, hp, NULL);
+		cls = pass_straight(sp, vc->fd, hp, NULL);
 	else if (http_HdrIs(hp, "Transfer-Encoding", "chunked"))
-		cls = pass_chunked(w, sp, vc->fd, hp);
+		cls = pass_chunked(sp, vc->fd, hp);
 	else {
 		INCOMPL();
 		cls = 1;

Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -19,7 +19,7 @@
 };
 
 static void
-rdf(int fd, short event, void *arg)
+rdf(int fd, short event __unused, void *arg)
 {
 	int i, j;
 	struct edir *ep;

Modified: trunk/varnish-cache/bin/varnishd/cache_shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_shmlog.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_shmlog.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -26,7 +26,6 @@
 #endif
 
 struct varnish_stats *VSL_stats;
-
 static struct shmloghead *loghead;
 static unsigned char *logstart;
 static pthread_mutex_t vsl_mutex;
@@ -132,8 +131,8 @@
 
 	/* XXX check sanity of loghead */
 	logstart = (unsigned char *)loghead + loghead->start;
-	VSL_stats = &loghead->stats;
 	AZ(pthread_mutex_init(&vsl_mutex, NULL));
+	VSL_stats = &loghead->stats;
 }
 
 /*--------------------------------------------------------------------*/

Added: trunk/varnish-cache/bin/varnishd/cache_shmlog.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_shmlog.h	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_shmlog.h	2006-07-10 09:47:56 UTC (rev 396)
@@ -0,0 +1,6 @@
+/*
+ * $Id$
+ */
+
+void VSL_MgtInit(const char *fn, unsigned size);
+extern struct varnish_stats *VSL_stats;

Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vcl.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cache_vcl.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -99,7 +99,7 @@
 }
 
 void
-cli_func_config_list(struct cli *cli, char **av, void *priv)
+cli_func_config_list(struct cli *cli, char **av __unused, void *priv __unused)
 {
 	struct vcls *vcl;
 
@@ -123,7 +123,7 @@
 }
 
 void
-cli_func_config_load(struct cli *cli, char **av, void *priv)
+cli_func_config_load(struct cli *cli, char **av, void *priv __unused)
 {
 	struct vcls *vcl;
 
@@ -166,13 +166,13 @@
 }
 
 void
-cli_func_config_unload(struct cli *cli, char **av, void *priv)
+cli_func_config_unload(struct cli *cli, char **av __unused, void *priv __unused)
 {
 	cli_result(cli, CLIS_UNIMPL);
 }
 
 void
-cli_func_config_use(struct cli *cli, char **av, void *priv)
+cli_func_config_use(struct cli *cli, char **av, void *priv __unused)
 {
 	struct vcls *vcl;
 

Modified: trunk/varnish-cache/bin/varnishd/cli_event.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cli_event.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/cli_event.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -110,7 +110,7 @@
 }
 
 static void
-wrcb(struct bufferevent *bev, void *arg)
+wrcb(struct bufferevent *bev __unused, void *arg)
 {
 	struct cli *cli = arg;
 

Modified: trunk/varnish-cache/bin/varnishd/mgt.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt.h	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/mgt.h	2006-07-10 09:47:56 UTC (rev 396)
@@ -24,5 +24,4 @@
 extern struct hash_slinger hsl_slinger;
 extern struct hash_slinger hcl_slinger;
 
-void VSL_MgtInit(const char *fn, unsigned size);
-extern struct varnish_stats *VSL_stats;
+#include "cache_shmlog.h"

Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -58,7 +58,7 @@
  */
 
 static void
-std_rdcb(struct bufferevent *bev, void *arg)
+std_rdcb(struct bufferevent *bev, void *arg __unused)
 {
 	const char *p;
 
@@ -132,7 +132,7 @@
 }
 
 static void
-cli_rdcb(struct bufferevent *bev, void *arg)
+cli_rdcb(struct bufferevent *bev, void *arg __unused)
 {
 	const char *p;
 	char **av;
@@ -174,14 +174,14 @@
 /*--------------------------------------------------------------------*/
 
 static void
-child_pingpong_ccb(unsigned u, const char *r, void *priv)
+child_pingpong_ccb(unsigned u __unused, const char *r __unused, void *priv __unused)
 {
 	/* XXX: reset keepalive timer */
 }
 
 
 static void
-child_pingpong(int a, short b, void *c)
+child_pingpong(int a __unused, short b __unused, void *c __unused)
 {
 	time_t t;
 	struct timeval tv;

Modified: trunk/varnish-cache/bin/varnishd/tcp.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/tcp.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/tcp.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -11,6 +11,7 @@
 #include <netdb.h>
 
 #include "heritage.h"
+#include "mgt.h"
 #include "libvarnish.h"
 
 static void

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2006-07-10 09:28:26 UTC (rev 395)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2006-07-10 09:47:56 UTC (rev 396)
@@ -50,7 +50,7 @@
 }
 
 static void
-m_cli_func_passthrough(struct cli *cli, char **av, void *priv)
+m_cli_func_passthrough(struct cli *cli, char **av, void *priv __unused)
 {
 
 	(void)av;




More information about the varnish-commit mailing list