mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-24 12:42:32 +00:00
[qfcc] Ensure one is the correct type for incop expressions
This makes for nicer generated code when the incop (especially post) is used in a condition.
This commit is contained in:
parent
dd183d3ba6
commit
18c0ea3657
1 changed files with 3 additions and 0 deletions
|
@ -2524,6 +2524,9 @@ incop_expr (int op, const expr_t *e, int postop)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
auto one = new_int_expr (1); // int constants get auto-cast to float
|
auto one = new_int_expr (1); // int constants get auto-cast to float
|
||||||
|
if (is_scalar (get_type (e))) {
|
||||||
|
one = cast_expr (get_type (e), one);
|
||||||
|
}
|
||||||
if (postop) {
|
if (postop) {
|
||||||
expr_t *t1, *t2;
|
expr_t *t1, *t2;
|
||||||
type_t *type = get_type (e);
|
type_t *type = get_type (e);
|
||||||
|
|
Loading…
Reference in a new issue