Tidy decl_designator
The fixme therein is long solved.
This commit is contained in:
parent
8ca98e23c4
commit
7aef0522b0
1 changed files with 2 additions and 9 deletions
11
tccgen.c
11
tccgen.c
|
@ -5970,7 +5970,6 @@ static void decl_designator(CType *type, Section *sec, unsigned long c,
|
||||||
{
|
{
|
||||||
Sym *s, *f;
|
Sym *s, *f;
|
||||||
int notfirst, index, index_last, align, l, nb_elems, elem_size;
|
int notfirst, index, index_last, align, l, nb_elems, elem_size;
|
||||||
CType type1;
|
|
||||||
|
|
||||||
notfirst = 0;
|
notfirst = 0;
|
||||||
elem_size = 0;
|
elem_size = 0;
|
||||||
|
@ -6022,10 +6021,7 @@ static void decl_designator(CType *type, Section *sec, unsigned long c,
|
||||||
expect("field");
|
expect("field");
|
||||||
if (!notfirst)
|
if (!notfirst)
|
||||||
*cur_field = f;
|
*cur_field = f;
|
||||||
/* XXX: fix this mess by using explicit storage field */
|
type = &f->type;
|
||||||
type1 = f->type;
|
|
||||||
type1.t |= (type->t & ~VT_TYPE);
|
|
||||||
type = &type1;
|
|
||||||
c += f->c;
|
c += f->c;
|
||||||
}
|
}
|
||||||
notfirst = 1;
|
notfirst = 1;
|
||||||
|
@ -6050,10 +6046,7 @@ static void decl_designator(CType *type, Section *sec, unsigned long c,
|
||||||
*cur_field = f = f->next;
|
*cur_field = f = f->next;
|
||||||
if (!f)
|
if (!f)
|
||||||
tcc_error("too many field init");
|
tcc_error("too many field init");
|
||||||
/* XXX: fix this mess by using explicit storage field */
|
type = &f->type;
|
||||||
type1 = f->type;
|
|
||||||
type1.t |= (type->t & ~VT_TYPE);
|
|
||||||
type = &type1;
|
|
||||||
c += f->c;
|
c += f->c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue