diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-11 01:19:34 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-11 14:27:02 +0100 |
commit | 570e295bfad6f0c2a2ed1421f163acd4c275607a (patch) | |
tree | 58f3d1db0c3bfc0b16b4a05d52b1654c642442b2 | |
parent | c2d67bb08bbaadd0a90093b71d5ee408c464853c (diff) | |
download | sparse-570e295bfad6f0c2a2ed1421f163acd4c275607a.tar.gz |
spec: s/size/rank/
In declaration_specifiers() the variable 'size' is used to
make the distinction between char/short/int/long/long long/...
but this correspond more closely to the notion of 'rank' since
some of these types can have the same bit-size.
Rename the variable 'size' to 'rank'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1599,7 +1599,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta { int seen = 0; int class = CInt; - int size = 0; + int rank = 0; while (token_type(token) == TOKEN_IDENT) { struct symbol *s = lookup_symbol(token->ident, @@ -1625,12 +1625,12 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta seen |= s->op->set; class += s->op->class; if (s->op->set & (Set_Short|Set_Float)) { - size = -1; + rank = -1; } else if (s->op->set & Set_Char) { - size = -2; + rank = -2; } else if (s->op->set & Set_Int128) { - size = 3; - } else if (s->op->set & Set_Long && size++) { + rank = 3; + } else if (s->op->set & Set_Long && rank++) { if (class == CReal) { specifier_conflict(token->pos, Set_Vlong, @@ -1652,7 +1652,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta if (!(seen & Set_S)) { /* not set explicitly? */ struct symbol *base = &incomplete_ctype; if (seen & Set_Any) - base = types[class][size]; + base = types[class][rank]; ctx->ctype.base_type = base; } |