[master] 64f7181b1 Polish min usage for SunCC
Nils Goroll
nils.goroll at uplex.de
Mon Nov 8 17:03:06 UTC 2021
commit 64f7181b1d337309e2bcae8a10be5f626f009e36
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Nov 8 18:01:38 2021 +0100
Polish min usage for SunCC
Fixes: left operand must be modifiable lvalue: op "="
diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index 172bb35b2..fcbe0153a 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -218,7 +218,7 @@ h2_win_limit(const struct h2_req *r2, const struct h2_sess *h2)
CHECK_OBJ_NOTNULL(h2->req0, H2_REQ_MAGIC);
Lck_AssertHeld(&h2->sess->mtx);
- return (vmin(r2->t_window, h2->req0->t_window));
+ return (vmin_t(int64_t, r2->t_window, h2->req0->t_window));
}
static void
diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c
index d78288db9..4ee895157 100644
--- a/lib/libvcc/vcc_acl.c
+++ b/lib/libvcc/vcc_acl.c
@@ -105,7 +105,7 @@ vcl_acl_cmp(const struct acl_e *ae1, const struct acl_e *ae2)
p1 = ae1->data;
p2 = ae2->data;
- m = vmin(ae1->mask, ae2->mask);
+ m = vmin_t(unsigned, ae1->mask, ae2->mask);
for (; m >= 8; m -= 8) {
CMP(*p1, *p2);
p1++;
diff --git a/vmod/vmod_directors_shard_cfg.c b/vmod/vmod_directors_shard_cfg.c
index 438609063..3d3c6de11 100644
--- a/vmod/vmod_directors_shard_cfg.c
+++ b/vmod/vmod_directors_shard_cfg.c
@@ -282,7 +282,7 @@ shardcfg_hashcircle(struct sharddir *shardd)
rmax = (UINT32_MAX - 1) / shardd->n_backend;
for (b = backends; b < backends + shardd->n_backend; b++) {
CHECK_OBJ_NOTNULL(b->backend, DIRECTOR_MAGIC);
- n_points += vmin(b->replicas, rmax);
+ n_points += vmin_t(uint32_t, b->replicas, rmax);
}
assert(n_points < UINT32_MAX);
@@ -298,7 +298,7 @@ shardcfg_hashcircle(struct sharddir *shardd)
AN(ident);
assert(ident[0] != '\0');
- r = vmin(b->replicas, rmax);
+ r = vmin_t(uint32_t, b->replicas, rmax);
for (j = 0; j < r; j++) {
assert(snprintf(s, len, "%d", j) < len);
More information about the varnish-commit
mailing list