[master] 4a9c1fd More Flexelintery

Poul-Henning Kamp phk at FreeBSD.org
Fri Apr 28 12:02:06 CEST 2017


commit 4a9c1fdca0cbd9696c9c7d99246783aa5bd7f4af
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Apr 28 10:01:28 2017 +0000

    More Flexelintery

diff --git a/bin/varnishstat/varnishstat_curses.c b/bin/varnishstat/varnishstat_curses.c
index af015d4..586ee18 100644
--- a/bin/varnishstat/varnishstat_curses.c
+++ b/bin/varnishstat/varnishstat_curses.c
@@ -1023,7 +1023,7 @@ handle_keypress(int ch)
 		break;
 	case 'G':
 		current = n_ptarray - 1;
-		page_start = current - l_points + 1;
+		page_start = (current - l_points) + 1;
 		break;
 	case 'v':
 		verbosity++;
diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index 9b60ba4..f9de433 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -491,7 +491,7 @@ ip_magic(void)
 	 * XXX: "localhost", but that doesn't work out of the box.
 	 * XXX: Things like "prefer_ipv6" parameter complicates things.
 	 */
-	fd = VSS_resolver("127.0.0.1", NULL, &bind_cb, NULL, &p);
+	fd = VSS_resolver("127.0.0.1", NULL, bind_cb, NULL, &p);
 	assert(fd >= 0);
 	VTCP_myname(fd, abuf, sizeof abuf, pbuf, sizeof(pbuf));
 	extmacro_def("localhost", "%s", abuf);
diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index af486a7..c7d48ff 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -203,10 +203,10 @@ update(int p)
 		n++;
 	AC(erase());
 	if (end_of_file)
-		AC(mvprintw(0, COLS - 1 - strlen(VUT.name) - 5, "%s (EOF)",
+		AC(mvprintw(0, (COLS - strlen(VUT.name)) - (1 + 6), "%s (EOF)",
 			VUT.name));
 	else
-		AC(mvprintw(0, COLS - 1 - strlen(VUT.name), "%s", VUT.name));
+		AC(mvprintw(0, (COLS - strlen(VUT.name)) - 1, "%s", VUT.name));
 	AC(mvprintw(0, 0, "list length %u", ntop));
 	for (tp = VRB_MIN(t_order, &h_order); tp != NULL; tp = tp2) {
 		tp2 = VRB_NEXT(t_order, &h_order, tp);
@@ -308,6 +308,7 @@ dump(void)
 	}
 }
 
+//lint -sem(usage, r_no)
 static void __attribute__((__noreturn__))
 usage(int status)
 {
@@ -366,7 +367,7 @@ main(int argc, char **argv)
 			exit(1);
 		}
 	}
-	VUT.dispatch_f = &accumulate;
+	VUT.dispatch_f = accumulate;
 	VUT.dispatch_priv = NULL;
 	VUT.sighup_f = sighup;
 	VUT_Main();
diff --git a/flint.lnt b/flint.lnt
index f03773f..f77c78b 100644
--- a/flint.lnt
+++ b/flint.lnt
@@ -60,6 +60,7 @@
 // ignore retval
 -esym(534, printf)
 -esym(534, fprintf)
+-esym(534, vfprintf)
 -esym(534, sprintf)
 
 -esym(534, memset)
@@ -151,6 +152,10 @@
 -esym(759, vsm_diag)
 
 ///////////////////////////////////////////////////////////////////////
+// "miniobj.h"
+
+-emacro(774, REPLACE)
+
 
 // It is ok to default after handling a few select SLT_* tags
 -esym(788, VSL_tag_e::SLT_*)	//  enum constant '...' not used within defaulted switch
diff --git a/lib/libvarnish/flint.lnt b/lib/libvarnish/flint.lnt
index ce26899..0a014ba 100644
--- a/lib/libvarnish/flint.lnt
+++ b/lib/libvarnish/flint.lnt
@@ -5,3 +5,5 @@
 -e713	// Loss of precision (assignment) (unsigned long long to long long)
 
 -dVARNISH_STATE_DIR="foo"
+
+--emacro((835),BINHEAP_NOIDX)
diff --git a/lib/libvarnishapi/flint.lnt b/lib/libvarnishapi/flint.lnt
index 4a0c875..59ad7b6 100644
--- a/lib/libvarnishapi/flint.lnt
+++ b/lib/libvarnishapi/flint.lnt
@@ -1,2 +1,6 @@
++fan
+
 -esym(788, vex_rhs_e::*)
 -esym(788, VSL_transaction_e::*)
+-esym(769, vex_rhs_e::VEX__UNSET)
+-esym(749, chunk_t::chunk_t__unassigned)
diff --git a/lib/libvarnishapi/vsl_query.c b/lib/libvarnishapi/vsl_query.c
index 79a9f66..b2d43a8 100644
--- a/lib/libvarnishapi/vsl_query.c
+++ b/lib/libvarnishapi/vsl_query.c
@@ -61,19 +61,21 @@ struct vslq_query {
 	struct vex		*vex;
 };
 
-#define VSLQ_TEST_NUMOP(TYPE, PRE_LHS, OP, PRE_RHS)	\
-	switch (TYPE) {					\
-	case VEX_INT:					\
-		if (PRE_LHS##_int OP PRE_RHS##_int)	\
-			return (1);			\
-		return (0);				\
-	case VEX_FLOAT:					\
-		if (PRE_LHS##_float OP PRE_RHS##_float)	\
-			return (1);			\
-		return (0);				\
-	default:					\
-		WRONG("Wrong RHS type");		\
-	}
+#define VSLQ_TEST_NUMOP(TYPE, PRE_LHS, OP, PRE_RHS)		\
+	do {							\
+		switch (TYPE) {					\
+		case VEX_INT:					\
+			if (PRE_LHS##_int OP PRE_RHS##_int)	\
+				return (1);			\
+			return (0);				\
+		case VEX_FLOAT:					\
+			if (PRE_LHS##_float OP PRE_RHS##_float)	\
+				return (1);			\
+			return (0);				\
+		default:					\
+			WRONG("Wrong RHS type");		\
+		}						\
+	} while(0)						\
 
 static int
 vslq_test_vxid(const struct vex *vex, const struct VSL_transaction *trans)
@@ -103,7 +105,7 @@ vslq_test_vxid(const struct vex *vex, const struct VSL_transaction *trans)
 
 	/* Compare */
 	switch (vex->tok) {
-	#define VXID_TEST_NUMOP(OP) return (trans->vxid OP rhs->val_int);
+#define VXID_TEST_NUMOP(OP) return (trans->vxid OP rhs->val_int)
 	case T_EQ:	VXID_TEST_NUMOP(==);
 	case T_NEQ:	VXID_TEST_NUMOP(!=);
 	case '<':	VXID_TEST_NUMOP(<);
@@ -185,10 +187,9 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
 		switch (rhs->type) {
 		case VEX_INT:
 			lhs_int = strtoll(b, &p, 0);
-			if (*p == '\0' || isspace(*p))
-				break;
-			/* Can't parse - no match */
-			return (0);
+			if (*p != '\0' && !isspace(*p))
+				return (0); /* Can't parse - no match */
+			break;
 		case VEX_FLOAT:
 			lhs_float = VNUMpfx(b, &q);
 			if (isnan(lhs_float))
@@ -257,8 +258,7 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
 	default:
 		WRONG("Bad expression token");
 	}
-
-	return (0);
+	NEEDLESS(return (0));
 }
 
 static int
diff --git a/lib/libvarnishapi/vut.c b/lib/libvarnishapi/vut.c
index f69528c..5c5b90e 100644
--- a/lib/libvarnishapi/vut.c
+++ b/lib/libvarnishapi/vut.c
@@ -373,7 +373,7 @@ VUT_Main(void)
 		if (VUT.sigusr1) {
 			/* Flush and report any incomplete records */
 			VUT.sigusr1 = 0;
-			VSLQ_Flush(VUT.vslq, vut_dispatch, NULL);
+			(void)VSLQ_Flush(VUT.vslq, vut_dispatch, NULL);
 		}
 
 		if (VUT.vsm != NULL && !VSM_IsOpen(VUT.vsm)) {
@@ -420,7 +420,7 @@ VUT_Main(void)
 
 		/* XXX: Make continuation optional */
 
-		VSLQ_Flush(VUT.vslq, vut_dispatch, NULL);
+		(void)VSLQ_Flush(VUT.vslq, vut_dispatch, NULL);
 
 		if (i == -2)
 			/* Abandoned */
diff --git a/lib/libvarnishapi/vxp.h b/lib/libvarnishapi/vxp.h
index b282a17..0cb7a9e 100644
--- a/lib/libvarnishapi/vxp.h
+++ b/lib/libvarnishapi/vxp.h
@@ -70,8 +70,6 @@ struct vxp {
 	int			err;
 };
 
-struct vex;
-
 struct vex_lhs {
 	/* Left-hand-side of a vex expression. Stores the information
 	   about which records and what parts of those records the



More information about the varnish-commit mailing list