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

Signed/unsigned Flexelinting

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