From: fennecdjay Date: Sat, 3 Sep 2022 10:34:19 +0000 (+0200) Subject: :art: update type_ref X-Git-Tag: nightly~264^2~3 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=20f028d940cd84964901423c3d554c805c225906;p=gwion.git :art: update type_ref --- diff --git a/include/env/type.h b/include/env/type.h index d7a234a0..6c0b4fc4 100644 --- a/include/env/type.h +++ b/include/env/type.h @@ -73,7 +73,7 @@ ANN Symbol array_sym(const Env env, const Type src, ANN static inline Type array_base_simple(Type t) { return t->array_depth ? t->info->base_type : t; } -ANN m_bool type_ref(Type) __attribute__((pure)); +ANN bool type_ref(Type) __attribute__((pure)); ANN Type actual_type(const struct Gwion_ *gwion, const Type t); ANN static inline m_uint env_push_type(const Env env, const Type type) { return env_push(env, type, type->nspc); diff --git a/src/env/type.c b/src/env/type.c index e0e2ed18..05b38149 100644 --- a/src/env/type.c +++ b/src/env/type.c @@ -104,21 +104,21 @@ ANN Type array_type(const Env env, const Type src, const m_uint depth) { return op_check(env, &opi); } -ANN m_bool type_ref(Type t) { +ANN bool type_ref(Type t) { do { - if (tflag(t, tflag_empty)) return GW_OK; + if (tflag(t, tflag_empty)) return true; if (tflag(t, tflag_typedef) && tflag(t, tflag_cdef)) { if (t->info->cdef->base.ext && t->info->cdef->base.ext->array) { if (!t->info->cdef->base.ext->array->exp) - return GW_OK; + return true; else { const Type type = t->info->parent->info->base_type; - if (tflag(type, tflag_empty)) return GW_OK; + if (tflag(type, tflag_empty)) return true; } } } } while ((t = t->info->parent)); - return 0; + return false; } ANN m_uint get_depth(const Type type) {