@@ -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;
@@ -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,
};
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@gmail.com> --- parse.c | 6 +++--- symbol.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)