]> err.no Git - varnish/commitdiff
Fix a bunch warnings, all cosmetic.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 10 Jul 2006 09:47:56 +0000 (09:47 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 10 Jul 2006 09:47:56 +0000 (09:47 +0000)
I'm using __unused for now, if we need to use something different
we can do a find/replace.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@396 d4fa192b-c00b-0410-8231-f00ffab90ce4

18 files changed:
varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/bin/varnishd/cache_ban.c
varnish-cache/bin/varnishd/cache_expire.c
varnish-cache/bin/varnishd/cache_fetch.c
varnish-cache/bin/varnishd/cache_http.c
varnish-cache/bin/varnishd/cache_main.c
varnish-cache/bin/varnishd/cache_pass.c
varnish-cache/bin/varnishd/cache_pipe.c
varnish-cache/bin/varnishd/cache_shmlog.c
varnish-cache/bin/varnishd/cache_shmlog.h [new file with mode: 0644]
varnish-cache/bin/varnishd/cache_vcl.c
varnish-cache/bin/varnishd/cli_event.c
varnish-cache/bin/varnishd/mgt.h
varnish-cache/bin/varnishd/mgt_child.c
varnish-cache/bin/varnishd/tcp.c
varnish-cache/bin/varnishd/varnishd.c

index d5aca3949c27ee7019d39859e7d57578a4420e1a..bd5086ee7700e981af73e1f81cef8d839a03ca8a 100644 (file)
@@ -241,6 +241,8 @@ void CacheInitPool(void);
 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 @@ void VSL(enum shmlogtag tag, unsigned id, const char *fmt, ...);
        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);
index c82852b53c53bd13fb5678f19ad3023bb4bddeb1..1779acb0edc5d4bd5c8d93c9fd2537cab540457d 100644 (file)
@@ -160,7 +160,7 @@ vca_write_obj(struct worker *w, struct sess *sp)
 /*--------------------------------------------------------------------*/
 
 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 @@ vca_callback(void *arg, int bad)
 }
 
 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 @@ pipe_f(int fd, short event, void *arg)
 }
 
 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 @@ accept_f(int fd, short event, void *arg)
 }
 
 static void *
-vca_main(void *arg)
+vca_main(void *arg __unused)
 {
        unsigned u;
        struct event *ep;
@@ -292,8 +292,8 @@ vca_main(void *arg)
        }
 
        event_base_loop(evb, 0);
-
-       return ("FOOBAR");
+       assert(0 == 1);
+       return (NULL);
 }
 
 /*--------------------------------------------------------------------*/
index 536f15cef51220b64c7a563371634832fc16cb47..45f2aaa59057627c95c7ed635b778abad6b11665 100644 (file)
@@ -151,14 +151,11 @@ connect_to_backend(struct vbe_conn *vc, struct backend *bp)
  */
 
 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 @@ vbe_rdp(int fd, short event, void *arg)
  */
 
 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 @@ vbe_rdf(int fd, short event, void *arg)
 /* 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);
 
index 1a2777f9e1a959e9e8b9b357032c6fd5ee8d4ae3..91e6a47a9bcd842d8a02e1b4e990578864cf5044 100644 (file)
@@ -71,7 +71,7 @@ BAN_CheckObject(struct object *o, const char *url)
 }
 
 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]);
index 8141682cfd119f546de41f9e037608910541bf7f..6a8ac73f1ff892acefc214d28cca2cc2dd24b126 100644 (file)
@@ -43,7 +43,7 @@ EXP_TTLchange(struct object *o)
  */
 
 static void *
-exp_hangman(void *arg)
+exp_hangman(void *arg __unused)
 {
        struct object *o;
        time_t t;
@@ -84,7 +84,7 @@ exp_hangman(void *arg)
  */
 
 static void *
-exp_prefetch(void *arg)
+exp_prefetch(void *arg __unused)
 {
        struct object *o;
        time_t t;
@@ -116,14 +116,12 @@ exp_prefetch(void *arg)
                }
                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 @@ object_cmp(void *priv, void *a, void *b)
 }
 
 static void
-object_update(void *priv, void *p, unsigned u)
+object_update(void *priv __unused, void *p, unsigned u)
 {
        struct object *o = p;
 
index dd230eeecc21558e5d82a7cc2cc3d26f1e4d82a6..e3364d668c988a24a3cabf8520319200d1d90374 100644 (file)
@@ -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 @@ fetch_straight(struct worker *w, struct sess *sp, int fd, struct http *hp, char
 /* 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 @@ fetch_chunked(struct worker *w, struct sess *sp, int fd, struct http *hp)
 #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 @@ FetchSession(struct worker *w, struct sess *sp)
        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;
index 825d413cf331fed3c960fd3922419a628bd5acae..09478a77abd11451900e337ae722d8ffe2b131ae 100644 (file)
@@ -308,7 +308,7 @@ http_header_complete(struct http *hp)
 #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;
index 1a05e0f991d65358318692d66c057b271b152867..bd73c86ed4a855d44d0361afc944397bf455f67e 100644 (file)
@@ -21,6 +21,7 @@ static struct event ev_keepalive;
 struct stevedore       *stevedore;
 
 pthread_mutex_t        sessmtx;
+struct varnish_stats *VSL_stats;
 
 /*--------------------------------------------------------------------*/
 
index 7ac2f6691c8abb32ec00061091a646b02c0386bf..09916a7185b7270b750dd700e7b8e383ef1fbc98 100644 (file)
@@ -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 @@ pass_straight(struct worker *w, struct sess *sp, int fd, struct http *hp, char *
 /*--------------------------------------------------------------------*/
 
 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 @@ PassSession(struct worker *w, struct sess *sp)
        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;
index 6e58e81ad6dcf13b5d30317a3bb36afe018fb9b1..d0b71b44ce22baed0adc18a1ff3e12d01bbdd242 100644 (file)
@@ -19,7 +19,7 @@ struct edir {
 };
 
 static void
-rdf(int fd, short event, void *arg)
+rdf(int fd, short event __unused, void *arg)
 {
        int i, j;
        struct edir *ep;
index bf96093e5cdc241055402bfe9b3cc7201e47f433..a30253c0be3483c56c8c3e3eea4fd0c1ab88214f 100644 (file)
@@ -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 @@ VSL_Init(void)
 
        /* 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;
 }
 
 /*--------------------------------------------------------------------*/
diff --git a/varnish-cache/bin/varnishd/cache_shmlog.h b/varnish-cache/bin/varnishd/cache_shmlog.h
new file mode 100644 (file)
index 0000000..f0cb197
--- /dev/null
@@ -0,0 +1,6 @@
+/*
+ * $Id$
+ */
+
+void VSL_MgtInit(const char *fn, unsigned size);
+extern struct varnish_stats *VSL_stats;
index 43c238e4074ef9e57e3b2371e4238217d8f78377..c271102ae509614b129ee1e370851e0c6bd4c672 100644 (file)
@@ -99,7 +99,7 @@ CVCL_Load(const char *fn, const char *name)
 }
 
 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 @@ find_vcls(const char *name)
 }
 
 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 @@ cli_func_config_load(struct cli *cli, char **av, void *priv)
 }
 
 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;
 
index 167e6aa3c59ebc4510ddfc785bd4201a35d0a15f..53e0cc5cf030f79ab940095f2e3fc410fd551aa6 100644 (file)
@@ -110,7 +110,7 @@ rdcb(struct bufferevent *bev, void *arg)
 }
 
 static void
-wrcb(struct bufferevent *bev, void *arg)
+wrcb(struct bufferevent *bev __unused, void *arg)
 {
        struct cli *cli = arg;
 
index 37fe78a0630cca75611630537df12cbaa793cbd0..ab94bfcdeff70fcebab4d1acd9856f02b7187c4e 100644 (file)
@@ -24,5 +24,4 @@ extern struct stevedore smf_stevedore;
 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"
index 80a49babed73373b892b59434c7cf4b447389f27..f49067366e9429d534d41a948d06c138f390b149 100644 (file)
@@ -58,7 +58,7 @@ static TAILQ_HEAD(,creq)      creqhead = TAILQ_HEAD_INITIALIZER(creqhead);
  */
 
 static void
-std_rdcb(struct bufferevent *bev, void *arg)
+std_rdcb(struct bufferevent *bev, void *arg __unused)
 {
        const char *p;
 
@@ -132,7 +132,7 @@ mgt_child_request(mgt_ccb_f *func, void *priv, char **argv, const char *fmt, ...
 }
 
 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 @@ cli_excb(struct bufferevent *bev, short what, void *arg)
 /*--------------------------------------------------------------------*/
 
 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;
index 70f3c1a05940d694436c180e6d878d10b023c1de..becf59d203e4839b3d380b313bc7ec49f9e095e5 100644 (file)
@@ -11,6 +11,7 @@
 #include <netdb.h>
 
 #include "heritage.h"
+#include "mgt.h"
 #include "libvarnish.h"
 
 static void
index 751c86d78db8f673543fad768eff4036dadfbd1a..60e57104b2f5a9f9f7492ae61a8d64e770c2ead6 100644 (file)
@@ -50,7 +50,7 @@ cli_passthrough_cb(unsigned u, const char *r, void *priv)
 }
 
 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;