From: phk Date: Thu, 16 Mar 2006 12:14:59 +0000 (+0000) Subject: cleanup X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e418260b9b01f64a4e8bad2393714922d34cda0;p=varnish cleanup git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@57 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_main.c b/varnish-cache/bin/varnishd/cache_main.c index 0aafb320..6cb3c350 100644 --- a/varnish-cache/bin/varnishd/cache_main.c +++ b/varnish-cache/bin/varnishd/cache_main.c @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -12,6 +13,7 @@ #include #include "heritage.h" +#include "cli_event.h" static struct event ev_keepalive; @@ -55,7 +57,7 @@ cli_func_ping(struct cli *cli, char **av, void *priv __unused) /*--------------------------------------------------------------------*/ static struct cli_proto cli_proto[] = { - { CLI_PING }, + { CLI_PING, cli_func_ping }, { NULL } }; diff --git a/varnish-cache/bin/varnishd/cli_event.c b/varnish-cache/bin/varnishd/cli_event.c index 10e5fd17..8621efe4 100644 --- a/varnish-cache/bin/varnishd/cli_event.c +++ b/varnish-cache/bin/varnishd/cli_event.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,7 @@ cli_result(struct cli *cli, unsigned res) static void encode_output(struct cli *cli) { - const char *p, *q; + char *p, *q; if (cli->verbose) { if (cli->result != CLIS_OK) @@ -64,7 +65,7 @@ encode_output(struct cli *cli) } evbuffer_add_printf(cli->bev1->output, "%d \"", cli->result); for (p = q = sbuf_data(cli->sb); *p != '\0'; p++) { - if (*p != '"' && *p != '\\' && isgraph(*p) || *p == ' ') + if ((*p != '"' && *p != '\\' && isgraph(*p)) || *p == ' ') continue; if (p != q) evbuffer_add(cli->bev1->output, q, p - q); @@ -83,10 +84,7 @@ static void rdcb(struct bufferevent *bev, void *arg) { const char *p; - char **av; struct cli *cli = arg; - unsigned u; - struct cli_proto *cp; p = evbuffer_readline(bev->input); if (p == NULL) diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index 2d81c1f1..6a688668 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -2,14 +2,16 @@ * $Id$ */ -#include #include +#include +#include +#include +#include #include #include #include +#include #include -#include -#include #include @@ -27,7 +29,7 @@ static enum { H_STOP = 0, - H_START, + H_START } desired; static pid_t child_pid; static int child_fds[2]; @@ -55,7 +57,7 @@ static void std_wrcb(struct bufferevent *bev, void *arg) { - printf("%s(%p, %p)\n", __func__, bev, arg); + printf("%s(%p, %p)\n", __func__, (void*)bev, arg); exit (2); } @@ -63,7 +65,7 @@ static void std_excb(struct bufferevent *bev, short what, void *arg) { - printf("%s(%p, %d, %p)\n", __func__, bev, what, arg); + printf("%s(%p, %d, %p)\n", __func__, (void*)bev, what, arg); exit (2); } diff --git a/varnish-cache/lib/libvarnish/argv.c b/varnish-cache/lib/libvarnish/argv.c index 52452309..98c3a120 100644 --- a/varnish-cache/lib/libvarnish/argv.c +++ b/varnish-cache/lib/libvarnish/argv.c @@ -23,6 +23,7 @@ static int BackSlash(const char *s, int *res) { int i, r; + unsigned u; assert(*s == '\\'); r = i = 0; @@ -59,8 +60,10 @@ BackSlash(const char *s, int *res) } break; case 'x': - if (1 == sscanf(s + 1, "x%02x", &i)) + if (1 == sscanf(s + 1, "x%02x", &u)) { + i = u; r = 4; + } break; default: break; diff --git a/varnish-cache/lib/libvarnish/cli.c b/varnish-cache/lib/libvarnish/cli.c index 3a5ed102..1e665303 100644 --- a/varnish-cache/lib/libvarnish/cli.c +++ b/varnish-cache/lib/libvarnish/cli.c @@ -5,6 +5,7 @@ */ #include +#include #include #include @@ -20,7 +21,6 @@ void cli_func_help(struct cli *cli, char **av, void *priv) { - unsigned u; struct cli_proto *cp; if (av[2] == NULL) {