projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
995049c
)
type: Make an assert()ion independent of the last entry of an enum.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Tue, 25 Dec 2012 12:08:07 +0000
(13:08 +0100)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 27 Dec 2012 11:58:43 +0000
(12:58 +0100)
type.c
patch
|
blob
|
history
diff --git
a/type.c
b/type.c
index
fd3b4ce
..
5a71c31
100644
(file)
--- 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];
}