From d4577fccb52a64a1dbe5d6223a2aa11a8683d441 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 4 Mar 2012 20:15:22 +0000 Subject: [PATCH] Formatting; remove 'loop has empty body' warnings with clang. I have to admit, I like its grumbling. git-svn-id: https://svn.eduke32.com/eduke32@2416 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/cache1d.c | 22 +++++++++++++++++----- polymer/eduke32/build/src/mdsprite.c | 12 ++++++++++-- polymer/eduke32/build/src/polymost.c | 12 ++++++++++-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/build/src/cache1d.c b/polymer/eduke32/build/src/cache1d.c index 69d6af963..e85f5935b 100644 --- a/polymer/eduke32/build/src/cache1d.c +++ b/polymer/eduke32/build/src/cache1d.c @@ -303,18 +303,26 @@ int32_t addsearchpath(const char *p) if (!srch) return -1; srch->next = searchpathhead; - srch->pathlen = strlen(p)+1; + srch->pathlen = Bstrlen(p)+1; srch->path = (char *)Bmalloc(srch->pathlen + 1); if (!srch->path) { Bfree(srch); return -1; } - strcpy(srch->path, p); - for (s=srch->path; *s; s++) ; s--; if (spath || toupperlookup[*s] != '/') strcat(srch->path, "/"); + + Bstrcpy(srch->path, p); + for (s=srch->path; *s; s++) + { + /* do nothing */ + } + s--; + if (spath || toupperlookup[*s] != '/') + Bstrcat(srch->path, "/"); searchpathhead = srch; - if (srch->pathlen > maxsearchpathlen) maxsearchpathlen = srch->pathlen; + if (srch->pathlen > maxsearchpathlen) + maxsearchpathlen = srch->pathlen; Bcorrectfilename(srch->path,0); @@ -1061,7 +1069,11 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int32_t type) // scan for the end of the string and shift // everything left a char in the process - for (i=1; (buf[i-1]=buf[i]); i++) ; i-=2; + for (i=1; (buf[i-1]=buf[i]); i++) + { + /* do nothing */ + } + i-=2; // if there's a slash at the end, this is a directory entry if (toupperlookup[buf[i]] == '/') { ftype = CACHE1D_FIND_DIR; buf[i] = 0; } diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 0a0ace656..649153527 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -3021,7 +3021,11 @@ static int32_t loadkvx(const char *filnam) vbit = (int32_t *)Bmalloc(i); if (!vbit) { Bfree(xyoffs); kclose(fil); return(-1); } memset(vbit,0,i); - for (vcolhashsizm1=4096; vcolhashsizm1<(mip1leng>>1); vcolhashsizm1<<=1); vcolhashsizm1--; //approx to numvoxs! + for (vcolhashsizm1=4096; vcolhashsizm1<(mip1leng>>1); vcolhashsizm1<<=1) + { + /* do nothing */ + } + vcolhashsizm1--; //approx to numvoxs! vcolhashead = (int32_t *)Bmalloc((vcolhashsizm1+1)*sizeof(int32_t)); if (!vcolhashead) { Bfree(xyoffs); kclose(fil); return(-1); } memset(vcolhashead,-1,(vcolhashsizm1+1)*sizeof(int32_t)); @@ -3077,7 +3081,11 @@ static int32_t loadkv6(const char *filnam) vbit = (int32_t *)Bmalloc(i); if (!vbit) { Bfree(ylen); kclose(fil); return(-1); } memset(vbit,0,i); - for (vcolhashsizm1=4096; vcolhashsizm1