[PATCH 2/9] spec: types[] is indexed by the specifier class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 parse.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/parse.c b/parse.c
index 66e177561..d544ba51e 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)
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux