From 20f028d940cd84964901423c3d554c805c225906 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 3 Sep 2022 12:34:19 +0200 Subject: [PATCH] :art: update type_ref --- include/env/type.h | 2 +- src/env/type.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) 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) { -- 2.43.0