From: Jérémie Astor Date: Fri, 3 Apr 2020 14:34:27 +0000 (+0200) Subject: :art: Remove clang warning X-Git-Tag: nightly~1716 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7f5a97eefd935c301b9e82b6a16071fb96a31d45;p=gwion.git :art: Remove clang warning --- diff --git a/include/env/tuple.h b/include/env/tuple.h index ec08289d..b4af992b 100644 --- a/include/env/tuple.h +++ b/include/env/tuple.h @@ -4,14 +4,13 @@ typedef struct TupleForm_* TupleForm; struct TupleForm_ { struct Vector_ types; struct Vector_ offset; -// Type_List list; m_uint start; }; ANN Type tuple_type(const Env, const Vector, const loc_t); ANN void tuple_info(const Env, Type_Decl*, const Var_Decl); ANN2(1) TupleForm new_tupleform(MemPool p, const Type parent_type); -ANN void free_tupleform(MemPool p, const TupleForm tuple); +ANN void free_tupleform(const TupleForm tuple); #ifdef __INSTR INSTR(TupleCtor); diff --git a/src/env/tupleform.c b/src/env/tupleform.c index 6f828716..8a8aef40 100644 --- a/src/env/tupleform.c +++ b/src/env/tupleform.c @@ -47,7 +47,7 @@ ANN2(1) TupleForm new_tupleform(MemPool p, const Type parent_type) { return tuple; } -ANN void free_tupleform(MemPool p, const TupleForm tuple) { +ANN void free_tupleform(const TupleForm tuple) { vector_release(&tuple->types); vector_release(&tuple->offset); } diff --git a/src/parse/check.c b/src/parse/check.c index 581468ca..05130dac 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1122,7 +1122,9 @@ ANN static Symbol case_op(const Env env, const Exp e, const m_uint i) { } ANN static m_bool match_case_exp(const Env env, Exp e) { - for(m_uint i = 0; i < map_size(&env->scope->match->map) && e; e = e->next, ++i) { + for(m_uint i = 0; i < map_size(&env->scope->match->map); e = e->next, ++i) { + if(!e) + ERR_B(e->pos, _("no enough to match")) const Symbol op = case_op(env, e, i); if(op) { const Exp base = (Exp)VKEY(&env->scope->match->map, i);