History

clarify post_type() VT_STORAGE handling by moving it out

Joe Soroka committed 15 years ago

Commit 810aca91 parent ace0f7f1 file · +7 −7Browse files

Unified · Split

tccgen.c+7−7
@@ -3168,11 +3168,9 @@ static void post_type(CType *type, AttributeDef *ad) · 3167 unmodified lines
31683168 }
31693169 /* we push a anonymous symbol which will contain the function prototype */
31703170 ad->func_args = arg_size;
3171− t1 = type->t & VT_STORAGE;
3172− type->t &= ~VT_STORAGE;
31733171 s = sym_push(SYM_FIELD, type, INT_ATTR(ad), l);
31743172 s->next = first;
3175− type->t = t1 | VT_FUNC;
3173+ type->t = VT_FUNC;
31763174 type->ref = s;
31773175 } else if (tok == '[') {
31783176 SValue *last_vtop = NULL;
@@ -3182,6 +3180,7 @@ static void post_type(CType *type, AttributeDef *ad) · 3 unmodified lines
31823180 if (tok == TOK_RESTRICT1)
31833181 next();
31843182 n = -1;
3183+ t1 = 0;
31853184 if (tok != ']') {
31863185 gexpr();
31873186 if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) {
@@ -3192,14 +3191,12 @@ static void post_type(CType *type, AttributeDef *ad) · 4 unmodified lines
31923191 } else {
31933192 if (!is_integer_btype(vtop->type.t & VT_BTYPE))
31943193 error("size of variable length array should be an integer");
3195− type->t |= VT_VLA;
3194+ t1 = VT_VLA;
31963195 last_vtop = vtop;
31973196 }
31983197 }
31993198 skip(']');
32003199 /* parse next post type */
3201− t1 = type->t & (VT_STORAGE|VT_VLA);
3202− type->t &= ~(VT_STORAGE|VT_VLA);
32033200 post_type(type, ad);
32043201 t1 |= type->t & VT_VLA;
32053202
@@ -3227,7 +3224,7 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td) · 21 unmodified lines
32273224 {
32283225 Sym *s;
32293226 CType type1, *type2;
3230− int qualifiers;
3227+ int qualifiers, storage;
32313228
32323229 while (tok == '*') {
32333230 qualifiers = 0;
@@ -3279,7 +3276,10 @@ static void type_decl(CType *type, AttributeDef *ad, int *v, int td) · 45 unmodified lines
32793276 *v = 0;
32803277 }
32813278 }
3279+ storage = type->t & VT_STORAGE;
3280+ type->t &= ~VT_STORAGE;
32823281 post_type(type, ad);
3282+ type->t |= storage;
32833283 if (tok == TOK_ATTRIBUTE1 || tok == TOK_ATTRIBUTE2)
32843284 parse_attribute(ad);
32853285

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t