r5002 - trunk/varnish-cache/lib/libvcl

phk at varnish-cache.org phk at varnish-cache.org
Sun Jul 4 21:55:12 CEST 2010


Author: phk
Date: 2010-07-04 21:55:12 +0200 (Sun, 04 Jul 2010)
New Revision: 5002

Modified:
   trunk/varnish-cache/lib/libvcl/vcc_action.c
   trunk/varnish-cache/lib/libvcl/vcc_compile.h
   trunk/varnish-cache/lib/libvcl/vcc_parse.c
   trunk/varnish-cache/lib/libvcl/vcc_string.c
   trunk/varnish-cache/lib/libvcl/vcc_var.c
   trunk/varnish-cache/lib/libvcl/vcc_xref.c
Log:
Various cleanups.



Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c	2010-07-04 14:40:33 UTC (rev 5001)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c	2010-07-04 19:55:12 UTC (rev 5002)
@@ -53,7 +53,7 @@
 	vcc_NextToken(tl);
 	ExpectErr(tl, ID);
 	vcc_AddCall(tl, tl->t);
-	vcc_AddRef(tl, tl->t, R_FUNC);
+	vcc_AddRef(tl, tl->t, R_SUB);
 	Fb(tl, 1, "if (VGC_function_%.*s(sp))\n", PF(tl->t));
 	Fb(tl, 1, "\treturn (1);\n");
 	vcc_NextToken(tl);
@@ -130,7 +130,7 @@
 	case SIZE:
 	case TIME:
 	case DURATION:
-	case FLOAT:
+//	case FLOAT:
 		if (tl->t->tok != '=')
 			Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b);
 		at = tl->t;
@@ -182,15 +182,6 @@
 		vcc_NextToken(tl);
 		Fb(tl, 0, ");\n");
 		break;
-	case HASH:
-		SkipToken(tl, T_INCR);
-		if (!vcc_StringVal(tl)) {
-			ERRCHK(tl);
-			vcc_ExpectedStringval(tl);
-			return;
-		}
-		Fb(tl, 0, ");\n");
-		break;
 	case STRING:
 		if (tl->t->tok != '=') {
 			illegal_assignment(tl, "strings");

Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_compile.h	2010-07-04 14:40:33 UTC (rev 5001)
+++ trunk/varnish-cache/lib/libvcl/vcc_compile.h	2010-07-04 19:55:12 UTC (rev 5002)
@@ -113,18 +113,16 @@
 	BACKEND,
 	BOOL,
 	INT,
-	FLOAT,
 	SIZE,
 	TIME,
 	DURATION,
 	STRING,
 	IP,
-	HASH,
 	HEADER
 };
 
 enum ref_type {
-	R_FUNC,
+	R_SUB,
 	R_ACL,
 	R_BACKEND,
 	R_PROBE

Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_parse.c	2010-07-04 14:40:33 UTC (rev 5001)
+++ trunk/varnish-cache/lib/libvcl/vcc_parse.c	2010-07-04 19:55:12 UTC (rev 5002)
@@ -518,8 +518,8 @@
 		tl->fb = tl->fm[m];
 		if (tl->mprocs[m] == NULL) {
 			tl->mprocs[m] = vcc_AddProc(tl, tl->t);
-			vcc_AddDef(tl, tl->t, R_FUNC);
-			vcc_AddRef(tl, tl->t, R_FUNC);
+			vcc_AddDef(tl, tl->t, R_SUB);
+			vcc_AddRef(tl, tl->t, R_SUB);
 		}
 		tl->curproc = tl->mprocs[m];
 		Fb(tl, 1, "  /* ... from ");
@@ -528,7 +528,7 @@
 	} else {
 		tl->fb = tl->fc;
 		tl->curproc = vcc_AddProc(tl, tl->t);
-		vcc_AddDef(tl, tl->t, R_FUNC);
+		vcc_AddDef(tl, tl->t, R_SUB);
 		Fh(tl, 0, "static int VGC_function_%.*s (struct sess *sp);\n",
 		    PF(tl->t));
 		Fc(tl, 1, "\nstatic int\n");

Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_string.c	2010-07-04 14:40:33 UTC (rev 5001)
+++ trunk/varnish-cache/lib/libvcl/vcc_string.c	2010-07-04 19:55:12 UTC (rev 5002)
@@ -173,9 +173,11 @@
 		case INT:
 			Fb(tl, 0, "VRT_int_string(sp, %s)", vp->rname);
 			break;
+#if 0
 		case FLOAT:
 			Fb(tl, 0, "VRT_double_string(sp, %s)", vp->rname);
 			break;
+#endif
 		case TIME:
 			Fb(tl, 0, "VRT_time_string(sp, %s)", vp->rname);
 			break;

Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_var.c	2010-07-04 14:40:33 UTC (rev 5001)
+++ trunk/varnish-cache/lib/libvcl/vcc_var.c	2010-07-04 19:55:12 UTC (rev 5002)
@@ -148,8 +148,10 @@
 		vcc_SizeVal(tl, &d);
 		ERRCHK(tl);
 		Fb(tl, 0, "%g", d);
+#if 0
 	} else if (vp->fmt == FLOAT) {
 		Fb(tl, 0, "%g", vcc_DoubleVal(tl));
+#endif
 	} else if (vp->fmt == INT) {
 		Fb(tl, 0, "%u", vcc_UintVal(tl));
 	} else {

Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_xref.c	2010-07-04 14:40:33 UTC (rev 5001)
+++ trunk/varnish-cache/lib/libvcl/vcc_xref.c	2010-07-04 19:55:12 UTC (rev 5002)
@@ -28,11 +28,11 @@
  *
  * This file contains code for two cross-reference or consistency checks.
  *
- * The first check is simply that all functions, acls and backends are
+ * The first check is simply that all subroutine, acls and backends are
  * both defined and referenced.  Complaints about referenced but undefined
  * or defined but unreferenced objects will be emitted.
  *
- * The second check recursively decends through function calls to make
+ * The second check recursively decends through subroutine calls to make
  * sure that action actions are correct for the methods through which
  * they are called.
  */
@@ -83,7 +83,7 @@
 vcc_typename(struct vcc *tl, const struct ref *r)
 {
 	switch (r->type) {
-	case R_FUNC: return ("function");
+	case R_SUB: return ("subroutine");
 	case R_ACL: return ("acl");
 	case R_BACKEND: return ("backend");
 	case R_PROBE: return ("probe");
@@ -280,7 +280,8 @@
 #include "vcl_returns.h"
 #undef VCL_RET_MAC
 /*lint -restore */
-		vsb_printf(tl->sb, "\n...in function \"%.*s\"\n", PF(p->name));
+		vsb_printf(tl->sb, "\n...in subroutine \"%.*s\"\n",
+		    PF(p->name));
 		vcc_ErrWhere(tl, p->name);
 		return (1);
 	}
@@ -360,7 +361,7 @@
 		    "'%.*s': %s not possible in method '%.*s'.\n",
 		    PF(pu->t), pu->use, PF(p->name));
 		vcc_ErrWhere(tl, pu->t);
-		vsb_printf(tl->sb, "\n...in function \"%.*s\"\n",
+		vsb_printf(tl->sb, "\n...in subroutine \"%.*s\"\n",
 		    PF(p->name));
 		vcc_ErrWhere(tl, p->name);
 		return (1);




More information about the varnish-commit mailing list