diff --git a/b2/chr.c b/b2/chr.c index bacaed5..2ae316e 100644 --- a/b2/chr.c +++ b/b2/chr.c @@ -70,7 +70,7 @@ struct condition *new_condition(enum relop relop, const char *word) struct condition *cond; cond = alloc_type(struct condition); - cond->value.u.name = word; + cond->value.u.s = word; cond->relop = relop; cond->next = NULL; return cond; @@ -84,7 +84,7 @@ void field_finalize(struct field *field) for (sel = field->sel; sel; sel = sel->next) for (cond = sel->cond; cond; cond = cond->next) - if (!evaluate(field->fmt, cond->value.u.name, + if (!evaluate(field->fmt, cond->value.u.s, &cond->value)) yyerrorf("invalid value in selection"); /* @@@ indicate exact location */ diff --git a/b2/comp.c b/b2/comp.c index 2d2abeb..cec339e 100644 --- a/b2/comp.c +++ b/b2/comp.c @@ -40,7 +40,7 @@ static int do_comp_name(const char *a, enum relop relop, const char *b) int comp_name(const struct value *a, enum relop relop, const struct value *b) { - return do_comp_name(a->u.name, relop, b->u.name); + return do_comp_name(a->u.s, relop, b->u.s); } diff --git a/b2/db.c b/b2/db.c index 9104f94..725d8c9 100644 --- a/b2/db.c +++ b/b2/db.c @@ -110,7 +110,7 @@ static void convert_params(struct param **params, /* convert parameter */ prm->u.field = f; - if (!evaluate(f->fmt, prm->value.u.name, &prm->value)) + if (!evaluate(f->fmt, prm->value.u.s, &prm->value)) yyerrorf("invalid value for %s", f->name); /* add to result list */ diff --git a/b2/dump.c b/b2/dump.c index 761940a..6b431ce 100644 --- a/b2/dump.c +++ b/b2/dump.c @@ -18,7 +18,7 @@ void dump_name(FILE *file, const struct format *fmt, const struct value *v) { - fprintf(file, "%s", v->u.name); + fprintf(file, "%s", v->u.s); } diff --git a/b2/eval.c b/b2/eval.c index 8d8e7b5..b38b9c7 100644 --- a/b2/eval.c +++ b/b2/eval.c @@ -20,7 +20,7 @@ int eval_name(const struct format *fmt, const char *s, struct value *res) { - res->u.name = s; + res->u.s = s; return 1; } diff --git a/b2/lang.y b/b2/lang.y index 2cd500b..d187f45 100644 --- a/b2/lang.y +++ b/b2/lang.y @@ -425,7 +425,7 @@ param: $$ = alloc_type(struct param); $$->u.name = $1; $$->op = rel_eq; - $$->value.u.name = $3; + $$->value.u.s = $3; } ; diff --git a/b2/param.h b/b2/param.h index 6658065..139a092 100644 --- a/b2/param.h +++ b/b2/param.h @@ -52,7 +52,7 @@ struct format { struct value { union { - const char *name; + const char *s; struct bitset set; double abs; struct rel_value {