From: fennecdjay Date: Mon, 12 Feb 2024 13:24:38 +0000 (+0100) Subject: :fire: boolify tmpl_fptr X-Git-Tag: nightly~93 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=951d22f467ac66bfc424b7824e0f205e9c61736f;p=gwion.git :fire: boolify tmpl_fptr --- diff --git a/include/closure.h b/include/closure.h index 9389151d..85bf76e3 100644 --- a/include/closure.h +++ b/include/closure.h @@ -1,4 +1,4 @@ #ifndef __GWION_CLOSURE #define __GWION_CLOSURE -ANN m_bool tmpl_fptr(const Env env, const Fptr_Def fptr, const Func_Def fdef); +ANN bool tmpl_fptr(const Env env, const Fptr_Def fptr, const Func_Def fdef); #endif diff --git a/src/lib/closure.c b/src/lib/closure.c index 01412b8a..08c99c77 100644 --- a/src/lib/closure.c +++ b/src/lib/closure.c @@ -701,14 +701,14 @@ static CTOR(fptr_ctor) { *(VM_Code*)o->data = ((Func)vector_at(&o->type_ref->nspc->vtable, 1))->code; } -ANN m_bool tmpl_fptr(const Env env, const Fptr_Def fptr, const Func_Def fdef) { +ANN bool tmpl_fptr(const Env env, const Fptr_Def fptr, const Func_Def fdef) { fptr->cdef->base.type->nspc->offset += SZ_INT * 3; env_push_type(env, fptr->cdef->base.type); - CHECK_BB(traverse_func_def(env, fdef)); + CHECK_B(traverse_func_def(env, fdef)); builtin_func(env->gwion, fdef->base->func, fptr_ctor); set_tflag(fdef->base->func->value_ref->type, tflag_ftmpl); env_pop(env, 0); - return GW_OK; + return true; } static DTOR(fptr_dtor) { diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 881a3a71..1cba388b 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -79,7 +79,7 @@ ANN m_bool scan2_fptr_def(const Env env NUSED, const Fptr_Def fptr) { const m_bool ret = scan2_class_def(env, fptr->cdef); const Func_Def fdef = mp_vector_at(fptr->cdef->base.type->info->cdef->body, struct Section_ , 0)->d.func_def; if(fdef->base->func) set_fflag(fdef->base->func, fflag_fptr); - else CHECK_BB(tmpl_fptr(env, fptr, fdef)); + else CHECK_b(tmpl_fptr(env, fptr, fdef)); if(GET_FLAG(fptr->cdef, global)) env_pop(env, 0); return ret; }