From f90613bc3a1423b7b380f38d55c27df9eb107a4e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 2 Apr 2020 15:00:01 +0900 Subject: [PATCH] [gamecode] Rename fields in pr_stack_t s and f are a little too succinct. --- include/QF/progs.h | 4 ++-- libs/gamecode/pr_debug.c | 18 +++++++++--------- libs/gamecode/pr_exec.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/QF/progs.h b/include/QF/progs.h index d9f738846..db969f6af 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -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; diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index b1b7d217c..61e45ce8b 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -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 ("\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); diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 9a287b4f9..4a79f8173 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -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; }