[PATCH 5/9] spec: KW_SHORT is not needed

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

 



To determine the rank of shorts & floats, the keyword type
KW_SHORT is used but there is no need for a specific keyword
since testing for 'Set_Short' or 'Set_Float' has the same
effect.

So, remove this keyword and test the Set_... flags instead
as this somehow clarify the processing of specifiers.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 parse.c  | 6 +++---
 symbol.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/parse.c b/parse.c
index c71f34a39..3526bf37e 100644
--- a/parse.c
+++ b/parse.c
@@ -266,14 +266,14 @@ static struct symbol_op double_op = {
 };
 
 static struct symbol_op float_op = {
-	.type = KW_SPECIFIER | KW_SHORT,
+	.type = KW_SPECIFIER,
 	.test = Set_T|Set_Signed|Set_Unsigned|Set_Short|Set_Long,
 	.set = Set_T|Set_Float,
 	.class = CReal,
 };
 
 static struct symbol_op short_op = {
-	.type = KW_SPECIFIER | KW_SHORT,
+	.type = KW_SPECIFIER,
 	.test = Set_S|Set_Char|Set_Float|Set_Double|Set_Long|Set_Short,
 	.set = Set_Short,
 	.class = CInt,
@@ -1624,7 +1624,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta
 			}
 			seen |= s->op->set;
 			class += s->op->class;
-			if (s->op->type & KW_SHORT) {
+			if (s->op->set & (Set_Short|Set_Float)) {
 				size = -1;
 			} else if (s->op->set & Set_Char) {
 				size = -2;
diff --git a/symbol.h b/symbol.h
index 4e7e437bf..5b25c040c 100644
--- a/symbol.h
+++ b/symbol.h
@@ -81,7 +81,7 @@ enum keyword {
      // KW UNUSED	= 1 << 4,
 	KW_ASM		= 1 << 5,
 	KW_MODE		= 1 << 6,
-	KW_SHORT	= 1 << 7,
+     // KW UNUSED	= 1 << 7,
 	KW_LONG		= 1 << 8,
 	KW_EXACT	= 1 << 9,
 };
-- 
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