From 787ae313812f0a385f3cec9216fa0e67df148ca7 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Thu, 13 Apr 2017 11:30:00 +0000 Subject: fix a bunch of C-specific programming errors detected by Clang --- src/game/bg_public.h | 2 +- src/game/g_active.c | 2 +- src/game/g_buildable.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 817b7aa..cbb2def 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -1014,7 +1014,7 @@ typedef struct int meansOfDeath; int team; - weapon_t buildWeapon; + int buildWeapon; int idleAnim; diff --git a/src/game/g_active.c b/src/game/g_active.c index 147aabc..bfbec2a 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -236,7 +236,7 @@ static void G_ClientShove( gentity_t *ent, gentity_t *victim ) VectorNormalizeFast( dir ); // don't break the dretch elevator - if( abs( dir[ 2 ] ) > abs( dir[ 0 ] ) && abs( dir[ 2 ] ) > abs( dir[ 1 ] ) ) + if( fabs( dir[ 2 ] ) > fabs( dir[ 0 ] ) && fabs( dir[ 2 ] ) > fabs( dir[ 1 ] ) ) return; VectorScale( dir, diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index b8ecad4..983e259 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2229,8 +2229,8 @@ qboolean HMGTurret_TrackEnemy( gentity_t *self ) vectoangles( dirToTarget, self->turretAim ); //if pointing at our target return true - if( abs( angleToTarget[ YAW ] - self->s.angles2[ YAW ] ) <= accuracyTolerance && - abs( angleToTarget[ PITCH ] - self->s.angles2[ PITCH ] ) <= accuracyTolerance ) + if( fabs( angleToTarget[ YAW ] - self->s.angles2[ YAW ] ) <= accuracyTolerance && + fabs( angleToTarget[ PITCH ] - self->s.angles2[ PITCH ] ) <= accuracyTolerance ) return qtrue; return qfalse; -- cgit