[qfcc] Use float for v6 comparisons

While simple types used floats, functions, vectors and entities used
ints. This doesn't go so well when compiling for v6 progs.
This commit is contained in:
Bill Currie 2023-02-11 20:11:46 +09:00
parent 67eb38173b
commit b7ad02c71d
1 changed files with 9 additions and 0 deletions

View File

@ -796,6 +796,9 @@ func_compare (int op, expr_t *e1, expr_t *e2)
new_alias_expr (&type_int, e2));
}
e->e.expr.type = &type_int;
if (options.code.progsversion == PROG_ID_VERSION) {
e->e.expr.type = &type_float;
}
return e;
}
@ -814,6 +817,9 @@ vector_compare (int op, expr_t *e1, expr_t *e2)
if (options.code.progsversion < PROG_VERSION) {
expr_t *e = new_binary_expr (op, e1, e2);
e->e.expr.type = &type_int;
if (options.code.progsversion == PROG_ID_VERSION) {
e->e.expr.type = &type_float;
}
return e;
}
int hop = op == EQ ? '&' : '|';
@ -903,6 +909,9 @@ entity_compare (int op, expr_t *e1, expr_t *e2)
}
expr_t *e = new_binary_expr (op, e1, e2);
e->e.expr.type = &type_int;
if (options.code.progsversion == PROG_ID_VERSION) {
e->e.expr.type = &type_float;
}
return e;
}