Simplify type coercion in condition evaluation

Change nstr_mkselval() to generate values with promoted types only,
and replace nstr_coerce_val() by new and simpler nstr_optype() in
nstr_comp().

Replace the only remaining use of nstr_coerce_val() in surv() by
nstr_promote(), and remove nstr_coerce_val().

This loses one half of the unimplemented sketch of coercions to
NSC_STRING.  Drop the other half from nstr_exec_val().
This commit is contained in:
Markus Armbruster 2008-12-27 16:59:53 +01:00
parent d2fba584e8
commit 9115c03949
4 changed files with 36 additions and 90 deletions

View file

@ -71,7 +71,7 @@ surv(void)
ptr = nstr_comp_val(ptr, &val, EF_SECTOR);
if (!ptr)
return RET_SYN;
if (val.val_cat != NSC_OFF || nstr_coerce_val(&val, NSC_LONG, NULL) < 0) {
if (val.val_cat != NSC_OFF || nstr_promote(val.val_type) != NSC_LONG) {
pr("Can't survey this\n");
return RET_SYN;
}