aboutsummaryrefslogtreecommitdiffstats
path: root/code/game
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-11-03 17:03:54 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-11-03 17:03:54 +0000
commitb31e8a67d9b1f11b9943b595a4fd66d3a07dd085 (patch)
tree712bb692c851148cf64d90d53dce9c753fb83923 /code/game
parent5502af97628223ea8f5192647cb1dd5dbd72ae3b (diff)
downloadioquake3-aero-b31e8a67d9b1f11b9943b595a4fd66d3a07dd085.tar.gz
ioquake3-aero-b31e8a67d9b1f11b9943b595a4fd66d3a07dd085.zip
fix strict aliasing issues
Patch by Przemysław Iskra (#3805) git-svn-id: svn://svn.icculus.org/quake3/trunk@1481 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/game')
-rw-r--r--code/game/g_syscalls.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/code/game/g_syscalls.c b/code/game/g_syscalls.c
index d82be06..59d89bd 100644
--- a/code/game/g_syscalls.c
+++ b/code/game/g_syscalls.c
@@ -36,9 +36,9 @@ 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_Printf( const char *fmt ) {
@@ -290,9 +290,9 @@ void trap_AAS_PresenceTypeBoundingBox(int presencetype, vec3_t mins, vec3_t maxs
}
float trap_AAS_Time(void) {
- int temp;
- temp = syscall( BOTLIB_AAS_TIME );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AAS_TIME );
+ return fi.f;
}
int trap_AAS_PointAreaNum(vec3_t point) {
@@ -476,15 +476,15 @@ void trap_BotFreeCharacter(int character) {
}
float trap_Characteristic_Float(int character, int index) {
- int temp;
- temp = syscall( BOTLIB_AI_CHARACTERISTIC_FLOAT, character, index );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AI_CHARACTERISTIC_FLOAT, character, index );
+ return fi.f;
}
float trap_Characteristic_BFloat(int character, int index, float min, float max) {
- int temp;
- temp = syscall( BOTLIB_AI_CHARACTERISTIC_BFLOAT, character, index, PASSFLOAT(min), PASSFLOAT(max) );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AI_CHARACTERISTIC_BFLOAT, character, index, PASSFLOAT(min), PASSFLOAT(max) );
+ return fi.f;
}
int trap_Characteristic_Integer(int character, int index) {
@@ -652,9 +652,9 @@ int trap_BotGetMapLocationGoal(char *name, void /* struct bot_goal_s */ *goal) {
}
float trap_BotAvoidGoalTime(int goalstate, int number) {
- int temp;
- temp = syscall( BOTLIB_AI_AVOID_GOAL_TIME, goalstate, number );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AI_AVOID_GOAL_TIME, goalstate, number );
+ return fi.f;
}
void trap_BotSetAvoidGoalTime(int goalstate, int number, float avoidtime) {