clang build warning fixes

master
per 2013-03-17 17:25:56 +01:00
parent 50efcff92e
commit 2295bfe10b
4 changed files with 4 additions and 6 deletions

View File

@ -172,7 +172,7 @@ int droidReloadBar(BASE_OBJECT *psObj, WEAPON *psWeap, int weapon_slot)
firingStage = gameTime - psWeap->lastFired;
interval = bSalvo ? weaponReloadTime(psStats, psObj->player) : weaponFirePause(psStats, psObj->player);
}
if (firingStage < interval)
if (firingStage < interval && interval > 0)
{
return PERCENT(firingStage, interval);
}

View File

@ -906,7 +906,6 @@ static void intProcessOptions(UDWORD id)
int oldSelectedPlayer = selectedPlayer;
widgSetButtonState(psWScreen, IDOPT_PLAYERSTART + selectedPlayer, 0);
oldSelectedPlayer = selectedPlayer;
selectedPlayer = id - IDOPT_PLAYERSTART;
NetPlay.players[selectedPlayer].allocated = !NetPlay.players[selectedPlayer].allocated;
NetPlay.players[oldSelectedPlayer].allocated = !NetPlay.players[oldSelectedPlayer].allocated;

View File

@ -476,7 +476,7 @@ static int determineGroundType(int x, int y, const char *tileset)
int weight[2][2];
int i,j, tile;
int a,b, best;
MAPTILE *psTile = mapTile(x,y);
MAPTILE *psTile;
if (x < 0 || y < 0 || x >= mapWidth || y >= mapHeight)
{
@ -490,7 +490,7 @@ static int determineGroundType(int x, int y, const char *tileset)
{
if (x+i-1 < 0 || y+j-1 < 0 || x+i-1 >= mapWidth || y+j-1 >= mapHeight)
{
psTile = 0;
psTile = NULL;
tile = 0;
}
else

View File

@ -1512,7 +1512,6 @@ bool loadTerrainTable(const char *pFileName)
bool loadBodyPropulsionIMDs(const char *pFileName)
{
BODY_STATS *psBodyStat = asBodyStats;
PROPULSION_STATS *psPropulsionStat = asPropulsionStats;
unsigned int i, numStats;
QString propulsionName, leftIMD, rightIMD;
iIMDShape **startIMDs;
@ -1552,7 +1551,7 @@ bool loadBodyPropulsionIMDs(const char *pFileName)
{
for (numStats = 0; numStats < numPropulsionStats; numStats++)
{
psPropulsionStat = &asPropulsionStats[numStats];
PROPULSION_STATS *psPropulsionStat = &asPropulsionStats[numStats];
if (keys[j].compare(psPropulsionStat->pName) == 0)
{
break;