Skip to content

Commit

Permalink
fix some OOB enumerator usages
Browse files Browse the repository at this point in the history
(should be no-op with usual compiler workings)
  • Loading branch information
/dev/humancontroller authored and zturtleman committed May 30, 2013
1 parent 9e9d6fa commit 120e296
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions code/q3_ui/ui_players.c
Expand Up @@ -708,10 +708,10 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti

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->lastWeapon = pi->pendingWeapon;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
if( pi->currentWeapon != pi->weapon ) {
trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL );
Expand Down Expand Up @@ -1136,7 +1136,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model ) {
pi->weapon = WP_MACHINEGUN;
pi->currentWeapon = pi->weapon;
pi->lastWeapon = pi->weapon;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
pi->chat = qfalse;
pi->newModel = qtrue;
Expand Down Expand Up @@ -1202,11 +1202,11 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
pi->torso.yawAngle = viewAngles[YAW];
pi->torso.yawing = qfalse;

if ( weaponNumber != -1 ) {
if ( weaponNumber != WP_NUM_WEAPONS ) {
pi->weapon = weaponNumber;
pi->currentWeapon = weaponNumber;
pi->lastWeapon = weaponNumber;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
UI_PlayerInfo_SetWeapon( pi, pi->weapon );
}
Expand All @@ -1215,8 +1215,8 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
}

// weapon
if ( weaponNumber == -1 ) {
pi->pendingWeapon = -1;
if ( weaponNumber == WP_NUM_WEAPONS ) {
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
}
else if ( weaponNumber != WP_NONE ) {
Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/files.c
Expand Up @@ -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;
directory_t *dir;
Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/qcommon.h
Expand Up @@ -624,7 +624,7 @@ qboolean FS_FileExists( const char *file );

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 );
qboolean FS_CompareZipChecksum(const char *zipfile);
Expand Down
4 changes: 2 additions & 2 deletions code/ui/ui_main.c
Expand Up @@ -118,7 +118,7 @@ static void UI_StartServerRefresh(qboolean full);
static void UI_StopServerRefresh( void );
static void UI_DoServerRefresh( void );
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_BuildFindPlayerList(qboolean force);
static int QDECL UI_ServersQsortCompare( const void *arg1, const void *arg2 );
Expand Down Expand Up @@ -3762,7 +3762,7 @@ static void UI_BinaryServerInsertion(int num) {
UI_BuildServerDisplayList
==================
*/
static void UI_BuildServerDisplayList(qboolean force) {
static void UI_BuildServerDisplayList(int force) {
int i, count, clients, maxClients, ping, game, len, visible;
char info[MAX_STRING_CHARS];
// qboolean startRefresh = qtrue; TTimo: unused
Expand Down
14 changes: 7 additions & 7 deletions code/ui/ui_players.c
Expand Up @@ -714,10 +714,10 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti

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->lastWeapon = pi->pendingWeapon;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
if( pi->currentWeapon != pi->weapon ) {
trap_S_StartLocalSound( weaponChangeSound, CHAN_LOCAL );
Expand Down Expand Up @@ -1254,7 +1254,7 @@ void UI_PlayerInfo_SetModel( playerInfo_t *pi, const char *model, const char *he
pi->weapon = WP_MACHINEGUN;
pi->currentWeapon = pi->weapon;
pi->lastWeapon = pi->weapon;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
pi->chat = qfalse;
pi->newModel = qtrue;
Expand Down Expand Up @@ -1293,11 +1293,11 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
pi->torso.yawAngle = viewAngles[YAW];
pi->torso.yawing = qfalse;

if ( weaponNumber != -1 ) {
if ( weaponNumber != WP_NUM_WEAPONS ) {
pi->weapon = weaponNumber;
pi->currentWeapon = weaponNumber;
pi->lastWeapon = weaponNumber;
pi->pendingWeapon = -1;
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
UI_PlayerInfo_SetWeapon( pi, pi->weapon );
}
Expand All @@ -1306,8 +1306,8 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_
}

// weapon
if ( weaponNumber == -1 ) {
pi->pendingWeapon = -1;
if ( weaponNumber == WP_NUM_WEAPONS ) {
pi->pendingWeapon = WP_NUM_WEAPONS;
pi->weaponTimer = 0;
}
else if ( weaponNumber != WP_NONE ) {
Expand Down

0 comments on commit 120e296

Please sign in to comment.