[master] 09e8a28 Add an extra '_' to identify SLT__Bogus and SLT__Reserved as magic

Poul-Henning Kamp phk at varnish-cache.org
Tue Nov 20 08:56:50 CET 2012


commit 09e8a28b5d983dc0f15cf44dfa68d4ce4ce04ea1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Nov 20 07:56:31 2012 +0000

    Add an extra '_' to identify SLT__Bogus and SLT__Reserved as magic

diff --git a/bin/varnishd/cache/cache_shmlog.c b/bin/varnishd/cache/cache_shmlog.c
index e7ae53e..a741035 100644
--- a/bin/varnishd/cache/cache_shmlog.c
+++ b/bin/varnishd/cache/cache_shmlog.c
@@ -60,7 +60,8 @@ vsl_tag_is_masked(enum VSL_tag_e tag)
 	volatile uint8_t *bm = &cache_param->vsl_mask[0];
 	uint8_t b;
 
-	assert(tag < SLT_Reserved);
+	assert(tag > SLT__Bogus);
+	assert(tag < SLT__Reserved);
 	bm += ((unsigned)tag >> 3);
 	b = (0x80 >> ((unsigned)tag & 7));
 	return (*bm & b);
@@ -75,8 +76,8 @@ vsl_hdr(enum VSL_tag_e tag, uint32_t *p, unsigned len, uint32_t vxid)
 {
 
 	assert(((uintptr_t)p & 0x3) == 0);
-	assert(tag > SLT_Bogus);
-	assert(tag < SLT_Reserved);
+	assert(tag > SLT__Bogus);
+	assert(tag < SLT__Reserved);
 	AZ(len & ~VSL_LENMASK);
 
 	p[1] = vxid;
diff --git a/bin/varnishd/mgt/mgt_param_bits.c b/bin/varnishd/mgt/mgt_param_bits.c
index a5996a2..faeff24 100644
--- a/bin/varnishd/mgt/mgt_param_bits.c
+++ b/bin/varnishd/mgt/mgt_param_bits.c
@@ -137,12 +137,12 @@ tweak_vsl_mask(struct cli *cli, const struct parspec *par, const char *arg)
 			(void)bit(mgt_param.vsl_mask, SLT_Hash, BSET);
 		} else {
 			bit_tweak(cli, mgt_param.vsl_mask,
-			    SLT_Reserved, arg, VSL_tags,
+			    SLT__Reserved, arg, VSL_tags,
 			    "VSL tag", "-");
 		}
 	} else {
 		s = "";
-		for (j = 0; j < (unsigned)SLT_Reserved; j++) {
+		for (j = 0; j < (unsigned)SLT__Reserved; j++) {
 			if (bit(mgt_param.vsl_mask, j, BTST)) {
 				VCLI_Out(cli, "%s-%s", s, VSL_tags[j]);
 				s = ",";
diff --git a/include/vapi/vsl_int.h b/include/vapi/vsl_int.h
index 24f2037..012a975 100644
--- a/include/vapi/vsl_int.h
+++ b/include/vapi/vsl_int.h
@@ -68,19 +68,19 @@
 #define VSL_BACKEND(ptr)	(((ptr)[1]) & VSL_BACKENDMARKER)
 #define VSL_DATA(ptr)		((char*)((ptr)+2))
 
-#define VSL_ENDMARKER	(((uint32_t)SLT_Reserved << 24) | 0x454545) /* "EEE" */
-#define VSL_WRAPMARKER	(((uint32_t)SLT_Reserved << 24) | 0x575757) /* "WWW" */
+#define VSL_ENDMARKER	(((uint32_t)SLT__Reserved << 24) | 0x454545) /* "EEE" */
+#define VSL_WRAPMARKER	(((uint32_t)SLT__Reserved << 24) | 0x575757) /* "WWW" */
 
 /*
  * The identifiers in shmlogtag are "SLT_" + XML tag.  A script may be run
  * on this file to extract the table rather than handcode it
  */
 enum VSL_tag_e {
-	SLT_Bogus = 0,
+	SLT__Bogus = 0,
 #define SLTM(foo,sdesc,ldesc)	SLT_##foo,
 #include "tbl/vsl_tags.h"
 #undef SLTM
-	SLT_Reserved = 255
+	SLT__Reserved = 255
 };
 
 #endif /* VAPI_VSL_FMT_H_INCLUDED */



More information about the varnish-commit mailing list