[gamecode] Rename fields in pr_stack_t

s and f are a little too succinct.
This commit is contained in:
Bill Currie 2020-04-02 15:00:01 +09:00
parent ea1e85905c
commit f90613bc3a
3 changed files with 16 additions and 16 deletions

View File

@ -1720,8 +1720,8 @@ extern const char *pr_gametype;
typedef struct strref_s strref_t;
typedef struct {
pr_int_t s; ///< Return statement.
bfunction_t *f; ///< Calling function.
pr_int_t staddr; ///< Return statement.
bfunction_t *func; ///< Calling function.
strref_t *tstr; ///< Linked list of temporary strings.
} prstack_t;

View File

@ -1464,35 +1464,35 @@ static void
dump_frame (progs_t *pr, prstack_t *frame)
{
prdeb_resources_t *res = pr->pr_debug_resources;
dfunction_t *f = frame->f ? frame->f->descriptor : 0;
dfunction_t *f = frame->func ? frame->func->descriptor : 0;
if (!f) {
Sys_Printf ("<NO FUNCTION>\n");
return;
}
if (pr_debug->int_val && res->debug) {
pr_lineno_t *lineno = PR_Find_Lineno (pr, frame->s);
pr_lineno_t *lineno = PR_Find_Lineno (pr, frame->staddr);
pr_auxfunction_t *func = PR_Get_Lineno_Func (pr, lineno);
pr_uint_t line = PR_Get_Lineno_Line (pr, lineno);
pr_int_t addr = PR_Get_Lineno_Addr (pr, lineno);
line += func->source_line;
if (addr == frame->s) {
if (addr == frame->staddr) {
Sys_Printf ("%12s:%u : %s: %x\n",
PR_GetString (pr, f->s_file),
line,
PR_GetString (pr, f->s_name),
frame->s);
frame->staddr);
} else {
Sys_Printf ("%12s:%u+%d : %s: %x\n",
PR_GetString (pr, f->s_file),
line, frame->s - addr,
line, frame->staddr - addr,
PR_GetString (pr, f->s_name),
frame->s);
frame->staddr);
}
} else {
Sys_Printf ("%12s : %s: %x\n", PR_GetString (pr, f->s_file),
PR_GetString (pr, f->s_name), frame->s);
PR_GetString (pr, f->s_name), frame->staddr);
}
}
@ -1507,8 +1507,8 @@ PR_StackTrace (progs_t *pr)
return;
}
top.s = pr->pr_xstatement;
top.f = pr->pr_xfunction;
top.staddr = pr->pr_xstatement;
top.func = pr->pr_xfunction;
dump_frame (pr, &top);
for (i = pr->pr_depth - 1; i >= 0; i--)
dump_frame (pr, pr->pr_stack + i);

View File

@ -124,9 +124,9 @@ PR_PushFrame (progs_t *pr)
frame = pr->pr_stack + pr->pr_depth++;
frame->s = pr->pr_xstatement;
frame->f = pr->pr_xfunction;
frame->tstr = pr->pr_xtstr;
frame->staddr = pr->pr_xstatement;
frame->func = pr->pr_xfunction;
frame->tstr = pr->pr_xtstr;
pr->pr_xtstr = pr->pr_pushtstr;
pr->pr_pushtstr = 0;
@ -158,8 +158,8 @@ PR_PopFrame (progs_t *pr)
// up stack
frame = pr->pr_stack + --pr->pr_depth;
pr->pr_xfunction = frame->f;
pr->pr_xstatement = frame->s;
pr->pr_xfunction = frame->func;
pr->pr_xstatement = frame->staddr;
pr->pr_xtstr = frame->tstr;
}