From d92d4ba8b661a2b84db8357c65283de26a7113da Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 1 Dec 2011 14:19:41 +0100 Subject: [PATCH] Fix idEventArg for x86_64 Pointers are passed through events; change the event value type to intptr_t to provide enough bits. --- neo/d3xp/gamesys/Class.h | 12 ++++++------ neo/game/gamesys/Class.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/neo/d3xp/gamesys/Class.h b/neo/d3xp/gamesys/Class.h index 21e6873b..9dc79868 100644 --- a/neo/d3xp/gamesys/Class.h +++ b/neo/d3xp/gamesys/Class.h @@ -57,16 +57,16 @@ struct idEventFunc { class idEventArg { public: int type; - int value; + intptr_t value; idEventArg() { type = D_EVENT_INTEGER; value = 0; }; idEventArg( int data ) { type = D_EVENT_INTEGER; value = data; }; idEventArg( float data ) { type = D_EVENT_FLOAT; value = *reinterpret_cast( &data ); }; - idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast( &data ); }; - idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast( data.c_str() ); }; - idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast( data ); }; - idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast( data ); }; - idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast( data ); }; + idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast( &data ); }; + idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast( data.c_str() ); }; + idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast( data ); }; + idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast( data ); }; + idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast( data ); }; }; class idAllocError : public idException { diff --git a/neo/game/gamesys/Class.h b/neo/game/gamesys/Class.h index 21e6873b..9dc79868 100644 --- a/neo/game/gamesys/Class.h +++ b/neo/game/gamesys/Class.h @@ -57,16 +57,16 @@ struct idEventFunc { class idEventArg { public: int type; - int value; + intptr_t value; idEventArg() { type = D_EVENT_INTEGER; value = 0; }; idEventArg( int data ) { type = D_EVENT_INTEGER; value = data; }; idEventArg( float data ) { type = D_EVENT_FLOAT; value = *reinterpret_cast( &data ); }; - idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast( &data ); }; - idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast( data.c_str() ); }; - idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast( data ); }; - idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast( data ); }; - idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast( data ); }; + idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast( &data ); }; + idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast( data.c_str() ); }; + idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast( data ); }; + idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast( data ); }; + idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast( data ); }; }; class idAllocError : public idException {