============
*/
-void PRVM_PrintFunction_f (void)
+void PRVM_PrintFunction_f(cmd_state_t *cmd)
{
prvm_prog_t *prog;
- if (Cmd_Argc() != 3)
+ if (Cmd_Argc(cmd) != 3)
{
Con_Printf("usage: prvm_printfunction <program name> <function name>\n");
return;
}
- if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+ if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
return;
- PRVM_PrintFunctionStatements(prog, Cmd_Argv(2));
+ PRVM_PrintFunctionStatements(prog, Cmd_Argv(cmd, 2));
}
/*
============
*/
-void PRVM_CallProfile_f (void)
+void PRVM_CallProfile_f(cmd_state_t *cmd)
{
prvm_prog_t *prog;
- if (Cmd_Argc() != 2)
+ if (Cmd_Argc(cmd) != 2)
{
Con_Print("prvm_callprofile <program name>\n");
return;
}
- if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+ if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
return;
PRVM_CallProfile(prog);
============
*/
-void PRVM_Profile_f (void)
+void PRVM_Profile_f(cmd_state_t *cmd)
{
prvm_prog_t *prog;
int howmany;
}
howmany = 1<<30;
- if (Cmd_Argc() == 3)
- howmany = atoi(Cmd_Argv(2));
- else if (Cmd_Argc() != 2)
+ if (Cmd_Argc(cmd) == 3)
+ howmany = atoi(Cmd_Argv(cmd, 2));
+ else if (Cmd_Argc(cmd) != 2)
{
Con_Print("prvm_profile <program name>\n");
return;
}
- if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+ if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
return;
PRVM_Profile(prog, howmany, 0, 0);
}
-void PRVM_ChildProfile_f (void)
+void PRVM_ChildProfile_f(cmd_state_t *cmd)
{
prvm_prog_t *prog;
int howmany;
}
howmany = 1<<30;
- if (Cmd_Argc() == 3)
- howmany = atoi(Cmd_Argv(2));
- else if (Cmd_Argc() != 2)
+ if (Cmd_Argc(cmd) == 3)
+ howmany = atoi(Cmd_Argv(cmd, 2));
+ else if (Cmd_Argc(cmd) != 2)
{
Con_Print("prvm_childprofile <program name>\n");
return;
}
- if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(1))))
+ if (!(prog = PRVM_FriendlyProgFromString(Cmd_Argv(cmd, 1))))
return;
PRVM_Profile(prog, howmany, 0, 1);
void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage)
{
mstatement_t *st, *startst;
- mfunction_t *f, *newf;
+ mfunction_t *func, *enterfunc;
prvm_edict_t *ed;
prvm_eval_t *ptr;
int jumpcount, cachedpr_trace, exitdepth;
double tm, starttm;
prvm_vec_t tempfloat;
// these may become out of date when a builtin is called, and are updated accordingly
- prvm_vec_t *cached_edictsfields = prog->edictsfields;
+ prvm_vec_t *cached_edictsfields = prog->edictsfields.fp;
unsigned int cached_entityfields = prog->entityfields;
unsigned int cached_entityfields_3 = prog->entityfields - 3;
unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
prog->error_cmd("MVM_ExecuteProgram: %s", errormessage);
}
- f = &prog->functions[fnum];
+ func = &prog->functions[fnum];
// after executing this function, delete all tempstrings it created
restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
exitdepth = prog->depth;
// make a stack frame
- st = &prog->statements[PRVM_EnterFunction(prog, f)];
+ st = &prog->statements[PRVM_EnterFunction(prog, func)];
// save the starting statement pointer for profiling
// (when the function exits or jumps, the (st - startst) integer value is
// added to the function's profile counter)
prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
tm = Sys_DirtyTime() - calltime;if (tm < 0 || tm >= 1800) tm = 0;
- f->totaltime += tm;
+ func->totaltime += tm;
if (prog == SVVM_prog)
SV_FlushBroadcastMessages();
void CLVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessage)
{
mstatement_t *st, *startst;
- mfunction_t *f, *newf;
+ mfunction_t *func, *enterfunc;
prvm_edict_t *ed;
prvm_eval_t *ptr;
int jumpcount, cachedpr_trace, exitdepth;
double tm, starttm;
prvm_vec_t tempfloat;
// these may become out of date when a builtin is called, and are updated accordingly
- prvm_vec_t *cached_edictsfields = prog->edictsfields;
+ prvm_vec_t *cached_edictsfields = prog->edictsfields.fp;
unsigned int cached_entityfields = prog->entityfields;
unsigned int cached_entityfields_3 = prog->entityfields - 3;
unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
prog->error_cmd("CLVM_ExecuteProgram: %s", errormessage);
}
- f = &prog->functions[fnum];
+ func = &prog->functions[fnum];
// after executing this function, delete all tempstrings it created
restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
exitdepth = prog->depth;
// make a stack frame
- st = &prog->statements[PRVM_EnterFunction(prog, f)];
+ st = &prog->statements[PRVM_EnterFunction(prog, func)];
// save the starting statement pointer for profiling
// (when the function exits or jumps, the (st - startst) integer value is
// added to the function's profile counter)
prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
tm = Sys_DirtyTime() - calltime;if (tm < 0 || tm >= 1800) tm = 0;
- f->totaltime += tm;
+ func->totaltime += tm;
if (prog == SVVM_prog)
SV_FlushBroadcastMessages();
#endif
{
mstatement_t *st, *startst;
- mfunction_t *f, *newf;
+ mfunction_t *func, *enterfunc;
prvm_edict_t *ed;
prvm_eval_t *ptr;
int jumpcount, cachedpr_trace, exitdepth;
double tm, starttm;
prvm_vec_t tempfloat;
// these may become out of date when a builtin is called, and are updated accordingly
- prvm_vec_t *cached_edictsfields = prog->edictsfields;
+ prvm_vec_t *cached_edictsfields = prog->edictsfields.fp;
unsigned int cached_entityfields = prog->entityfields;
unsigned int cached_entityfields_3 = prog->entityfields - 3;
unsigned int cached_entityfieldsarea = prog->entityfieldsarea;
prog->error_cmd("SVVM_ExecuteProgram: %s", errormessage);
}
- f = &prog->functions[fnum];
+ func = &prog->functions[fnum];
// after executing this function, delete all tempstrings it created
restorevm_tempstringsbuf_cursize = prog->tempstringsbuf.cursize;
exitdepth = prog->depth;
// make a stack frame
- st = &prog->statements[PRVM_EnterFunction(prog, f)];
+ st = &prog->statements[PRVM_EnterFunction(prog, func)];
// save the starting statement pointer for profiling
// (when the function exits or jumps, the (st - startst) integer value is
// added to the function's profile counter)
prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
tm = Sys_DirtyTime() - calltime;if (tm < 0 || tm >= 1800) tm = 0;
- f->totaltime += tm;
+ func->totaltime += tm;
if (prog == SVVM_prog)
SV_FlushBroadcastMessages();