more corrections to the error message conversion

Foudn these by writing a simple source checker.
This commit is contained in:
Matthew Flatt 2012-06-01 12:31:23 -07:00
parent 85a2267e6c
commit d8a26e6c3c
9 changed files with 19 additions and 17 deletions

View File

@ -5413,7 +5413,7 @@ static Scheme_Object *file_modify_seconds(int argc, Scheme_Object **argv)
return NULL;
}
if (!scheme_get_time_val(argv[1], &mtime)) {
scheme_contract_error("file-or-directory-modify-seconds"
scheme_contract_error("file-or-directory-modify-seconds",
"integer value is out-of-range",
"value", 1, argv[1],
NULL);

View File

@ -299,7 +299,8 @@ static Scheme_Object *write_top(Scheme_Object *obj)
if (!top->prefix)
scheme_contract_error("write",
"cannot marshal shared compiled code",
"compiled code", 1, obj);
"compiled code", 1, obj,
NULL);
return cons(scheme_make_integer(top->max_let_depth),
cons((Scheme_Object *)top->prefix,

View File

@ -1453,7 +1453,7 @@ static Scheme_Object *do_namespace_attach_module(const char *who, int argc, Sche
same_namespace = SAME_OBJ(from_env, to_env);
if (from_env->phase != to_env->phase) {
scheme_contract_error("namespace-attach-module"
scheme_contract_error("namespace-attach-module",
"source and destination namespace phases do not match",
"source phase", 1, scheme_make_integer(from_env->phase),
"destination phase", 1, scheme_make_integer(to_env->phase),
@ -3914,7 +3914,7 @@ static Scheme_Module *module_load(Scheme_Object *name, Scheme_Env *env, const ch
m = registry_get_loaded(env, name);
if (!m) {
scheme_contract_error(who ? who : "require",
scheme_contract_error((who ? who : "require"),
"unknown module",
"module name", 1, name,
NULL);
@ -5086,7 +5086,7 @@ static void start_module(Scheme_Module *m, Scheme_Env *env, int restart,
for (l = cycle_list; !SCHEME_NULLP(l); l = SCHEME_CDR(l)) {
if (SAME_OBJ(m->modname, SCHEME_CAR(l))) {
scheme_contract_error("module",
"import cycle detected"
"import cycle detected",
"module in cycle", 1, m->modsrc,
NULL);
}

View File

@ -2093,7 +2093,7 @@ static Scheme_Object *bytes_to_real (int argc, Scheme_Object *argv[])
}
if ((slen != 4) && (slen != 8))
scheme_contract_error("floating-point-bytes->real"
scheme_contract_error("floating-point-bytes->real",
"length is not 2, 4, or 8 bytes",
"length", 1, scheme_make_integer(slen),
NULL);

View File

@ -5595,7 +5595,7 @@ static void check_already_closed(const char *name, Scheme_Object *p)
}
if (is_closed) {
scheme_contract_error(name,
"port is closed"
"port is closed",
"port", 1, p,
NULL);
}
@ -9371,7 +9371,7 @@ static Scheme_Object *subprocess(int c, Scheme_Object *args[])
scheme_contract_error(name,
"extra arguments after the application id are "
"not allowed on this platform",
"first extra argument", 1 args[5],
"first extra argument", 1, args[5],
NULL);
} else {
appname = args[3];

View File

@ -5930,7 +5930,8 @@ static Scheme_Object *make_readtable(int argc, Scheme_Object **argv)
if (i + 1 >= argc) {
if (SCHEME_FALSEP(argv[i]))
scheme_contract_error("make-readtable",
"expected 'non-terminating-macro after #f");
"expected 'non-terminating-macro after #f",
NULL);
else
scheme_contract_error("make-readtable",
"expected 'terminating-macro, 'non-terminating-macro, 'dispatch-macro,"

View File

@ -4471,7 +4471,7 @@ static char* immutable_pos_list_to_immutable_array(Scheme_Object *immutable_pos_
else
a_val = SCHEME_INT_VAL(a);
if (a_val < 0) {
scheme_contract_error("make-struct-type"
scheme_contract_error("make-struct-type",
"contract failure at index for immutable field",
"expected matching", 0, "(and/c exact-nonnegative-integer? fixnum?)",
"given", 1, a,

View File

@ -7625,7 +7625,7 @@ static Scheme_Object *general_datum_to_syntax(Scheme_Object *o,
if (ut)
return_NULL; /* happens with bad wraps from a bad .zo */
/* otherwise, only happens with cycles: */
scheme_contract_error("datum->syntax"
scheme_contract_error("datum->syntax",
"cannot create syntax from cyclic datum",
"datum", 1, o,
NULL);

View File

@ -1151,8 +1151,8 @@ void scheme_custodian_check_available(Scheme_Custodian *m, const char *who, cons
if (!scheme_custodian_is_available(m))
scheme_contract_error(who, "the custodian has been shut down",
"custodian", 1, (Scheme_Object *)m,
NULL);
"custodian", 1, m,
NULL);
}
Scheme_Custodian_Reference *scheme_add_managed(Scheme_Custodian *m, Scheme_Object *o,
@ -1441,9 +1441,9 @@ static Scheme_Object *make_custodian(int argc, Scheme_Object *argv[])
if (m->shut_down)
scheme_contract_error("make-custodian",
"the custodian has been shut down",
"custodian", 1, (Scheme_Object *)m,
NULL);
"the custodian has been shut down",
"custodian", 1, m,
NULL);
return (Scheme_Object *)scheme_make_custodian(m);
}
@ -1873,7 +1873,7 @@ static void check_current_custodian_allows(const char *who, Scheme_Thread *p)
scheme_contract_error(who,
"the current custodian does not "
"solely manage the specified thread",
"thread", 1, (Scheme_Object *)p,
"thread", 1, p,
NULL);
}