]> err.no Git - varnish/commitdiff
Make flexelint happier
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Sep 2006 07:36:33 +0000 (07:36 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Sep 2006 07:36:33 +0000 (07:36 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1061 d4fa192b-c00b-0410-8231-f00ffab90ce4

12 files changed:
varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_http.c
varnish-cache/bin/varnishd/cache_pool.c
varnish-cache/bin/varnishd/cache_session.c
varnish-cache/bin/varnishd/cache_vrt_acl.c
varnish-cache/bin/varnishd/flint.lnt
varnish-cache/bin/varnishd/mgt_child.c
varnish-cache/bin/varnishd/mgt_param.c
varnish-cache/bin/varnishd/shmlog.c
varnish-cache/bin/varnishd/varnishd.c

index 65d00b50036ee0f5351524d09c24fbe21b573180..c95739517fda0840a15e6dae9e7dbf3be31de127 100644 (file)
@@ -124,8 +124,6 @@ struct worker {
 };
 
 struct workreq {
-       unsigned                magic;
-#define WORKREQ_MAGIC          0x5ccb4eb2
        TAILQ_ENTRY(workreq)    list;
        struct sess             *sess;
 };
@@ -342,7 +340,6 @@ void http_SetResp(struct worker *w, int fd, struct http *to, const char *proto,
 void http_FilterHeader(struct worker *w, int fd, struct http *to, struct http *fm, unsigned how);
 void http_PrintfHeader(struct worker *w, int fd, struct http *to, const char *fmt, ...);
 void http_SetHeader(struct worker *w, int fd, struct http *to, const char *hdr);
-int http_IsHdr(struct http_hdr *hh, char *hdr);
 void http_Setup(struct http *ht, void *space, unsigned len);
 int http_GetHdr(struct http *hp, const char *hdr, char **ptr);
 int http_GetHdrField(struct http *hp, const char *hdr, const char *field, char **ptr);
@@ -396,7 +393,6 @@ void VSL(enum shmlogtag tag, unsigned id, const char *fmt, ...);
 void WSLR(struct worker *w, enum shmlogtag tag, unsigned id, const char *b, const char *e);
 void WSL(struct worker *w, enum shmlogtag tag, unsigned id, const char *fmt, ...);
 void WSL_Flush(struct worker *w);
-#define HERE() VSL(SLT_Debug, 0, "HERE: %s(%d)", __func__, __LINE__)
 #define INCOMPL() do {                                                 \
        VSL(SLT_Debug, 0, "INCOMPLETE AT: %s(%d)", __func__, __LINE__); \
        fprintf(stderr,"INCOMPLETE AT: %s(%d)\n", (const char *)__func__, __LINE__);    \
index 0eb36af0b4f0f9b6dc078e29835bf44bc1c7b598..79567178a5d54849f1c9c9a38eb001dc02047f63 100644 (file)
@@ -33,7 +33,7 @@ static struct kevent ki[NKEV];
 static unsigned nki;
 
 static void
-vca_kq_sess(struct sess *sp, int arm)
+vca_kq_sess(struct sess *sp, short arm)
 {
 
        CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
index d19e879e5da59bf04c63765aa9ea8baff867a6e9..2b8bd2ed3df7de314202abada531af1dedde4e0b 100644 (file)
@@ -35,7 +35,6 @@ DOT start -> RECV
 #include <unistd.h>
 
 #include "shmlog.h"
-#include "heritage.h"
 #include "vcl.h"
 #include "cache.h"
 
index 54cdf7b069c74af1059ff22b4d8c46be5ea83ff7..6cd83d1b9d5f2514fcf29e9666e19a5e16d88aaf 100644 (file)
@@ -58,9 +58,6 @@ T(struct http *hp, enum httptag t)
        return (logmtx[hp->logtag][t]);
 }
 
-#define VSLH(ax, bx, cx, dx) \
-       VSLR(T((cx), (ax)), (bx), (cx)->hd[(dx)].b, (cx)->hd[(dx)].e);
-
 #define WSLH(wx, ax, bx, cx, dx) \
        WSLR(wx, T((cx), (ax)), (bx), (cx)->hd[(dx)].b, (cx)->hd[(dx)].e);
 
@@ -85,7 +82,7 @@ http_Setup(struct http *hp, void *space, unsigned len)
 /*--------------------------------------------------------------------*/
 
 
-int
+static int
 http_IsHdr(struct http_hdr *hh, char *hdr)
 {
        unsigned l;
index ef9849f6b49d1732a1505c172f2570265935a6e5..44f49760e5816f5972d82578605869fc66c2de08 100644 (file)
@@ -240,7 +240,7 @@ WRK_QueueSession(struct sess *sp)
        struct worker *w;
        pthread_t tp;
        struct wq *qp;
-       static unsigned nq;
+       static unsigned nq = 0;
        unsigned onq;
 
        onq = nq + 1;
index 2dc01d9e04f17b90156828e3c307560e5a8500b6..1d69bdaf335b9681835d5eb6e3a3f02a12c47582 100644 (file)
@@ -76,7 +76,7 @@ static struct srcaddrhead {
        MTX                     mtx;
 } *srchash;
        
-unsigned                       nsrchash;
+static unsigned                        nsrchash;
 static MTX                     stat_mtx;
 
 /*--------------------------------------------------------------------
index 51bd3c86b69f0434433e165c93237c51512c3838..bc7ce8d777a3b6631b1d6087f4863d4593e39009 100644 (file)
@@ -21,9 +21,9 @@
 #include <netinet/in.h>
 
 
-static unsigned ipv4mask[] = {
+static uint32_t ipv4mask[] = {
        [0]     =       0xffffffff,
-#define M(n)   [n] = (0xffffffff << (32 - n))
+#define M(n)   [n] = (uint32_t)((uint64_t)0xffffffff << (32 - n))
         M( 1), M( 2), M( 3), M( 4), M( 5), M( 6), M( 7), M( 8), M( 9), M(10),
         M(11), M(12), M(13), M(14), M(15), M(16), M(17), M(18), M(19), M(20),
         M(21), M(22), M(23), M(24), M(25), M(26), M(27), M(28), M(29), M(30),
index 6c5f2b8af822b9a10e4916fbe3732986f0b5e2e9..9d9ab0a46baefa4ec47c79a9b41a5b9a2ec49849 100644 (file)
@@ -1,6 +1,7 @@
 -passes=3
 
 +libh mgt_event.h
++libh ../../config.h
 
 -header(../../config.h)
 
@@ -20,7 +21,9 @@
 -e786  // String concatenation within initializer
 
 -emacro(740, TAILQ_PREV) // Unusual pointer cast (incompatible indirect types)
+-emacro(740, TAILQ_LAST) // Unusual pointer cast (incompatible indirect types)
 -emacro((826), TAILQ_PREV) // Suspicious pointer-to-pointer conversion (area too small)
+-emacro((826), TAILQ_LAST) // Suspicious pointer-to-pointer conversion (area too small)
 
 
 -esym(534, printf)     // Ignoring return value of function
index 8ff3babf3c5b75dc965e8b2db69e29fd7daa9705..f9e9b24b6548c65de5613a2c00d7110192247108 100644 (file)
@@ -97,6 +97,7 @@ static void
 start_child(void)
 {
        int i;
+       unsigned u;
        char *p;
        struct ev *e;
 
@@ -170,7 +171,7 @@ start_child(void)
        AZ(close(heritage.fds[2]));
        heritage.fds[2] = -1;
        child_pid = i;
-       if (mgt_push_vcls_and_start(&i, &p)) {
+       if (mgt_push_vcls_and_start(&u, &p)) {
                fprintf(stderr, "Pushing vcls failed:\n%s\n", p);
                free(p);
                /* Pick up any stuff lingering on stdout/stderr */
index 219b353c74a786ec0e8b7f20dd9f2cb561d1b2fa..c7f20b900367f2334922172b8ea647ed6cb8f9be 100644 (file)
@@ -14,7 +14,6 @@
 #include "mgt.h"
 #include "mgt_cli.h"
 
-#include "vsb.h"
 #include "heritage.h"
 
 struct parspec;
@@ -308,10 +307,6 @@ tweak_srcaddr_ttl(struct cli *cli, struct parspec *par, const char *arg)
 #define DELAYED_EFFECT \
        "\nNB: This parameter will take some time to take effect.\n"
 
-#define SHOULD_RESTART \
-       "\nNB: This parameter will not take full effect until the " \
-       "child process has been restarted.\n"
-
 #define MUST_RESTART \
        "\nNB: This parameter will not take any effect until the " \
        "child process has been restarted.\n"
index 8a6ad565a96bb08db092e7448892240906644245..1e6cce65baf4f4f5ba799e2d5df9193e010bf474 100644 (file)
@@ -107,8 +107,7 @@ VSL(enum shmlogtag tag, unsigned id, const char *fmt, ...)
 
        va_start(ap, fmt);
 
-       p = strchr(fmt, '%');
-       if (p == NULL) {
+       if (strchr(fmt, '%') == NULL) {
                VSLR(tag, id, fmt, NULL);
                return;
        }
@@ -221,8 +220,7 @@ WSL(struct worker *w, enum shmlogtag tag, unsigned id, const char *fmt, ...)
 
        va_start(ap, fmt);
 
-       p = strchr(fmt, '%');
-       if (p == NULL) {
+       if (strchr(fmt, '%') == NULL) {
                WSLR(w, tag, id, fmt, NULL);
                return;
        }
index 74f8676ccc53c54052d9d4aaecf5b6a54bf1cad1..77652ae5ee19adea67762a3be96254ee0cba2060 100644 (file)
@@ -347,9 +347,9 @@ main(int argc, char *argv[])
        setbuf(stderr, NULL);
 
        memset(cli, 0, sizeof cli);
-       cli->sb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
-       XXXAN(cli->sb);
-       cli->result = CLIS_OK;
+       cli[0].sb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
+       XXXAN(cli[0].sb);
+       cli[0].result = CLIS_OK;
 
        heritage.socket = -1;
        memset(&param, 0, sizeof param);