From c034a5216e1c9a583ea9f633c9d5b0a801f1cd1b Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 13 Jul 2014 18:57:04 +0200 Subject: use floatint_t --- src/cgame/cg_syscalls.c | 6 +++--- src/game/g_syscalls.c | 6 +++--- src/ui/ui_syscalls.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c index 4765751d..16e01b8f 100644 --- a/src/cgame/cg_syscalls.c +++ b/src/cgame/cg_syscalls.c @@ -38,9 +38,9 @@ Q_EXPORT void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) int PASSFLOAT( float x ) { - float floatTemp; - floatTemp = x; - return *(int *)&floatTemp; + floatint_t fi; + fi.f = x; + return fi.i; } void trap_Print( const char *fmt ) diff --git a/src/game/g_syscalls.c b/src/game/g_syscalls.c index 5622249e..1b278cda 100644 --- a/src/game/g_syscalls.c +++ b/src/game/g_syscalls.c @@ -36,9 +36,9 @@ Q_EXPORT void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) int PASSFLOAT( float x ) { - float floatTemp; - floatTemp = x; - return *(int *)&floatTemp; + floatint_t fi; + fi.f = x; + return fi.i; } void trap_Print( const char *fmt ) diff --git a/src/ui/ui_syscalls.c b/src/ui/ui_syscalls.c index f44a749f..3163322c 100644 --- a/src/ui/ui_syscalls.c +++ b/src/ui/ui_syscalls.c @@ -35,9 +35,9 @@ Q_EXPORT void dllEntry( intptr_t ( QDECL *syscallptr )( intptr_t arg, ... ) ) int PASSFLOAT( float x ) { - float floatTemp; - floatTemp = x; - return *( int * ) & floatTemp; + floatint_t fi; + fi.f = x; + return fi.i; } void trap_Print( const char *string ) @@ -74,9 +74,9 @@ void trap_Cvar_Set( const char *var_name, const char *value ) float trap_Cvar_VariableValue( const char *var_name ) { - int temp; - temp = syscall( UI_CVAR_VARIABLEVALUE, var_name ); - return ( *( float* ) & temp ); + floatint_t fi; + fi.i = syscall( UI_CVAR_VARIABLEVALUE, var_name ); + return fi.f; } void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ) -- cgit