Commit b0b5eaa1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Flexelinting

parent c310f04b
......@@ -133,8 +133,8 @@ client_tcp_connect(struct vtclog *vl, const char *addr, double tmo,
static int v_matchproto_(vus_resolved_f)
uds_open(void *priv, const struct sockaddr_un *uds)
{
double *p, tmo;
int s, i;
double *p;
int s, i, tmo;
struct pollfd fds[1];
socklen_t sl = sizeof(*uds);
......@@ -142,14 +142,14 @@ uds_open(void *priv, const struct sockaddr_un *uds)
AN(uds);
p = priv;
assert(*p > 0.);
tmo = *p * 1e3;
tmo = (int)(*p * 1e3);
s = socket(uds->sun_family, SOCK_STREAM, 0);
if (s < 0)
return (s);
(void) VTCP_nonblocking(s);
i = connect(s, (const struct sockaddr *)uds, sl);
i = connect(s, (const void*)uds, sl);
if (i == 0)
return(s);
if (errno != EINPROGRESS) {
......
......@@ -395,7 +395,7 @@ HPK_EncHdr(struct hpk_iter *iter, const struct hpk_hdr *h)
switch (h->t) {
case hpk_idx:
*iter->buf = 0x80;
num_encode(iter, 7, h->i);
assert(num_encode(iter, 7, h->i) != hpk_err);
return (ITER_DONE(iter));
case hpk_inc:
*iter->buf = 0x40;
......
......@@ -836,7 +836,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
{
int bodylen = 0;
char *b, *c;
char *nullbody = NULL;
char *nullbody;
int nolen = 0;
int l;
......@@ -1727,7 +1727,7 @@ cmd_http_settings(CMD_ARGS)
if (*p != '\0')
vtc_fatal(hp->vl, "-dectbl takes an integer as "
"argument (found %s)", av[1]);
HPK_ResizeTbl(hp->decctx, n);
assert(HPK_ResizeTbl(hp->decctx, n) != hpk_err);
av++;
} else
vtc_fatal(vl, "Unknown settings spec: %s\n", *av);
......
......@@ -829,8 +829,8 @@ receive_frame(void *priv)
continue;
}
AZ(pthread_mutex_unlock(&hp->mtx));
if (!vtc_error)
AZ(vsb);
if (vsb != NULL)
VSB_destroy(&vsb);
return (NULL);
}
......@@ -1238,19 +1238,19 @@ cmd_sendhex(CMD_ARGS)
VSB_destroy(&vsb);
}
#define ENC(hdr, k, v) \
{ \
AN(k); \
hdr.key.ptr = strdup(k); \
AN(hdr.key.ptr); \
hdr.key.len = strlen(k); \
AN(v); \
hdr.value.ptr = strdup(v); \
AN(hdr.value.ptr); \
hdr.value.len = strlen(v); \
(void)HPK_EncHdr(iter, &hdr); \
free(hdr.key.ptr); \
free(hdr.value.ptr); \
#define ENC(hdr, k, v) \
{ \
AN(k); \
hdr.key.ptr = strdup(k); \
AN(hdr.key.ptr); \
hdr.key.len = strlen(k); \
AN(v); \
hdr.value.ptr = strdup(v); \
AN(hdr.value.ptr); \
hdr.value.len = strlen(v); \
assert(HPK_EncHdr(iter, &hdr) != hpk_err); \
free(hdr.key.ptr); \
free(hdr.value.ptr); \
}
#define STR_ENC(av, field, str) \
......@@ -1452,7 +1452,7 @@ cmd_tx11obj(CMD_ARGS)
else if (AV_IS("-idxHdr")) {
hdr.t = hpk_idx;
STRTOU32_CHECK(hdr.i, av, p, vl, "-idxHdr", 0);
HPK_EncHdr(iter, &hdr);
assert(HPK_EncHdr(iter, &hdr) != hpk_err);
}
else if (AV_IS("-litIdxHdr")) {
av++;
......@@ -1469,7 +1469,7 @@ cmd_tx11obj(CMD_ARGS)
hdr.key.ptr = NULL;
hdr.key.len = 0;
STR_ENC(av, value, "third -litHdr");
HPK_EncHdr(iter, &hdr);
assert(HPK_EncHdr(iter, &hdr) != hpk_err);
}
else if (AV_IS("-litHdr")) {
av++;
......@@ -1482,7 +1482,7 @@ cmd_tx11obj(CMD_ARGS)
STR_ENC(av, key, "second -litHdr");
STR_ENC(av, value, "fourth -litHdr");
HPK_EncHdr(iter, &hdr);
assert(HPK_EncHdr(iter, &hdr) != hpk_err);
}
else if (AV_IS("-nostrend")) {
f.flags &= ~END_STREAM;
......@@ -1852,7 +1852,7 @@ cmd_txsettings(CMD_ARGS)
}
else if (!strcmp(*av, "-hdrtbl")) {
PUT_KV(av, vl, hdrtbl, val, 0x1);
HPK_ResizeTbl(s->hp->decctx, val);
assert(HPK_ResizeTbl(s->hp->decctx, val) != hpk_err);
}
else if (!strcmp(*av, "-maxstreams"))
PUT_KV(av, vl, maxstreams, val, 0x3);
......@@ -2726,9 +2726,9 @@ b64_settings(const struct http *hp, const char *s)
if (v == 1) {
if (hp->sfd)
HPK_ResizeTbl(hp->encctx, v);
assert(HPK_ResizeTbl(hp->encctx, v) != hpk_err);
else
HPK_ResizeTbl(hp->decctx, v);
assert(HPK_ResizeTbl(hp->decctx, v) != hpk_err);
}
vtc_log(hp->vl, 4, "Upgrade: %s (%d): %ju",
......
......@@ -168,7 +168,7 @@ server_listen_uds(struct server *s, const char **errp)
*/
m = umask(0);
s->sock = VUS_resolver(s->listen, uds_listen, &h, errp);
umask(m);
(void)umask(m);
if (*errp != NULL)
return;
assert(s->sock > 0);
......
......@@ -65,7 +65,7 @@ struct varnish {
int fds[4];
pid_t pid;
float syntax;
double syntax;
pthread_t tp;
pthread_t tp_vsl;
......
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