mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 18:31:27 +00:00
Fix some more type aliasing issues
Getting there... (I knew this would be a big job)
This commit is contained in:
parent
d50a27a045
commit
9610788dea
3 changed files with 11 additions and 6 deletions
|
@ -1138,9 +1138,9 @@ append_expr (expr_t *block, expr_t *e)
|
|||
}
|
||||
|
||||
static symbol_t *
|
||||
get_struct_field (type_t *t1, expr_t *e1, expr_t *e2)
|
||||
get_struct_field (const type_t *t1, expr_t *e1, expr_t *e2)
|
||||
{
|
||||
symtab_t *strct = t1->t.symtab;
|
||||
symtab_t *strct = unalias_type (t1)->t.symtab;
|
||||
symbol_t *sym = e2->e.symbol;//FIXME need to check
|
||||
symbol_t *field;
|
||||
|
||||
|
@ -1159,12 +1159,12 @@ get_struct_field (type_t *t1, expr_t *e1, expr_t *e2)
|
|||
expr_t *
|
||||
field_expr (expr_t *e1, expr_t *e2)
|
||||
{
|
||||
type_t *t1, *t2;
|
||||
const type_t *t1, *t2;
|
||||
expr_t *e;
|
||||
|
||||
if (e1->type == ex_error)
|
||||
return e1;
|
||||
t1 = get_type (e1);
|
||||
t1 = unalias_type (get_type (e1));
|
||||
if (t1->type == ev_entity) {
|
||||
symbol_t *field = 0;
|
||||
|
||||
|
|
|
@ -422,6 +422,7 @@ external_decl
|
|||
if (spec.is_typedef) {
|
||||
error (0, "typedef %s is initialized", $1->name);
|
||||
$1->sy_type = sy_type;
|
||||
$1->type = alias_type ($1->type, $1->name);
|
||||
symtab_addsymbol (current_symtab, $1);
|
||||
} else {
|
||||
initialize_def ($1, $2, current_symtab->space, spec.storage);
|
||||
|
@ -435,6 +436,7 @@ external_decl
|
|||
$1->type = find_type (append_type ($1->type, spec.type));
|
||||
if (spec.is_typedef) {
|
||||
$1->sy_type = sy_type;
|
||||
$1->type = alias_type ($1->type, $1->name);
|
||||
symtab_addsymbol (current_symtab, $1);
|
||||
} else {
|
||||
$1 = function_symbol ($1, spec.is_overload, 1);
|
||||
|
|
|
@ -897,8 +897,11 @@ type_assignable (const type_t *dst, const type_t *src)
|
|||
if (ret >= 0)
|
||||
return ret;
|
||||
|
||||
dst = dst->t.fldptr.type;
|
||||
src = src->t.fldptr.type;
|
||||
dst = unalias_type (dst->t.fldptr.type);
|
||||
src = unalias_type (src->t.fldptr.type);
|
||||
if (dst == src) {
|
||||
return 1;
|
||||
}
|
||||
if (is_void (dst))
|
||||
return 1;
|
||||
if (is_void (src))
|
||||
|
|
Loading…
Reference in a new issue