mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
make vector.x work for structure fields (which actually makes vectors more
useful in structures:)
This commit is contained in:
parent
df1fdca828
commit
f95510bd46
1 changed files with 16 additions and 1 deletions
|
@ -1232,8 +1232,23 @@ field_expr (expr_t *e1, expr_t *e2)
|
|||
e->e.expr.type = field->type;
|
||||
return e;
|
||||
}
|
||||
case ex_block:
|
||||
break;
|
||||
case ex_uexpr:
|
||||
if (e1->e.expr.op == '.') {
|
||||
if (e1->e.expr.e1->type == ex_pointer) {
|
||||
e = new_expr ();
|
||||
e->type = ex_pointer;
|
||||
e1 = e1->e.expr.e1;
|
||||
i = e1->e.pointer.val;
|
||||
e->e.pointer.val = i + field->offset;
|
||||
e->e.pointer.type = field->type;
|
||||
e->e.pointer.abs = e1->e.pointer.abs;
|
||||
return unary_expr ('.', e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ex_block:
|
||||
print_expr (e1); puts ("");
|
||||
#if 0
|
||||
e1 = new_bind_expr (e1, new_temp_def_expr (t1));
|
||||
e2 = new_short_expr (field->offset);
|
||||
|
|
Loading…
Reference in a new issue