diff options
Diffstat (limited to 'src/qcommon/vm.c')
-rw-r--r-- | src/qcommon/vm.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qcommon/vm.c b/src/qcommon/vm.c index 14fa32e9..225119fb 100644 --- a/src/qcommon/vm.c +++ b/src/qcommon/vm.c @@ -307,7 +307,7 @@ Dlls will call this directly rcg010206 The horror; the horror. - The syscall mechanism relies on stack manipulation to get it's args. + The syscall mechanism relies on stack manipulation to get its args. This is likely due to C's inability to pass "..." parameters to a function in one clean chunk. On PowerPC Linux, these parameters are not necessarily passed on the stack, so while (&arg[0] == arg) @@ -347,7 +347,7 @@ intptr_t QDECL VM_DllSyscall( intptr_t arg, ... ) { args[0] = arg; va_start(ap, arg); - for (i = 1; i < sizeof (args) / sizeof (args[i]); i++) + for (i = 1; i < ARRAY_LEN (args); i++) args[i] = va_arg(ap, intptr_t); va_end(ap); @@ -385,8 +385,8 @@ vmHeader_t *VM_LoadQVM( vm_t *vm, qboolean alloc ) { return NULL; } - // show where the qvm was loaded from - Cmd_ExecuteString( va( "which %s\n", filename ) ); + // show where the qvm was loaded from + Cmd_ExecuteString( va( "which %s\n", filename ) ); if( LittleLong( header.h->vmMagic ) == VM_MAGIC_VER2 ) { Com_Printf( "...which has vmMagic VM_MAGIC_VER2\n" ); @@ -560,7 +560,7 @@ vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *), if ( interpret == VMI_NATIVE ) { // try to load as a system dll Com_Printf( "Loading dll file %s.\n", vm->name ); - vm->dllHandle = Sys_LoadDll( module, vm->fqpath , &vm->entryPoint, VM_DllSyscall ); + vm->dllHandle = Sys_LoadDll( module, &vm->entryPoint, VM_DllSyscall ); if ( vm->dllHandle ) { return vm; } @@ -757,7 +757,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... ) { int args[10]; va_list ap; va_start(ap, callnum); - for (i = 0; i < sizeof (args) / sizeof (args[i]); i++) { + for (i = 0; i < ARRAY_LEN(args); i++) { args[i] = va_arg(ap, int); } va_end(ap); @@ -782,7 +782,7 @@ intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... ) { a.callnum = callnum; va_start(ap, callnum); - for (i = 0; i < sizeof (a.args) / sizeof (a.args[0]); i++) { + for (i = 0; i < ARRAY_LEN(a.args); i++) { a.args[i] = va_arg(ap, int); } va_end(ap); |