From fbce4de5ee6613df5d837c62db69dbe422a2698d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 29 Apr 2022 16:44:46 +0200 Subject: [PATCH] fix c++ linkage --- src/import/import_checker.c | 6 ++---- src/lib/instr.c | 3 --- src/lib/tmpl_info.c | 3 --- src/parse/scan1.c | 1 - src/parse/template.c | 1 - 5 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/import/import_checker.c b/src/import/import_checker.c index 8e681269..28848073 100644 --- a/src/import/import_checker.c +++ b/src/import/import_checker.c @@ -201,11 +201,10 @@ ANN static Type_Decl *_str2td(const Gwion gwion, struct td_checker *tdc) { } ANN Type_Decl *str2td(const Gwion gwion, const m_str str, const loc_t pos) { -puts(str); struct td_checker tdc = {.str = str, .pos = pos}; DECL_OO(Type_Decl *, td, = _str2td(gwion, &tdc)); -//*(m_uint*)0 = 1; if(*tdc.str) { +/* Type_Decl *tmp = td; while(tmp->next) tmp = tmp->next; while(!strcmp(tdc.str, "[]")) { @@ -214,6 +213,7 @@ puts(str); else td->array->depth++; return td; } +*/ free_type_decl(gwion->mp, td); GWION_ERR_O(pos, "excedental character '%c' in '%s'", *tdc.str, str); } @@ -258,7 +258,6 @@ ANEW ANN m_str type2str(const Gwion gwion, const Type t, const Type owner = t->info->value->from->owner_class; if (owner) { td_fullname(gwion->env, &text, owner); -printf("%s %s\n", text.str, t->name); text_add(&text, "."); } text_add(&text, t->name); @@ -269,7 +268,6 @@ ANEW ANN m_str tl2str(const Gwion gwion, const Type_List tl, const loc_t pos NUSED) { struct td_info info = {.tl = tl, {.mp = gwion->mp}}; CHECK_BO(td_info_run(gwion->env, &info)); -printf("=== %s ===\n", info.text.str); return info.text.str; } diff --git a/src/lib/instr.c b/src/lib/instr.c index afb2f687..f9f546e4 100644 --- a/src/lib/instr.c +++ b/src/lib/instr.c @@ -39,9 +39,6 @@ ANN static Func_Def from_base(const Env env, struct dottmpl_ *const dt, def->base->tmpl->call = cpy_type_list(env->gwion->mp, dt->tl); def->base->tmpl->base = dt->base->base->tmpl->base; dt->def = def; -printf("%s %p\n", v->from->owner->name, v->from->owner_class); -printf("%p %p\n", v->from->owner->parent, v->from->owner); -printf("%p %p\n", v->from->owner->parent->parent, v->from->owner); dt->owner = v->from->owner; dt->owner_class = v->from->owner_class; return def; diff --git a/src/lib/tmpl_info.c b/src/lib/tmpl_info.c index efe18be3..65705889 100644 --- a/src/lib/tmpl_info.c +++ b/src/lib/tmpl_info.c @@ -44,11 +44,8 @@ ANN static inline size_t tmpl_set(struct tmpl_info *info, const m_str str) { ANN static ssize_t template_size(const Env env, struct tmpl_info *info) { DECL_OB(const m_str, str, = tl2str(env->gwion, info->td->types, info->td->pos)); -printf("ùù %s ùù\n", str); const size_t tmpl_sz = tmpl_set(info, str); -puts("jeje"); const m_str base = type2str(env->gwion, info->base, info->td->pos); -printf("mm %s mm\n", str); return tmpl_sz + tmpl_set(info, base) + 4; // return tmpl_sz + tmpl_set(info, info->base->name) + 4; } diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 2777ce0d..b6c232c8 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -41,7 +41,6 @@ ANN static m_bool check_global(const Env env, const Type t, const loc_t pos) { if(!GET_FLAG(t, global) && !from_global_nspc(env, from->owner)) { if(from->owner_class && type_global(env, from->owner_class)) return true; -puts(t->name); gwerr_basic("can't use non-global type in a global class", NULL, NULL, env->name, pos, 0); gwerr_secondary("not declared global", from->filename, from->loc); const struct ValueFrom_ *ownerFrom = env->class_def->info->value->from; diff --git a/src/parse/template.c b/src/parse/template.c index 88403d47..4052bec8 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -69,7 +69,6 @@ ANN Tmpl *mk_tmpl(const Env env, const Tmpl *tm, const Type_List types) { static ANN Type scan_func(const Env env, const Type t, const Type_Decl *td) { DECL_OO(const m_str, tl_name, = tl2str(env->gwion, td->types, td->pos)); -printf("||| %s ||| \n", tl_name); const Symbol sym = func_symbol(env, t->info->value->from->owner->name, t->info->func->name, tl_name, 0); free_mstr(env->gwion->mp, tl_name); -- 2.43.0