]> git.pond.sub.org Git - empserver/commit
nsc: Rename nstr_exec_val() to nstr_eval() and tighten contract
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 2 Feb 2014 08:39:35 +0000 (09:39 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Feb 2015 15:52:59 +0000 (16:52 +0100)
commit143a4e4e6fa2fe641aebe679e77a650782d0b0fc
tree1f639c994a5666d2f4360c4f5240227aec04594d
parent5a1544f9256177e7452452713dfc76e9d05c7ad8
nsc: Rename nstr_exec_val() to nstr_eval() and tighten contract

nstr_exec_val() can produce three different error values: NSC_NOTYPE
on invalid category, invalid type with zero val_as.lng on invalid type
(this is a bug), and the wanted type with zero val_s when it can't
coerce.  None of these should ever happen.

Fix it to always produce an NSC_NOTYPE error value.  Fix up callers to
check for it.

Specify the result's type is promoted on success.  Ensure it is even
when the argument is NSC_VAL with an unpromoted type, which is
invalid.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/nsc.h
src/lib/commands/surv.c
src/lib/common/ef_verify.c
src/lib/common/nstreval.c
src/lib/common/xdump.c
src/lib/subs/nstr.c