Commit 0459355a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Remove unused/unreferenced stuff.

Not detected by:  FlexeLint 9.00f
Detected by:  FlexeLint 9.00g
parent 8f451fa7
......@@ -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 { \
......
......@@ -210,44 +210,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
*/
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
}
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