]> err.no Git - varnish/commitdiff
Polish things to silence FlexeLint a bit
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Jun 2006 19:31:46 +0000 (19:31 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Jun 2006 19:31:46 +0000 (19:31 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@213 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/bin/varnishd/cache_fetch.c
varnish-cache/bin/varnishd/cache_main.c
varnish-cache/bin/varnishd/cache_pipe.c
varnish-cache/bin/varnishd/cache_shmlog.c
varnish-cache/bin/varnishd/cli_event.c
varnish-cache/bin/varnishd/flint.lnt
varnish-cache/bin/varnishd/storage_file.c
varnish-cache/bin/varnishd/varnishd.c

index a7f70cfb5690dca64981dc635a65f9d563b482d6..7bf6ebd36ed7afae7cce3880174e4aca740053a7 100644 (file)
@@ -60,7 +60,6 @@ extern struct stevedore *stevedore;
 /* Storage -----------------------------------------------------------*/
 
 struct sess;
-typedef void sesscb_f(struct sess *sp);
 
 #define VCA_ADDRBUFSIZE                32
 
@@ -99,8 +98,6 @@ struct sess {
 
        TAILQ_ENTRY(sess)       list;
 
-       sesscb_f                *sesscb;
-
        struct backend          *backend;
        struct object           *obj;
        struct VCL_conf         *vcl;
@@ -113,12 +110,14 @@ struct sess {
 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 @@ void VCA_Init(void);
 /* 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);
 
index 8bdb0356d7e1bbdb28eecd91253be764976f3ac3..15965e8c2e200a094e37dfcde1e7cfa5cb3fd2b9 100644 (file)
@@ -78,7 +78,7 @@ static int vbe_pipe[2];
  * 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;
index cf915bb12f1a6a8ce56fe096fe75e0a21e9a8320..fec882997de8c44c7f5e45df67a78d64f7def825 100644 (file)
@@ -139,6 +139,7 @@ fetch_chunked(struct worker *w, struct sess *sp, int fd, struct http *hp)
                        i = bp - q;
                        if (i == 0) {
                        } else if (v > i) {
+                               assert(i > 0);
                                memcpy(p, q, i);
                                p += i;
                                st->len += i;
index 37d3493cbc9b05ec55cf5c55a5e9899160dc4344..8183e14eeb2a2f3717b1ae78156af5c0f299d8aa 100644 (file)
@@ -35,7 +35,7 @@ static void
 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);
 }
index 8a4077c1ac266ecb90897d1a0e649dace4dea574..3a5dc02a960fd83253a923b65e7c8ccc0b3b1cf8 100644 (file)
@@ -44,7 +44,7 @@ rdf(int fd, short event, void *arg)
 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 @@ PipeSession(struct worker *w, struct sess *sp)
        i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
        assert(i == sbuf_len(w->sb));
        assert(__LINE__ == 0);
-       j = 0;
 #if 0
+       { int j;
+       j = 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;
index aa2ad9bdca5dcaa64a1ea91d9134c85abfa6e40f..195571a170972fd860ef3f2dbd01aaf82d8f677c 100644 (file)
@@ -23,7 +23,6 @@ static unsigned char *logstart, *logend;
 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 @@ VSLR(enum shmlogtag tag, unsigned id, const char *b, const char *e)
        loghead->ptr = (p + 4 + (e - b)) - logstart;
        
        /* XXX: Unlock */
-
-       va_end(ap);
 }
 
 
index f183a4f868a4d244343ee130df82c5534d07afb5..167e6aa3c59ebc4510ddfc785bd4201a35d0a15f 100644 (file)
@@ -120,7 +120,7 @@ wrcb(struct bufferevent *bev, void *arg)
 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 *
index dff5c94d3b91ceebb39ba3cb7ba756e16cae1ab8..48dc5d9ae7bf43525898febfdf6e327d8b109038 100644 (file)
@@ -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
 
index bd0902d18e03302535b12f8ea6ec913e4a36a4cd..70cd5ef1fc4c294f0b18582bd0ba5d7d25ceab41 100644 (file)
@@ -48,7 +48,7 @@ TAILQ_HEAD(smfhead, smf);
 struct smf_sc {
        char                    *filename;
        int                     fd;
-       int                     pagesize;
+       unsigned                pagesize;
        uintmax_t               filesize;
        struct smfhead          order;
        struct smfhead          free;
@@ -481,7 +481,7 @@ smf_free(struct storage *s)
 {
        struct smf *smf;
 
-       smf = s->priv;
+       smf = (struct smf *)(s->priv);
        free_smf(smf);
 }
 
index cd5b0e6330994fb23361b3a54941216c5636751e..127a33ddd4b04d7af9eaa2c60f4e7e56cfffec61 100644 (file)
@@ -38,7 +38,7 @@ struct event_base *mgt_eb;
  * 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 @@ setup_storage(const char *sflag)
        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)) {