r553 - in trunk/varnish-cache: bin/varnishd include lib/libvcl

phk at projects.linpro.no phk at projects.linpro.no
Fri Jul 21 23:57:44 CEST 2006


Author: phk
Date: 2006-07-21 23:57:43 +0200 (Fri, 21 Jul 2006)
New Revision: 553

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_vcl.c
   trunk/varnish-cache/include/vcl_returns.h
   trunk/varnish-cache/lib/libvcl/vcc_compile.c
   trunk/varnish-cache/lib/libvcl/vcc_compile.h
   trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
   trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
   trunk/varnish-cache/lib/libvcl/vcc_token.c
Log:
Make FlexeLint happier


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-07-21 21:57:43 UTC (rev 553)
@@ -366,7 +366,7 @@
 struct VCL_conf *VCL_Get(void);
 int VCL_Load(const char *fn, const char *name, struct cli *cli);
 
-#define VCL_RET_MAC(l,u,b)
+#define VCL_RET_MAC(l,u,b,n)
 #define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct sess *);
 #include "vcl_returns.h"
 #undef VCL_MET_MAC

Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vcl.c	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/bin/varnishd/cache_vcl.c	2006-07-21 21:57:43 UTC (rev 553)
@@ -206,8 +206,8 @@
 {
 
 	switch (u) {
-#define VCL_RET_MAC(a, b, c)	case VCL_RET_##b: return(#a);
-#define VCL_RET_MAC_E(a, b, c)	case VCL_RET_##b: return(#a);
+#define VCL_RET_MAC(a, b, c,d)	case VCL_RET_##b: return(#a);
+#define VCL_RET_MAC_E(a, b, c,d)	case VCL_RET_##b: return(#a);
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
 #undef VCL_RET_MAC_E
@@ -216,7 +216,7 @@
 	}
 }
 
-#define VCL_RET_MAC(l,u,b)
+#define VCL_RET_MAC(l,u,b,n)
 
 #define VCL_MET_MAC(func, xxx, bitmap) 					\
 void									\

Modified: trunk/varnish-cache/include/vcl_returns.h
===================================================================
--- trunk/varnish-cache/include/vcl_returns.h	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/include/vcl_returns.h	2006-07-21 21:57:43 UTC (rev 553)
@@ -1,5 +1,5 @@
 /*
- * $Id$
+ * $Id: vcc_gen_fixed_token.tcl 545 2006-07-21 20:43:56Z phk $
  *
  * NB:  This file is machine generated, DO NOT EDIT!
  *
@@ -8,16 +8,16 @@
 
 #ifdef VCL_RET_MAC
 #ifdef VCL_RET_MAC_E
-VCL_RET_MAC_E(error, ERROR, 0)
+VCL_RET_MAC_E(error, ERROR, (1 << 0), 0)
 #endif
-VCL_RET_MAC(lookup, LOOKUP, (1 << 1))
-VCL_RET_MAC(pipe, PIPE, (1 << 2))
-VCL_RET_MAC(pass, PASS, (1 << 3))
-VCL_RET_MAC(insert_pass, INSERT_PASS, (1 << 4))
-VCL_RET_MAC(fetch, FETCH, (1 << 5))
-VCL_RET_MAC(insert, INSERT, (1 << 6))
-VCL_RET_MAC(deliver, DELIVER, (1 << 7))
-VCL_RET_MAC(discard, DISCARD, (1 << 8))
+VCL_RET_MAC(lookup, LOOKUP, (1 << 1), 1)
+VCL_RET_MAC(pipe, PIPE, (1 << 2), 2)
+VCL_RET_MAC(pass, PASS, (1 << 3), 3)
+VCL_RET_MAC(insert_pass, INSERT_PASS, (1 << 4), 4)
+VCL_RET_MAC(fetch, FETCH, (1 << 5), 5)
+VCL_RET_MAC(insert, INSERT, (1 << 6), 6)
+VCL_RET_MAC(deliver, DELIVER, (1 << 7), 7)
+VCL_RET_MAC(discard, DISCARD, (1 << 8), 8)
 #else
 #define VCL_RET_ERROR  (1 << 0)
 #define VCL_RET_LOOKUP  (1 << 1)

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.c	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.c	2006-07-21 21:57:43 UTC (rev 553)
@@ -58,6 +58,15 @@
 
 #define ERRCHK(tl)	do { if ((tl)->err) return; } while (0)
 
+static struct method method_tab[] = {
+#define VCL_RET_MAC(a,b,c,d)
+#define VCL_MET_MAC(a,b,c)	{ "vcl_"#a, "default_vcl_"#a, c },
+#include "vcl_returns.h"
+#undef VCL_MET_MAC
+#undef VCL_RET_MAC
+	{ NULL, 0U }
+};
+
 /*--------------------------------------------------------------------*/
 
 static void Compound(struct tokenlist *tl);
@@ -214,6 +223,7 @@
 	struct token *t;
 
 	t = calloc(sizeof *t, 1);
+	assert(t != NULL);
 	t->b = s;
 	t->e = strchr(s, '\0');
 	t->tok = METHOD;
@@ -745,10 +755,10 @@
 	case T_NO_CACHE:
 		Fc(tl, 1, "VCL_no_cache(sp);\n");
 		return;
-#define VCL_RET_MAC(a,b,c) case T_##b: \
+#define VCL_RET_MAC(a,b,c,d) case T_##b: \
 		Fc(tl, 1, "VRT_done(sp, VCL_RET_%s);\n", #b); \
 		tl->curproc->returns |= VCL_RET_##b; \
-		tl->curproc->returnt[c] = at; \
+		tl->curproc->returnt[d] = at; \
 		return;
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
@@ -1169,10 +1179,10 @@
 	}
 	u = p->returns & ~returns;
 	if (u) {
-#define VCL_RET_MAC(a, b, c) \
+#define VCL_RET_MAC(a, b, c, d) \
 		if (u & VCL_RET_##b) { \
 			sbuf_printf(tl->sb, "Illegal return for method\n"); \
-			vcc_ErrWhere(tl, p->returnt[c]); \
+			vcc_ErrWhere(tl, p->returnt[d]); \
 		} 
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
@@ -1350,7 +1360,7 @@
 	Fc(tl, 0, "\t.nbackend = %d,\n", tl->nbackend);
 	Fc(tl, 0, "\t.ref = VGC_ref,\n");
 	Fc(tl, 0, "\t.nref = VGC_NREFS,\n");
-#define VCL_RET_MAC(l,u,b)
+#define VCL_RET_MAC(l,u,b,n)
 #define VCL_MET_MAC(l,u,b) \
 	if (FindRefStr(tl, "vcl_" #l, R_FUNC)) { \
 		Fc(tl, 0, "\t." #l "_func = VGC_function_vcl_" #l ",\n"); \

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.h	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.h	2006-07-21 21:57:43 UTC (rev 553)
@@ -68,17 +68,10 @@
 	const char		*lname;
 };
 
-static struct method {
+struct method {
 	const char		*name;
 	const char		*defname;
 	unsigned		returns;
-} method_tab[] = {
-#define VCL_RET_MAC(a,b,c)
-#define VCL_MET_MAC(a,b,c)	{ "vcl_"#a, "default_vcl_"#a, c },
-#include "vcl_returns.h"
-#undef VCL_MET_MAC
-#undef VCL_RET_MAC
-	{ NULL, 0U }
 };
 
 struct proccall {
@@ -107,7 +100,7 @@
 /* vcc_obj.c */
 extern struct var vcc_be_vars[];
 extern struct var vcc_vars[];
-const char *vrt_obj_h;
+extern const char *vrt_obj_h;
 
 /* vcc_token.c */
 void vcc_ErrToken(struct tokenlist *tl, struct token *t);

Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c	2006-07-21 21:57:43 UTC (rev 553)
@@ -488,8 +488,6 @@
 	fputs("};\n", f);
 	fputs("\n", f);
 	fputs("void VRT_count(struct sess *, unsigned);\n", f);
-	fputs("void VRT_no_cache(struct sess *);\n", f);
-	fputs("void VRT_no_new_cache(struct sess *);\n", f);
 	fputs("#if 0\n", f);
 	fputs("int ip_match(unsigned, struct vcl_acl *);\n", f);
 	fputs("int string_match(const char *, const char *);\n", f);
@@ -499,14 +497,9 @@
 	fputs("int VRT_switch_config(const char *);\n", f);
 	fputs("\n", f);
 	fputs("char *VRT_GetHdr(struct sess *, const char *);\n", f);
-	fputs("char *VRT_GetReq(struct sess *);\n", f);
 	fputs("void VRT_handling(struct sess *sp, unsigned hand);\n", f);
-	fputs("int VRT_obj_valid(struct sess *);\n", f);
-	fputs("int VRT_obj_cacheable(struct sess *);\n", f);
 	fputs("\n", f);
 	fputs("void VRT_set_backend_name(struct backend *, const char *);\n", f);
-	fputs("void VRT_set_backend_hostname(struct backend *, const char *);\n", f);
-	fputs("void VRT_set_backend_portname(struct backend *, const char *);\n", f);
 	fputs("\n", f);
 	fputs("void VRT_alloc_backends(struct VCL_conf *cp);\n", f);
 	fputs("\n", f);

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl	2006-07-21 21:57:43 UTC (rev 553)
@@ -128,10 +128,10 @@
 foreach k $returns {
 	if {$k == "error"} {
 		puts $for "#ifdef VCL_RET_MAC_E"
-		puts $for "VCL_RET_MAC_E($k, [string toupper $k], $i)"
+		puts $for "VCL_RET_MAC_E($k, [string toupper $k], (1 << $i), $i)"
 		puts $for "#endif"
 	} else {
-		puts $for "VCL_RET_MAC($k, [string toupper $k], (1 << $i))"
+		puts $for "VCL_RET_MAC($k, [string toupper $k], (1 << $i), $i)"
 	}
 	incr i
 }

Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_token.c	2006-07-21 21:42:00 UTC (rev 552)
+++ trunk/varnish-cache/lib/libvcl/vcc_token.c	2006-07-21 21:57:43 UTC (rev 553)
@@ -26,10 +26,6 @@
 
 #include "libvcl.h"
 
-#define ERRCHK(tl)	do { if ((tl)->err) return; } while (0)
-
-#define INDENT		2
-
 /*--------------------------------------------------------------------*/
 
 void
@@ -146,21 +142,6 @@
 	vcc_ErrWhere(tl, tl->t);
 }
 
-#define Expect(a, b) _Expect(a, b, __LINE__)
-#define ExpectErr(a, b) do { _Expect(a, b, __LINE__); ERRCHK(a);} while (0)
-
-#define L(tl, foo)	do {	\
-	tl->indent += INDENT;	\
-	foo;			\
-	tl->indent -= INDENT;	\
-} while (0)
-
-#define C(tl, sep)	do {				\
-	Fc(tl, 1, "VRT_count(sp, %u)%s\n", ++tl->cnt, sep);	\
-	tl->t->cnt = tl->cnt; 				\
-} while (0)
-	
-
 /*--------------------------------------------------------------------
  * Compare token to token
  */




More information about the varnish-commit mailing list