Commit 679c64d0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Signed/unsigned Flexelinting

parent 1dee0bd1
...@@ -52,7 +52,7 @@ struct hpk_hdr { ...@@ -52,7 +52,7 @@ struct hpk_hdr {
struct txt key; struct txt key;
struct txt value; struct txt value;
enum hpk_indexed t; enum hpk_indexed t;
int i; unsigned i;
}; };
struct hpk_ctx; struct hpk_ctx;
......
...@@ -70,7 +70,7 @@ struct ssym { ...@@ -70,7 +70,7 @@ struct ssym {
}; };
struct stbl { struct stbl {
int msk; unsigned msk;
struct ssym *syms; struct ssym *syms;
}; };
''') ''')
......
...@@ -37,6 +37,8 @@ server s1 -listen "${tmpdir}/s1.sock" { ...@@ -37,6 +37,8 @@ server s1 -listen "${tmpdir}/s1.sock" {
barrier b1 sync barrier b1 sync
} -start } -start
varnish v1 -cliok "param.set debug +syncvsl"
varnish v1 -vcl { varnish v1 -vcl {
backend foo { backend foo {
......
...@@ -104,7 +104,7 @@ void vtc_fatal(struct vtclog *vl, const char *, ...) ...@@ -104,7 +104,7 @@ void vtc_fatal(struct vtclog *vl, const char *, ...)
v_noreturn_ v_printflike_(2,3); v_noreturn_ v_printflike_(2,3);
void vtc_dump(struct vtclog *vl, int lvl, const char *pfx, void vtc_dump(struct vtclog *vl, int lvl, const char *pfx,
const char *str, int len); const char *str, int len);
void vtc_hexdump(struct vtclog *, int , const char *, const void *, int ); void vtc_hexdump(struct vtclog *, int , const char *, const void *, unsigned);
int vtc_send_proxy(int fd, int version, const struct suckaddr *sac, int vtc_send_proxy(int fd, int version, const struct suckaddr *sac,
const struct suckaddr *sas); const struct suckaddr *sas);
......
...@@ -54,9 +54,9 @@ struct barrier { ...@@ -54,9 +54,9 @@ struct barrier {
pthread_mutex_t mtx; pthread_mutex_t mtx;
pthread_cond_t cond; pthread_cond_t cond;
unsigned waiters; int waiters;
unsigned expected; int expected;
unsigned cyclic; int cyclic;
enum barrier_e type; enum barrier_e type;
/* fields below are only for BARRIER_SOCK */ /* fields below are only for BARRIER_SOCK */
......
...@@ -59,7 +59,7 @@ struct client { ...@@ -59,7 +59,7 @@ struct client {
char *proxy_spec; char *proxy_spec;
int proxy_version; int proxy_version;
unsigned repeat; int repeat;
unsigned keepalive; unsigned keepalive;
unsigned running; unsigned running;
...@@ -200,7 +200,7 @@ client_thread(void *priv) ...@@ -200,7 +200,7 @@ client_thread(void *priv)
struct client *c; struct client *c;
struct vtclog *vl; struct vtclog *vl;
int fd; int fd;
unsigned u; int i;
struct vsb *vsb; struct vsb *vsb;
const char *err; const char *err;
...@@ -218,7 +218,7 @@ client_thread(void *priv) ...@@ -218,7 +218,7 @@ client_thread(void *priv)
if (c->repeat != 1) if (c->repeat != 1)
vtc_log(vl, 2, "Started (%u iterations%s)", c->repeat, vtc_log(vl, 2, "Started (%u iterations%s)", c->repeat,
c->keepalive ? " using keepalive" : ""); c->keepalive ? " using keepalive" : "");
for (u = 0; u < c->repeat; u++) { for (i = 0; i < c->repeat; i++) {
char *addr = VSB_data(vsb); char *addr = VSB_data(vsb);
vtc_log(vl, 3, "Connect to %s", addr); vtc_log(vl, 3, "Connect to %s", addr);
...@@ -237,7 +237,7 @@ client_thread(void *priv) ...@@ -237,7 +237,7 @@ client_thread(void *priv)
fd = http_process(vl, c->spec, fd, NULL, addr, fd = http_process(vl, c->spec, fd, NULL, addr,
c->rcvbuf); c->rcvbuf);
else else
while (fd >= 0 && u++ < c->repeat) while (fd >= 0 && i++ < c->repeat)
fd = http_process(vl, c->spec, fd, NULL, addr, fd = http_process(vl, c->spec, fd, NULL, addr,
c->rcvbuf); c->rcvbuf);
vtc_log(vl, 3, "closing fd %d", fd); vtc_log(vl, 3, "closing fd %d", fd);
......
...@@ -254,11 +254,14 @@ str_decode(struct hpk_iter *iter, struct txt *t) ...@@ -254,11 +254,14 @@ str_decode(struct hpk_iter *iter, struct txt *t)
{ {
uint32_t num; uint32_t num;
int huff; int huff;
assert(iter->buf < iter->end); assert(iter->buf < iter->end);
huff = (*iter->buf & 0x80); huff = (*iter->buf & 0x80);
if (hpk_more != num_decode(&num, iter, 7)) if (hpk_more != num_decode(&num, iter, 7))
return (hpk_err); return (hpk_err);
if (num > iter->end - iter->buf) assert(iter->buf < iter->end);
if (num > (unsigned)(iter->end - iter->buf))
return (hpk_err); return (hpk_err);
if (huff) { /*Huffman encoding */ if (huff) { /*Huffman encoding */
t->ptr = malloc((num * 8L) / 5L + 1L); t->ptr = malloc((num * 8L) / 5L + 1L);
......
...@@ -569,7 +569,8 @@ static void ...@@ -569,7 +569,8 @@ static void
parse_settings(const struct stream *s, struct frame *f) parse_settings(const struct stream *s, struct frame *f)
{ {
struct http *hp; struct http *hp;
int i, t, v; int t, v;
unsigned u;
const char *buf; const char *buf;
enum hpk_result r; enum hpk_result r;
CHECK_OBJ_NOTNULL(f, FRAME_MAGIC); CHECK_OBJ_NOTNULL(f, FRAME_MAGIC);
...@@ -580,19 +581,19 @@ parse_settings(const struct stream *s, struct frame *f) ...@@ -580,19 +581,19 @@ parse_settings(const struct stream *s, struct frame *f)
vtc_fatal(hp->vl, vtc_fatal(hp->vl,
"Size should be a multiple of 6, but isn't (%d)", f->size); "Size should be a multiple of 6, but isn't (%d)", f->size);
for (i = 0; i <= SETTINGS_MAX; i++) for (u = 0; u <= SETTINGS_MAX; u++)
f->md.settings[i] = NAN; f->md.settings[u] = NAN;
for (i = 0; i < f->size;) { for (u = 0; u < f->size;) {
t = vbe16dec(f->data + i); t = vbe16dec(f->data + u);
i += 2; u += 2;
v = vbe32dec(f->data + i); v = vbe32dec(f->data + u);
if (t <= SETTINGS_MAX) { if (t <= SETTINGS_MAX) {
buf = h2_settings[t]; buf = h2_settings[t];
f->md.settings[t] = v; f->md.settings[t] = v;
} else } else
buf = "unknown"; buf = "unknown";
i += 4; u += 4;
if (t == 1) { if (t == 1) {
r = HPK_ResizeTbl(s->hp->encctx, v); r = HPK_ResizeTbl(s->hp->encctx, v);
...@@ -2116,7 +2117,7 @@ cmd_rxhdrs(CMD_ARGS) ...@@ -2116,7 +2117,7 @@ cmd_rxhdrs(CMD_ARGS)
char *p; char *p;
int loop = 0; int loop = 0;
unsigned long int times = 1; unsigned long int times = 1;
int rcv = 0; unsigned rcv = 0;
enum h2_type expect = TYPE_HEADERS; enum h2_type expect = TYPE_HEADERS;
(void)cmd; (void)cmd;
...@@ -2155,7 +2156,7 @@ cmd_rxcont(CMD_ARGS) ...@@ -2155,7 +2156,7 @@ cmd_rxcont(CMD_ARGS)
char *p; char *p;
int loop = 0; int loop = 0;
unsigned long int times = 1; unsigned long int times = 1;
int rcv = 0; unsigned rcv = 0;
(void)cmd; (void)cmd;
(void)av; (void)av;
...@@ -2206,7 +2207,7 @@ cmd_rxdata(CMD_ARGS) ...@@ -2206,7 +2207,7 @@ cmd_rxdata(CMD_ARGS)
char *p; char *p;
int loop = 0; int loop = 0;
unsigned long int times = 1; unsigned long int times = 1;
int rcv = 0; unsigned rcv = 0;
(void)cmd; (void)cmd;
(void)av; (void)av;
...@@ -2307,7 +2308,7 @@ cmd_rxpush(CMD_ARGS) ...@@ -2307,7 +2308,7 @@ cmd_rxpush(CMD_ARGS)
char *p; char *p;
int loop = 0; int loop = 0;
unsigned long int times = 1; unsigned long int times = 1;
int rcv = 0; unsigned rcv = 0;
enum h2_type expect = TYPE_PUSH_PROMISE; enum h2_type expect = TYPE_PUSH_PROMISE;
(void)cmd; (void)cmd;
......
...@@ -148,7 +148,7 @@ vtc_leadin(const struct vtclog *vl, int lvl, const char *fmt, ...) ...@@ -148,7 +148,7 @@ vtc_leadin(const struct vtclog *vl, int lvl, const char *fmt, ...)
static void static void
vtc_log_emit(const struct vtclog *vl) vtc_log_emit(const struct vtclog *vl)
{ {
int l; unsigned l;
l = VSB_len(vl->vsb); l = VSB_len(vl->vsb);
if (l == 0) if (l == 0)
...@@ -232,7 +232,7 @@ vtc_dump(struct vtclog *vl, int lvl, const char *pfx, const char *str, int len) ...@@ -232,7 +232,7 @@ vtc_dump(struct vtclog *vl, int lvl, const char *pfx, const char *str, int len)
void void
vtc_hexdump(struct vtclog *vl, int lvl, const char *pfx, vtc_hexdump(struct vtclog *vl, int lvl, const char *pfx,
const void *ptr, int len) const void *ptr, unsigned len)
{ {
int nl = 1; int nl = 1;
unsigned l; unsigned l;
......
...@@ -50,7 +50,7 @@ struct server { ...@@ -50,7 +50,7 @@ struct server {
VTAILQ_ENTRY(server) list; VTAILQ_ENTRY(server) list;
char run; char run;
unsigned repeat; int repeat;
unsigned keepalive; unsigned keepalive;
char *spec; char *spec;
......
...@@ -51,7 +51,7 @@ struct syslog_srv { ...@@ -51,7 +51,7 @@ struct syslog_srv {
VTAILQ_ENTRY(syslog_srv) list; VTAILQ_ENTRY(syslog_srv) list;
char run; char run;
unsigned repeat; int repeat;
char *spec; char *spec;
int sock; int sock;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment