disable integers for --id. probably not thorough enough yet :/

This commit is contained in:
Bill Currie 2001-08-03 07:47:15 +00:00
parent 484edfde55
commit 1e1cb06a1f
2 changed files with 14 additions and 4 deletions

View file

@ -731,10 +731,14 @@ type_mismatch:
} else {
type = types[t1];
}
if ((op >= OR && op <= GT) || op == '>' || op == '<')
type = &type_integer;
else if (op == '*' && t1 == ev_vector && t2 == ev_vector)
if ((op >= OR && op <= GT) || op == '>' || op == '<') {
if (options.version > PROG_ID_VERSION)
type = &type_integer;
else
type = &type_float;
} else if (op == '*' && t1 == ev_vector && t2 == ev_vector) {
type = &type_float;
}
if (op == '=' && e1->type == ex_expr && e1->e.expr.op == '.') {
e1->e.expr.type = &type_pointer;
}
@ -803,7 +807,10 @@ unary_expr (int op, expr_t *e)
case ex_def:
{
expr_t *n = new_unary_expr (op, e);
n->e.expr.type = &type_integer;
if (options.version > PROG_ID_VERSION)
n->e.expr.type = &type_integer;
else
n->e.expr.type = &type_float;
return n;
}
case ex_integer:

View file

@ -178,6 +178,9 @@ PR_Opcode_Init_Tables (void)
for (op = pr_opcodes; op->name; op++) {
if (op->min_version > options.version)
continue;
if (options.version == PROG_ID_VERSION
&& op->type_c == ev_integer)
op->type_c = ev_float;
Hash_Add (opcode_priority_table, op);
Hash_Add (opcode_priority_type_table_ab, op);
Hash_Add (opcode_priority_type_table_abc, op);