]> err.no Git - varnish/commitdiff
More assorted FlexeLint polishing
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 19 Jul 2008 12:38:28 +0000 (12:38 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 19 Jul 2008 12:38:28 +0000 (12:38 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2968 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_dir_random.c
varnish-cache/bin/varnishd/cache_dir_round_robin.c
varnish-cache/bin/varnishd/cache_dir_simple.c
varnish-cache/bin/varnishd/cache_http.c
varnish-cache/bin/varnishd/cache_vary.c

index fffa9e95b4b822d957a72779c8553899d92cd450..2db0856141ca89e6d9aa521dbb8ab712dc6e206f 100644 (file)
@@ -98,7 +98,7 @@ VBE_TryConnect(const struct sess *sp, int pf, const struct sockaddr *sa, socklen
 
        tmo = params->connect_timeout;
        if (sp->backend->connect_timeout > 10e-3)
-               tmo = sp->backend->connect_timeout * 1000;
+               tmo = (int)(sp->backend->connect_timeout * 1000);
 
        if (tmo > 0)
                i = TCP_connect(s, sa, salen, tmo);
index 61d76333d6d641302a00a908ac7e6020d8e41b4f..37414481bf8221c9980b5893fa27cb90420b94e8 100644 (file)
@@ -72,7 +72,6 @@ DOT acceptor -> start [style=bold,color=green,weight=4]
 
 #include "shmlog.h"
 #include "vcl.h"
-#include "cli.h"
 #include "cli_priv.h"
 #include "cache.h"
 
index f2d5c983c25d169ac1d32da4d9c61adf509b64d2..f2890c38c1dcd2c043b849dbbd5dbff1d6c49e3b 100644 (file)
@@ -61,6 +61,7 @@ struct vdi_random {
 };
 
 
+/*lint -e{818} not const-able */
 static struct backend *
 vdi_random_choose(struct sess *sp)
 {
@@ -81,6 +82,7 @@ vdi_random_choose(struct sess *sp)
        return (NULL);
 }
 
+/*lint -e{818} not const-able */
 static void
 vdi_random_fini(struct director *d)
 {
index 47663f09d18730910ba1b020903941b5bb97bc76..728691c63642aaea88f1545b5a404300ffb587fc 100644 (file)
@@ -60,6 +60,7 @@ struct vdi_round_robin {
 };
 
 
+/*lint -e{818} not const-able */
 static struct backend *
 vdi_round_robin_choose(struct sess *sp)
 {
@@ -75,6 +76,7 @@ vdi_round_robin_choose(struct sess *sp)
        return (backend);
 }
 
+/*lint -e{818} not const-able */
 static void
 vdi_round_robin_fini(struct director *d)
 {
index bbea21942a2f90b8621354e1d54b793afe53439d..672d4d551d8468bb7a3891badc7352d5eace6b93 100644 (file)
@@ -54,6 +54,7 @@ struct vdi_simple {
        struct backend          *backend;
 };
 
+/*lint -e{818} not const-able */
 static struct backend *
 vdi_simple_choose(struct sess *sp)
 {
@@ -64,6 +65,7 @@ vdi_simple_choose(struct sess *sp)
        return (vs->backend);
 }
 
+/*lint -e{818} not const-able */
 static void
 vdi_simple_fini(struct director *d)
 {
index 175081aef0a3ceba66eb4b361f9df2de951dcb3f..3d67ad4ee89f2b993683b78ae3e84f3de4451f9d 100644 (file)
@@ -53,6 +53,7 @@
 #include "http_headers.h"
 #undef HTTPH
 
+/*lint -save -e773 not () */
 #define LOGMTX2(ax, bx, cx)    [bx] = SLT_##ax##cx
 
 #define LOGMTX1(ax) {          \
@@ -69,6 +70,7 @@ static enum shmlogtag logmtx[][HTTP_HDR_FIRST + 1] = {
        [HTTP_Tx] = LOGMTX1(Tx),
        [HTTP_Obj] = LOGMTX1(Obj)
 };
+/*lint -restore */
 
 static enum shmlogtag
 http2shmlog(const struct http *hp, int t)
@@ -551,20 +553,20 @@ http_copyh(struct http *to, const struct http *fm, unsigned n)
 }
 
 static void
-http_copyreq(struct http *to, const struct http *fm, int transparent)
+http_copyreq(struct http *to, const struct http *fm, int how)
 {
 
        CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
        CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
-       if (transparent)
+
+       if ((how == HTTPH_R_PIPE) || (how == HTTPH_R_PASS)) {
                http_copyh(to, fm, HTTP_HDR_REQ);
-       else
-               http_SetH(to, HTTP_HDR_REQ, "GET");
-       http_copyh(to, fm, HTTP_HDR_URL);
-       if (transparent)
                http_copyh(to, fm, HTTP_HDR_PROTO);
-       else
+       } else {
+               http_SetH(to, HTTP_HDR_REQ, "GET");
                http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1");
+       }
+       http_copyh(to, fm, HTTP_HDR_URL);
 }
 
 void
@@ -645,8 +647,7 @@ http_FilterHeader(struct sess *sp, unsigned how)
         hp = bereq->http;
         hp->logtag = HTTP_Tx;
 
-       http_copyreq(hp, sp->http,
-           (how == HTTPH_R_PIPE) || (how == HTTPH_R_PASS));
+       http_copyreq(hp, sp->http, how);
        http_FilterFields(sp->wrk, sp->fd, hp, sp->http, how);
        http_PrintfHeader(sp->wrk, sp->fd, hp, "X-Varnish: %u", sp->xid);
        http_PrintfHeader(sp->wrk, sp->fd, hp,
index d76353035b8ce2ef8c9571c9c35717790e15108b..852c8f553b91a531fcb82f48b9c94efec85d4bb6 100644 (file)
@@ -107,7 +107,8 @@ VRY_Create(const struct sess *sp)
                                e--;
                        /* Encode two byte length and contents */
                        l = e - h;
-                       vsb_printf(sb, "%c%c", l >> 8, l & 0xff);
+                       assert(!(l & ~0xffff));
+                       vsb_printf(sb, "%c%c", (unsigned)l >> 8, l & 0xff);
                        vsb_bcat(sb, h, e - h);
                } else {
                        /* Mark as "not present" */