Commit 73e85b57 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Be agnostic about size of VCL_INT and VCL_BYTES

parent a60d8d95
......@@ -462,11 +462,11 @@ VRT_IP_string(VRT_CTX, VCL_IP ip)
}
VCL_STRING v_matchproto_()
VRT_INT_string(VRT_CTX, long num)
VRT_INT_string(VRT_CTX, VCL_INT num)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
return (WS_Printf(ctx->ws, "%ld", num));
return (WS_Printf(ctx->ws, "%jd", (intmax_t)num));
}
VCL_STRING v_matchproto_()
......@@ -499,7 +499,7 @@ VRT_BACKEND_string(VCL_BACKEND d)
}
VCL_STRING v_matchproto_()
VRT_BOOL_string(unsigned val)
VRT_BOOL_string(VCL_BOOL val)
{
return (val ? "true" : "false");
......
......@@ -581,8 +581,9 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
}
assert(b->len >= 0);
if (off + n > b->len) {
VERR(ctx, "size %lld from offset %lld requires more bytes than "
"blob length %d in blob.sub()", n, off, b->len);
VERR(ctx, "size %jd from offset %jd requires more bytes than "
"blob length %d in blob.sub()",
(intmax_t)n, (intmax_t)off, b->len);
return NULL;
}
......@@ -595,7 +596,7 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
return NULL;
}
if ((sub->priv = WS_Alloc(ctx->ws, n)) == NULL) {
VERRNOMEM(ctx, "Allocating %lld bytes in blob.sub()", n);
VERRNOMEM(ctx, "Allocating %jd bytes in blob.sub()", (intmax_t)n);
WS_Reset(ctx->ws, snap);
return NULL;
}
......
......@@ -278,9 +278,9 @@ shardcfg_hashcircle(struct sharddir *shardd, VCL_INT replicas)
for (i = 0; i < shardd->n_backend; i++)
for (j = 0; j < replicas; j++)
SHDBG(SHDBG_CIRCLE, shardd,
"hashcircle[%5ld] = "
"hashcircle[%5jd] = "
"{point = %8x, host = %2u}\n",
i * replicas + j,
(intmax_t)(i * replicas + j),
shardd->hashcircle[i * replicas + j].point,
shardd->hashcircle[i * replicas + j].host);
}
......
......@@ -506,8 +506,9 @@ shard_param_args(VRT_CTX,
}
if (key_int < 0 || key_int > UINT32_MAX) {
VRT_fail(ctx, "%s %s: "
"invalid key argument %ld with by=%s",
who, p->vcl_name, key_int, by_s);
"invalid key argument %jd with by=%s",
who, p->vcl_name,
(intmax_t)key_int, by_s);
return (NULL);
}
assert(key_int >= 0);
......@@ -561,8 +562,8 @@ shard_param_args(VRT_CTX,
if (args & arg_alt) {
if (alt < 0) {
VRT_fail(ctx, "%s %s: "
"invalid alt argument %ld",
who, p->vcl_name, alt);
"invalid alt argument %jd",
who, p->vcl_name, (intmax_t)alt);
return (NULL);
}
p->alt = alt;
......
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