diff mbox series

[6/9] spec: KW_LONG is not needed

Message ID 20191111134747.79516-7-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series simplify parsing of specifiers | expand

Commit Message

Luc Van Oostenryck Nov. 11, 2019, 1:47 p.m. UTC
To determine the rank of shorts & floats, the keyword type
KW_LONG is used but there is no need for a specific keyword
since testing for 'Set_Long' has the same effect.

So, remove this keyword and test for 'Set_Long' instead
as this somehow clarify the processing of specifiers.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 parse.c  | 4 ++--
 symbol.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/parse.c b/parse.c
index 3526bf37e..0ace13514 100644
--- a/parse.c
+++ b/parse.c
@@ -294,7 +294,7 @@  static struct symbol_op unsigned_op = {
 };
 
 static struct symbol_op long_op = {
-	.type = KW_SPECIFIER | KW_LONG,
+	.type = KW_SPECIFIER,
 	.test = Set_S|Set_Char|Set_Float|Set_Short|Set_Vlong,
 	.set = Set_Long,
 };
@@ -1630,7 +1630,7 @@  static struct token *declaration_specifiers(struct token *token, struct decl_sta
 				size = -2;
 			} else if (s->op->set & Set_Int128) {
 				size = 3;
-			} else if (s->op->type & KW_LONG && size++) {
+			} else if (s->op->set & Set_Long && size++) {
 				if (class == CReal) {
 					specifier_conflict(token->pos,
 							   Set_Vlong,
diff --git a/symbol.h b/symbol.h
index 5b25c040c..188291cd7 100644
--- a/symbol.h
+++ b/symbol.h
@@ -82,7 +82,7 @@  enum keyword {
 	KW_ASM		= 1 << 5,
 	KW_MODE		= 1 << 6,
      // KW UNUSED	= 1 << 7,
-	KW_LONG		= 1 << 8,
+     // KW UNUSED	= 1 << 8,
 	KW_EXACT	= 1 << 9,
 };