[master] 3bb4641 FlexeLinting: Avoid cpp macro argument names inside strings

Poul-Henning Kamp phk at FreeBSD.org
Thu Mar 23 13:58:06 CET 2017


commit 3bb4641bf1f6620d246c00cf88b2bf92b10ce3bd
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Mar 23 10:40:45 2017 +0000

    FlexeLinting: Avoid cpp macro argument names inside strings

diff --git a/bin/varnishtest/vtc.h b/bin/varnishtest/vtc.h
index 0e09392..8ba61c2 100644
--- a/bin/varnishtest/vtc.h
+++ b/bin/varnishtest/vtc.h
@@ -41,13 +41,13 @@
 #include "vqueue.h"
 #include "vsb.h"
 
-#define VTC_CHECK_NAME(vl, name, type, chr)				\
+#define VTC_CHECK_NAME(vl, nm, type, chr)				\
 	do {								\
-		AN(name);						\
-		if (*(name) != chr)					\
+		AN(nm);							\
+		if (*(nm) != chr)					\
 			vtc_fatal(vl,					\
 			    type " name must start with '%c' (got %s)",	\
-			    chr, name);					\
+			    chr, nm);					\
 	} while (0)
 
 struct vtclog;
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index bef8689..1f6bfc3 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -840,12 +840,12 @@ receive_frame(void *priv)
 	return (NULL);
 }
 
-#define STRTOU32(n, s, p, v, c)						\
+#define STRTOU32(n, ss, p, v, c)					\
 	do {								\
-		n = strtoul(s, &p, 0);					\
+		n = strtoul(ss, &p, 0);					\
 		if (*p != '\0')						\
 			vtc_fatal(v, "%s takes an integer as argument"	\
-				"(found %s)", c, s);			\
+				"(found %s)", c, ss);			\
 	} while (0)
 
 #define STRTOU32_CHECK(n, sp, p, v, c, l)				\
@@ -2336,7 +2336,7 @@ cmd_rxpush(CMD_ARGS)
 		if (s->frame->type != TYPE_ ## upctype) \
 			vtc_fatal(vl, "Received frame of type %d " \
 			    "is invalid for %s", \
-			    s->frame->type, "rx ## lctype"); \
+			    s->frame->type, "rx" #lctype); \
 	}
 
 /* SECTION: stream.spec.prio_rxprio rxprio



More information about the varnish-commit mailing list