Skip to content

Commit

Permalink
68 warnings on the wall, take some down, grind them to dust (with hel…
Browse files Browse the repository at this point in the history
…p from per), 40 warnings on the wall.
  • Loading branch information
dak180 committed Dec 20, 2010
1 parent 7574f25 commit dcca83d
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/script/script.cpp
Expand Up @@ -175,7 +175,7 @@ BOOL scriptGetVarIndex(SCRIPT_CODE *psCode, char *pID, UDWORD *pIndex)
these aren't currently checked for, but it's a lot clearer what's going on if they're all here */
BOOL scriptTypeIsPointer(INTERP_TYPE type)
{
ASSERT( ((type < ST_MAXTYPE) || (type >= VAL_REF)), "scriptTypeIsPointer: invalid type: %d", type );
ASSERT((_scr_user_types)type < ST_MAXTYPE || type >= VAL_REF, "Invalid type: %d", type);
// any value or'ed with VAL_REF is a pointer
if (type >= VAL_REF) return true;
switch (type) {
Expand Down
2 changes: 1 addition & 1 deletion lib/sound/playlist.cpp
Expand Up @@ -78,7 +78,7 @@ bool PlayList_Read(const char* path)
}

// Find the end of the songList
for (; *last; last = &(*last)->next);
for (; *last; last = &(*last)->next) {}

while (!PHYSFS_eof(fileHandle))
{
Expand Down
8 changes: 3 additions & 5 deletions src/display.cpp
Expand Up @@ -944,12 +944,10 @@ void processMouseClickInput(void)
// can't build if res extractors arent available.
if (item == MT_RESOURCE)
{
for (i=0;(i<numStructureStats)&&(asStructureStats[i].type != REF_RESOURCE_EXTRACTOR);i++); // find resource stat
for (i = 0; i < numStructureStats && asStructureStats[i].type != REF_RESOURCE_EXTRACTOR; i++) {} // find resource stat
if (i < numStructureStats && apStructTypeLists[selectedPlayer][i] != AVAILABLE) // check if you can build it!
{
if( (i < numStructureStats) && (apStructTypeLists[selectedPlayer][i] != AVAILABLE)) // check if you can build it!
{
item = MT_BLOCKING; // don't allow build pointer.
}
item = MT_BLOCKING; // don't allow build pointer.
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/hci.cpp
Expand Up @@ -6229,9 +6229,7 @@ BOOL intAddProximityButton(PROXIMITY_DISPLAY *psProxDisp, UDWORD inc)
{
for(cnt = IDPROX_START;cnt<IDPROX_END;cnt++)
{ // go down the prox msgs and see if it's free.
for (psProxDisp2 = apsProxDisp[selectedPlayer];
psProxDisp2 &&(psProxDisp2->buttonID!=cnt) ;
psProxDisp2 = psProxDisp2->psNext);
for (psProxDisp2 = apsProxDisp[selectedPlayer]; psProxDisp2 && psProxDisp2->buttonID != cnt; psProxDisp2 = psProxDisp2->psNext) {}

if(psProxDisp == NULL) // value was unused.
{
Expand Down
4 changes: 1 addition & 3 deletions src/keyedit.cpp
Expand Up @@ -549,9 +549,7 @@ BOOL saveKeyMap(void)
WRITE(&psMapping->action, sizeof(KEY_ACTION)); // action

// function to map to!
for (count = 0; keyMapSaveTable[count] != NULL
&& keyMapSaveTable[count] != psMapping->function;
count++);
for (count = 0; keyMapSaveTable[count] != NULL && keyMapSaveTable[count] != psMapping->function; count++) {}
if(keyMapSaveTable[count] == NULL)
{
debug( LOG_FATAL, "can't find keymapped function %s in the keymap save table at %d!", name, count );
Expand Down
2 changes: 1 addition & 1 deletion src/keymap.cpp
Expand Up @@ -730,7 +730,7 @@ SDWORD i;
break;
}

if(keyToProcess->subKeyCode == KEY_MAXSCAN)
if (keyToProcess->subKeyCode == (KEY_CODE)KEY_MAXSCAN)
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/move.cpp
Expand Up @@ -2655,7 +2655,7 @@ void moveUpdateDroid(DROID *psDroid)
updateDroidOrientation(psDroid);
}

if( (psDroid->inFire && psDroid->type != DROID_PERSON) && psDroid->visible[selectedPlayer])
if( (psDroid->inFire && psDroid->droidType != DROID_PERSON) && psDroid->visible[selectedPlayer])
{
pos.x = psDroid->pos.x + (18-rand()%36);
pos.z = psDroid->pos.y + (18-rand()%36);
Expand Down
8 changes: 2 additions & 6 deletions src/multiplay.cpp
Expand Up @@ -404,9 +404,7 @@ DROID_TEMPLATE *IdToTemplate(UDWORD tempId,UDWORD player)
// Check if we know which player this is from, in that case, assume it is a player template
if (player != ANYPLAYER && player < MAX_PLAYERS)
{
for (psTempl = apsDroidTemplates[player]; // follow templates
(psTempl && (psTempl->multiPlayerID != tempId ));
psTempl = psTempl->psNext);
for (psTempl = apsDroidTemplates[player]; psTempl && (psTempl->multiPlayerID != tempId); psTempl = psTempl->psNext) {} // follow templates

return psTempl;
}
Expand Down Expand Up @@ -531,9 +529,7 @@ Vector3i cameraToHome(UDWORD player,BOOL scroll)
UDWORD x,y;
STRUCTURE *psBuilding;

for (psBuilding = apsStructLists[player];
psBuilding && (psBuilding->pStructureType->type != REF_HQ);
psBuilding= psBuilding->psNext);
for (psBuilding = apsStructLists[player]; psBuilding && (psBuilding->pStructureType->type != REF_HQ); psBuilding= psBuilding->psNext) {}

if(psBuilding)
{
Expand Down
4 changes: 1 addition & 3 deletions src/multistruct.cpp
Expand Up @@ -105,9 +105,7 @@ BOOL recvBuildFinished(NETQUEUE queue)
// The building wasn't started, so we'll have to just plonk it down in the map.

// Find the structures stats
for (typeindex=0; // Find structure target
(typeindex<numStructureStats ) && (asStructureStats[typeindex].ref != type);
typeindex++);
for (typeindex = 0; typeindex < numStructureStats && asStructureStats[typeindex].ref != type; typeindex++) {} // Find structure target

// Check for similar buildings, to avoid overlaps
if (TileHasStructure(mapTile(map_coord(pos.x), map_coord(pos.y))))
Expand Down
7 changes: 2 additions & 5 deletions src/scores.cpp
Expand Up @@ -523,12 +523,9 @@ void fillUpStats( void )
infoBars[STAT_STR_BLOWN_UP].percent = PERCENT(length,STAT_BAR_WIDTH);

/* Finally the force information - need amount of droids as well*/
for(psDroid = apsDroidLists[selectedPlayer],numUnits = 0;
psDroid; psDroid = psDroid->psNext,numUnits++);

for(psDroid = mission.apsDroidLists[selectedPlayer];
psDroid; psDroid = psDroid->psNext,numUnits++);
for(psDroid = apsDroidLists[selectedPlayer], numUnits = 0; psDroid; psDroid = psDroid->psNext, numUnits++) {}

for(psDroid = mission.apsDroidLists[selectedPlayer]; psDroid; psDroid = psDroid->psNext, numUnits++) {}

maxi = MAX(missionData.unitsBuilt, missionData.strBuilt);
maxi = MAX(maxi, numUnits);
Expand Down
3 changes: 1 addition & 2 deletions src/scriptai.cpp
Expand Up @@ -1535,8 +1535,7 @@ BOOL scrSkLocateEnemy(void)
|| psStruct->pStructureType->type == REF_CYBORG_FACTORY
|| psStruct->pStructureType->type == REF_VTOL_FACTORY
);
psStruct=psStruct->psNext);

psStruct = psStruct->psNext) {}

// set the x and y accordingly..
if(psStruct)
Expand Down
2 changes: 1 addition & 1 deletion src/structure.cpp
Expand Up @@ -2768,7 +2768,7 @@ static BOOL structPlaceDroid(STRUCTURE *psStructure, DROID_TEMPLATE *psTempl,
for(psFlag = apsFlagPosLists[psFact->psAssemblyPoint->player];
!( (psFlag->factoryInc == psFact->psAssemblyPoint->factoryInc) // correct fact.
&&(psFlag->factoryType == factoryType)); // correct type
psFlag = psFlag->psNext);
psFlag = psFlag->psNext) {}

if (isVtolDroid(psNewDroid))
{
Expand Down

0 comments on commit dcca83d

Please sign in to comment.