Replace the semicolon trailing empty-bodied loops with opening and closing braces.

I believe this is the clearest way to indicate that an empty-bodied loop is intended, as opposed to the possibility of a mistaken semicolon.

This eliminates "warning: suggest a space before ‘;’ or explicit braces around empty body in ‘for’ statement" with GCC 4.2, which is important for old OS X versions.

git-svn-id: https://svn.eduke32.com/eduke32@5556 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-01-12 10:31:12 +00:00
parent c695e8e911
commit a35f3b13dc
7 changed files with 19 additions and 19 deletions

View File

@ -10747,7 +10747,7 @@ static void AlignWalls_(int32_t tilenum, int32_t z0, int32_t z1, int32_t doxpann
if (doxpanning) if (doxpanning)
wall[w1_pan].xpanning = (uint8_t)((wall[w0_pan].xpanning + (wall[w0_rep].xrepeat<<3))%tilesiz[tilenum].x); wall[w1_pan].xpanning = (uint8_t)((wall[w0_pan].xpanning + (wall[w0_rep].xrepeat<<3))%tilesiz[tilenum].x);
for (n=picsiz[tilenum]>>4; (1<<n)<tilesiz[tilenum].y; n++); for (n=picsiz[tilenum]>>4; (1<<n)<tilesiz[tilenum].y; n++) { }
wall[w1_rep].yrepeat = wall[w0_rep].yrepeat; wall[w1_rep].yrepeat = wall[w0_rep].yrepeat;
wall[w1_pan].ypanning = (uint8_t)(wall[w0_pan].ypanning + (((z1-z0)*wall[w0_rep].yrepeat)>>(n+3))); wall[w1_pan].ypanning = (uint8_t)(wall[w0_pan].ypanning + (((z1-z0)*wall[w0_rep].yrepeat)>>(n+3)));

View File

@ -411,7 +411,7 @@ int32_t addsearchpath_user(const char *p, int32_t user)
srch->path = (char *)Xmalloc(srch->pathlen + 1); srch->path = (char *)Xmalloc(srch->pathlen + 1);
Bstrcpy(srch->path, path); Bstrcpy(srch->path, path);
for (s=srch->path; *s; s++); for (s=srch->path; *s; s++) { }
s--; s--;
if (s<srch->path || toupperlookup[*s] != '/') if (s<srch->path || toupperlookup[*s] != '/')
@ -442,7 +442,7 @@ int32_t removesearchpath(const char *p)
if (path[Bstrlen(path)-1] == '\\') if (path[Bstrlen(path)-1] == '\\')
path[Bstrlen(path)-1] = 0; path[Bstrlen(path)-1] = 0;
for (s=path; *s; s++); for (s=path; *s; s++) { }
s--; s--;
if (s<path || toupperlookup[*s] != '/') if (s<path || toupperlookup[*s] != '/')
@ -555,7 +555,7 @@ int32_t findfrompath(const char *fn, char **where)
char const *cpfn; char const *cpfn;
for (cpfn = fn; toupperlookup[*cpfn] == '/'; cpfn++); for (cpfn = fn; toupperlookup[*cpfn] == '/'; cpfn++) { }
char *ffn = Xstrdup(cpfn); char *ffn = Xstrdup(cpfn);
Bcorrectfilename(ffn,0); // compress relative paths Bcorrectfilename(ffn,0); // compress relative paths
@ -1030,7 +1030,7 @@ static int32_t kopen_internal(const char *filename, char **lastpfn, char searchf
return newhandle; return newhandle;
} }
for (; toupperlookup[*filename] == '/'; filename++); for (; toupperlookup[*filename] == '/'; filename++) { }
#ifdef WITHKPLIB #ifdef WITHKPLIB
if (tryzip) if (tryzip)

View File

@ -3129,11 +3129,11 @@ static inline int32_t bunchfront(int32_t b1, int32_t b2)
if (x1b1 >= x1b2) if (x1b1 >= x1b2)
{ {
for (; xb2[b2f] < x1b1; b2f = bunchp2[b2f]); for (; xb2[b2f] < x1b1; b2f = bunchp2[b2f]) { }
return wallfront(b1f, b2f); return wallfront(b1f, b2f);
} }
for (; xb2[b1f] < x1b2; b1f = bunchp2[b1f]); for (; xb2[b1f] < x1b2; b1f = bunchp2[b1f]) { }
return wallfront(b1f, b2f); return wallfront(b1f, b2f);
} }

View File

@ -621,8 +621,8 @@ static int32_t daskinloader(int32_t filh, intptr_t *fptr, int32_t *bpl, int32_t
if (!glinfo.texnpot) if (!glinfo.texnpot)
{ {
for (xsiz=1; xsiz<tsizx; xsiz+=xsiz); for (xsiz=1; xsiz<tsizx; xsiz+=xsiz) { }
for (ysiz=1; ysiz<tsizy; ysiz+=ysiz); for (ysiz=1; ysiz<tsizy; ysiz+=ysiz) { }
} }
else else
{ {

View File

@ -798,8 +798,8 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das
if (!glinfo.texnpot) if (!glinfo.texnpot)
{ {
for (siz.x = 1; siz.x < tsiz.x; siz.x += siz.x); for (siz.x = 1; siz.x < tsiz.x; siz.x += siz.x) { }
for (siz.y = 1; siz.y < tsiz.y; siz.y += siz.y); for (siz.y = 1; siz.y < tsiz.y; siz.y += siz.y) { }
} }
else else
{ {
@ -1060,8 +1060,8 @@ int32_t gloadtile_hi(int32_t dapic,int32_t dapalnum, int32_t facen, hicreplctyp
if (!glinfo.texnpot) if (!glinfo.texnpot)
{ {
for (siz.x=1; siz.x<tsiz.x; siz.x+=siz.x); for (siz.x=1; siz.x<tsiz.x; siz.x+=siz.x) { }
for (siz.y=1; siz.y<tsiz.y; siz.y+=siz.y); for (siz.y=1; siz.y<tsiz.y; siz.y+=siz.y) { }
} }
else else
siz = tsiz; siz = tsiz;
@ -3396,11 +3396,11 @@ static int32_t polymost_bunchfront(const int32_t b1, const int32_t b2)
if (x1b1 >= x1b2) if (x1b1 >= x1b2)
{ {
for (; dxb2[b2f]<=x1b1; b2f=bunchp2[b2f]); for (; dxb2[b2f]<=x1b1; b2f=bunchp2[b2f]) { }
return wallfront(b1f, b2f); return wallfront(b1f, b2f);
} }
for (; dxb2[b1f]<=x1b2; b1f=bunchp2[b1f]); for (; dxb2[b1f]<=x1b2; b1f=bunchp2[b1f]) { }
return wallfront(b1f, b2f); return wallfront(b1f, b2f);
} }
@ -3513,7 +3513,7 @@ void polymost_scansector(int32_t sectnum)
for (int z=bunchfrst; z<numbunches; z++) for (int z=bunchfrst; z<numbunches; z++)
{ {
int zz; int zz;
for (zz=bunchfirst[z]; bunchp2[zz]>=0; zz=bunchp2[zz]); for (zz=bunchfirst[z]; bunchp2[zz]>=0; zz=bunchp2[zz]) { }
bunchlast[z] = zz; bunchlast[z] = zz;
} }
} }

View File

@ -192,7 +192,7 @@ int32_t scriptfile_getlinum(const scriptfile *sf, const char *ptr)
ind = ((intptr_t)ptr) - ((intptr_t)sf->textbuf); ind = ((intptr_t)ptr) - ((intptr_t)sf->textbuf);
for (stp=1; stp+stp<sf->linenum; stp+=stp); //stp = highest power of 2 less than sf->linenum for (stp=1; stp+stp<sf->linenum; stp+=stp) { } //stp = highest power of 2 less than sf->linenum
for (i=0; stp; stp>>=1) for (i=0; stp; stp>>=1)
if ((i+stp < sf->linenum) && (sf->lineoffs[i+stp] < ind)) i += stp; if ((i+stp < sf->linenum) && (sf->lineoffs[i+stp] < ind)) i += stp;
return(i+1); //i = index to highest lineoffs which is less than ind; convert to 1-based line numbers return(i+1); //i = index to highest lineoffs which is less than ind; convert to 1-based line numbers
@ -337,7 +337,7 @@ static char *getsymbtabspace(int32_t reqd)
if (symbtablength + reqd > symbtaballoclength) if (symbtablength + reqd > symbtaballoclength)
{ {
for (i=max(symbtaballoclength,SYMBTABSTARTSIZE); symbtablength+reqd>i; i<<=1); for (i=max(symbtaballoclength,SYMBTABSTARTSIZE); symbtablength+reqd>i; i<<=1) { }
np = (char *)Xrealloc(symbtab, i); np = (char *)Xrealloc(symbtab, i);
symbtab = np; symbtaballoclength = i; symbtab = np; symbtaballoclength = i;
} }

View File

@ -3741,7 +3741,7 @@ void C_Compile(const char *filenameortext, int32_t isfilename)
Bmemcpy(&cs, &cs_default, sizeof(compilerstate_t)); Bmemcpy(&cs, &cs_default, sizeof(compilerstate_t));
while (C_ParseCommand() == 0); while (C_ParseCommand() == 0) { }
// flushlogwindow = 1; // flushlogwindow = 1;