r1338 - in branches/1.0: . lib/libvcl

des at projects.linpro.no des at projects.linpro.no
Thu Apr 19 16:51:01 CEST 2007


Author: des
Date: 2007-04-19 16:51:01 +0200 (Thu, 19 Apr 2007)
New Revision: 1338

Modified:
   branches/1.0/
   branches/1.0/lib/libvcl/vcc_compile.h
   branches/1.0/lib/libvcl/vcc_xref.c
Log:
 r37071 at cat (orig r1295):  phk | 2007-04-01 10:23:48 +0200
 I got confused about the terminology.  An action is something we do
 in the program, a "return" is when we quit the program.
 



Property changes on: branches/1.0
___________________________________________________________________
Name: svk:merge
   - d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1294
   + d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1295

Modified: branches/1.0/lib/libvcl/vcc_compile.h
===================================================================
--- branches/1.0/lib/libvcl/vcc_compile.h	2007-04-19 14:50:59 UTC (rev 1337)
+++ branches/1.0/lib/libvcl/vcc_compile.h	2007-04-19 14:51:01 UTC (rev 1338)
@@ -120,7 +120,7 @@
 
 struct method {
 	const char		*name;
-	unsigned		actions;
+	unsigned		returns;
 };
 
 struct proc;

Modified: branches/1.0/lib/libvcl/vcc_xref.c
===================================================================
--- branches/1.0/lib/libvcl/vcc_xref.c	2007-04-19 14:50:59 UTC (rev 1337)
+++ branches/1.0/lib/libvcl/vcc_xref.c	2007-04-19 14:51:01 UTC (rev 1338)
@@ -59,11 +59,11 @@
 	TAILQ_ENTRY(proc)	list;
 	TAILQ_HEAD(,proccall)	calls;
 	struct token		*name;
-	unsigned		actions;
+	unsigned		returns;
 	unsigned		exists;
 	unsigned		called;
 	unsigned		active;
-	struct token		*action_tok[VCL_RET_MAX];
+	struct token		*return_tok[VCL_RET_MAX];
 };
 
 /*--------------------------------------------------------------------*/
@@ -171,7 +171,7 @@
 }
 
 /*--------------------------------------------------------------------
- * Returned action checks
+ * Returns checks
  */
 
 static struct proc *
@@ -216,17 +216,17 @@
 }
 
 void
-vcc_ProcAction(struct proc *p, unsigned action, struct token *t)
+vcc_ProcAction(struct proc *p, unsigned returns, struct token *t)
 {
 
-	p->actions |= (1 << action);
-	/* Record the first instance of this action */
-	if (p->action_tok[action] == NULL)
-		p->action_tok[action] = t;
+	p->returns |= (1 << returns);
+	/* Record the first instance of this return */
+	if (p->return_tok[returns] == NULL)
+		p->return_tok[returns] = t;
 }
 
 static int
-vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned actions)
+vcc_CheckActionRecurse(struct tokenlist *tl, struct proc *p, unsigned returns)
 {
 	unsigned u;
 	struct proccall *pc;
@@ -241,12 +241,12 @@
 		vcc_ErrWhere(tl, p->name);
 		return (1);
 	}
-	u = p->actions & ~actions;
+	u = p->returns & ~returns;
 	if (u) {
 #define VCL_RET_MAC(a, b, c, d) \
 		if (u & VCL_RET_##b) { \
-			vsb_printf(tl->sb, "Illegal action \"%s\"\n", #a); \
-			vcc_ErrWhere(tl, p->action_tok[d]); \
+			vsb_printf(tl->sb, "Illegal return \"%s\"\n", #a); \
+			vcc_ErrWhere(tl, p->return_tok[d]); \
 		}
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
@@ -256,7 +256,7 @@
 	}
 	p->active = 1;
 	TAILQ_FOREACH(pc, &p->calls, list) {
-		if (vcc_CheckActionRecurse(tl, pc->p, actions)) {
+		if (vcc_CheckActionRecurse(tl, pc->p, returns)) {
 			vsb_printf(tl->sb, "\n...called from \"%.*s\"\n",
 			    PF(p->name));
 			vcc_ErrWhere(tl, pc->t);
@@ -280,12 +280,12 @@
 		if (i < 0)
 			continue;
 		m = method_tab + i;
-		if (vcc_CheckActionRecurse(tl, p, m->actions)) {
+		if (vcc_CheckActionRecurse(tl, p, m->returns)) {
 			vsb_printf(tl->sb,
 			    "\n...which is the \"%s\" method\n", m->name);
-			vsb_printf(tl->sb, "Legal actions are:");
+			vsb_printf(tl->sb, "Legal returns are:");
 #define VCL_RET_MAC(a, b, c, d) \
-			if (m->actions & c) \
+			if (m->returns & c) \
 				vsb_printf(tl->sb, " \"%s\"", #a);
 #define VCL_RET_MAC_E(a, b, c, d) VCL_RET_MAC(a, b, c, d)
 #include "vcl_returns.h"




More information about the varnish-commit mailing list