diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-11 00:48:20 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-11 13:49:02 +0100 |
commit | 30ca8e0bc21702da00a3570d2a2c1c969f9d9e01 (patch) | |
tree | 86ee33662d5ba83f2ac48d315d505a1dd1a50ce6 | |
parent | 91c4ac100b05c4a68e619d1b2e36a9c6d50e034c (diff) | |
download | sparse-30ca8e0bc21702da00a3570d2a2c1c969f9d9e01.tar.gz |
spec: types[] is indexed by the specifier class
The array types[] is initialized without using 'designators'
but the entries are in fact indexed by the 'class'.
Make this clear by using the 'class' constant (CInt, CUInt, CSInt
& CReal) as designator in the table initializer.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1564,8 +1564,10 @@ static struct symbol * const unsigned_types[] = static struct symbol * const real_types[] = {&float_ctype, &double_ctype, &ldouble_ctype}; static struct symbol * const * const types[] = { - int_types + 2, signed_types + 2, unsigned_types + 2, - real_types + 1, + [CInt] = int_types + 2, + [CSInt] = signed_types + 2, + [CUInt] = unsigned_types + 2, + [CReal] = real_types + 1, }; struct symbol *ctype_integer(int size, int want_unsigned) |