Skip to content
Browse files

clang build warning fixes

  • Loading branch information...
1 parent 50efcff commit 2295bfe10b0a1f4e3beccbeb3cb626afa535ebae @perim perim committed Mar 17, 2013
Showing with 4 additions and 6 deletions.
  1. +1 −1 src/droid.cpp
  2. +0 −1 src/hci.cpp
  3. +2 −2 src/map.cpp
  4. +1 −2 src/stats.cpp
View
2 src/droid.cpp
@@ -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
1 src/hci.cpp
@@ -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
4 src/map.cpp
@@ -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
3 src/stats.cpp
@@ -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;

0 comments on commit 2295bfe

Please sign in to comment.
Something went wrong with that request. Please try again.