Fix event callbacks for x86_64

Fix remaining event related code for the new intptr_t value type.
Regenerated game/gamesys/Callbacks.cpp via CREATE_EVENT_CODE.
This commit is contained in:
dhewg 2011-12-01 19:03:17 +01:00 committed by Daniel Gibson
parent 379ab902bb
commit 30dd372efa
12 changed files with 1041 additions and 1041 deletions

File diff suppressed because it is too large Load diff

View file

@ -828,7 +828,7 @@ idClass::ProcessEventArgs
bool idClass::ProcessEventArgs( const idEventDef *ev, int numargs, ... ) { bool idClass::ProcessEventArgs( const idEventDef *ev, int numargs, ... ) {
idTypeInfo *c; idTypeInfo *c;
int num; int num;
int data[ D_EVENT_MAXARGS ]; intptr_t data[ D_EVENT_MAXARGS ];
va_list args; va_list args;
assert( ev ); assert( ev );
@ -936,7 +936,7 @@ bool idClass::ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg ar
idClass::ProcessEventArgPtr idClass::ProcessEventArgPtr
================ ================
*/ */
bool idClass::ProcessEventArgPtr( const idEventDef *ev, int *data ) { bool idClass::ProcessEventArgPtr( const idEventDef *ev, intptr_t *data ) {
idTypeInfo *c; idTypeInfo *c;
int num; int num;
eventCallback_t callback; eventCallback_t callback;
@ -999,42 +999,42 @@ http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/
break; break;
case 1 : case 1 :
typedef void ( idClass::*eventCallback_1_t )( const int ); typedef void ( idClass::*eventCallback_1_t )( const intptr_t );
( this->*( eventCallback_1_t )callback )( data[ 0 ] ); ( this->*( eventCallback_1_t )callback )( data[ 0 ] );
break; break;
case 2 : case 2 :
typedef void ( idClass::*eventCallback_2_t )( const int, const int ); typedef void ( idClass::*eventCallback_2_t )( const intptr_t, const intptr_t );
( this->*( eventCallback_2_t )callback )( data[ 0 ], data[ 1 ] ); ( this->*( eventCallback_2_t )callback )( data[ 0 ], data[ 1 ] );
break; break;
case 3 : case 3 :
typedef void ( idClass::*eventCallback_3_t )( const int, const int, const int ); typedef void ( idClass::*eventCallback_3_t )( const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_3_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ] ); ( this->*( eventCallback_3_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ] );
break; break;
case 4 : case 4 :
typedef void ( idClass::*eventCallback_4_t )( const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_4_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_4_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ] ); ( this->*( eventCallback_4_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ] );
break; break;
case 5 : case 5 :
typedef void ( idClass::*eventCallback_5_t )( const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_5_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_5_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ] ); ( this->*( eventCallback_5_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ] );
break; break;
case 6 : case 6 :
typedef void ( idClass::*eventCallback_6_t )( const int, const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_6_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_6_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ] ); ( this->*( eventCallback_6_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ] );
break; break;
case 7 : case 7 :
typedef void ( idClass::*eventCallback_7_t )( const int, const int, const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_7_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_7_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ] ); ( this->*( eventCallback_7_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ] );
break; break;
case 8 : case 8 :
typedef void ( idClass::*eventCallback_8_t )( const int, const int, const int, const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_8_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_8_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ], data[ 7 ] ); ( this->*( eventCallback_8_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ], data[ 7 ] );
break; break;

View file

@ -230,7 +230,7 @@ public:
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 ); bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 ); bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 );
bool ProcessEventArgPtr( const idEventDef *ev, int *data ); bool ProcessEventArgPtr( const idEventDef *ev, intptr_t *data );
void CancelEvents( const idEventDef *ev ); void CancelEvents( const idEventDef *ev );
void Event_Remove( void ); void Event_Remove( void );

View file

@ -334,7 +334,7 @@ idEvent *idEvent::Alloc( const idEventDef *evdef, int numargs, va_list args ) {
idEvent::CopyArgs idEvent::CopyArgs
================ ================
*/ */
void idEvent::CopyArgs( const idEventDef *evdef, int numargs, va_list args, int data[ D_EVENT_MAXARGS ] ) { void idEvent::CopyArgs( const idEventDef *evdef, int numargs, va_list args, intptr_t data[ D_EVENT_MAXARGS ] ) {
int i; int i;
const char *format; const char *format;
idEventArg *arg; idEventArg *arg;
@ -493,7 +493,7 @@ idEvent::ServiceEvents
void idEvent::ServiceEvents( void ) { void idEvent::ServiceEvents( void ) {
idEvent *event; idEvent *event;
int num; int num;
int args[ D_EVENT_MAXARGS ]; intptr_t args[ D_EVENT_MAXARGS ];
int offset; int offset;
int i; int i;
int numargs; int numargs;
@ -593,7 +593,7 @@ idEvent::ServiceFastEvents
void idEvent::ServiceFastEvents() { void idEvent::ServiceFastEvents() {
idEvent *event; idEvent *event;
int num; int num;
int args[ D_EVENT_MAXARGS ]; intptr_t args[ D_EVENT_MAXARGS ];
int offset; int offset;
int i; int i;
int numargs; int numargs;
@ -1016,8 +1016,6 @@ CreateEventCallbackHandler
================ ================
*/ */
void CreateEventCallbackHandler( void ) { void CreateEventCallbackHandler( void ) {
int num;
int count;
int i, j, k; int i, j, k;
char argString[ D_EVENT_MAXARGS + 1 ]; char argString[ D_EVENT_MAXARGS + 1 ];
idStr string1; idStr string1;
@ -1046,7 +1044,7 @@ void CreateEventCallbackHandler( void ) {
string1 += "const float"; string1 += "const float";
string2 += va( "*( float * )&data[ %d ]", k ); string2 += va( "*( float * )&data[ %d ]", k );
} else { } else {
string1 += "const int"; string1 += "const intptr_t";
string2 += va( "data[ %d ]", k ); string2 += va( "data[ %d ]", k );
} }

View file

@ -104,7 +104,7 @@ public:
~idEvent(); ~idEvent();
static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args ); static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args );
static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, int data[ D_EVENT_MAXARGS ] ); static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, intptr_t data[ D_EVENT_MAXARGS ] );
void Free( void ); void Free( void );
void Schedule( idClass *object, const idTypeInfo *cls, int time ); void Schedule( idClass *object, const idTypeInfo *cls, int time );

View file

@ -686,7 +686,7 @@ void idInterpreter::CallEvent( const function_t *func, int argsize ) {
varEval_t var; varEval_t var;
int pos; int pos;
int start; int start;
int data[ D_EVENT_MAXARGS ]; intptr_t data[ D_EVENT_MAXARGS ];
const idEventDef *evdef; const idEventDef *evdef;
const char *format; const char *format;
@ -857,7 +857,7 @@ void idInterpreter::CallSysEvent( const function_t *func, int argsize ) {
varEval_t source; varEval_t source;
int pos; int pos;
int start; int start;
int data[ D_EVENT_MAXARGS ]; intptr_t data[ D_EVENT_MAXARGS ];
const idEventDef *evdef; const idEventDef *evdef;
const char *format; const char *format;

File diff suppressed because it is too large Load diff

View file

@ -828,7 +828,7 @@ idClass::ProcessEventArgs
bool idClass::ProcessEventArgs( const idEventDef *ev, int numargs, ... ) { bool idClass::ProcessEventArgs( const idEventDef *ev, int numargs, ... ) {
idTypeInfo *c; idTypeInfo *c;
int num; int num;
int data[ D_EVENT_MAXARGS ]; intptr_t data[ D_EVENT_MAXARGS ];
va_list args; va_list args;
assert( ev ); assert( ev );
@ -936,7 +936,7 @@ bool idClass::ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg ar
idClass::ProcessEventArgPtr idClass::ProcessEventArgPtr
================ ================
*/ */
bool idClass::ProcessEventArgPtr( const idEventDef *ev, int *data ) { bool idClass::ProcessEventArgPtr( const idEventDef *ev, intptr_t *data ) {
idTypeInfo *c; idTypeInfo *c;
int num; int num;
eventCallback_t callback; eventCallback_t callback;
@ -990,42 +990,42 @@ http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/
break; break;
case 1 : case 1 :
typedef void ( idClass::*eventCallback_1_t )( const int ); typedef void ( idClass::*eventCallback_1_t )( const intptr_t );
( this->*( eventCallback_1_t )callback )( data[ 0 ] ); ( this->*( eventCallback_1_t )callback )( data[ 0 ] );
break; break;
case 2 : case 2 :
typedef void ( idClass::*eventCallback_2_t )( const int, const int ); typedef void ( idClass::*eventCallback_2_t )( const intptr_t, const intptr_t );
( this->*( eventCallback_2_t )callback )( data[ 0 ], data[ 1 ] ); ( this->*( eventCallback_2_t )callback )( data[ 0 ], data[ 1 ] );
break; break;
case 3 : case 3 :
typedef void ( idClass::*eventCallback_3_t )( const int, const int, const int ); typedef void ( idClass::*eventCallback_3_t )( const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_3_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ] ); ( this->*( eventCallback_3_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ] );
break; break;
case 4 : case 4 :
typedef void ( idClass::*eventCallback_4_t )( const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_4_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_4_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ] ); ( this->*( eventCallback_4_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ] );
break; break;
case 5 : case 5 :
typedef void ( idClass::*eventCallback_5_t )( const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_5_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_5_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ] ); ( this->*( eventCallback_5_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ] );
break; break;
case 6 : case 6 :
typedef void ( idClass::*eventCallback_6_t )( const int, const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_6_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_6_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ] ); ( this->*( eventCallback_6_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ] );
break; break;
case 7 : case 7 :
typedef void ( idClass::*eventCallback_7_t )( const int, const int, const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_7_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_7_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ] ); ( this->*( eventCallback_7_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ] );
break; break;
case 8 : case 8 :
typedef void ( idClass::*eventCallback_8_t )( const int, const int, const int, const int, const int, const int, const int, const int ); typedef void ( idClass::*eventCallback_8_t )( const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t, const intptr_t );
( this->*( eventCallback_8_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ], data[ 7 ] ); ( this->*( eventCallback_8_t )callback )( data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ], data[ 7 ] );
break; break;

View file

@ -230,7 +230,7 @@ public:
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 ); bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7 );
bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 ); bool ProcessEvent( const idEventDef *ev, idEventArg arg1, idEventArg arg2, idEventArg arg3, idEventArg arg4, idEventArg arg5, idEventArg arg6, idEventArg arg7, idEventArg arg8 );
bool ProcessEventArgPtr( const idEventDef *ev, int *data ); bool ProcessEventArgPtr( const idEventDef *ev, intptr_t *data );
void CancelEvents( const idEventDef *ev ); void CancelEvents( const idEventDef *ev );
void Event_Remove( void ); void Event_Remove( void );

View file

@ -331,7 +331,7 @@ idEvent *idEvent::Alloc( const idEventDef *evdef, int numargs, va_list args ) {
idEvent::CopyArgs idEvent::CopyArgs
================ ================
*/ */
void idEvent::CopyArgs( const idEventDef *evdef, int numargs, va_list args, int data[ D_EVENT_MAXARGS ] ) { void idEvent::CopyArgs( const idEventDef *evdef, int numargs, va_list args, intptr_t data[ D_EVENT_MAXARGS ] ) {
int i; int i;
const char *format; const char *format;
idEventArg *arg; idEventArg *arg;
@ -460,7 +460,7 @@ idEvent::ServiceEvents
void idEvent::ServiceEvents( void ) { void idEvent::ServiceEvents( void ) {
idEvent *event; idEvent *event;
int num; int num;
int args[ D_EVENT_MAXARGS ]; intptr_t args[ D_EVENT_MAXARGS ];
int offset; int offset;
int i; int i;
int numargs; int numargs;
@ -850,7 +850,7 @@ void CreateEventCallbackHandler( void ) {
string1 += "const float"; string1 += "const float";
string2 += va( "*( float * )&data[ %d ]", k ); string2 += va( "*( float * )&data[ %d ]", k );
} else { } else {
string1 += "const int"; string1 += "const intptr_t";
string2 += va( "data[ %d ]", k ); string2 += va( "data[ %d ]", k );
} }

View file

@ -104,7 +104,7 @@ public:
~idEvent(); ~idEvent();
static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args ); static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args );
static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, int data[ D_EVENT_MAXARGS ] ); static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, intptr_t data[ D_EVENT_MAXARGS ] );
void Free( void ); void Free( void );
void Schedule( idClass *object, const idTypeInfo *cls, int time ); void Schedule( idClass *object, const idTypeInfo *cls, int time );

View file

@ -686,7 +686,7 @@ void idInterpreter::CallEvent( const function_t *func, int argsize ) {
varEval_t var; varEval_t var;
int pos; int pos;
int start; int start;
int data[ D_EVENT_MAXARGS ]; intptr_t data[ D_EVENT_MAXARGS ];
const idEventDef *evdef; const idEventDef *evdef;
const char *format; const char *format;
@ -857,7 +857,7 @@ void idInterpreter::CallSysEvent( const function_t *func, int argsize ) {
varEval_t source; varEval_t source;
int pos; int pos;
int start; int start;
int data[ D_EVENT_MAXARGS ]; intptr_t data[ D_EVENT_MAXARGS ];
const idEventDef *evdef; const idEventDef *evdef;
const char *format; const char *format;