fix some OOB enumerator usages

(should be no-op with usual compiler workings)
This commit is contained in:
/dev/humancontroller 2013-04-14 18:33:25 +02:00 committed by Zack Middleton
parent 9e9d6fa52c
commit 120e296a74
5 changed files with 18 additions and 18 deletions

View file

@ -708,10 +708,10 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti
dp_realtime = time; dp_realtime = time;
if ( pi->pendingWeapon != -1 && dp_realtime > pi->weaponTimer ) { if ( pi->pendingWeapon != WP_NUM_WEAPONS && dp_realtime > pi->weaponTimer ) {
pi->weapon = pi->pendingWeapon; pi->weapon = pi->pendingWeapon;
pi->lastWeapon = pi->pendingWeapon; pi->lastWeapon = pi->pendingWeapon;
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
if( pi->currentWeapon != pi->weapon ) { if( pi->currentWeapon != pi->weapon ) {
trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL ); trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL );
@ -1136,7 +1136,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model ) {
pi->weapon = WP_MACHINEGUN; pi->weapon = WP_MACHINEGUN;
pi->currentWeapon = pi->weapon; pi->currentWeapon = pi->weapon;
pi->lastWeapon = pi->weapon; pi->lastWeapon = pi->weapon;
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
pi->chat = qfalse; pi->chat = qfalse;
pi->newModel = qtrue; pi->newModel = qtrue;
@ -1202,11 +1202,11 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
pi->torso.yawAngle = viewAngles[YAW]; pi->torso.yawAngle = viewAngles[YAW];
pi->torso.yawing = qfalse; pi->torso.yawing = qfalse;
if ( weaponNumber != -1 ) { if ( weaponNumber != WP_NUM_WEAPONS ) {
pi->weapon = weaponNumber; pi->weapon = weaponNumber;
pi->currentWeapon = weaponNumber; pi->currentWeapon = weaponNumber;
pi->lastWeapon = weaponNumber; pi->lastWeapon = weaponNumber;
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
UI_PlayerInfo_SetWeapon( pi, pi->weapon ); UI_PlayerInfo_SetWeapon( pi, pi->weapon );
} }
@ -1215,8 +1215,8 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
} }
// weapon // weapon
if ( weaponNumber == -1 ) { if ( weaponNumber == WP_NUM_WEAPONS ) {
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
} }
else if ( weaponNumber != WP_NONE ) { else if ( weaponNumber != WP_NONE ) {

View file

@ -1398,7 +1398,7 @@ Return the searchpath in "startSearch".
================= =================
*/ */
vmInterpret_t FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll) int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll)
{ {
searchpath_t *search, *lastSearch; searchpath_t *search, *lastSearch;
directory_t *dir; directory_t *dir;

View file

@ -624,7 +624,7 @@ qboolean FS_FileExists( const char *file );
qboolean FS_CreatePath (char *OSPath); qboolean FS_CreatePath (char *OSPath);
vmInterpret_t FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll); int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, int enableDll);
char *FS_BuildOSPath( const char *base, const char *game, const char *qpath ); char *FS_BuildOSPath( const char *base, const char *game, const char *qpath );
qboolean FS_CompareZipChecksum(const char *zipfile); qboolean FS_CompareZipChecksum(const char *zipfile);

View file

@ -118,7 +118,7 @@ static void UI_StartServerRefresh(qboolean full);
static void UI_StopServerRefresh( void ); static void UI_StopServerRefresh( void );
static void UI_DoServerRefresh( void ); static void UI_DoServerRefresh( void );
static void UI_FeederSelection(float feederID, int index); static void UI_FeederSelection(float feederID, int index);
static void UI_BuildServerDisplayList(qboolean force); static void UI_BuildServerDisplayList(int force);
static void UI_BuildServerStatus(qboolean force); static void UI_BuildServerStatus(qboolean force);
static void UI_BuildFindPlayerList(qboolean force); static void UI_BuildFindPlayerList(qboolean force);
static int QDECL UI_ServersQsortCompare( const void *arg1, const void *arg2 ); static int QDECL UI_ServersQsortCompare( const void *arg1, const void *arg2 );
@ -3762,7 +3762,7 @@ static void UI_BinaryServerInsertion(int num) {
UI_BuildServerDisplayList UI_BuildServerDisplayList
================== ==================
*/ */
static void UI_BuildServerDisplayList(qboolean force) { static void UI_BuildServerDisplayList(int force) {
int i, count, clients, maxClients, ping, game, len, visible; int i, count, clients, maxClients, ping, game, len, visible;
char info[MAX_STRING_CHARS]; char info[MAX_STRING_CHARS];
// qboolean startRefresh = qtrue; TTimo: unused // qboolean startRefresh = qtrue; TTimo: unused

View file

@ -714,10 +714,10 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti
dp_realtime = time; dp_realtime = time;
if ( pi->pendingWeapon != -1 && dp_realtime > pi->weaponTimer ) { if ( pi->pendingWeapon != WP_NUM_WEAPONS && dp_realtime > pi->weaponTimer ) {
pi->weapon = pi->pendingWeapon; pi->weapon = pi->pendingWeapon;
pi->lastWeapon = pi->pendingWeapon; pi->lastWeapon = pi->pendingWeapon;
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
if( pi->currentWeapon != pi->weapon ) { if( pi->currentWeapon != pi->weapon ) {
trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL ); trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL );
@ -1254,7 +1254,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model, const char *he
pi->weapon = WP_MACHINEGUN; pi->weapon = WP_MACHINEGUN;
pi->currentWeapon = pi->weapon; pi->currentWeapon = pi->weapon;
pi->lastWeapon = pi->weapon; pi->lastWeapon = pi->weapon;
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
pi->chat = qfalse; pi->chat = qfalse;
pi->newModel = qtrue; pi->newModel = qtrue;
@ -1293,11 +1293,11 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
pi->torso.yawAngle = viewAngles[YAW]; pi->torso.yawAngle = viewAngles[YAW];
pi->torso.yawing = qfalse; pi->torso.yawing = qfalse;
if ( weaponNumber != -1 ) { if ( weaponNumber != WP_NUM_WEAPONS ) {
pi->weapon = weaponNumber; pi->weapon = weaponNumber;
pi->currentWeapon = weaponNumber; pi->currentWeapon = weaponNumber;
pi->lastWeapon = weaponNumber; pi->lastWeapon = weaponNumber;
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
UI_PlayerInfo_SetWeapon( pi, pi->weapon ); UI_PlayerInfo_SetWeapon( pi, pi->weapon );
} }
@ -1306,8 +1306,8 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
} }
// weapon // weapon
if ( weaponNumber == -1 ) { if ( weaponNumber == WP_NUM_WEAPONS ) {
pi->pendingWeapon = -1; pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0; pi->weaponTimer = 0;
} }
else if ( weaponNumber != WP_NONE ) { else if ( weaponNumber != WP_NONE ) {