From: Christoph Mallon Date: Tue, 25 Dec 2012 12:08:07 +0000 (+0100) Subject: type: Make an assert()ion independent of the last entry of an enum. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;ds=sidebyside;h=84b4c24ec6848505549af4b240df492317138f27;p=cparser type: Make an assert()ion independent of the last entry of an enum. --- diff --git a/type.c b/type.c index fd3b4ce..5a71c31 100644 --- a/type.c +++ b/type.c @@ -50,8 +50,7 @@ static size_t get_type_struct_size(type_kind_t kind) [TYPE_TYPEDEF] = sizeof(typedef_type_t), [TYPE_TYPEOF] = sizeof(typeof_type_t), }; - assert(lengthof(sizes) == (int)TYPE_TYPEOF + 1); - assert(kind <= TYPE_TYPEOF); + assert((size_t)kind < lengthof(sizes)); assert(sizes[kind] != 0); return sizes[kind]; }