From ebacbd123ab9cd937fdddbfa6a6bbb25645c0f33 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 26 Oct 2014 17:29:50 -0700 Subject: * lib.c (type_check): Function moved to header file inline. (throw_mismatch): New function. * lib.h (throw_mismatch): Declared. (type_mismatch): Declaration turned into inline function. --- lib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index d74a864d..cc81745c 100644 --- a/lib.c +++ b/lib.c @@ -183,11 +183,9 @@ val typeof(val obj) } } -val type_check(val obj, int typecode) +val throw_mismatch(val obj, type_t t) { - if (type(obj) != typecode) - type_mismatch(lit("~s is not of type ~s"), obj, code2type(typecode), nao); - return t; + type_mismatch(lit("~s is not of type ~s"), obj, code2type(t), nao); } val type_check2(val obj, int t1, int t2) -- cgit v1.2.3