From 84b4c24ec6848505549af4b240df492317138f27 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 25 Dec 2012 13:08:07 +0100 Subject: [PATCH] type: Make an assert()ion independent of the last entry of an enum. --- type.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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]; } -- 2.20.1