summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-02-24 22:04:35 +0000
committerTim Angus <tim@ngus.net>2006-02-24 22:04:35 +0000
commite9456d7a58fc721cc5c931838399d9734b6fd971 (patch)
treeece21f7411a55bb9bfec20a5e516d589726aa272
parent5c520de1c5d9fe71dadea68767535ce27add2dba (diff)
* Merged ioq3-r584
-rw-r--r--src/cgame/cg_main.c6
-rw-r--r--src/cgame/cg_syscalls.c4
-rw-r--r--src/client/cl_cgame.c2
-rw-r--r--src/client/cl_scrn.c2
-rw-r--r--src/client/cl_ui.c2
-rw-r--r--src/client/snd_codec_wav.c11
-rw-r--r--src/client/snd_openal.c2
-rw-r--r--src/game/g_main.c8
-rw-r--r--src/game/g_syscalls.c4
-rw-r--r--src/qcommon/common.c6
-rw-r--r--src/qcommon/q_shared.h6
-rw-r--r--src/qcommon/qcommon.h16
-rw-r--r--src/qcommon/vm.c26
-rw-r--r--src/qcommon/vm_interpreted.c8
-rw-r--r--src/qcommon/vm_local.h5
-rw-r--r--src/qcommon/vm_x86.c2
-rw-r--r--src/server/sv_client.c2
-rw-r--r--src/server/sv_game.c2
-rw-r--r--src/server/sv_init.c2
-rw-r--r--src/server/sv_main.c4
-rw-r--r--src/ui/ui_main.c6
-rw-r--r--src/ui/ui_syscalls.c4
-rw-r--r--src/unix/unix_main.c6
-rw-r--r--src/win32/win_main.c10
24 files changed, 81 insertions, 65 deletions
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 5963d0bf..d5903ce7 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -43,9 +43,9 @@ This is the only way control passes into the module.
This must be the very first function compiled into the .q3vm file
================
*/
-long vmMain( long command, long arg0, long arg1, long arg2, long arg3,
- long arg4, long arg5, long arg6, long arg7,
- long arg8, long arg9, long arg10, long arg11 )
+intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3,
+ int arg4, int arg5, int arg6, int arg7,
+ int arg8, int arg9, int arg10, int arg11 )
{
switch( command )
{
diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c
index 1d982734..5c7ac16d 100644
--- a/src/cgame/cg_syscalls.c
+++ b/src/cgame/cg_syscalls.c
@@ -27,10 +27,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
-static long (QDECL *syscall)( long arg, ... ) = (long (QDECL *)( long, ...))-1;
+static intptr_t (QDECL *syscall)( intptr_t arg, ... ) = (intptr_t (QDECL *)( intptr_t, ...))-1;
-void dllEntry( long (QDECL *syscallptr)( long arg,... ) )
+void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) )
{
syscall = syscallptr;
}
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index 96a18f6e..7d4c0a95 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -414,7 +414,7 @@ CL_CgameSystemCalls
The cgame module is making a system call
====================
*/
-long CL_CgameSystemCalls( long *args ) {
+intptr_t CL_CgameSystemCalls( intptr_t *args ) {
switch( args[0] ) {
case CG_PRINT:
Com_Printf( "%s", VMA(1) );
diff --git a/src/client/cl_scrn.c b/src/client/cl_scrn.c
index d1da0018..21f4b932 100644
--- a/src/client/cl_scrn.c
+++ b/src/client/cl_scrn.c
@@ -418,7 +418,7 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
// wide aspect ratio screens need to have the sides cleared
// unless they are displaying game renderings
- if ( cls.state != CA_ACTIVE ) {
+ if ( cls.state != CA_ACTIVE && cls.state != CA_CINEMATIC ) {
if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) {
re.SetColor( g_color_table[0] );
re.DrawStretchPic( 0, 0, cls.glconfig.vidWidth, cls.glconfig.vidHeight, 0, 0, 0, 0, cls.whiteShader );
diff --git a/src/client/cl_ui.c b/src/client/cl_ui.c
index eee0ba1f..d5dca4c2 100644
--- a/src/client/cl_ui.c
+++ b/src/client/cl_ui.c
@@ -670,7 +670,7 @@ CL_UISystemCalls
The ui module is making a system call
====================
*/
-long CL_UISystemCalls( long *args ) {
+intptr_t CL_UISystemCalls( intptr_t *args ) {
switch( args[0] ) {
case UI_ERROR:
Com_Error( ERR_DROP, "%s", VMA(1) );
diff --git a/src/client/snd_codec_wav.c b/src/client/snd_codec_wav.c
index 281a0023..e38b360e 100644
--- a/src/client/snd_codec_wav.c
+++ b/src/client/snd_codec_wav.c
@@ -133,6 +133,7 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
{
char dump[16];
int wav_format;
+ int bits;
int fmtlen = 0;
// skip the riff wav header
@@ -151,7 +152,15 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
info->rate = FGetLittleLong(file);
FGetLittleLong(file);
FGetLittleShort(file);
- info->width = FGetLittleShort(file) / 8;
+ bits = FGetLittleShort(file);
+
+ if( bits < 8 )
+ {
+ Com_Printf( S_COLOR_RED "ERROR: Less than 8 bit sound is not supported\n");
+ return qfalse;
+ }
+
+ info->width = bits / 8;
info->dataofs = 0;
// Skip the rest of the format chunk if required
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index e3a01754..699db246 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -1641,7 +1641,7 @@ qboolean S_AL_Init( soundInterface_t *si )
s_alMinDistance = Cvar_Get( "s_alMinDistance", "120", CVAR_CHEAT );
s_alRolloff = Cvar_Get( "s_alRolloff", "0.8", CVAR_CHEAT );
s_alMaxSpeakerDistance = Cvar_Get( "s_alMaxSpeakerDistance", "1024", CVAR_ARCHIVE );
- s_alSpatEntOrigin = Cvar_Get( "s_alSpatEntOrigin", "1", CVAR_ARCHIVE );
+ s_alSpatEntOrigin = Cvar_Get( "s_alSpatEntOrigin", "0", CVAR_ARCHIVE );
s_alDriver = Cvar_Get( "s_alDriver", ALDRIVER_DEFAULT, CVAR_ARCHIVE );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index a72d0459..06241b80 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -216,9 +216,9 @@ This is the only way control passes into the module.
This must be the very first function compiled into the .q3vm file
================
*/
-long vmMain( long command, long arg0, long arg1, long arg2, long arg3, long arg4,
- long arg5, long arg6, long arg7, long arg8, long arg9,
- long arg10, long arg11 )
+intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4,
+ int arg5, int arg6, int arg7, int arg8, int arg9,
+ int arg10, int arg11 )
{
switch( command )
{
@@ -231,7 +231,7 @@ long vmMain( long command, long arg0, long arg1, long arg2, long arg3, long arg4
return 0;
case GAME_CLIENT_CONNECT:
- return (long)ClientConnect( arg0, arg1, arg2 );
+ return (intptr_t)ClientConnect( arg0, arg1, arg2 );
case GAME_CLIENT_THINK:
ClientThink( arg0 );
diff --git a/src/game/g_syscalls.c b/src/game/g_syscalls.c
index 4fe05c91..b6347441 100644
--- a/src/game/g_syscalls.c
+++ b/src/game/g_syscalls.c
@@ -26,10 +26,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// this file is only included when building a dll
// g_syscalls.asm is included instead when building a qvm
-static long (QDECL *syscall)( long arg, ... ) = (long (QDECL *)( long, ...))-1;
+static intptr_t (QDECL *syscall)( intptr_t arg, ... ) = (intptr_t (QDECL *)( intptr_t, ...))-1;
-void dllEntry( long (QDECL *syscallptr)( long arg,... ) )
+void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) )
{
syscall = syscallptr;
}
diff --git a/src/qcommon/common.c b/src/qcommon/common.c
index 85cef699..15f36f00 100644
--- a/src/qcommon/common.c
+++ b/src/qcommon/common.c
@@ -928,7 +928,7 @@ void *Z_TagMalloc( int size, int tag ) {
//
size += sizeof(memblock_t); // account for size of block header
size += 4; // space for memory trash tester
- size = PAD(size, sizeof(long)); // align to 32/64 bit boundary
+ size = PAD(size, sizeof(intptr_t)); // align to 32/64 bit boundary
base = rover = zone->rover;
start = base->prev;
@@ -1530,7 +1530,7 @@ void Com_InitHunkMemory( void ) {
Com_Error( ERR_FATAL, "Hunk data failed to allocate %i megs", s_hunkTotal / (1024*1024) );
}
// cacheline align
- s_hunkData = (byte *) ( ( (long)s_hunkData + 31 ) & ~31 );
+ s_hunkData = (byte *) ( ( (intptr_t)s_hunkData + 31 ) & ~31 );
Hunk_Clear();
Cmd_AddCommand( "meminfo", Com_Meminfo_f );
@@ -1750,7 +1750,7 @@ void *Hunk_AllocateTempMemory( int size ) {
Hunk_SwapBanks();
- size = PAD(size, sizeof(long)) + sizeof( hunkHeader_t );
+ size = PAD(size, sizeof(intptr_t)) + sizeof( hunkHeader_t );
if ( hunk_temp->temp + hunk_permanent->permanent + size > s_hunkTotal ) {
Com_Error( ERR_DROP, "Hunk_AllocateTempMemory: failed on %i", size );
diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h
index a55689e7..518eab41 100644
--- a/src/qcommon/q_shared.h
+++ b/src/qcommon/q_shared.h
@@ -102,6 +102,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//=============================================================
+#ifdef Q3_VM
+typedef int intptr_t;
+#else
+#include <inttypes.h>
+#endif
+
typedef unsigned char byte;
typedef enum {qfalse, qtrue} qboolean;
diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h
index 7363d213..e6ae0587 100644
--- a/src/qcommon/qcommon.h
+++ b/src/qcommon/qcommon.h
@@ -311,7 +311,7 @@ typedef enum {
} sharedTraps_t;
void VM_Init( void );
-vm_t *VM_Create( const char *module, long (*systemCalls)(long *),
+vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
vmInterpret_t interpret );
// module should be bare: "cgame", not "cgame.dll" or "vm/cgame.qvm"
@@ -319,18 +319,18 @@ void VM_Free( vm_t *vm );
void VM_Clear(void);
vm_t *VM_Restart( vm_t *vm );
-long QDECL VM_Call( vm_t *vm, long callNum, ... );
+intptr_t QDECL VM_Call( vm_t *vm, int callNum, ... );
void VM_Debug( int level );
-void *VM_ArgPtr( long intValue );
-void *VM_ExplicitArgPtr( vm_t *vm, long intValue );
+void *VM_ArgPtr( intptr_t intValue );
+void *VM_ExplicitArgPtr( vm_t *vm, intptr_t intValue );
#define VMA(x) VM_ArgPtr(args[x])
-static ID_INLINE float _vmf(long x)
+static ID_INLINE float _vmf(intptr_t x)
{
union {
- long l;
+ intptr_t l;
float f;
} t;
t.l = x;
@@ -955,8 +955,8 @@ void Sys_Init (void);
// general development dll loading for virtual machine testing
// fqpath param added 7/20/02 by T.Ray - Sys_LoadDll is only called in vm.c at this time
-void * QDECL Sys_LoadDll( const char *name, char *fqpath , long (QDECL **entryPoint)(long, ...),
- long (QDECL *systemcalls)(long, ...) );
+void * QDECL Sys_LoadDll( const char *name, char *fqpath , intptr_t (QDECL **entryPoint)(int, ...),
+ intptr_t (QDECL *systemcalls)(intptr_t, ...) );
void Sys_UnloadDll( void *dllHandle );
void Sys_UnloadGame( void );
diff --git a/src/qcommon/vm.c b/src/qcommon/vm.c
index 63529309..515afc9b 100644
--- a/src/qcommon/vm.c
+++ b/src/qcommon/vm.c
@@ -330,10 +330,10 @@ Dlls will call this directly
============
*/
-long QDECL VM_DllSyscall( long arg, ... ) {
+intptr_t QDECL VM_DllSyscall( intptr_t arg, ... ) {
#if !id386
// rcg010206 - see commentary above
- long args[16];
+ intptr_t args[16];
int i;
va_list ap;
@@ -341,7 +341,7 @@ long QDECL VM_DllSyscall( long arg, ... ) {
va_start(ap, arg);
for (i = 1; i < sizeof (args) / sizeof (args[i]); i++)
- args[i] = va_arg(ap, long);
+ args[i] = va_arg(ap, intptr_t);
va_end(ap);
return currentVM->systemCall( args );
@@ -472,7 +472,7 @@ vm_t *VM_Restart( vm_t *vm ) {
// DLL's can't be restarted in place
if ( vm->dllHandle ) {
char name[MAX_QPATH];
- long (*systemCall)( long *parms );
+ intptr_t (*systemCall)( intptr_t *parms );
systemCall = vm->systemCall;
Q_strncpyz( name, vm->name, sizeof( name ) );
@@ -508,7 +508,7 @@ it will attempt to load as a system dll
#define STACK_SIZE 0x20000
-vm_t *VM_Create( const char *module, long (*systemCalls)(long *),
+vm_t *VM_Create( const char *module, intptr_t (*systemCalls)(intptr_t *),
vmInterpret_t interpret ) {
vm_t *vm;
vmHeader_t *header;
@@ -649,7 +649,7 @@ void VM_Clear(void) {
lastVM = NULL;
}
-void *VM_ArgPtr( long intValue ) {
+void *VM_ArgPtr( intptr_t intValue ) {
if ( !intValue ) {
return NULL;
}
@@ -665,7 +665,7 @@ void *VM_ArgPtr( long intValue ) {
}
}
-void *VM_ExplicitArgPtr( vm_t *vm, long intValue ) {
+void *VM_ExplicitArgPtr( vm_t *vm, intptr_t intValue ) {
if ( !intValue ) {
return NULL;
}
@@ -710,9 +710,9 @@ locals from sp
#define MAX_STACK 256
#define STACK_MASK (MAX_STACK-1)
-long QDECL VM_Call( vm_t *vm, long callnum, ... ) {
+intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... ) {
vm_t *oldVM;
- int r;
+ intptr_t r;
int i;
if ( !vm ) {
@@ -730,11 +730,11 @@ long QDECL VM_Call( vm_t *vm, long callnum, ... ) {
// if we have a dll loaded, call it directly
if ( vm->entryPoint ) {
//rcg010207 - see dissertation at top of VM_DllSyscall() in this file.
- long args[10];
+ int args[10];
va_list ap;
va_start(ap, callnum);
for (i = 0; i < sizeof (args) / sizeof (args[i]); i++) {
- args[i] = va_arg(ap, long);
+ args[i] = va_arg(ap, int);
}
va_end(ap);
@@ -759,7 +759,7 @@ long QDECL VM_Call( vm_t *vm, long callnum, ... ) {
a.callnum = callnum;
va_start(ap, callnum);
for (i = 0; i < sizeof (a.args) / sizeof (a.args[0]); i++) {
- a.args[i] = va_arg(ap, long);
+ a.args[i] = va_arg(ap, int);
}
va_end(ap);
#ifndef NO_VM_COMPILED
@@ -887,6 +887,6 @@ void VM_LogSyscalls( int *args ) {
f = fopen("syscalls.log", "w" );
}
callnum++;
- fprintf(f, "%i: %li (%i) = %i %i %i %i\n", callnum, (long)(args - (int *)currentVM->dataBase),
+ fprintf(f, "%i: %"PRIiPTR" (%i) = %i %i %i %i\n", callnum, (intptr_t)(args - (int *)currentVM->dataBase),
args[0], args[1], args[2], args[3], args[4] );
}
diff --git a/src/qcommon/vm_interpreted.c b/src/qcommon/vm_interpreted.c
index 0ed58b37..44b6e5d3 100644
--- a/src/qcommon/vm_interpreted.c
+++ b/src/qcommon/vm_interpreted.c
@@ -494,7 +494,7 @@ nextInstruction2:
src = (int *)&image[ r0&dataMask ];
dest = (int *)&image[ r1&dataMask ];
- if ( ( (long)src | (long)dest | count ) & 3 ) {
+ if ( ( (intptr_t)src | (intptr_t)dest | count ) & 3 ) {
// happens in westernq3
Com_Printf( S_COLOR_YELLOW "Warning: OP_BLOCK_COPY not dword aligned\n");
}
@@ -535,16 +535,16 @@ nextInstruction2:
//VM_LogSyscalls( (int *)&image[ programStack + 4 ] );
{
- long* argptr = (long *)&image[ programStack + 4 ];
+ intptr_t* argptr = (intptr_t *)&image[ programStack + 4 ];
#if __WORDSIZE == 64
// the vm has ints on the stack, we expect
// longs so we have to convert it
- long argarr[16];
+ intptr_t argarr[16];
int i;
for (i = 0; i < 16; ++i) {
argarr[i] = *(int*)&image[ programStack + 4 + 4*i ];
- argptr = argarr;
}
+ argptr = argarr;
#endif
r = vm->systemCall( argptr );
}
diff --git a/src/qcommon/vm_local.h b/src/qcommon/vm_local.h
index 7c4b7b1b..27b52260 100644
--- a/src/qcommon/vm_local.h
+++ b/src/qcommon/vm_local.h
@@ -128,7 +128,7 @@ struct vm_s {
// DO NOT MOVE OR CHANGE THESE WITHOUT CHANGING THE VM_OFFSET_* DEFINES
// USED BY THE ASM CODE
int programStack; // the vm may be recursively entered
- long (*systemCall)( long *parms );
+ intptr_t (*systemCall)( intptr_t *parms );
//------------------------------------
@@ -136,7 +136,8 @@ struct vm_s {
// for dynamic linked modules
void *dllHandle;
- long (QDECL *entryPoint)( long callNum, ... );
+ intptr_t (QDECL *entryPoint)( int callNum, ... );
+ void (*destroy)(vm_t* self);
// for interpreted modules
qboolean currentlyInterpreting;
diff --git a/src/qcommon/vm_x86.c b/src/qcommon/vm_x86.c
index c387c216..348cd01e 100644
--- a/src/qcommon/vm_x86.c
+++ b/src/qcommon/vm_x86.c
@@ -193,7 +193,7 @@ void callAsmCall(void)
currentVM->programStack = callProgramStack - 4;
*(int *)((byte *)currentVM->dataBase + callProgramStack + 4) = callSyscallNum;
//VM_LogSyscalls((int *)((byte *)currentVM->dataBase + callProgramStack + 4) );
- *(callOpStack2+1) = currentVM->systemCall( (long *)((byte *)currentVM->dataBase + callProgramStack + 4) );
+ *(callOpStack2+1) = currentVM->systemCall( (intptr_t *)((byte *)currentVM->dataBase + callProgramStack + 4) );
currentVM = savedVM;
}
diff --git a/src/server/sv_client.c b/src/server/sv_client.c
index cbc2e8c9..0272fab0 100644
--- a/src/server/sv_client.c
+++ b/src/server/sv_client.c
@@ -101,7 +101,7 @@ void SV_DirectConnect( netadr_t from ) {
int challenge;
char *password;
int startIndex;
- int denied;
+ intptr_t denied;
int count;
Com_DPrintf ("SVC_DirectConnect ()\n");
diff --git a/src/server/sv_game.c b/src/server/sv_game.c
index cefcddeb..cd6354f5 100644
--- a/src/server/sv_game.c
+++ b/src/server/sv_game.c
@@ -306,7 +306,7 @@ SV_GameSystemCalls
The module is making a system call
====================
*/
-long SV_GameSystemCalls( long *args ) {
+intptr_t SV_GameSystemCalls( intptr_t *args ) {
switch( args[0] ) {
case G_PRINT:
Com_Printf( "%s", VMA(1) );
diff --git a/src/server/sv_init.c b/src/server/sv_init.c
index 15c3de0c..4adff6f2 100644
--- a/src/server/sv_init.c
+++ b/src/server/sv_init.c
@@ -664,7 +664,7 @@ void SV_Shutdown( char *finalmsg ) {
return;
}
- Com_Printf( "----- Server Shutdown -----\n" );
+ Com_Printf( "----- Server Shutdown (%s) -----\n", finalmsg );
if ( svs.clients && !com_errorEntered ) {
SV_FinalMessage( finalmsg );
diff --git a/src/server/sv_main.c b/src/server/sv_main.c
index be579268..adc472ed 100644
--- a/src/server/sv_main.c
+++ b/src/server/sv_main.c
@@ -824,13 +824,13 @@ void SV_Frame( int msec ) {
// 2giga-milliseconds = 23 days, so it won't be too often
if ( svs.time > 0x70000000 ) {
SV_Shutdown( "Restarting server due to time wrapping" );
- Cbuf_AddText( "vstr nextmap\n" );
+ Cbuf_AddText( va( "map %s\n", Cvar_VariableString( "mapname" ) ) );
return;
}
// this can happen considerably earlier when lots of clients play and the map doesn't change
if ( svs.nextSnapshotEntities >= 0x7FFFFFFE - svs.numSnapshotEntities ) {
SV_Shutdown( "Restarting server due to numSnapshotEntities wrapping" );
- Cbuf_AddText( "vstr nextmap\n" );
+ Cbuf_AddText( va( "map %s\n", Cvar_VariableString( "mapname" ) ) );
return;
}
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c
index aee374bd..30b4c9fe 100644
--- a/src/ui/ui_main.c
+++ b/src/ui/ui_main.c
@@ -159,9 +159,9 @@ void _UI_KeyEvent( int key, qboolean down );
void _UI_MouseEvent( int dx, int dy );
void _UI_Refresh( int realtime );
qboolean _UI_IsFullscreen( void );
-long vmMain( long command, long arg0, long arg1, long arg2, long arg3,
- long arg4, long arg5, long arg6, long arg7,
- long arg8, long arg9, long arg10, long arg11 ) {
+intptr_t vmMain( int command, int arg0, int arg1, int arg2, int arg3,
+ int arg4, int arg5, int arg6, int arg7,
+ int arg8, int arg9, int arg10, int arg11 ) {
switch ( command ) {
case UI_GETAPIVERSION:
return UI_API_VERSION;
diff --git a/src/ui/ui_syscalls.c b/src/ui/ui_syscalls.c
index 3aba4d69..545bcecc 100644
--- a/src/ui/ui_syscalls.c
+++ b/src/ui/ui_syscalls.c
@@ -26,9 +26,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// this file is only included when building a dll
// syscalls.asm is included instead when building a qvm
-static long (QDECL *syscall)( long arg, ... ) = (long (QDECL *)( long, ...))-1;
+static intptr_t (QDECL *syscall)( intptr_t arg, ... ) = (intptr_t (QDECL *)( intptr_t, ...))-1;
-void dllEntry( long (QDECL *syscallptr)( long arg,... ) ) {
+void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) {
syscall = syscallptr;
}
diff --git a/src/unix/unix_main.c b/src/unix/unix_main.c
index 156407e0..6e9ead4a 100644
--- a/src/unix/unix_main.c
+++ b/src/unix/unix_main.c
@@ -767,11 +767,11 @@ static void* try_dlopen(const char* base, const char* gamedir, const char* fname
}
void *Sys_LoadDll( const char *name, char *fqpath ,
- long (**entryPoint)(long, ...),
- long (*systemcalls)(long, ...) )
+ intptr_t (**entryPoint)(int, ...),
+ intptr_t (*systemcalls)(intptr_t, ...) )
{
void *libHandle;
- void (*dllEntry)( long (*syscallptr)(long, ...) );
+ void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) );
char curpath[MAX_OSPATH];
char fname[MAX_OSPATH];
char *basepath;
diff --git a/src/win32/win_main.c b/src/win32/win_main.c
index 73d0f485..8b390afd 100644
--- a/src/win32/win_main.c
+++ b/src/win32/win_main.c
@@ -527,10 +527,10 @@ extern char *FS_BuildOSPath( const char *base, const char *game, const char *qp
// fqpath param added 7/20/02 by T.Ray - Sys_LoadDll is only called in vm.c at this time
// fqpath will be empty if dll not loaded, otherwise will hold fully qualified path of dll module loaded
// fqpath buffersize must be at least MAX_QPATH+1 bytes long
-void * QDECL Sys_LoadDll( const char *name, char *fqpath , long (QDECL **entryPoint)(long, ...),
- long (QDECL *systemcalls)(long, ...) ) {
+void * QDECL Sys_LoadDll( const char *name, char *fqpath , intptr_t (QDECL **entryPoint)(intptr_t, ...),
+ intptr_t (QDECL *systemcalls)(intptr_t, ...) ) {
HINSTANCE libHandle;
- void (QDECL *dllEntry)( long (QDECL *syscallptr)(long, ...) );
+ void (QDECL *dllEntry)( intptr_t (QDECL *syscallptr)(intptr_t, ...) );
char *basepath;
char *cdpath;
char *gamedir;
@@ -607,8 +607,8 @@ void * QDECL Sys_LoadDll( const char *name, char *fqpath , long (QDECL **entryPo
}
#endif
- dllEntry = ( void (QDECL *)(long (QDECL *)( long, ... ) ) )GetProcAddress( libHandle, "dllEntry" );
- *entryPoint = (long (QDECL *)(long,...))GetProcAddress( libHandle, "vmMain" );
+ dllEntry = ( void (QDECL *)(intptr_t (QDECL *)( intptr_t, ... ) ) )GetProcAddress( libHandle, "dllEntry" );
+ *entryPoint = (intptr_t (QDECL *)(intptr_t,...))GetProcAddress( libHandle, "vmMain" );
if ( !*entryPoint || !dllEntry ) {
FreeLibrary( libHandle );
return NULL;