From 379ab902bb8e6db4b5d0137999f5c285427ea045 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. --- d3xp/gamesys/Class.h | 12 ++++++------ game/gamesys/Class.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/d3xp/gamesys/Class.h b/d3xp/gamesys/Class.h index 21e6873..9dc7986 100644 --- a/d3xp/gamesys/Class.h +++ b/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/game/gamesys/Class.h b/game/gamesys/Class.h index 21e6873..9dc7986 100644 --- a/game/gamesys/Class.h +++ b/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 {