signedness fixes

reported by flexelint
parent ea5917c6
...@@ -320,7 +320,6 @@ VPX_tlv(const struct req *req, int typ, void **dst, int *len) ...@@ -320,7 +320,6 @@ VPX_tlv(const struct req *req, int typ, void **dst, int *len)
static int static int
vpx_proto2(const struct worker *wrk, struct req *req) vpx_proto2(const struct worker *wrk, struct req *req)
{ {
int l, hdr_len;
uintptr_t *up; uintptr_t *up;
uint16_t tlv_len; uint16_t tlv_len;
const uint8_t *p, *ap, *pp; const uint8_t *p, *ap, *pp;
...@@ -333,7 +332,7 @@ vpx_proto2(const struct worker *wrk, struct req *req) ...@@ -333,7 +332,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
char pb[VTCP_PORTBUFSIZE]; char pb[VTCP_PORTBUFSIZE];
struct vpx_tlv_iter vpi[1], vpi2[1]; struct vpx_tlv_iter vpi[1], vpi2[1];
struct vpx_tlv *tlv; struct vpx_tlv *tlv;
unsigned flen, alen; unsigned l, hdr_len, flen, alen;
unsigned const plen = 2, aoff = 16; unsigned const plen = 2, aoff = 16;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
...@@ -343,7 +342,7 @@ vpx_proto2(const struct worker *wrk, struct req *req) ...@@ -343,7 +342,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
assert(req->htc->rxbuf_e - req->htc->rxbuf_b >= 16L); assert(req->htc->rxbuf_e - req->htc->rxbuf_b >= 16L);
l = vbe16dec(req->htc->rxbuf_b + 14); l = vbe16dec(req->htc->rxbuf_b + 14);
hdr_len = l + 16L; hdr_len = l + 16L;
assert(req->htc->rxbuf_e - req->htc->rxbuf_b >= hdr_len); assert(req->htc->rxbuf_e >= req->htc->rxbuf_b + hdr_len);
HTC_RxPipeline(req->htc, req->htc->rxbuf_b + hdr_len); HTC_RxPipeline(req->htc, req->htc->rxbuf_b + hdr_len);
WS_Rollback(req->ws, 0); WS_Rollback(req->ws, 0);
p = (const void *)req->htc->rxbuf_b; p = (const void *)req->htc->rxbuf_b;
...@@ -398,7 +397,7 @@ vpx_proto2(const struct worker *wrk, struct req *req) ...@@ -398,7 +397,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
if (l < flen) { if (l < flen) {
VSL(SLT_ProxyGarbage, req->sp->vxid, VSL(SLT_ProxyGarbage, req->sp->vxid,
"PROXY2: Ignoring short %s addresses (%d)", "PROXY2: Ignoring short %s addresses (%u)",
pfam == AF_INET ? "IPv4" : "IPv6", l); pfam == AF_INET ? "IPv4" : "IPv6", l);
return (0); return (0);
} }
......
...@@ -115,7 +115,7 @@ vcc_acl_chk(struct vcc *tl, const struct acl_e *ae, const int l, ...@@ -115,7 +115,7 @@ vcc_acl_chk(struct vcc *tl, const struct acl_e *ae, const int l,
assert (ll >= 0); assert (ll >= 0);
m %= 8; m %= 8;
if (m && (*p << m & 0xff) != 0) { if (m && (*p << m & UINT8_C(0xff)) != 0) {
ret = 1; ret = 1;
m = 0xff00 >> m; m = 0xff00 >> m;
*p &= m; *p &= m;
......
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