]> err.no Git - varnish/commitdiff
cleanup
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 16 Mar 2006 12:14:59 +0000 (12:14 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 16 Mar 2006 12:14:59 +0000 (12:14 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@57 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_main.c
varnish-cache/bin/varnishd/cli_event.c
varnish-cache/bin/varnishd/varnishd.c
varnish-cache/lib/libvarnish/argv.c
varnish-cache/lib/libvarnish/cli.c

index 0aafb320a54b65db53b37131b54a9ddeb206cff8..6cb3c3506285f0e40f74c48b2332f75e51712818 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <stdio.h>
 #include <assert.h>
+#include <stdlib.h>
 #include <sys/time.h>
 
 #include <event.h>
@@ -12,6 +13,7 @@
 #include <cli_priv.h>
 
 #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 }
 };
 
index 10e5fd17d466f1cb491321b66fabbb355cccd5c4..8621efe404bb71cc44e8d61c63ca6de317813c40 100644 (file)
@@ -6,6 +6,7 @@
 #include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <ctype.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <signal.h>
@@ -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)
index 2d81c1f1ad4a47efeff69b10078b7a6e6602d0ae..6a688668263a19169f1de5aeef8d2a0d5d425259 100644 (file)
@@ -2,14 +2,16 @@
  * $Id$
  */
 
-#include <errno.h>
 #include <assert.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <time.h>
 #include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
 
 #include <sys/wait.h>
 
@@ -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);
 }
 
index 52452309cd4c72eb062657862885c15eb9f7ab8c..98c3a120adfeeaf944b131781b4aebd91b68f4bc 100644 (file)
@@ -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;
index 3a5ed102aec7d2f582446514e8aee49951c74245..1e6653031f042444bd10952569a7a6aee04f8c79 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <ctype.h>
+#include <string.h>
 #include <stdio.h>
 
 #include <cli.h>
@@ -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) {