aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-11 00:32:13 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-11 14:23:47 +0100
commitc2d67bb08bbaadd0a90093b71d5ee408c464853c (patch)
tree79b2f817b938c35c3479c7f6517cdf37fa41c7f5
parentbe1c60ca43fc7179ce30e2544b3c5b200fbe0804 (diff)
downloadsparse-c2d67bb08bbaadd0a90093b71d5ee408c464853c.tar.gz
spec: KW_LONG is not needed
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>
-rw-r--r--parse.c4
-rw-r--r--symbol.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index 3526bf37..0ace1351 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 5b25c040..188291cd 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,
};