Browse Source

Fix warnings.

gravgun
Andrey Akhmichin 5 years ago
parent
commit
bf4f01f9b2
  1. 16
      dlls/client.cpp
  2. 16
      dlls/coop.cpp
  3. 6
      dlls/enttools.cpp
  4. 14
      dlls/gravgunmod.cpp
  5. 2
      dlls/player.cpp
  6. 2
      dlls/player.h
  7. 2
      dlls/prop.cpp
  8. 10
      dlls/triggers.cpp
  9. 84
      dlls/util.cpp
  10. 2
      dlls/weapons.h

16
dlls/client.cpp

@ -1274,15 +1274,15 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h @@ -1274,15 +1274,15 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h
size = ent->v.size.z;
if( size > 512 ) // big brushes may be rotated, but dist check does not cover this
dist = abs(delta.z), size = ent->v.size.z;
dist = fabs(delta.z), size = ent->v.size.z;
else
{
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
}
dist -= size / 2;
@ -1314,7 +1314,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h @@ -1314,7 +1314,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h
// attachments/sounds, so we may just skip adding it to packet
// but left it just hidden if we have enough visents to prevent
// sending big delta packets, but reserve 256 slots for visible
if( counter > 128 && !istrash || counter > 256 )
if( ( counter > 128 && !istrash ) || counter > 256 )
return 0;
}

16
dlls/coop.cpp

@ -224,7 +224,7 @@ static void COOP_CheckSaveSlots( void ) @@ -224,7 +224,7 @@ static void COOP_CheckSaveSlots( void )
// check save slots (may be cleaned by newunit)
GET_GAME_DIR(path);
strcat( path, PATHSEP"save" );
strcat( path, PATHSEP "save" );
for( i = 0; i < ARRAYSIZE( g_CoopState.p.rgszSaveSlots ); i++ )
{
char fpath[256] = "";
@ -233,8 +233,8 @@ static void COOP_CheckSaveSlots( void ) @@ -233,8 +233,8 @@ static void COOP_CheckSaveSlots( void )
if( !g_CoopState.p.rgszSaveSlots[i] )
continue;
snprintf( fpath, 255, "%s"PATHSEP"%s.coop", path, g_CoopState.p.rgszSaveSlots[i] );
if( f = fopen( fpath, "rb" ) )
snprintf( fpath, 255, "%s" PATHSEP "%s.coop", path, g_CoopState.p.rgszSaveSlots[i] );
if( ( f = fopen( fpath, "rb" ) ) )
fclose( f );
else
g_CoopState.p.rgszSaveSlots[i][0] = 0;
@ -256,7 +256,7 @@ void COOP_ClearSaves( void ) @@ -256,7 +256,7 @@ void COOP_ClearSaves( void )
const char *pszOldMap = NULL;
GET_GAME_DIR(path);
strcat( path, PATHSEP"save" );
strcat( path, PATHSEP "save" );
if( g_CoopState.landmarkTransition.szSourceMap[0] )
pszOldMap = g_CoopState.landmarkTransition.szSourceMap;
@ -270,7 +270,7 @@ void COOP_ClearSaves( void ) @@ -270,7 +270,7 @@ void COOP_ClearSaves( void )
return;
}
while( entry = readdir( dir) )
while( ( entry = readdir( dir ) ) )
{
if( Q_stricmpext("auto0-*", entry->d_name ) ||
Q_stricmpext("auto1-*", entry->d_name ) ||
@ -280,7 +280,7 @@ void COOP_ClearSaves( void ) @@ -280,7 +280,7 @@ void COOP_ClearSaves( void )
if( pszOldMap && !strncmp( entry->d_name + 6, pszOldMap, strlen( pszOldMap ) ) )
continue;
snprintf( fpath, 255, "%s"PATHSEP"%s", path, entry->d_name );
snprintf( fpath, 255, "%s" PATHSEP "%s", path, entry->d_name );
ALERT( at_console, "Removing %s\n", fpath );
remove( fpath );
}
@ -579,7 +579,7 @@ void COOP_MarkTriggers( void ) @@ -579,7 +579,7 @@ void COOP_MarkTriggers( void )
{
CBaseEntity *pTrigger = NULL;
while( pTrigger = UTIL_FindEntityByClassname( pTrigger, "trigger_changelevel" ) )
while( ( pTrigger = UTIL_FindEntityByClassname( pTrigger, "trigger_changelevel" ) ) )
{
struct COOPChangelevelData *pData = COOP_GetTriggerData( pTrigger );
//pData->fIsBack = !strcmp( pData->pszMapName, g_CoopState.landmarkTransition.szSourceMap );
@ -933,7 +933,7 @@ CBaseEntity *UTIL_CoopGetPlayerTrain( CBaseEntity *pPlayer) @@ -933,7 +933,7 @@ CBaseEntity *UTIL_CoopGetPlayerTrain( CBaseEntity *pPlayer)
if( !train )
return NULL;
if( !train->pev->globalname ||!STRING(train->pev->globalname) || !STRING(train->pev->globalname)[0] )
if( !train->pev->globalname || !( STRING( train->pev->globalname ) ) || !( STRING( train->pev->globalname ) )[0] )
return NULL;
// doors are elevators
if( strcmp( STRING( train->pev->classname ), "func_train") && strcmp( STRING( train->pev->classname ), "func_tracktrain") && strcmp( STRING( train->pev->classname ), "func_door") )

6
dlls/enttools.cpp

@ -45,7 +45,7 @@ void Ent_AddToBlacklist_f( void ) @@ -45,7 +45,7 @@ void Ent_AddToBlacklist_f( void )
node->next = entblacklist;
strncpy( node->pattern, CMD_ARGV(1), 31 );
node->pattern[32] = 0;
node->pattern[31] = 0;
node->limit = atoi( CMD_ARGV(2) );
node->behaviour = atoi( CMD_ARGV( 3 ) );
node->clear = !!atoi( CMD_ARGV( 4 ) );
@ -474,7 +474,7 @@ bool Ent_CheckModel( const char *model ) @@ -474,7 +474,7 @@ bool Ent_CheckModel( const char *model )
return false;
model_t *world = (model_t*)g_physfuncs.pfnGetModel(1);
int submodel = atoi(model + 1);
if( submodel < 1 || world && submodel >= world->numsubmodels )
if( submodel < 1 || ( world && submodel >= world->numsubmodels ) )
return false;
} // do not allow to set different model types. bsp models will destroy all submodels on map
else if( !strstr( model, ".mdl" ) && !strstr( model, ".spr" ) )
@ -1093,7 +1093,7 @@ void Ent_Create_f( edict_t *player ) @@ -1093,7 +1093,7 @@ void Ent_Create_f( edict_t *player )
if( pPlayer && pPlayer->IsPlayer() && pPlayer->m_ggm.pState && pPlayer->m_ggm.pState->fRegistered )
entity->enttools_data.enttools = 2;
if( plid );
if( plid )
strcpy( entity->enttools_data.ownerid, plid );
}
}

14
dlls/gravgunmod.cpp

@ -327,7 +327,7 @@ const char *GGM_PlayerName( CBaseEntity *pPlayer ) @@ -327,7 +327,7 @@ const char *GGM_PlayerName( CBaseEntity *pPlayer )
{
if( !pPlayer )
return "unnamed(NULL)";
return (const char*)( ( pPlayer->pev->netname && STRING( pPlayer->pev->netname )[0] != 0 ) ? STRING( pPlayer->pev->netname ) : "unconnected" );
return (const char*)( ( pPlayer->pev->netname && ( STRING( pPlayer->pev->netname ) )[0] != 0 ) ? STRING( pPlayer->pev->netname ) : "unconnected" );
}
/*
@ -492,7 +492,7 @@ void Ent_RunGC( int flags, const char *userid, const char *pattern ) @@ -492,7 +492,7 @@ void Ent_RunGC( int flags, const char *userid, const char *pattern )
continue;
}
if( !strncmp( classname, "monster_", 8 ) && ent->v.health <= 0 || ent->v.deadflag != DEAD_NO )
if( ( !strncmp( classname, "monster_", 8 ) && ent->v.health <= 0 ) || ent->v.deadflag != DEAD_NO )
{
ent->v.flags |= FL_KILLME;
removed++;
@ -742,7 +742,7 @@ bool GGM_FilterFileName( const char *name ) @@ -742,7 +742,7 @@ bool GGM_FilterFileName( const char *name )
{
while( name && *name )
{
if( *name >= 'A' && *name <= 'z' || *name >= '0' && *name <= '9' || *name == '_' )
if( ( *name >= 'A' && *name <= 'z' ) || ( *name >= '0' && *name <= '9' ) || *name == '_' )
{
name++;
continue;
@ -1439,7 +1439,7 @@ struct GGMPlayerState *GGM_GetState( const char *uid, const char *name ) @@ -1439,7 +1439,7 @@ struct GGMPlayerState *GGM_GetState( const char *uid, const char *name )
{
struct GGMPlayerState *pState;
struct GGMLogin *pLogin = GGM_LoadLogin( uid, name );
char *rgpszBadNames[] = {
const char *rgpszBadNames[] = {
"player*", // does not even can set own name
"*talat*",
"*hmse*",
@ -1739,7 +1739,7 @@ bool GGM_PlayerSpawn( CBasePlayer *pPlayer ) @@ -1739,7 +1739,7 @@ bool GGM_PlayerSpawn( CBasePlayer *pPlayer )
return true;
}
if( ( mp_coop.value || mp_spectator.value ) && pPlayer->m_ggm.iState == STATE_CONNECTED || !pPlayer->m_ggm.pState )
if( ( ( mp_coop.value || mp_spectator.value ) && pPlayer->m_ggm.iState == STATE_CONNECTED ) || !pPlayer->m_ggm.pState )
{
if( !pPlayer->m_ggm.pState )
GGM_ChatPrintf( pPlayer, "This nickname busy! Please login or change nickname\n" );
@ -2640,7 +2640,7 @@ bool GGM_MenuCommand( CBasePlayer *player, const char *name ) @@ -2640,7 +2640,7 @@ bool GGM_MenuCommand( CBasePlayer *player, const char *name )
GGM_PlayerMenu &m = player->m_ggm.menu.New( buf );
while( pFile = GGM::COM_ParseFile( pFile, buf ) )
while( ( pFile = GGM::COM_ParseFile( pFile, buf ) ) )
{
char cmd[256];
if( !(pFile = GGM::COM_ParseFile( pFile, cmd )) )
@ -3018,7 +3018,7 @@ void SET_MODEL( edict_t *e, const char *model ) @@ -3018,7 +3018,7 @@ void SET_MODEL( edict_t *e, const char *model )
{
int index = g_engfuncs.pfnPrecacheModel(model);
model_t *mod = (model_t*)g_physfuncs.pfnGetModel(index);
if( !mod || mod->type == mod_brush && !mod->nodes )
if( !mod || ( mod->type == mod_brush && !mod->nodes ) )
g_engfuncs.pfnSetModel( e, mp_errormdlpath.string );
ALERT( at_console, "SET_MODEL %s %d\n", model, e->v.modelindex );

2
dlls/player.cpp

@ -2849,7 +2849,7 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer ) @@ -2849,7 +2849,7 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer )
if( mp_coop.value || FStringNull( gpGlobals->startspot ) || !strlen(STRING( gpGlobals->startspot ) ) )
{
pSpot = NULL;
while( pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_start" ) )
while( ( pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_start" ) ) )
{
TraceResult tr;
if( FNullEnt( pSpot ) )

2
dlls/player.h

@ -217,7 +217,7 @@ public: @@ -217,7 +217,7 @@ public:
virtual void StartSneaking( void ) { m_tSneaking = gpGlobals->time - 1; }
virtual void StopSneaking( void ) { m_tSneaking = gpGlobals->time + 30; }
virtual BOOL IsSneaking( void ) { return m_tSneaking <= gpGlobals->time; }
virtual BOOL IsAlive( void ) { return (pev->deadflag == DEAD_NO) && pev->health > 0 || ( pev->flags & FL_SPECTATOR ); }
virtual BOOL IsAlive( void ) { return ( ( pev->deadflag == DEAD_NO ) && pev->health > 0 ) || ( pev->flags & FL_SPECTATOR ); }
virtual BOOL ShouldFadeOnDeath( void ) { return FALSE; }
virtual BOOL IsPlayer( void ) { return !( pev->flags & FL_SPECTATOR ); } // Spectators should return FALSE for this, they aren't "players" as far as game logic is concerned

2
dlls/prop.cpp

@ -439,7 +439,7 @@ void CProp::DamageSound( void ) @@ -439,7 +439,7 @@ void CProp::DamageSound( void )
{
int pitch;
float fvol;
char *rgpsz[6];
const char *rgpsz[6];
int i = 0;
int material = m_Material;

10
dlls/triggers.cpp

@ -1465,7 +1465,7 @@ void CChangeLevel::UseChangeLevel( CBaseEntity *pActivator, CBaseEntity *pCaller @@ -1465,7 +1465,7 @@ void CChangeLevel::UseChangeLevel( CBaseEntity *pActivator, CBaseEntity *pCaller
{
// if not activated by touch, do not count players
m_coopData.fUsed = true;
if( pCaller && FClassnameIs( pCaller->edict(), "multi_manager" ) || FClassnameIs( pCaller->edict(), "trigger_once" ) )
if( ( pCaller && FClassnameIs( pCaller->edict(), "multi_manager" ) ) || FClassnameIs( pCaller->edict(), "trigger_once" ) )
m_coopData.fSkipSpawnCheck = true;
else
m_coopData.fSkipSpawnCheck = false;
@ -1729,7 +1729,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator ) @@ -1729,7 +1729,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
ALERT( at_console, "There are %d players in transition volume %s\n", count, m_szLandmarkName );
}
else if( ( (gpGlobals->time -((CBasePlayer*)pPlayer)->m_ggm.flSpawnTime ) < 30 ) && FindTriggerTransition( m_szLandmarkName ) || !InTransitionVolume( pPlayer, m_szLandmarkName ) )
else if( ( ( (gpGlobals->time -((CBasePlayer*)pPlayer)->m_ggm.flSpawnTime ) < 30 ) && FindTriggerTransition( m_szLandmarkName ) ) || !InTransitionVolume( pPlayer, m_szLandmarkName ) )
{
if( !m_coopData.fSkipSpawnCheck )
{
@ -2596,7 +2596,7 @@ void CTriggerCamera::CoopThink() @@ -2596,7 +2596,7 @@ void CTriggerCamera::CoopThink()
}
// Nothing to look at!
if( m_hTarget == NULL )
if( m_hTarget == 0 )
{
return;
}
@ -2798,10 +2798,10 @@ void CTriggerCamera::FollowTarget() @@ -2798,10 +2798,10 @@ void CTriggerCamera::FollowTarget()
void CTriggerCamera::CoopFollowTarget()
{
// if( m_hPlayer == NULL )
// if( m_hPlayer == 0 )
// return;
if( m_hTarget == NULL || m_flReturnTime < gpGlobals->time )
if( m_hTarget == 0 || m_flReturnTime < gpGlobals->time )
{
for( int i = 1; i <= gpGlobals->maxClients; i++ )
{

84
dlls/util.cpp

@ -1113,12 +1113,12 @@ void UTIL_BloodStream( const Vector &origin, const Vector &direction, int color, @@ -1113,12 +1113,12 @@ void UTIL_BloodStream( const Vector &origin, const Vector &direction, int color,
Vector delta = origin - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;
@ -1183,12 +1183,12 @@ void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, @@ -1183,12 +1183,12 @@ void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color,
Vector delta = origin - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;
@ -1303,12 +1303,12 @@ void UTIL_DecalTrace( TraceResult *pTrace, int decalNumber ) @@ -1303,12 +1303,12 @@ void UTIL_DecalTrace( TraceResult *pTrace, int decalNumber )
Vector delta = pTrace->vecEndPos - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;
@ -1380,12 +1380,12 @@ void UTIL_PlayerDecalTrace( TraceResult *pTrace, int playernum, int decalNumber, @@ -1380,12 +1380,12 @@ void UTIL_PlayerDecalTrace( TraceResult *pTrace, int playernum, int decalNumber,
Vector delta = pTrace->vecEndPos - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;
@ -1441,12 +1441,12 @@ void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber ) @@ -1441,12 +1441,12 @@ void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber )
Vector delta = pTrace->vecEndPos - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;
@ -1488,12 +1488,12 @@ void UTIL_Sparks( const Vector &position ) @@ -1488,12 +1488,12 @@ void UTIL_Sparks( const Vector &position )
Vector delta = position - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;
@ -1530,12 +1530,12 @@ void UTIL_Ricochet( const Vector &position, float scale ) @@ -1530,12 +1530,12 @@ void UTIL_Ricochet( const Vector &position, float scale )
Vector delta = position - pPlayer->edict()->v.origin;
float dist = 0;
if( abs(delta.x) > dist )
dist = abs(delta.x);
if( abs(delta.y) > dist )
dist = abs(delta.y);
if( abs(delta.z) > dist )
dist = abs(delta.z);
if( fabs(delta.x) > dist )
dist = fabs(delta.x);
if( fabs(delta.y) > dist )
dist = fabs(delta.y);
if( fabs(delta.z) > dist )
dist = fabs(delta.z);
if( dist > mp_maxtentdist.value)
continue;

2
dlls/weapons.h

@ -484,7 +484,7 @@ public: @@ -484,7 +484,7 @@ public:
}*/
return 200;
}
int ObjectCaps( void ) { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION | FCAP_DONT_SAVE; }
int ObjectCaps( void ) { return ( CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION ) | FCAP_DONT_SAVE; }
};
#ifdef CLIENT_DLL

Loading…
Cancel
Save