warning/error message cleanups. Well, at least *I* think they make more

sense. :)
This commit is contained in:
Jeff Teunissen 2001-07-06 02:43:39 +00:00
parent 62a4b86001
commit 35f5118803
2 changed files with 8 additions and 7 deletions

View file

@ -441,7 +441,7 @@ binary_const (int op, expr_t *e1, expr_t *e2)
if (t1 == t2) { if (t1 == t2) {
return do_op[t1](op, e1, e2); return do_op[t1](op, e1, e2);
} else { } else {
return error (e1, "type missmatch for %d (%c)", return error (e1, "type mismatch for %d (%c)",
op, (op > ' ' && op < 127) ? op : ' '); op, (op > ' ' && op < 127) ? op : ' ');
} }
} }
@ -527,7 +527,7 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
} }
default: default:
type_mismatch: type_mismatch:
return error (e1, "type missmatch %d %d", t1, t2); return error (e1, "type mismatch %d %d", t1, t2);
} }
} }
} }
@ -645,7 +645,7 @@ function_expr (expr_t *e1, expr_t *e2)
for (e = e2; e; e = e->next) for (e = e2; e; e = e->next)
parm_count++; parm_count++;
if (parm_count > 8) { if (parm_count > 8) {
return error (e1, "more than 8 paramters"); return error (e1, "more than 8 parameters");
} }
if (ftype->num_parms != -1) { if (ftype->num_parms != -1) {
if (parm_count > ftype->num_parms) { if (parm_count > ftype->num_parms) {
@ -773,6 +773,7 @@ emit_assign_expr (expr_t *e)
memcpy (pr_globals + ofs, pr_globals + def_a->ofs, size); memcpy (pr_globals + ofs, pr_globals + def_a->ofs, size);
def_a->ofs = ofs; def_a->ofs = ofs;
def_a->initialized = 0; def_a->initialized = 0;
warning (e1, "assignment to constant %s", def_a->name);
} else { } else {
error (e1, "assignment to constant %s", def_a->name); error (e1, "assignment to constant %s", def_a->name);
} }
@ -961,7 +962,7 @@ emit_expr (expr_t *e)
emit_statement (op_state, def_a, def_b, 0); emit_statement (op_state, def_a, def_b, 0);
break; break;
default: default:
warning (e, "unused expression ignored"); warning (e, "Ignoring useless expression");
break; break;
} }
break; break;
@ -977,7 +978,7 @@ emit_expr (expr_t *e)
emit_branch (op_goto, 0, e->e.expr.e1); emit_branch (op_goto, 0, e->e.expr.e1);
break; break;
default: default:
warning (e, "unused expression ignored"); warning (e, "Ignoring useless expression");
emit_expr (e->e.expr.e1); emit_expr (e->e.expr.e1);
break; break;
} }
@ -988,7 +989,7 @@ emit_expr (expr_t *e)
case ex_string: case ex_string:
case ex_vector: case ex_vector:
case ex_quaternion: case ex_quaternion:
warning (e, "unused expression ignored"); warning (e, "Ignoring useless expression");
break; break;
} }
PR_FreeTempDefs (); PR_FreeTempDefs ();

View file

@ -84,7 +84,7 @@ PR_ParseImmediate (def_t *def)
vector_imm_defs = Hash_NewTable (16381, vector_imm_get_key, 0, 0); vector_imm_defs = Hash_NewTable (16381, vector_imm_get_key, 0, 0);
} }
if (def && def->type != pr_immediate_type) { if (def && def->type != pr_immediate_type) {
PR_ParseError ("immediate type missmatch"); PR_ParseError ("type mismatch for immediate value");
} }
if (pr_immediate_type == &type_string) { if (pr_immediate_type == &type_string) {
cn = (def_t*) Hash_Find (string_imm_defs, pr_immediate_string); cn = (def_t*) Hash_Find (string_imm_defs, pr_immediate_string);