Skip to content

Commit

Permalink
144 warnings on the wall, take some down, grind them to dust, 98 warn…
Browse files Browse the repository at this point in the history
…ings on the wall.
  • Loading branch information
dak180 committed Dec 17, 2010
1 parent 0364933 commit c4ec4ff
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/framework/tagfile.cpp
Expand Up @@ -388,7 +388,7 @@ static bool scan_to(element_t tag)
}
lastAccess = tag;
// Set the right node
for (; current->next && current->element < tag; current = current->next);
for (; current->next && current->element < tag; current = current->next) {}
if (current->element != tag)
{
TF_ERROR("Unknown element %#04x sought", (unsigned int)tag);
Expand Down
2 changes: 1 addition & 1 deletion lib/ivis_common/bitimage.cpp
Expand Up @@ -92,7 +92,7 @@ IMAGEFILE *iV_LoadImageFile(const char *fileName)
{
tPages = ImageDef->TPageID;
}
while (ptr < pFileData + pFileSize && *ptr++ != '\n'); // skip rest of line
while (ptr < pFileData + pFileSize && *ptr++ != '\n') {} // skip rest of line
}

dot = (char *)strrchr(fileName, '/'); // go to last path character
Expand Down
4 changes: 2 additions & 2 deletions lib/ivis_opengl/pieblitfunc.cpp
Expand Up @@ -287,8 +287,8 @@ void pie_DownLoadRadar(UDWORD *buffer, int width, int height, bool filter)
char *black;

/* Find power of two size */
while (width > (w *= 2));
while (height > (h *= 2));
while (width > (w *= 2)) {}
while (height > (h *= 2)) {}

pie_SetTexturePage(radarTexture);
black = (char *)calloc(1, w * h * 4);
Expand Down
4 changes: 2 additions & 2 deletions lib/ivis_opengl/tex.cpp
Expand Up @@ -77,7 +77,7 @@ int pie_AddTexPage(iV_Image *s, const char* filename, int slot, int maxTextureSi
}

/* Use first unused slot */
for (i = slot; i < iV_TEX_MAX && _TEX_PAGE[i].name[0] != '\0'; i++);
for (i = slot; i < iV_TEX_MAX && _TEX_PAGE[i].name[0] != '\0'; i++) {}

if (i == _TEX_INDEX)
{
Expand Down Expand Up @@ -208,7 +208,7 @@ void pie_MakeTexPageTCMaskName(char * filename)
if (strncmp(filename, "page-", 5) == 0)
{
int i;
for( i = 5; i < iV_TEXNAME_MAX-1 && isdigit(filename[i]); i++);
for ( i = 5; i < iV_TEXNAME_MAX-1 && isdigit(filename[i]); i++) {}
filename[i] = '\0';
strcat(filename, iV_TEXNAME_TCSUFFIX);
}
Expand Down
6 changes: 3 additions & 3 deletions src/clparse.cpp
Expand Up @@ -494,7 +494,7 @@ bool ParseCommandLine(int argc, const char** argv)
}

// Find an empty place in the global_mods list
for (i = 0; i < 100 && global_mods[i] != NULL; ++i);
for (i = 0; i < 100 && global_mods[i] != NULL; ++i) {}
if (i >= 100 || global_mods[i] != NULL)
{
debug(LOG_FATAL, "Too many mods registered! Aborting!");
Expand All @@ -516,7 +516,7 @@ bool ParseCommandLine(int argc, const char** argv)
}

// Find an empty place in the campaign_mods list
for (i = 0; i < 100 && campaign_mods[i] != NULL; ++i);
for (i = 0; i < 100 && campaign_mods[i] != NULL; ++i) {}
if (i >= 100 || campaign_mods[i] != NULL)
{
debug(LOG_FATAL, "Too many mods registered! Aborting!");
Expand All @@ -537,7 +537,7 @@ bool ParseCommandLine(int argc, const char** argv)
return false;
}

for (i = 0; i < 100 && multiplay_mods[i] != NULL; ++i);
for (i = 0; i < 100 && multiplay_mods[i] != NULL; ++i) {}
if (i >= 100 || multiplay_mods[i] != NULL)
{
debug(LOG_FATAL, "Too many mods registered! Aborting!");
Expand Down
2 changes: 1 addition & 1 deletion src/display.cpp
Expand Up @@ -2005,7 +2005,7 @@ static void dealWithLMBFeature(FEATURE* psFeature)
// find any construction droids. and order them to build an oil resource.

// first find the derrick.
for(i = 0; (i < numStructureStats) && (asStructureStats[i].type != REF_RESOURCE_EXTRACTOR); ++i);
for (i = 0; (i < numStructureStats) && (asStructureStats[i].type != REF_RESOURCE_EXTRACTOR); ++i) {}

if( (i < numStructureStats) &&
(apStructTypeLists[selectedPlayer][i] == AVAILABLE) ) // dont go any further if no derrick stat found.
Expand Down
2 changes: 1 addition & 1 deletion src/hci.cpp
Expand Up @@ -6692,7 +6692,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];
for (psProxDisp2 = apsProxDisp[selectedPlayer];
psProxDisp2 &&(psProxDisp2->buttonID!=cnt) ;
psProxDisp2 = psProxDisp2->psNext);

Expand Down
2 changes: 1 addition & 1 deletion src/keyedit.cpp
Expand Up @@ -549,7 +549,7 @@ BOOL saveKeyMap(void)
WRITE(&psMapping->action, sizeof(KEY_ACTION)); // action

// function to map to!
for(count = 0; keyMapSaveTable[count] != NULL
for (count = 0; keyMapSaveTable[count] != NULL
&& keyMapSaveTable[count] != psMapping->function;
count++);
if(keyMapSaveTable[count] == NULL)
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -305,7 +305,7 @@ void addLoadedMod(const char * modname)
// Yes, this is an online insertion sort.
// I swear, for the numbers of mods this is going to be dealing with
// (i.e. 0 to 2), it really is faster than, say, Quicksort.
for (i=0; i<num_loaded_mods && strcmp(loaded_mods[i], mod)>0; i++);
for (i=0; i<num_loaded_mods && strcmp(loaded_mods[i], mod)>0; i++) {}
if (i < num_loaded_mods)
{
if (strcmp(loaded_mods[i], mod) == 0)
Expand Down
2 changes: 1 addition & 1 deletion src/message.cpp
Expand Up @@ -167,7 +167,7 @@ static inline void addMessageToList(MESSAGE *list[MAX_PLAYERS], MESSAGE *msg, UD
/*add it to the bottom of the list */

// Iterate to the last item in the list
for(psCurr = list[player]; psCurr->psNext != NULL; psCurr = psCurr->psNext);
for (psCurr = list[player]; psCurr->psNext != NULL; psCurr = psCurr->psNext) {}

// Append the new message to the end of the list
psCurr->psNext = msg;
Expand Down
2 changes: 1 addition & 1 deletion src/multigifts.cpp
Expand Up @@ -690,7 +690,7 @@ void recvMultiPlayerRandomArtifacts(NETQUEUE queue)
NETenum(&type);

debug(LOG_FEATURE, "receiving %u artifact(s) type: (%s)", quantity, feature_names[type]);
for (i = 0; i < numFeatureStats && asFeatureStats[i].subType != type; i++);
for (i = 0; i < numFeatureStats && asFeatureStats[i].subType != type; i++) {}

for (count = 0; count < quantity; count++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/multimenu.cpp
Expand Up @@ -973,7 +973,7 @@ static void displayMultiPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset,
int num;
STRUCTURE *temp;
// NOTE, This tallys up *all* the structures you have. Test out via 'start with no base'.
for (num = 0, temp = apsStructLists[player]; temp != NULL;num++,temp = temp->psNext);
for (num = 0, temp = apsStructLists[player]; temp != NULL;num++,temp = temp->psNext) {}
//c11: Structures
sprintf(str, "%d", num);
iV_DrawText(str, x+MULTIMENU_C11, y+MULTIMENU_FONT_OSET);
Expand Down
8 changes: 4 additions & 4 deletions src/multiplay.cpp
Expand Up @@ -339,7 +339,7 @@ STRUCTURE *IdToStruct(UDWORD id,UDWORD player)
{
for(i=0;i<MAX_PLAYERS;i++)
{
for(psStr=apsStructLists[i];( (psStr != NULL) && (psStr->id != id)); psStr=psStr->psNext);
for (psStr=apsStructLists[i];( (psStr != NULL) && (psStr->id != id)); psStr=psStr->psNext) {}
if(psStr)
{
return psStr;
Expand All @@ -354,7 +354,7 @@ STRUCTURE *IdToStruct(UDWORD id,UDWORD player)
// feature hack, player = 9 are features
return NULL;
}
for(psStr=apsStructLists[player];((psStr != NULL )&&(psStr->id != id) );psStr=psStr->psNext);
for (psStr=apsStructLists[player];((psStr != NULL )&&(psStr->id != id) );psStr=psStr->psNext) {}
}
return psStr;
}
Expand All @@ -370,7 +370,7 @@ FEATURE *IdToFeature(UDWORD id,UDWORD player)
{
for(i=0;i<MAX_PLAYERS;i++)
{
for(psF=apsFeatureLists[i];( (psF != NULL) && (psF->id != id)); psF=psF->psNext);
for(psF=apsFeatureLists[i];( (psF != NULL) && (psF->id != id)); psF=psF->psNext) {}
if(psF)
{
return psF;
Expand All @@ -385,7 +385,7 @@ FEATURE *IdToFeature(UDWORD id,UDWORD player)
// feature hack, player = 9 are features
return NULL;
}
for(psF=apsFeatureLists[player];((psF != NULL )&&(psF->id != id) );psF=psF->psNext);
for(psF=apsFeatureLists[player];((psF != NULL )&&(psF->id != id) );psF=psF->psNext) {}
}
return psF;
}
Expand Down
2 changes: 1 addition & 1 deletion src/scriptai.cpp
Expand Up @@ -1688,7 +1688,7 @@ BOOL scrSkVtolEnableCheck(void)


// vtol factory
for(i=0;(i<numStructureStats)&&(asStructureStats[i].type != REF_VTOL_FACTORY);i++);
for(i=0;(i<numStructureStats)&&(asStructureStats[i].type != REF_VTOL_FACTORY);i++) {}
if( (i < numStructureStats) && (apStructTypeLists[player][i] == AVAILABLE) )
{
// vtol propulsion
Expand Down
4 changes: 2 additions & 2 deletions src/terrain.cpp
Expand Up @@ -1003,8 +1003,8 @@ bool initTerrain(void)
lightmapWidth = 1;
lightmapHeight = 1;
// determine the smallest power-of-two size we can use for the lightmap
while (mapWidth > (lightmapWidth <<= 1));
while (mapHeight > (lightmapHeight <<= 1));
while (mapWidth > (lightmapWidth <<= 1)) {}
while (mapHeight > (lightmapHeight <<= 1)) {}
debug(LOG_TERRAIN, "the size of the map is %ix%i", mapWidth, mapHeight);
debug(LOG_TERRAIN, "lightmap texture size is %ix%i", lightmapWidth, lightmapHeight);

Expand Down
4 changes: 2 additions & 2 deletions src/texture.cpp
Expand Up @@ -201,8 +201,8 @@ bool texLoad(const char *fileName)
const int yLimit = TILES_IN_PAGE_ROW * i;

// pad width and height into ^2 values
while (xLimit > (xSize *= 2));
while (yLimit > (ySize *= 2));
while (xLimit > (xSize *= 2)) {}
while (yLimit > (ySize *= 2)) {}

// Generate the empty texture buffer in VRAM
texPage = newPage(fileName, j, xSize, ySize, 0);
Expand Down

0 comments on commit c4ec4ff

Please sign in to comment.