[master] 33ed161 More Flexelinting

Poul-Henning Kamp phk at FreeBSD.org
Fri Mar 9 09:53:06 UTC 2018


commit 33ed16191d786a878787fb97bd23f562f6a60d24
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Mar 9 09:52:26 2018 +0000

    More Flexelinting

diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index fdc773a..3f72597 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -187,14 +187,14 @@ update(void)
 		    scale, nhist, delay);
 
 	for (j = 2; j < LINES - 3; j += 5)
-		mvprintw(j, 0, "%u_", (LINES - 3 - j) * scale);
+		mvprintw(j, 0, "%u_", ((LINES - 3) - j) * scale);
 
 	/* show them */
 	for (i = 0; i < n; ++i) {
 		for (j = 0; j < bm[i] / scale; ++j)
-			(void)mvaddch(LINES - 3 - j, i, '#');
+			(void)mvaddch((LINES - 3) - j, i, '#');
 		for (; j < (bm[i] + bh[i]) / scale; ++j)
-			(void)mvaddch(LINES - 3 - j, i, '|');
+			(void)mvaddch((LINES - 3) - j, i, '|');
 	}
 
 	refresh();
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index f4307b6..8f917d4 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -2704,9 +2704,9 @@ b64_settings(const struct http *hp, const char *s)
 			if (*s >= 'A' && *s <= 'Z')
 				v |= (uint64_t)(*s - 'A') << shift;
 			else if (*s >= 'a' && *s <= 'z')
-				v |= (uint64_t)(*s - 'a' + 26) << shift;
+				v |= (uint64_t)((*s - 'a') + 26) << shift;
 			else if (*s >= '0' && *s <= '9')
-				v |= (uint64_t)(*s - '0' + 52) << shift;
+				v |= (uint64_t)((*s - '0') + 52) << shift;
 			else if (*s == '-')
 				v |= (uint64_t)62 << shift;
 			else if (*s == '_')
diff --git a/flint.lnt b/flint.lnt
index e49efe5..a585940 100644
--- a/flint.lnt
+++ b/flint.lnt
@@ -215,5 +215,7 @@
 -e459	// unlocked access from func-ptr
 -e679	// Suspicious Truncation in arithmetic expression combining with pointer
 -e712	// Loss of precision (___) (___ to ___)
+-e713	// Loss of precision (___) (___ to ___)
 -e732	// Loss of sign (___) (___ to ___)
+-e734	// Loss of precision (___) (___ bits to ___ bits)
 -e747	// Significant prototype coercion (___) ___ to ___
diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c
index c5cf838..36d7377 100644
--- a/lib/libvarnishapi/vsm.c
+++ b/lib/libvarnishapi/vsm.c
@@ -176,7 +176,7 @@ vsm_mapseg(struct vsm *vd, struct vsm_seg *vg)
 	sz = strtoul(vg->av[3], NULL, 10);
 	assert(sz > 0);
 	assert(of >= off);
-	len = RUP2(of - off + sz, ps);
+	len = RUP2((of - off) + sz, ps);
 
 	vsb = VSB_new_auto();
 	AN(vsb);


More information about the varnish-commit mailing list