[master] 91f22a1 Remove unused/unreferenced stuff.

Poul-Henning Kamp phk at varnish-cache.org
Wed Jun 22 12:51:50 CEST 2011


commit 91f22a160fe2f63d4a85d525fa0e70b4c3c9395e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jun 22 10:51:08 2011 +0000

    Remove unused/unreferenced stuff.
    
    Not detected by:  FlexeLint 9.00f
    Detected by:  FlexeLint 9.00g

diff --git a/include/libvarnish.h b/include/libvarnish.h
index 317dc9e..157a64e 100644
--- a/include/libvarnish.h
+++ b/include/libvarnish.h
@@ -104,8 +104,6 @@ int vtmpfile(char *);
 char *vreadfile(const char *pfx, const char *fn, ssize_t *sz);
 char *vreadfd(int fd, ssize_t *sz);
 
-const char* VCS_Version(void);
-
 /* Safe printf into a fixed-size buffer */
 #define bprintf(buf, fmt, ...)						\
 	do {								\
diff --git a/lib/libvcl/vcc_backend.c b/lib/libvcl/vcc_backend.c
index 3198ce1..f90c1b1 100644
--- a/lib/libvcl/vcc_backend.c
+++ b/lib/libvcl/vcc_backend.c
@@ -211,44 +211,6 @@ Emit_Sockaddr(struct vcc *tl, const struct token *t_host, const char *port)
 }
 
 /*--------------------------------------------------------------------
- * When a new VCL is loaded, it is likely to contain backend declarations
- * identical to other loaded VCL programs, and we want to reuse the state
- * of those in order to not have to relearn statistics, DNS etc.
- *
- * This function emits a space separated text-string of the tokens which
- * define a given backend which can be used to determine "identical backend"
- * in that context.
- */
-
-void
-vcc_EmitBeIdent(const struct vcc *tl, struct vsb *v,
-    int serial, const struct token *first, const struct token *last)
-{
-
-	assert(first != last);
-	VSB_printf(v, "\t.ident =");
-	if (serial >= 0) {
-		VSB_printf(v, "\n\t    \"%.*s %.*s [%d] \"",
-		    PF(tl->t_policy), PF(tl->t_dir), serial);
-	} else {
-		VSB_printf(v, "\n\t    \"%.*s %.*s \"",
-		    PF(tl->t_policy), PF(tl->t_dir));
-	}
-	while (1) {
-		if (first->dec != NULL)
-			VSB_printf(v, "\n\t    \"\\\"\" %.*s \"\\\" \"",
-			    PF(first));
-		else
-			VSB_printf(v, "\n\t    \"%.*s \"", PF(first));
-		if (first == last)
-			break;
-		first = VTAILQ_NEXT(first, list);
-		AN(first);
-	}
-	VSB_printf(v, ",\n");
-}
-
-/*--------------------------------------------------------------------
  * Parse a backend probe specification
  */
 
diff --git a/lib/libvcl/vcc_compile.h b/lib/libvcl/vcc_compile.h
index c90d225..b8c8454 100644
--- a/lib/libvcl/vcc_compile.h
+++ b/lib/libvcl/vcc_compile.h
@@ -210,8 +210,6 @@ void vcc_IsField(struct vcc *tl, struct token **t, struct fld_spec *fs);
 void vcc_FieldsOk(struct vcc *tl, const struct fld_spec *fs);
 
 void Emit_Sockaddr(struct vcc *tl, const struct token *t_host, const char *port);
-void vcc_EmitBeIdent(const struct vcc *tl, struct vsb *v,
-	 int serial, const struct token *first, const struct token *last);
 
 /* vcc_compile.c */
 extern struct method method_tab[];
@@ -245,7 +243,6 @@ parsedirector_f vcc_ParseRoundRobinDirector;
 void vcc_RTimeVal(struct vcc *tl, double *);
 void vcc_TimeVal(struct vcc *tl, double *);
 unsigned vcc_UintVal(struct vcc *tl);
-double vcc_DoubleVal(struct vcc *tl);
 void vcc_Expr(struct vcc *tl, enum var_type typ);
 void vcc_Expr_Call(struct vcc *tl, const struct symbol *sym);
 void vcc_Expr_Init(struct vcc *tl);
@@ -267,8 +264,6 @@ sym_wildcard_t vcc_Stv_Wildcard;
 
 /* vcc_string.c */
 char *vcc_regexp(struct vcc *tl);
-int vcc_StringVal(struct vcc *tl);
-void vcc_ExpectedStringval(struct vcc *tl);
 
 /* vcc_symb.c */
 struct symbol *VCC_AddSymbolStr(struct vcc *tl, const char *name, enum symkind);
@@ -303,8 +298,6 @@ void vcc_AddToken(struct vcc *tl, unsigned tok, const char *b,
 sym_wildcard_t vcc_Var_Wildcard;
 const struct var *vcc_FindVar(struct vcc *tl, const struct token *t,
     int wr_access, const char *use);
-void vcc_VarVal(struct vcc *tl, const struct var *vp,
-    const struct token *vt);
 
 /* vcc_vmod.c */
 void vcc_ParseImport(struct vcc *tl);
diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
index 82a8aba..9a504e5 100644
--- a/lib/libvcl/vcc_expr.c
+++ b/lib/libvcl/vcc_expr.c
@@ -145,7 +145,7 @@ vcc_NumVal(struct vcc *tl, double *d, int *frac)
 	vcc_NextToken(tl);
 }
 
-double
+static double
 vcc_DoubleVal(struct vcc *tl)
 {
 	double d;
diff --git a/lib/libvcl/vcc_var.c b/lib/libvcl/vcc_var.c
index 94a5fb9..3871dbc 100644
--- a/lib/libvcl/vcc_var.c
+++ b/lib/libvcl/vcc_var.c
@@ -121,29 +121,3 @@ vcc_FindVar(struct vcc *tl, const struct token *t, int wr_access,
 	vcc_ErrWhere(tl, t);
 	return (NULL);
 }
-
-/*--------------------------------------------------------------------*/
-
-void
-vcc_VarVal(struct vcc *tl, const struct var *vp, const struct token *vt)
-{
-	double d;
-
-	if (vp->fmt == TIME) {
-		vcc_TimeVal(tl, &d);
-		ERRCHK(tl);
-		Fb(tl, 0, "%g", d);
-	} else if (vp->fmt == DURATION) {
-		vcc_RTimeVal(tl, &d);
-		ERRCHK(tl);
-		Fb(tl, 0, "%g", d);
-	} else if (vp->fmt == INT) {
-		Fb(tl, 0, "%u", vcc_UintVal(tl));
-	} else {
-		AN(vt);
-		VSB_printf(tl->sb,
-		    "Variable has incompatible type.\n");
-		vcc_ErrWhere(tl, vt);
-		return;
-	}
-}



More information about the varnish-commit mailing list