mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
report all bad builtins rather than just the first
This commit is contained in:
parent
595280decb
commit
0ddb5eb822
1 changed files with 9 additions and 5 deletions
|
@ -112,6 +112,7 @@ int
|
||||||
PR_RelocateBuiltins (progs_t *pr)
|
PR_RelocateBuiltins (progs_t *pr)
|
||||||
{
|
{
|
||||||
int i, ind;
|
int i, ind;
|
||||||
|
int bad = 0;
|
||||||
dfunction_t *func;
|
dfunction_t *func;
|
||||||
builtin_t *bi;
|
builtin_t *bi;
|
||||||
const char *bi_name;
|
const char *bi_name;
|
||||||
|
@ -122,23 +123,26 @@ PR_RelocateBuiltins (progs_t *pr)
|
||||||
if (func->first_statement > 0)
|
if (func->first_statement > 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
bi_name = PR_GetString (pr, func->s_name);
|
||||||
|
|
||||||
if (!func->first_statement) {
|
if (!func->first_statement) {
|
||||||
bi_name = PR_GetString (pr, func->s_name);
|
|
||||||
bi = PR_FindBuiltin (pr, bi_name);
|
bi = PR_FindBuiltin (pr, bi_name);
|
||||||
if (!bi) {
|
if (!bi) {
|
||||||
Sys_Printf ("PR_RelocateBuiltins: %s: undefined builtin %s\n",
|
Sys_Printf ("PR_RelocateBuiltins: %s: undefined builtin %s\n",
|
||||||
pr->progs_name, bi_name);
|
pr->progs_name, bi_name);
|
||||||
return 0;
|
bad = 1;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
func->first_statement = -bi->binum;
|
func->first_statement = -bi->binum;
|
||||||
}
|
}
|
||||||
|
|
||||||
ind = -func->first_statement;
|
ind = -func->first_statement;
|
||||||
if (ind >= pr->numbuiltins || !(bi = pr->builtins[ind]) || !bi->proc) {
|
if (ind >= pr->numbuiltins || !(bi = pr->builtins[ind]) || !bi->proc) {
|
||||||
Sys_Printf ("Bad builtin call number: %d\n", ind);
|
Sys_Printf ("Bad builtin call number: %s = #%d\n", bi_name, ind);
|
||||||
return 0;
|
bad = 1;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
((bfunction_t *) func)->func = bi->proc;
|
((bfunction_t *) func)->func = bi->proc;
|
||||||
}
|
}
|
||||||
return 1;
|
return !bad;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue