mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[gamecode] Relocate aux function return types
They are written with offsets relative to the type encodings base.
This commit is contained in:
parent
067bc264fa
commit
2f9f6d3aa9
1 changed files with 12 additions and 9 deletions
|
@ -496,6 +496,12 @@ PR_LoadDebug (progs_t *pr)
|
|||
for (i = 0; i < pr->progs->numfunctions; i++)
|
||||
res->auxfunction_map[i] = 0;
|
||||
|
||||
res->type_encodings_def = PR_FindGlobal (pr, ".type_encodings");
|
||||
if (res->type_encodings_def) {
|
||||
encodings = &G_STRUCT (pr, qfot_type_encodings_t,
|
||||
res->type_encodings_def->ofs);
|
||||
type_encodings = encodings->types;
|
||||
}
|
||||
for (i = 0; i < res->debug->num_auxfunctions; i++) {
|
||||
res->auxfunctions[i].function = LittleLong
|
||||
(res->auxfunctions[i].function);
|
||||
|
@ -508,6 +514,9 @@ PR_LoadDebug (progs_t *pr)
|
|||
res->auxfunctions[i].num_locals = LittleLong
|
||||
(res->auxfunctions[i].num_locals);
|
||||
|
||||
if (type_encodings) {
|
||||
res->auxfunctions[i].return_type += type_encodings;
|
||||
}
|
||||
res->auxfunction_map[res->auxfunctions[i].function] =
|
||||
&res->auxfunctions[i];
|
||||
}
|
||||
|
@ -515,12 +524,6 @@ PR_LoadDebug (progs_t *pr)
|
|||
res->linenos[i].fa.func = LittleLong (res->linenos[i].fa.func);
|
||||
res->linenos[i].line = LittleLong (res->linenos[i].line);
|
||||
}
|
||||
res->type_encodings_def = PR_FindGlobal (pr, ".type_encodings");
|
||||
if (res->type_encodings_def) {
|
||||
encodings = &G_STRUCT (pr, qfot_type_encodings_t,
|
||||
res->type_encodings_def->ofs);
|
||||
type_encodings = encodings->types;
|
||||
}
|
||||
for (i = 0; i < res->debug->num_locals; i++) {
|
||||
res->local_defs[i].type = LittleShort (res->local_defs[i].type);
|
||||
res->local_defs[i].size = LittleShort (res->local_defs[i].size);
|
||||
|
@ -1320,7 +1323,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents)
|
|||
char mode = fmt[1], opchar = fmt[2];
|
||||
unsigned parm_ind = 0;
|
||||
pr_int_t opval;
|
||||
qfot_type_t *optype = ev_void;
|
||||
qfot_type_t *optype = &res->void_type;
|
||||
func_t func;
|
||||
|
||||
if (mode == 'P') {
|
||||
|
@ -1355,7 +1358,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents)
|
|||
}
|
||||
switch (mode) {
|
||||
case 'R':
|
||||
optype = ev_void;
|
||||
optype = &res->void_type;
|
||||
aux_func = get_aux_function (pr);
|
||||
if (aux_func) {
|
||||
optype = get_type (res, aux_func->return_type);
|
||||
|
@ -1373,7 +1376,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents)
|
|||
break;
|
||||
case 'P':
|
||||
parm_def = PR_Get_Param_Def (pr, call_func, parm_ind);
|
||||
optype = ev_void;
|
||||
optype = &res->void_type;
|
||||
if (parm_def) {
|
||||
optype = get_type (res, parm_def->type_encoding);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue