Commit 92f77690 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Various cleanups.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5002 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent e7ada880
......@@ -53,7 +53,7 @@ parse_call(struct vcc *tl)
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 @@ parse_set(struct vcc *tl)
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 @@ parse_set(struct vcc *tl)
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");
......
......@@ -113,18 +113,16 @@ enum var_type {
BACKEND,
BOOL,
INT,
FLOAT,
SIZE,
TIME,
DURATION,
STRING,
IP,
HASH,
HEADER
};
enum ref_type {
R_FUNC,
R_SUB,
R_ACL,
R_BACKEND,
R_PROBE
......
......@@ -518,8 +518,8 @@ vcc_Function(struct vcc *tl)
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 @@ vcc_Function(struct vcc *tl)
} 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");
......
......@@ -173,9 +173,11 @@ vcc_StringVal(struct vcc *tl)
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;
......
......@@ -148,8 +148,10 @@ vcc_VarVal(struct vcc *tl, const struct var *vp, const struct token *vt)
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 {
......
......@@ -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 @@ static const char *
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 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap)
#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 @@ vcc_CheckUseRecurse(struct vcc *tl, const struct proc *p,
"'%.*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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment