[master] b6b979072 Flexelint vmin/vmax

Nils Goroll nils.goroll at uplex.de
Tue Jul 11 19:41:05 UTC 2023


commit b6b97907206561dd95cc35aebae4913406200277
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jul 11 21:39:18 2023 +0200

    Flexelint vmin/vmax
    
    someone(tm) should have checked the history and found
    9fd79a7cb69aad1597101aca6608d8bf8c03952d

diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index f989d001c..be3d6fd67 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -272,7 +272,7 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
 			(void)h2_cond_wait(h2->winupd_cond, h2, r2);
 
 		if (h2_errcheck(r2, h2) == 0) {
-			w = vmin(h2_win_limit(r2, h2), wanted);
+			w = vmin_t(int64_t, h2_win_limit(r2, h2), wanted);
 			h2_win_charge(r2, h2, w);
 			assert (w > 0);
 		}
diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index 427392873..4d8abe18a 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -157,7 +157,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
 
 	AZ(VFIL_fsinfo(fd, &bs, &fssize, NULL));
 	/* Increase granularity if it is lower than the filesystem block size */
-	*granularity = vmax(*granularity, bs);
+	*granularity = vmax_t(unsigned, *granularity, bs);
 
 	if ((size == NULL || *size == '\0') && st.st_size != 0) {
 		/*


More information about the varnish-commit mailing list