A minor optimisation for lazy compilers.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3259 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-07-11 18:25:41 +00:00
parent 3b9f4c9fbb
commit bde52736c2

View file

@ -474,13 +474,22 @@ void QVM_UnLoadVM(qvm_t *qvm)
/*
** QVM_Goto
(inlined this the old fashioned way)
*/
static void inline QVM_Goto(qvm_t *vm, int addr)
{
if(addr<0 || addr>vm->len_cs)
Sys_Error("VM run time error: program jumped off to hyperspace\n");
vm->pc=vm->cs+addr*2;
}
#define QVM_Goto(vm,addr) \
do{ \
if(addr<0 || addr>vm->len_cs) \
Sys_Error("VM run time error: program jumped off to hyperspace\n"); \
vm->pc=vm->cs+addr*2; \
} while(0)
//static void inline QVM_Goto(qvm_t *vm, int addr)
//{
// if(addr<0 || addr>vm->len_cs)
// Sys_Error("VM run time error: program jumped off to hyperspace\n");
// vm->pc=vm->cs+addr*2;
//}
/*
** QVM_Call