mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-16 17:01:53 +00:00
[qfcc] Cast pointers to ints for comparison
Ruamoko doesn't wast instructions on otherwise compatible low-level types.
This commit is contained in:
parent
501dd7db76
commit
f853a449b8
1 changed files with 6 additions and 1 deletions
|
@ -686,7 +686,12 @@ pointer_compare (int op, expr_t *e1, expr_t *e2)
|
|||
return error (e2, "cannot use %s on pointers of different types",
|
||||
get_op_string (op));
|
||||
}
|
||||
e = new_binary_expr (op, e1, e2);
|
||||
if (options.code.progsversion < PROG_VERSION) {
|
||||
e = new_binary_expr (op, e1, e2);
|
||||
} else {
|
||||
e = new_binary_expr (op, cast_expr (&type_int, e1),
|
||||
cast_expr (&type_int, e2));
|
||||
}
|
||||
e->e.expr.type = &type_int;
|
||||
return e;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue