aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-11 00:48:20 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-11 13:49:02 +0100
commit30ca8e0bc21702da00a3570d2a2c1c969f9d9e01 (patch)
tree86ee33662d5ba83f2ac48d315d505a1dd1a50ce6
parent91c4ac100b05c4a68e619d1b2e36a9c6d50e034c (diff)
downloadsparse-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 66e17756..d544ba51 100644
--- a/parse.c
+++ b/parse.c
@@ -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)