From 7f5a97eefd935c301b9e82b6a16071fb96a31d45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 3 Apr 2020 16:34:27 +0200 Subject: [PATCH] :art: Remove clang warning --- include/env/tuple.h | 3 +-- src/env/tupleform.c | 2 +- src/parse/check.c | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) 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); -- 2.43.0