From: phk Date: Tue, 20 Jun 2006 19:31:46 +0000 (+0000) Subject: Polish things to silence FlexeLint a bit X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a00d77f5906e9bbbaaa90a378b684dd80943295;p=varnish Polish things to silence FlexeLint a bit git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@213 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index a7f70cfb..7bf6ebd3 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -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); diff --git a/varnish-cache/bin/varnishd/cache_backend.c b/varnish-cache/bin/varnishd/cache_backend.c index 8bdb0356..15965e8c 100644 --- a/varnish-cache/bin/varnishd/cache_backend.c +++ b/varnish-cache/bin/varnishd/cache_backend.c @@ -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; diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index cf915bb1..fec88299 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -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; diff --git a/varnish-cache/bin/varnishd/cache_main.c b/varnish-cache/bin/varnishd/cache_main.c index 37d3493c..8183e14e 100644 --- a/varnish-cache/bin/varnishd/cache_main.c +++ b/varnish-cache/bin/varnishd/cache_main.c @@ -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); } diff --git a/varnish-cache/bin/varnishd/cache_pipe.c b/varnish-cache/bin/varnishd/cache_pipe.c index 8a4077c1..3a5dc02a 100644 --- a/varnish-cache/bin/varnishd/cache_pipe.c +++ b/varnish-cache/bin/varnishd/cache_pipe.c @@ -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; diff --git a/varnish-cache/bin/varnishd/cache_shmlog.c b/varnish-cache/bin/varnishd/cache_shmlog.c index aa2ad9bd..195571a1 100644 --- a/varnish-cache/bin/varnishd/cache_shmlog.c +++ b/varnish-cache/bin/varnishd/cache_shmlog.c @@ -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); } diff --git a/varnish-cache/bin/varnishd/cli_event.c b/varnish-cache/bin/varnishd/cli_event.c index f183a4f8..167e6aa3 100644 --- a/varnish-cache/bin/varnishd/cli_event.c +++ b/varnish-cache/bin/varnishd/cli_event.c @@ -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 * diff --git a/varnish-cache/bin/varnishd/flint.lnt b/varnish-cache/bin/varnishd/flint.lnt index dff5c94d..48dc5d9a 100644 --- a/varnish-cache/bin/varnishd/flint.lnt +++ b/varnish-cache/bin/varnishd/flint.lnt @@ -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 diff --git a/varnish-cache/bin/varnishd/storage_file.c b/varnish-cache/bin/varnishd/storage_file.c index bd0902d1..70cd5ef1 100644 --- a/varnish-cache/bin/varnishd/storage_file.c +++ b/varnish-cache/bin/varnishd/storage_file.c @@ -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); } diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index cd5b0e63..127a33dd 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -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)) {