diff --git a/polymer/eduke32/build/include/pragmas_ppc.h b/polymer/eduke32/build/include/pragmas_ppc.h index 867622ea0..e8cd1f254 100644 --- a/polymer/eduke32/build/include/pragmas_ppc.h +++ b/polymer/eduke32/build/include/pragmas_ppc.h @@ -254,7 +254,7 @@ static inline int32_t krecipasm(int32_t i) // Ken did this float const f = (float const)i; i = *(int32_t const *)&f; - return((reciptable[(i>>12)&2047]>>(((i-0x3f800000)>>23)&31))^(i>>31)); + return ((reciptable[(i>>12)&2047]>>(((i-0x3f800000)>>23)&31))^(i>>31)); } #endif // pragmas_ppc_h_ diff --git a/polymer/eduke32/build/src/2d.c b/polymer/eduke32/build/src/2d.c index 76919c489..1d9bace1d 100644 --- a/polymer/eduke32/build/src/2d.c +++ b/polymer/eduke32/build/src/2d.c @@ -114,7 +114,7 @@ char getpixel(int32_t x, int32_t y) begindrawing(); //{{{ r = readpixel((void *) (ylookup[y]+x+frameplace)); enddrawing(); //}}} - return(r); + return r; } diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 456be429a..00c495442 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -919,7 +919,7 @@ CANCEL: // clearfilenames(); uninitengine(); - return(0); + return 0; } static int32_t mhk=0; @@ -1523,7 +1523,7 @@ char changechar(char dachar, int32_t dadir, char smooshyalign, char boundcheck) } } } - return(dachar); + return dachar; } @@ -8719,7 +8719,7 @@ static int32_t adjustmark(int32_t *xplc, int32_t *yplc, int16_t danumwalls) *xplc = dax; *yplc = day; - return(0); + return 0; } static int32_t checkautoinsert(int32_t dax, int32_t day, int16_t danumwalls) @@ -8954,7 +8954,7 @@ static int32_t deletesector(int16_t sucksect) if (wall[i].nextwall >= startwall) wall[i].nextsector--; - return(0); + return 0; } int32_t fixspritesectors(void) @@ -9045,7 +9045,7 @@ static int32_t movewalls(int32_t start, int32_t offs) yax_tweakwalls(start, offs); #endif - return(0); + return 0; } int32_t wallength(int16_t i) @@ -9177,7 +9177,7 @@ static int32_t numloopsofsector(int16_t sectnum) endwall = startwall + sector[sectnum].wallnum; for (i=startwall; ix)-spr->x) < t) && (klabs((vect->y)-spr->y) < t)); bad = -1; - k--; if (k <= 0) return(bad); + k--; if (k <= 0) return bad; updatesector(vect->x, vect->y, sectnum); } } @@ -1399,7 +1399,7 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum, bad2--; if (bad2 == 0) break; } while (clipinsidebox((vec2_t *)vect, i, walldist-4) != 0); bad = -1; - k--; if (k <= 0) return(bad); + k--; if (k <= 0) return bad; updatesector(vect->x, vect->y, sectnum); if (*sectnum < 0) return -1; } @@ -1416,5 +1416,5 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum, dir = -dir; } while (bad != 0); - return(bad); + return bad; } diff --git a/polymer/eduke32/build/src/common.c b/polymer/eduke32/build/src/common.c index bc5794e12..10634ee10 100644 --- a/polymer/eduke32/build/src/common.c +++ b/polymer/eduke32/build/src/common.c @@ -166,7 +166,7 @@ int32_t fnlist_getnames(fnlist_t *fnl, const char *dirname, const char *pattern, for (r=fnl->findfiles; r; r=r->next) fnl->numfiles++; - return(0); + return 0; } diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 89a1f687f..2d49e0fc6 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -419,7 +419,7 @@ static int32_t defsparser(scriptfile *script) initprintf("Error on line %s:%d.\n", script->filename,scriptfile_getlinum(script,cmdtokptr)); break; case T_EOF: - return(0); + return 0; case T_INCLUDE: { char *fn; diff --git a/polymer/eduke32/build/src/dxtfilter.c b/polymer/eduke32/build/src/dxtfilter.c index 748fd636a..5086dc232 100644 --- a/polymer/eduke32/build/src/dxtfilter.c +++ b/polymer/eduke32/build/src/dxtfilter.c @@ -50,7 +50,7 @@ static uint16_t dxt_hicosub(uint16_t c) g = ((c>> 5)&63); r = ((c>>11)-(g>>1))&31; b = ((c>> 0)-(g>>1))&31; - return((r<<11)+(g<<5)+b); + return ((r<<11)+(g<<5)+b); } static uint16_t dedxt_hicoadd(uint16_t c) @@ -59,7 +59,7 @@ static uint16_t dedxt_hicoadd(uint16_t c) g = ((c>> 5)&63); r = ((c>>11)+(g>>1))&31; b = ((c>> 0)+(g>>1))&31; - return((r<<11)+(g<<5)+b); + return ((r<<11)+(g<<5)+b); } #endif diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 73965e4e2..c8d63ab79 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -2132,9 +2132,9 @@ static int32_t spriteobstructswall(spritetype *s, int32_t w) // check if the sprite obstructs the wall if ((d1 < d2) && (min(x1, x2) <= x) && (x <= max(x1, x2)) && (min(y1, y2) <= y) && (y <= max(y1, y2))) - return (1); + return 1; else - return (0); + return 0; } #endif // @@ -2147,14 +2147,14 @@ static inline int32_t bunchfront(int32_t b1, int32_t b2) int const x2b2 = xb2[bunchlast[b2]] + 1; if (x1b1 >= x2b2) - return (-1); + return -1; int b2f = bunchfirst[b2]; int const x1b2 = xb1[b2f]; int const x2b1 = xb2[bunchlast[b1]] + 1; if (x1b2 >= x2b1) - return (-1); + return -1; if (x1b1 >= x1b2) { @@ -6145,7 +6145,7 @@ static int32_t clippoly(int32_t npoints, int32_t clipstat) while ((z < npoints) && (xb1[z] < 0)) z++; } while (z < npoints); - if (npoints2 <= 2) return(0); + if (npoints2 <= 2) return 0; for (z=1; zp1.x, wall->p2.x) <= point.x) && (point.x <= max(wall->p1.x, wall->p2.x)) && (min(wall->p1.y, wall->p2.y) <= point.y) && (point.y <= max(wall->p1.y, wall->p2.y))) - return (1); - return (0); + return 1; + return 0; } // returns 1 if wall2 is hidden by wall1 @@ -8173,21 +8173,21 @@ int32_t wallobstructswall(_maskleaf* wall1, _maskleaf* wall2) cross = intersection(wall2->p1eq, wall1->maskeq); if (pointonmask(cross, wall1)) - return (1); + return 1; cross = intersection(wall2->p2eq, wall1->maskeq); if (pointonmask(cross, wall1)) - return (1); + return 1; cross = intersection(wall1->p1eq, wall2->maskeq); if (pointonmask(cross, wall2)) - return (1); + return 1; cross = intersection(wall1->p2eq, wall2->maskeq); if (pointonmask(cross, wall2)) - return (1); + return 1; - return (0); + return 0; } // recursive mask drawing function @@ -9287,15 +9287,15 @@ int32_t loadoldboard(const char *filename, char fromwhere, vec3_t *dapos, int16_ struct spritetypev6 v6spr; if ((fil = kopen4load(filename,fromwhere)) == -1) - { mapversion = 5L; return(-1); } + { mapversion = 5L; return -1; } kread(fil,&mapversion,4); mapversion = B_LITTLE32(mapversion); - if (mapversion != 5L && mapversion != 6L) { kclose(fil); return(-2); } + if (mapversion != 5L && mapversion != 6L) { kclose(fil); return -2; } prepare_loadboard(fil, dapos, daang, dacursectnum); kread(fil,&numsectors,2); numsectors = B_LITTLE16(numsectors); - if (numsectors > MAXSECTORS) { kclose(fil); return(-1); } + if (numsectors > MAXSECTORS) { kclose(fil); return -1; } for (i=0; i MAXWALLS) { kclose(fil); return(-1); } + if (numwalls > MAXWALLS) { kclose(fil); return -1; } for (i=0; i MAXSPRITES) { kclose(fil); return(-1); } + if (numsprites > MAXSPRITES) { kclose(fil); return -1; } for (i=0; ix,newpos->y,&tempsectnum); if (tempsectnum < 0) - return(-1); + return -1; if (tempsectnum != sprite[spritenum].sectnum) changespritesect(spritenum,tempsectnum); - return(0); + return 0; } int32_t setspritez(int16_t spritenum, const vec3_t *newpos) @@ -10109,11 +10109,11 @@ int32_t setspritez(int16_t spritenum, const vec3_t *newpos) updatesectorz(newpos->x,newpos->y,newpos->z,&tempsectnum); if (tempsectnum < 0) - return(-1); + return -1; if (tempsectnum != sprite[spritenum].sectnum) changespritesect(spritenum,tempsectnum); - return(0); + return 0; } @@ -10902,7 +10902,7 @@ restart_grand: } #endif - return(0); + return 0; } diff --git a/polymer/eduke32/build/src/engine_priv.h b/polymer/eduke32/build/src/engine_priv.h index feddd703a..257ba1ed0 100644 --- a/polymer/eduke32/build/src/engine_priv.h +++ b/polymer/eduke32/build/src/engine_priv.h @@ -256,7 +256,7 @@ extern uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[409 { // Ken did this d = ((a<0)<<3) + ((b<0)<<2) + ((c<0)<<1) + (d<0); - return(((d<<4)^0xf0)|d); + return (((d<<4)^0xf0)|d); } inline int32_t getkensmessagecrc(int32_t b) @@ -352,7 +352,7 @@ FORCE_INLINE int32_t bad_tspr(const uspritetype *tspr) // FORCE_INLINE int32_t getpalookup(int32_t davis, int32_t dashade) { - return (min(max(dashade + (davis >> 8), 0), numshades - 1)); + return min(max(dashade + (davis >> 8), 0), numshades - 1); } FORCE_INLINE int32_t getpalookupsh(int32_t davis) { return getpalookup(davis, globalshade) << 8; } diff --git a/polymer/eduke32/build/src/jwzgles.c b/polymer/eduke32/build/src/jwzgles.c index a59f6f9ab..e71e66e0e 100644 --- a/polymer/eduke32/build/src/jwzgles.c +++ b/polymer/eduke32/build/src/jwzgles.c @@ -4052,7 +4052,7 @@ jwzgles_gluProject (GLdouble objx, GLdouble objy, GLdouble objz, in[3]=1.0; __gluMultMatrixVecd(modelMatrix, in, out); __gluMultMatrixVecd(projMatrix, out, in); - if (in[3] == 0.0) return(GL_FALSE); + if (in[3] == 0.0) return GL_FALSE; in[0] /= in[3]; in[1] /= in[3]; in[2] /= in[3]; @@ -4068,7 +4068,7 @@ jwzgles_gluProject (GLdouble objx, GLdouble objy, GLdouble objz, *winx=in[0]; *winy=in[1]; *winz=in[2]; - return(GL_TRUE); + return GL_TRUE; } diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index f79a8b1f6..d0ba460c4 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -46,13 +46,12 @@ credits. # if !defined __INTEL_COMPILER typedef long long __int64; # endif -static __inline int32_t _lrotl(int32_t i, int sh) -{ return((i>>(-sh))|(i<> (-sh)) | (i << sh); } /*__inline*/ int32_t filelength(int h) { struct stat st; - if (fstat(h,&st) < 0) return(-1); - return(st.st_size); + if (fstat(h,&st) < 0) return -1; + return st.st_size; } #define _fileno fileno #else @@ -206,7 +205,7 @@ static inline int32_t bitrev(int32_t b, int32_t c) { int32_t i, j; for (i=1,j=0,c=(1<>3]))>>(bitpos&7))&pow2mask[n]); } +static _inline int32_t peekbits(int32_t n) { return (B_LITTLE32(B_UNBUF32(&filptr[bitpos>>3]))>>(bitpos&7))&pow2mask[n]; } static _inline void suckbits(int32_t n) { bitpos += n; if (bitpos < 0) return; suckbitsnextblock(); } -static _inline int32_t getbits(int32_t n) { int32_t i = peekbits(n); suckbits(n); return(i); } +static _inline int32_t getbits(int32_t n) { int32_t i = peekbits(n); suckbits(n); return i; } static int32_t hufgetsym(int32_t *hitab, int32_t *hbmax) { @@ -259,7 +258,7 @@ static int32_t hufgetsym(int32_t *hitab, int32_t *hbmax) v = n = 0; do { v = (v<<1)+getbits(1)+hbmax[n]-hbmax[n+1]; n++; } while (v >= 0); - return(hitab[hbmax[n]+v]); + return hitab[hbmax[n]+v]; } //This did not result in a speed-up on P4-3.6Ghz (02/22/2005) @@ -269,7 +268,7 @@ static int32_t hufgetsym(int32_t *hitab, int32_t *hbmax) // // v = bitrev(getbits(n),n)+addit; // do { v = (v<<1)+getbits(1)+hbmax[n]-hbmax[n+1]; n++; } while (v >= 0); -// return(hitab[hbmax[n]+v]); +// return hitab[hbmax[n]+v]; //} static void qhufgencode(int32_t *hitab, int32_t *hbmax, int32_t *qhval, uint8_t *qhbit, int32_t numbits) @@ -312,7 +311,7 @@ static void qhufgencode(int32_t *hitab, int32_t *hbmax, int32_t *qhval, uint8_t // //hufgetsym_skipb related code: //for(k=n=0;n= 2) return(-1); //"Unsupported interlace type" + xsiz = B_BIG32(B_UNBUF32(&filptr[0])); if (xsiz <= 0) return -1; + ysiz = B_BIG32(B_UNBUF32(&filptr[4])); if (ysiz <= 0) return -1; + bitdepth = filptr[8]; if (!((1<= 2) return -1; //"Unsupported interlace type" intlac = filptr[12]*7; //0=no interlace/1=Adam7 interlace //Save code by making grayscale look like a palette color scheme @@ -880,7 +879,7 @@ static int32_t kpngrend(const char *kfilebuf, int32_t kfilength, } //Tests to see if xsiz > allocated space in olinbuf //Note: xsizbpl gets re-written inside initpass() - if ((xsizbpl+1)*sizeof(olinbuf[0]) > sizeof(olinbuf)) return(-1); + if ((xsizbpl+1)*sizeof(olinbuf[0]) > sizeof(olinbuf)) return -1; initpass(); @@ -893,7 +892,7 @@ static int32_t kpngrend(const char *kfilebuf, int32_t kfilength, { //Raw (uncompressed) suckbits((-bitpos)&7); //Synchronize to start of next byte - i = getbits(16); if ((getbits(16)^i) != 0xffff) return(-1); + i = getbits(16); if ((getbits(16)^i) != 0xffff) return -1; for (; i; i--) { if (slidew >= slider) @@ -990,7 +989,7 @@ kpngrend_goodret: else if ((filter1st == 1) && (!(filterest&~(1<<3)))) filtype = 3; else filtype = 5; if (kcoltype == 4) paleng = 0; //For /c4, palcol/paleng used as LUT for "*0x10101": alpha is invalid! - return(0); + return 0; } //============================= KPNGILIB ends ================================ @@ -1054,12 +1053,12 @@ static _inline int32_t mulshr32(int32_t a, int32_t d) static inline int32_t mulshr24(int32_t a, int32_t b) { - return((int32_t)((((__int64)a)*((__int64)b))>>24)); + return (int32_t)((((__int64)a)*((__int64)b))>>24); } static inline int32_t mulshr32(int32_t a, int32_t b) { - return((int32_t)((((__int64)a)*((__int64)b))>>32)); + return (int32_t)((((__int64)a)*((__int64)b))>>32); } #endif @@ -1297,7 +1296,7 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength, kfileend = &kfileptr[kfilength]; if (B_UNBUF16(kfileptr) == B_LITTLE16(0xd8ff)) kfileptr += 2; - else return(-1); //"%s is not a JPEG file\n",filename + else return -1; //"%s is not a JPEG file\n",filename restartinterval = 0; for (i=0; i<4; i++) lastdc[i] = 0; @@ -1404,9 +1403,9 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength, kfileptr += leng; break; case 0xda: - if ((xdim <= 0) || (ydim <= 0)) { Bfree(dctbuf); return(-1); } + if ((xdim <= 0) || (ydim <= 0)) { Bfree(dctbuf); return -1; } - lnumcomponents = (int32_t)(*kfileptr++); if (!lnumcomponents) { Bfree(dctbuf); return(-1); } + lnumcomponents = (int32_t)(*kfileptr++); if (!lnumcomponents) { Bfree(dctbuf); return -1; } if (lnumcomponents > 1) kcoltype = 2; for (z=0; z>3)+1); break; case 0xd9: break; default: kfileptr += leng; break; @@ -1613,7 +1612,7 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength, } while (kfileptr-(uint8_t const *)kfilebuf < kfilength); - if (!dctbuf) return(0); + if (!dctbuf) return 0; lnumcomponents = gnumcomponents; for (i=0; i= 12) || (!((1< 32)) return(-1); - if (header[17]&0xc0) return(-1); + if ((fleng < 19) || (header[1]&0xfe)) return -1; + if ((header[2] >= 12) || (!((1< 32)) return -1; + if (header[17]&0xc0) return -1; fptr = (uint8_t const *)&header[header[0]+18]; - xsiz = (int32_t)B_LITTLE16(B_UNBUF16(&header[12])); if (xsiz <= 0) return(-1); - ysiz = (int32_t)B_LITTLE16(B_UNBUF16(&header[14])); if (ysiz <= 0) return(-1); + xsiz = (int32_t)B_LITTLE16(B_UNBUF16(&header[12])); if (xsiz <= 0) return -1; + ysiz = (int32_t)B_LITTLE16(B_UNBUF16(&header[14])); if (ysiz <= 0) return -1; colbyte = ((((int32_t)header[16])+7)>>3); if (header[1] == 1) @@ -1889,7 +1888,7 @@ static int32_t ktgarend(const char *header, int32_t fleng, if (((uint32_t)x < (uint32_t)daxres) && ((uint32_t)y < (uint32_t)dayres)) B_BUF32((void *) (x*4+p), i); } - return(0); + return 0; } //============================== TARGA ends ================================= @@ -1923,7 +1922,7 @@ static int32_t kbmprend(const char *buf, int32_t fleng, headsiz = B_UNBUF32(&buf[14]); if (headsiz == (int32_t)B_LITTLE32(12)) //OS/2 1.x (old format) { - if (B_UNBUF16(&buf[22]) != B_LITTLE16(1)) return(-1); + if (B_UNBUF16(&buf[22]) != B_LITTLE16(1)) return -1; xsiz = (int32_t)B_LITTLE16(B_UNBUF16(&buf[18])); ysiz = (int32_t)B_LITTLE16(B_UNBUF16(&buf[20])); cdim = (int32_t)B_LITTLE16(B_UNBUF16(&buf[24])); @@ -1931,16 +1930,16 @@ static int32_t kbmprend(const char *buf, int32_t fleng, } else //All newer formats... { - if (B_UNBUF16(&buf[26]) != B_LITTLE16(1)) return(-1); + if (B_UNBUF16(&buf[26]) != B_LITTLE16(1)) return -1; xsiz = B_LITTLE32(B_UNBUF32(&buf[18])); ysiz = B_LITTLE32(B_UNBUF32(&buf[22])); cdim = (int32_t)B_LITTLE16(B_UNBUF16(&buf[28])); comp = B_LITTLE32(B_UNBUF32(&buf[30])); } - if ((xsiz <= 0) || (!ysiz)) return(-1); + if ((xsiz <= 0) || (!ysiz)) return -1; //cdim must be: (1,4,8,16,24,32) - if (((uint32_t)(cdim-1) >= (uint32_t)32) || (!((1<= (uint32_t)32) || (!((1<= daxres) || (x1 <= 0) || (y0 >= dayres) || (y1 <= 0)) return(0); + if ((x0 >= daxres) || (x1 <= 0) || (y0 >= dayres) || (y1 <= 0)) return 0; if (x0 < 0) x0 = 0; if (x1 > daxres) x1 = daxres; for (y=y0; y= (uint32_t)ydim) continue; Bmemcpy((void *)j,(void *)buf,xsiz); } - return(0); + return 0; } - if (!((B_UNBUF32(&buf[80]))&B_LITTLE32(4))) return(-1); //FOURCC invalid + if (!((B_UNBUF32(&buf[80]))&B_LITTLE32(4))) return -1; //FOURCC invalid dxt = buf[87]-'0'; - if ((buf[84] != 'D') || (buf[85] != 'X') || (buf[86] != 'T') || (dxt < 1) || (dxt > 5)) return(-1); + if ((buf[84] != 'D') || (buf[85] != 'X') || (buf[86] != 'T') || (dxt < 1) || (dxt > 5)) return -1; buf += 128; if (!(dxt&1)) @@ -2228,7 +2227,7 @@ static int32_t kddsrend(const char *buf, int32_t leng, } } } - return(0); + return 0; } #endif //=============================== DDS ends ================================== @@ -2333,28 +2332,28 @@ int32_t kprender(const char *buf, int32_t leng, intptr_t frameptr, int32_t bpl, paleng = 0; bakcol = 0; numhufblocks = zlibcompflags = 0; filtype = -1; if (B_UNBUF16(&ubuf[0]) == B_LITTLE16(0x5089)) //.PNG - return(kpngrend(buf,leng,frameptr,bpl,xdim,ydim)); + return kpngrend(buf,leng,frameptr,bpl,xdim,ydim); else if (B_UNBUF16(&ubuf[0]) == B_LITTLE16(0xd8ff)) //.JPG - return(kpegrend(buf,leng,frameptr,bpl,xdim,ydim)); + return kpegrend(buf,leng,frameptr,bpl,xdim,ydim); else { if ((ubuf[0] == 'G') && (ubuf[1] == 'I') && (ubuf[2] == 'F')) //.GIF - return(kgifrend(buf, leng, frameptr, bpl, xdim, ydim)); + return kgifrend(buf, leng, frameptr, bpl, xdim, ydim); else if ((ubuf[0] == 'B') && (ubuf[1] == 'M')) //.BMP - return(kbmprend(buf, leng, frameptr, bpl, xdim, ydim)); + return kbmprend(buf, leng, frameptr, bpl, xdim, ydim); else if (B_UNBUF32(ubuf) == B_LITTLE32(0x0801050a)) //.PCX - return(kpcxrend(buf, leng, frameptr, bpl, xdim, ydim)); + return kpcxrend(buf, leng, frameptr, bpl, xdim, ydim); #ifdef KPCEL else if ((ubuf[0] == 0x19) && (ubuf[1] == 0x91) && (ubuf[10] == 8) && (ubuf[11] == 0)) //old .CEL/.PIC - return(kcelrend(buf, leng, frameptr, bpl, xdim, ydim, xoff, yoff)); + return kcelrend(buf, leng, frameptr, bpl, xdim, ydim, xoff, yoff); #endif #ifdef KPDDS else if ((B_UNBUF32(ubuf) == B_LITTLE32(0x20534444)) && (B_UNBUF32(&ubuf[4]) == B_LITTLE32(124))) //.DDS - return(kddsrend(buf, leng, frameptr, bpl, xdim, ydim, xoff, yoff)); + return kddsrend(buf, leng, frameptr, bpl, xdim, ydim, xoff, yoff); #endif //Unreliable .TGA identification - this MUST be final case! else if (istarga(ubuf, leng)) - return(ktgarend(buf, leng, frameptr, bpl, xdim, ydim)); + return ktgarend(buf, leng, frameptr, bpl, xdim, ydim); else return -1; } } @@ -2427,17 +2426,17 @@ static int32_t kzcheckhashsiz(int32_t siz) if (!kzhashbuf) //Initialize hash table on first call { Bmemset(kzhashead,-1,sizeof(kzhashead)); - kzhashbuf = (char *)Bmalloc(KZHASHINITSIZE); if (!kzhashbuf) return(0); + kzhashbuf = (char *)Bmalloc(KZHASHINITSIZE); if (!kzhashbuf) return 0; kzhashpos = 0; kzlastfnam = -1; kzhashsiz = KZHASHINITSIZE; kzdirnamhead = -1; } if (kzhashpos+siz > kzhashsiz) //Make sure string fits in kzhashbuf { i = kzhashsiz; do { i <<= 1; } while (kzhashpos+siz > i); - kzhashbuf = (char *)Brealloc(kzhashbuf,i); if (!kzhashbuf) return(0); + kzhashbuf = (char *)Brealloc(kzhashbuf,i); if (!kzhashbuf) return 0; kzhashsiz = i; } - return(1); + return 1; } static int32_t kzcalchash(const char *st) @@ -2447,14 +2446,14 @@ static int32_t kzcalchash(const char *st) for (i=0,hashind=0; st[i]; i++) hashind = toupperlookup[st[i]]-((hashind<<1)+hashind); - return(hashind%ARRAY_SIZE(kzhashead)); + return hashind%ARRAY_SIZE(kzhashead); } static int32_t kzcheckhash(const char *filnam, char **zipnam, int32_t *fileoffs, int32_t *fileleng, char *iscomp) { int32_t i; - if (!kzhashbuf) return(0); + if (!kzhashbuf) return 0; if (filnam[0] == '|') filnam++; for (i=kzhashead[kzcalchash(filnam)]; i>=0; i=(B_UNBUF32(&kzhashbuf[i]))) if (!filnamcmp(filnam,&kzhashbuf[i+21])) @@ -2463,9 +2462,9 @@ static int32_t kzcheckhash(const char *filnam, char **zipnam, int32_t *fileoffs, (*fileoffs) = B_UNBUF32(&kzhashbuf[i+12]); (*fileleng) = B_UNBUF32(&kzhashbuf[i+16]); (*iscomp) = kzhashbuf[i+20]; - return(1); + return 1; } - return(0); + return 0; } void kzuninit() @@ -2486,16 +2485,16 @@ int32_t kzaddstack(const char *filnam) if (!fil) //if file not found, assume it's a directory { //Add directory name to internal list (using kzhashbuf for convenience of dynamic allocation) - i = strlen(filnam)+5; if (!kzcheckhashsiz(i)) return(-1); + i = strlen(filnam)+5; if (!kzcheckhashsiz(i)) return -1; B_BUF32(&kzhashbuf[kzhashpos], kzdirnamhead); kzdirnamhead = kzhashpos; strcpy(&kzhashbuf[kzhashpos+4],filnam); kzhashpos += i; - return(-1); + return -1; } //Write ZIP/GRP filename to hash - i = strlen(filnam)+1; if (!kzcheckhashsiz(i)) { fclose(fil); return(-1); } + i = strlen(filnam)+1; if (!kzcheckhashsiz(i)) { fclose(fil); return -1; } strcpy(&kzhashbuf[kzhashpos],filnam); zipnamoffs = kzhashpos; kzhashpos += i; @@ -2521,20 +2520,20 @@ int32_t kzaddstack(const char *filnam) fseek(fil,B_LITTLE32(B_UNBUF32(&tempbuf[14])) + B_LITTLE16(B_UNBUF16(&tempbuf[24])) + B_LITTLE16(B_UNBUF16(&tempbuf[22])),SEEK_CUR); numfiles++; } - if (numfiles < 0) { fclose(fil); return(-1); } + if (numfiles < 0) { fclose(fil); return -1; } fseek(fil,-4,SEEK_CUR); } for (i=0; i 2GB-32K bytes gslidew = 0x7fffffff; //Force reload at beginning - return((intptr_t)kzfs.fil); - default: fclose(kzfs.fil); kzfs.fil = 0; return(0); + return (intptr_t)kzfs.fil; + default: fclose(kzfs.fil); kzfs.fil = 0; return 0; } } } @@ -2674,11 +2673,11 @@ intptr_t kzopen(const char *filnam) kzfs.leng = filelength(_fileno(kzfs.fil)); kzfs.pos = 0; kzfs.i = 0; - return((intptr_t)kzfs.fil); + return (intptr_t)kzfs.fil; } } - return(0); + return 0; } // -------------------------------------------------------------------------- @@ -2722,7 +2721,7 @@ int32_t kzfindfile(char *filnam) filnam[0] = 0; if (srchstat == 0) { - if (!newildst[0]) { srchstat = -1; return(0); } + if (!newildst[0]) { srchstat = -1; return 0; } do { srchstat = 1; @@ -2738,7 +2737,7 @@ int32_t kzfindfile(char *filnam) #if defined(_WIN32) hfind = FindFirstFile(newildst,&findata); if (hfind == INVALID_HANDLE_VALUE) - { if (!kzhashbuf) return(0); srchstat = 2; continue; } + { if (!kzhashbuf) return 0; srchstat = 2; continue; } if (findata.dwFileAttributes&FILE_ATTRIBUTE_HIDDEN) continue; i = wildstpathleng; if (findata.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) @@ -2759,7 +2758,7 @@ int32_t kzfindfile(char *filnam) } break; // process srchstat == 1 #endif - return(1); + return 1; } while (0); } @@ -2770,7 +2769,7 @@ int32_t kzfindfile(char *filnam) Bmemcpy(filnam,newildst,wildstpathleng); #if defined(_WIN32) if (!FindNextFile(hfind,&findata)) - { FindClose(hfind); hfind = INVALID_HANDLE_VALUE; if (!kzhashbuf) return(0); srchstat = 2; break; } + { FindClose(hfind); hfind = INVALID_HANDLE_VALUE; if (!kzhashbuf) return 0; srchstat = 2; break; } if (findata.dwFileAttributes&FILE_ATTRIBUTE_HIDDEN) continue; i = wildstpathleng; if (findata.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) @@ -2790,7 +2789,7 @@ int32_t kzfindfile(char *filnam) strcpy(&filnam[i],findata->d_name); if (findata->d_type == DT_DIR) strcat(&filnam[i],"/"); #endif - return(1); + return 1; } } while (srchstat == 2) @@ -2801,7 +2800,7 @@ int32_t kzfindfile(char *filnam) //strcpy(filnam,&kzhashbuf[srchzoff+21]); filnam[0] = '|'; strcpy(&filnam[1],&kzhashbuf[srchzoff+21]); srchzoff = B_UNBUF32(&kzhashbuf[srchzoff+4]); - return(1); + return 1; } srchzoff = B_UNBUF32(&kzhashbuf[srchzoff+4]); } @@ -2821,7 +2820,7 @@ int32_t kzfindfile(char *filnam) srchstat = 0; goto kzfindfile_beg; } - return(0); + return 0; } //File searching code (supports inside ZIP files!) How to use this code: @@ -2850,7 +2849,7 @@ int32_t kzread(void *buffer, int32_t leng) { int32_t i, j, k, bfinal, btype, hlit, hdist; - if ((!kzfs.fil) || (leng <= 0)) return(0); + if ((!kzfs.fil) || (leng <= 0)) return 0; if (kzfs.comptyp == 0) { @@ -2867,7 +2866,7 @@ int32_t kzread(void *buffer, int32_t leng) //Initialize for putbuf4zip gzbufptr = (char *)buffer; gzbufptr = &gzbufptr[-kzfs.pos]; kzfs.endpos = min(kzfs.pos+leng,kzfs.leng); - if (kzfs.endpos == kzfs.pos) return(0); //Guard against reading 0 length + if (kzfs.endpos == kzfs.pos) return 0; //Guard against reading 0 length if (kzfs.pos < gslidew-32768) // Must go back to start :( { @@ -2943,7 +2942,7 @@ int32_t kzread(void *buffer, int32_t leng) { //Raw (uncompressed) suckbits((-bitpos)&7); //Synchronize to start of next byte - i = getbits(16); if ((getbits(16)^i) != 0xffff) return(-1); + i = getbits(16); if ((getbits(16)^i) != 0xffff) return -1; for (; i; i--) { if (gslidew >= gslider) @@ -3043,14 +3042,14 @@ int32_t kzread(void *buffer, int32_t leng) retkzread:; i = kzfs.pos; kzfs.pos += leng; if (kzfs.pos > kzfs.leng) kzfs.pos = kzfs.leng; - return(kzfs.pos-i); + return kzfs.pos-i; } //WARNING: kzseek(<-32768,SEEK_CUR); or: // kzseek(0,SEEK_END); can make next kzread very slow!!! int32_t kzseek(int32_t offset, int32_t whence) { - if (!kzfs.fil) return(-1); + if (!kzfs.fil) return -1; switch (whence) { case SEEK_CUR: kzfs.pos += offset; break; @@ -3059,7 +3058,7 @@ int32_t kzseek(int32_t offset, int32_t whence) } if (kzfs.pos < 0) kzfs.pos = 0; if (kzfs.pos > kzfs.leng) kzfs.pos = kzfs.leng; - return(kzfs.pos); + return kzfs.pos; } //====================== ZIP decompression code ends ========================= diff --git a/polymer/eduke32/build/src/lz4.c b/polymer/eduke32/build/src/lz4.c index 08cf6b5cd..5e2e01e50 100644 --- a/polymer/eduke32/build/src/lz4.c +++ b/polymer/eduke32/build/src/lz4.c @@ -948,7 +948,7 @@ void LZ4_resetStream (LZ4_stream_t* LZ4_stream) int LZ4_freeStream (LZ4_stream_t* LZ4_stream) { FREEMEM(LZ4_stream); - return (0); + return 0; } diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index e3b2d4a7f..19995c81f 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -261,9 +261,9 @@ int32_t md_loadmodel(const char *fn) models = ml; nummodelsalloced += MODELALLOCGROUP; } - vm = mdload(fn); if (!vm) return(-1); + vm = mdload(fn); if (!vm) return -1; models[nextmodelid++] = vm; - return(nextmodelid-1); + return nextmodelid-1; } int32_t md_setmisc(int32_t modelid, float scale, int32_t shadeoff, float zadd, float yoffset, int32_t flags) @@ -308,7 +308,7 @@ static int32_t framename2index(mdmodel_t *vm, const char *nam) } break; } - return(i); + return i; } int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, int32_t skinnum, float smoothduration, int32_t pal) @@ -318,9 +318,9 @@ int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, if (!mdinited) mdinit(); - if ((uint32_t)modelid >= (uint32_t)nextmodelid) return(-1); - if ((uint32_t)tilenume >= (uint32_t)MAXTILES) return(-2); - if (!framename) return(-3); + if ((uint32_t)modelid >= (uint32_t)nextmodelid) return -1; + if ((uint32_t)tilenume >= (uint32_t)MAXTILES) return -2; + if (!framename) return -3; tilenume=addtileP(modelid,tilenume,pal); m = (md2model_t *)models[modelid]; @@ -332,7 +332,7 @@ int32_t md_defineframe(int32_t modelid, const char *framename, int32_t tilenume, } i = framename2index((mdmodel_t *)m,framename); - if (i == m->numframes) return(-3); // frame name invalid + if (i == m->numframes) return -3; // frame name invalid tile2model[tilenume].modelid = modelid; tile2model[tilenume].framenum = i; @@ -350,7 +350,7 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char * if (!mdinited) mdinit(); - if ((uint32_t)modelid >= (uint32_t)nextmodelid) return(-1); + if ((uint32_t)modelid >= (uint32_t)nextmodelid) return -1; Bmemset(&ma, 0, sizeof(ma)); m = (md2model_t *)models[modelid]; @@ -376,7 +376,7 @@ int32_t md_defineanimation(int32_t modelid, const char *framestart, const char * map->next = m->animations; m->animations = map; - return(0); + return 0; } #if 0 @@ -638,7 +638,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) if (!sk) { if (pal >= (MAXPALOOKUPS - RESERVEDPALS)) - return (0); + return 0; if (skzero) { @@ -1000,7 +1000,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf) OSD_Printf("Load skin: p%d-e%d \"%s\"... %d ms\n", pal, hicfxmask(pal), fn, etime); } - return(*texidx); + return (*texidx); } //Note: even though it says md2model, it works for both md2model&md3model @@ -1223,7 +1223,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) head.ofseof = B_LITTLE32(head.ofseof); #endif - if ((head.id != IDP2_MAGIC) || (head.vers != 8)) { Bfree(m); return(0); } //"IDP2" + if ((head.id != IDP2_MAGIC) || (head.vers != 8)) { Bfree(m); return 0; } //"IDP2" ournumskins = head.numskins ? head.numskins : 1; ournumglcmds = head.numglcmds ? head.numglcmds : 1; @@ -1241,22 +1241,22 @@ static md2model_t *md2load(int32_t fil, const char *filnam) klseek(fil,head.ofsframes,SEEK_SET); if (kread(fil,(char *)m->frames,m->numframes*m->framebytes) != m->numframes*m->framebytes) - { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return 0; } if (m->numglcmds > 0) { klseek(fil,head.ofsglcmds,SEEK_SET); if (kread(fil,(char *)m->glcmds,m->numglcmds*sizeof(int32_t)) != (int32_t)(m->numglcmds*sizeof(int32_t))) - { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return 0; } } klseek(fil,head.ofstris,SEEK_SET); if (kread(fil,(char *)m->tris,head.numtris*sizeof(md2tri_t)) != (int32_t)(head.numtris*sizeof(md2tri_t))) - { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return 0; } klseek(fil,head.ofsuv,SEEK_SET); if (kread(fil,(char *)m->uv,head.numuv*sizeof(md2uv_t)) != (int32_t)(head.numuv*sizeof(md2uv_t))) - { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + { Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return 0; } #if B_BIG_ENDIAN != 0 { @@ -1306,7 +1306,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) { klseek(fil,head.ofsskins,SEEK_SET); if (kread(fil,m->skinfn,64*m->numskins) != 64*m->numskins) - { Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return(0); } + { Bfree(m->glcmds); Bfree(m->frames); Bfree(m); return 0; } } m->texid = (GLuint *)Xcalloc(ournumskins, sizeof(GLuint) * (HICEFFECTMASK+1)); @@ -1314,7 +1314,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) maxmodelverts = max(maxmodelverts, m->numverts); maxmodeltris = max(maxmodeltris, head.numtris); - //return(m); + //return m; // the MD2 is now loaded internally - let's begin the MD3 conversion process //OSD_Printf("Beginning md3 conversion.\n"); @@ -1437,7 +1437,7 @@ static md2model_t *md2load(int32_t fil, const char *filnam) // die MD2 ! DIE ! Bfree(m->texid); Bfree(m->skinfn); Bfree(m->basepath); Bfree(m->uv); Bfree(m->tris); Bfree(m->glcmds); Bfree(m->frames); Bfree(m); - return((md2model_t *)m3); + return ((md2model_t *)m3); } //---------------------------------------- MD2 LIBRARY ENDS ---------------------------------------- @@ -1501,7 +1501,7 @@ static md3model_t *md3load(int32_t fil) m->head.eof = B_LITTLE32(m->head.eof); #endif - if ((m->head.id != IDP3_MAGIC) && (m->head.vers != 15)) { Bfree(m); return(0); } //"IDP3" + if ((m->head.id != IDP3_MAGIC) && (m->head.vers != 15)) { Bfree(m); return 0; } //"IDP3" m->numskins = m->head.numskins; //<- dead code? m->numframes = m->head.numframes; @@ -1623,7 +1623,7 @@ static md3model_t *md3load(int32_t fil) m->vbos = NULL; - return(m); + return m; } #ifdef POLYMER diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 397fe00a0..5f5078757 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -769,7 +769,7 @@ int32_t polymer_init(void) { OSD_Printf("PR : Your video card driver/combo doesn't support the necessary features!\n"); OSD_Printf("PR : Disabling Polymer...\n"); - return (0); + return 0; } // clean up existing stuff since it will be initialized again if we're re-entering here @@ -782,7 +782,7 @@ int32_t polymer_init(void) if (prtess == 0) { OSD_Printf("PR : Tessellation object initialization failed!\n"); - return (0); + return 0; } polymer_loadboard(); @@ -860,7 +860,7 @@ int32_t polymer_init(void) if (pr_verbosity >= 1) OSD_Printf("PR : Initialization complete in %d ms.\n", getticks()-t); - return (1); + return 1; } void polymer_uninit(void) @@ -1627,23 +1627,23 @@ int16_t polymer_addlight(_prlight* light) int32_t lighti; if (lightcount >= PR_MAXLIGHTS || light->priority > pr_maxlightpriority || !pr_lighting) - return (-1); + return -1; if ((light->sector == -1) || (light->sector >= numsectors)) - return (-1); + return -1; lighti = 0; while ((lighti < PR_MAXLIGHTS) && (prlights[lighti].flags.active)) lighti++; if (lighti == PR_MAXLIGHTS) - return (-1); + return -1; #if 0 // Spot lights disabled on ATI cards because they cause crashes with // Catalyst 12.8 drivers. // See: http://forums.duke4.net/topic/5723-hrp-polymer-crash/ if (pr_ati_fboworkaround && light->radius) - return (-1); + return -1; #endif Bmemcpy(&prlights[lighti], light, sizeof(_prlight)); @@ -1680,7 +1680,7 @@ int16_t polymer_addlight(_prlight* light) lightcount++; - return (lighti); + return lighti; } void polymer_deletelight(int16_t lighti) @@ -2575,7 +2575,7 @@ static int32_t polymer_initsector(int16_t sectnum) if (pr_verbosity >= 2) OSD_Printf("PR : Initialized sector %i.\n", sectnum); - return (1); + return 1; } static int32_t polymer_updatesector(int16_t sectnum) @@ -2602,7 +2602,7 @@ static int32_t polymer_updatesector(int16_t sectnum) if (s == NULL) { if (pr_verbosity >= 1) OSD_Printf("PR : Can't update uninitialized sector %i.\n", sectnum); - return (-1); + return -1; } needfloor = wallinvalidate = 0; @@ -2875,7 +2875,7 @@ finish: if (pr_verbosity >= 3) OSD_Printf("PR : Updated sector %i.\n", sectnum); - return (0); + return 0; } void PR_CALLBACK polymer_tesserror(GLenum error) @@ -2923,7 +2923,7 @@ static int32_t polymer_buildfloor(int16_t sectnum) sec = (usectortype *)§or[sectnum]; if (s == NULL) - return (-1); + return -1; if (s->floor.indices == NULL) { @@ -2968,7 +2968,7 @@ static int32_t polymer_buildfloor(int16_t sectnum) if (pr_verbosity >= 2) OSD_Printf("PR : Tesselated floor of sector %i.\n", sectnum); - return (1); + return 1; } static void polymer_drawsector(int16_t sectnum, int32_t domasks) @@ -3091,7 +3091,7 @@ static int32_t polymer_initwall(int16_t wallnum) if (pr_verbosity >= 2) OSD_Printf("PR : Initialized wall %i.\n", wallnum); - return (1); + return 1; } // TODO: r_npotwallmode. Needs polymost_is_npotmode() handling among others. @@ -5471,7 +5471,7 @@ static int32_t polymer_bindmaterial(const _prmaterial *material, int16_t* l bglActiveTextureARB(GL_TEXTURE0_ARB); - return (programbits); + return programbits; } static void polymer_unbindmaterial(int32_t programbits) diff --git a/polymer/eduke32/build/src/screenshot.c b/polymer/eduke32/build/src/screenshot.c index 3d12fc2bb..0ff4736b1 100644 --- a/polymer/eduke32/build/src/screenshot.c +++ b/polymer/eduke32/build/src/screenshot.c @@ -293,7 +293,7 @@ static int32_t screencapture_tga(const char *filename, char inverseit) OSD_Printf("Saved screenshot to %s\n", fn); Bfree(fn); capturecount++; - return(0); + return 0; } # endif diff --git a/polymer/eduke32/build/src/scriptfile.c b/polymer/eduke32/build/src/scriptfile.c index a28370cef..ebdc2b8a1 100644 --- a/polymer/eduke32/build/src/scriptfile.c +++ b/polymer/eduke32/build/src/scriptfile.c @@ -35,9 +35,9 @@ int32_t scriptfile_getstring(scriptfile *sf, char **retst) if (*retst == NULL) { initprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr)); - return(-2); + return -2; } - return(0); + return 0; } int32_t scriptfile_getnumber(scriptfile *sf, int32_t *num) @@ -172,7 +172,7 @@ int32_t scriptfile_getbraces(scriptfile *sf, char **braceend) bracestart = ++sf->textptr; bracecnt = 1; while (1) { - if (sf->textptr >= sf->eof) return(0); + if (sf->textptr >= sf->eof) return 0; if (sf->textptr[0] == '{') bracecnt++; if (sf->textptr[0] == '}') { bracecnt--; if (!bracecnt) break; } sf->textptr++; @@ -188,14 +188,14 @@ int32_t scriptfile_getlinum(const scriptfile *sf, const char *ptr) int32_t i, stp; intptr_t ind; - //for(i=0;ilinenum;i++) if (sf->lineoffs[i] >= ind) return(i+1); //brute force algo + //for(i=0;ilinenum;i++) if (sf->lineoffs[i] >= ind) return i+1; //brute force algo ind = ((intptr_t)ptr) - ((intptr_t)sf->textbuf); for (stp=1; stp+stplinenum; stp+=stp) { } //stp = highest power of 2 less than sf->linenum for (i=0; stp; stp>>=1) 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 } void scriptfile_preparse(scriptfile *sf, char *tx, int32_t flen) diff --git a/polymer/eduke32/build/src/texcache.c b/polymer/eduke32/build/src/texcache.c index 4a4b4d1e7..8dd92d910 100644 --- a/polymer/eduke32/build/src/texcache.c +++ b/polymer/eduke32/build/src/texcache.c @@ -56,7 +56,7 @@ static pthtyp *texcache_tryart(int32_t const dapicnum, int32_t const dapalnum, i pth->palnum = dapalnum; } - return(pth); + return pth; } pth = (pthtyp *)Xcalloc(1,sizeof(pthtyp)); @@ -67,7 +67,7 @@ static pthtyp *texcache_tryart(int32_t const dapicnum, int32_t const dapalnum, i pth->next = texcache.list[j]; texcache.list[j] = pth; - return(pth); + return pth; } pthtyp *texcache_fetchmulti(pthtyp *pth, hicreplctyp *si, int32_t dapicnum, int32_t dameth) diff --git a/polymer/eduke32/build/src/voxmodel.c b/polymer/eduke32/build/src/voxmodel.c index 958cb5dce..f21965f8d 100644 --- a/polymer/eduke32/build/src/voxmodel.c +++ b/polymer/eduke32/build/src/voxmodel.c @@ -135,7 +135,7 @@ static int32_t isrectfree(int32_t x0, int32_t y0, int32_t dx, int32_t dy) int32_t i, j, x; i = y0*gvox->mytexx + x0; for (dy=0; dy; dy--, i+=gvox->mytexx) - for (x=0; x>5]&(1<>5]&(1<>5); dx += x0-1; @@ -167,7 +167,7 @@ static int32_t isrectfree(int32_t x0, int32_t y0, int32_t dx, int32_t dy) } } #endif - return(1); + return 1; } static void setrect(int32_t x0, int32_t y0, int32_t dx, int32_t dy) @@ -581,7 +581,7 @@ skindidntfit: Bfree(shp); Bfree(zbit); Bfree(bx0); - return(gvox); + return gvox; } static void alloc_vcolhashead(void) @@ -785,7 +785,7 @@ static int32_t loadkv6(const char *filnam) if (B_LITTLE32(i) != 0x6c78764b) { kclose(fil); - return(-1); + return -1; } //Kvxl kread(fil, &voxsiz, sizeof(vec3_t)); diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index f3ccc3e70..37f4a32cb 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -1818,7 +1818,7 @@ static HRESULT WINAPI getvalidmodes_enum(DDSURFACEDESC *ddsd, VOID *udata) ADDMODE(ddsd->dwWidth, ddsd->dwHeight, ddsd->ddpfPixelFormat.dwRGBBitCount, 1,-1); } - return(DDENUMRET_OK); + return DDENUMRET_OK; } static int sortmodes(const void *a_, const void *b_) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index c69653459..05e4df0d2 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -725,7 +725,7 @@ const char *ExtGetSectorCaption(int16_t sectnum) else Bsprintf(tempbuf,"%hu %s", TrackerCast(sector[sectnum].lotag), lo); } - return(tempbuf); + return tempbuf; } const char *ExtGetWallCaption(int16_t wallnum) @@ -738,13 +738,13 @@ const char *ExtGetWallCaption(int16_t wallnum) { Bsprintf(tempbuf,"%d", wallength(wallnum)); wall[wallnum].cstat &= ~(1<<14); - return(tempbuf); + return tempbuf; } if (!(onnames==2 || onnames==4)) { tempbuf[0] = 0; - return(tempbuf); + return tempbuf; } // HERE @@ -777,7 +777,7 @@ const char *ExtGetWallCaption(int16_t wallnum) } } - return(tempbuf); + return tempbuf; } //end const char *SectorEffectorTagText(int32_t lotag) @@ -843,7 +843,7 @@ const char *SectorEffectorTagText(int32_t lotag) break; } - return (tempbuf); + return tempbuf; } const char *MusicAndSFXTagText(int32_t lotag) @@ -880,7 +880,7 @@ const char *SectorEffectorText(int32_t spritenum) else Bstrcpy(tempbuf, lo); } - return (tempbuf); + return tempbuf; } const char *ExtGetSpriteCaption(int16_t spritenum) @@ -9302,7 +9302,7 @@ static int32_t parsegroupfiles(scriptfile *script) } break; case T_EOF: - return(0); + return 0; default: break; } @@ -9610,7 +9610,7 @@ int32_t parsetilegroups(scriptfile *script) break; } case T_EOF: - return(0); + return 0; default: break; } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 2a9d49b19..974824677 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -5391,7 +5391,7 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload) } break; case T_EOF: - return(0); + return 0; default: break; } diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index da1352b1f..be663ad16 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -493,14 +493,14 @@ int32_t G_GetAngleDelta(int32_t a,int32_t na) if (klabs(a-na) < 1024) { // OSD_Printf("G_GetAngleDelta() returning %d\n",na-a); - return (na-a); + return na-a; } if (na > 1024) na -= 2048; if (a > 1024) a -= 2048; // OSD_Printf("G_GetAngleDelta() returning %d\n",na-a); - return (na-a); + return na-a; } GAMEEXEC_STATIC void VM_AlterAng(int32_t movflags) diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 393bb7f67..cd939ea2d 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -261,9 +261,9 @@ int32_t Gv_ReadSave(int32_t fil, int32_t newbehav) AddLog("Done Dumping..."); } # endif - return(0); + return 0; corrupt: - return(1); + return 1; } void Gv_WriteSave(FILE *fil, int32_t newbehav) diff --git a/polymer/eduke32/source/jmact/control.c b/polymer/eduke32/source/jmact/control.c index 5247a3cbd..fed6bf362 100644 --- a/polymer/eduke32/source/jmact/control.c +++ b/polymer/eduke32/source/jmact/control.c @@ -163,7 +163,7 @@ int32_t CONTROL_KeyboardFunctionPressed(int32_t which) if (CONTROL_KeyMapping[which].key2 != KEYUNDEFINED && !KeyBindings[CONTROL_KeyMapping[which].key2].cmdstr) key2 = KB_KeyDown[ CONTROL_KeyMapping[which].key2 ] ? TRUE : FALSE; - return (key1 | key2); + return key1 | key2; } void CONTROL_ClearKeyboardFunction(int32_t which) diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index c22187542..5f35d1a05 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -193,14 +193,14 @@ static int32_t G_GetAngleDelta(int32_t a,int32_t na) if (klabs(a-na) < 1024) { // OSD_Printf("G_GetAngleDelta() returning %d\n",na-a); - return (na-a); + return na-a; } if (na > 1024) na -= 2048; if (a > 1024) a -= 2048; // OSD_Printf("G_GetAngleDelta() returning %d\n",na-a); - return (na-a); + return na-a; } static inline void __fastcall VM_DoConditional(register int32_t condition) diff --git a/polymer/eduke32/source/midi.c b/polymer/eduke32/source/midi.c index 06a5f00fa..95ba85feb 100644 --- a/polymer/eduke32/source/midi.c +++ b/polymer/eduke32/source/midi.c @@ -136,7 +136,7 @@ static int32_t _MIDI_ReadNumber value += *FromPtr++; } - return(value); + return value; } @@ -168,7 +168,7 @@ static int32_t _MIDI_ReadDelta while (c & 0x80); } - return(value); + return value; } @@ -707,23 +707,23 @@ static int32_t _MIDI_SendControlChange c1, c2); if (status == MIDI_DONT_PLAY) { - return(MIDI_Ok); + return MIDI_Ok; } } if (_MIDI_Funcs == NULL) { - return(MIDI_Error); + return MIDI_Error; } if (_MIDI_Funcs->ControlChange == NULL) { - return(MIDI_Error); + return MIDI_Error; } _MIDI_Funcs->ControlChange(channel, c1, c2); - return(MIDI_Ok); + return MIDI_Ok; } @@ -769,7 +769,7 @@ int32_t MIDI_AllNotesOff _MIDI_SendControlChange(channel, 0x78, 0); } - return(MIDI_Ok); + return MIDI_Ok; } @@ -933,7 +933,7 @@ int32_t MIDI_Reset Reset = TRUE; - return(MIDI_Ok); + return MIDI_Ok; } @@ -953,7 +953,7 @@ int32_t MIDI_SetVolume if (_MIDI_Funcs == NULL) { - return(MIDI_NullMidiModule); + return MIDI_NullMidiModule; } volume = min(MIDI_MaxVolume, volume); @@ -978,7 +978,7 @@ int32_t MIDI_SetVolume _MIDI_SendChannelVolumes(); } - return(MIDI_Ok); + return MIDI_Ok; } @@ -998,7 +998,7 @@ int32_t MIDI_GetVolume if (_MIDI_Funcs == NULL) { - return(MIDI_NullMidiModule); + return MIDI_NullMidiModule; } if (_MIDI_Funcs->GetVolume) @@ -1010,7 +1010,7 @@ int32_t MIDI_GetVolume volume = _MIDI_TotalVolume; } - return(volume); + return volume; } @@ -1118,7 +1118,7 @@ int32_t MIDI_SongPlaying ) { - return(_MIDI_SongActive); + return _MIDI_SongActive; } @@ -1209,12 +1209,12 @@ int32_t MIDI_PlaySong if (_MIDI_Funcs == NULL) { - return(MIDI_NullMidiModule); + return MIDI_NullMidiModule; } if (B_UNBUF32(song) != MIDI_HEADER_SIGNATURE) { - return(MIDI_InvalidMidiFile); + return MIDI_InvalidMidiFile; } song += 4; @@ -1232,14 +1232,14 @@ int32_t MIDI_PlaySong if (format > MAX_FORMAT) { - return(MIDI_UnknownMidiFormat); + return MIDI_UnknownMidiFormat; } ptr = song + headersize; if (_MIDI_NumTracks == 0) { - return(MIDI_NoTracks); + return MIDI_NoTracks; } _MIDI_TrackMemSize = _MIDI_NumTracks * sizeof(track); @@ -1255,7 +1255,7 @@ int32_t MIDI_PlaySong _MIDI_TrackMemSize = 0; - return(MIDI_InvalidTrack); + return MIDI_InvalidTrack; } tracklength = _MIDI_ReadNumber(ptr + 4, 4); @@ -1295,7 +1295,7 @@ int32_t MIDI_PlaySong while (_MPU_BuffersWaiting < 4) _MIDI_ServiceRoutine(); MPU_BeginPlayback(); - return(MIDI_Ok); + return MIDI_Ok; } @@ -1337,7 +1337,7 @@ int32_t MIDI_GetTempo ) { - return(MIDI_Tempo); + return MIDI_Tempo; } @@ -1487,7 +1487,7 @@ static int32_t _MIDI_ProcessNextTick _MIDI_AdvanceTick(); - return(TimeSet); + return TimeSet; } diff --git a/polymer/eduke32/source/mpu401.c b/polymer/eduke32/source/mpu401.c index d62e1978f..a7b677449 100644 --- a/polymer/eduke32/source/mpu401.c +++ b/polymer/eduke32/source/mpu401.c @@ -257,7 +257,7 @@ int32_t MPU_Reset midiStreamStop(hmido); midiStreamClose(hmido); - return(MPU_Ok); + return MPU_Ok; } @@ -281,9 +281,9 @@ int32_t MPU_Init if (midiOutGetDevCaps(mididevice, &midicaps, sizeof(MIDIOUTCAPS)) != MMSYSERR_NOERROR) return MPU_Error; - if (midiStreamOpen(&hmido,(LPUINT)&mididevice,1,(DWORD_PTR)MPU_MIDICallback,0L,CALLBACK_FUNCTION) != MMSYSERR_NOERROR) return(MPU_Error); + if (midiStreamOpen(&hmido,(LPUINT)&mididevice,1,(DWORD_PTR)MPU_MIDICallback,0L,CALLBACK_FUNCTION) != MMSYSERR_NOERROR) return MPU_Error; - return(MPU_Ok); + return MPU_Ok; } diff --git a/polymer/eduke32/source/music.c b/polymer/eduke32/source/music.c index 57a305561..f981aec38 100644 --- a/polymer/eduke32/source/music.c +++ b/polymer/eduke32/source/music.c @@ -119,7 +119,7 @@ const char *MUSIC_ErrorString break; } - return(ErrorString); + return ErrorString; } @@ -148,7 +148,7 @@ int32_t MUSIC_Init status = MUSIC_InitMidi(SoundCard, &MUSIC_MidiFunctions, Address); - return(status); + return status; } @@ -172,7 +172,7 @@ int32_t MUSIC_Shutdown //MPU_Reset(); - return(status); + return status; } @@ -244,9 +244,9 @@ int32_t MUSIC_GetVolume { if (MUSIC_SoundDevice == -1) { - return(0); + return 0; } - return(MIDI_GetVolume()); + return MIDI_GetVolume(); } @@ -279,7 +279,7 @@ int32_t MUSIC_SongPlaying ) { - return(MIDI_SongPlaying()); + return MIDI_SongPlaying(); } @@ -330,7 +330,7 @@ int32_t MUSIC_StopSong MUSIC_StopFade(); MIDI_StopSong(); MUSIC_SetErrorCode(MUSIC_Ok); - return(MUSIC_Ok); + return MUSIC_Ok; } @@ -355,11 +355,11 @@ int32_t MUSIC_PlaySong if (status != MIDI_Ok) { MUSIC_SetErrorCode(MUSIC_MidiError); - return(MUSIC_Warning); + return MUSIC_Warning; } } - return(MUSIC_Ok); + return MUSIC_Ok; } @@ -501,7 +501,7 @@ int32_t MUSIC_InitMidi MIDI_SetMidiFuncs(Funcs); - return(MIDI_Ok); + return MIDI_Ok; } @@ -521,7 +521,7 @@ int32_t MUSIC_FadeVolume { UNREFERENCED_PARAMETER(milliseconds); MIDI_SetVolume(tovolume); - return(MUSIC_Ok); + return MUSIC_Ok; } @@ -537,7 +537,7 @@ int32_t MUSIC_FadeActive ) { - return(0); + return 0; } diff --git a/polymer/eduke32/source/sbar.c b/polymer/eduke32/source/sbar.c index 5be1e8079..8111ef6e7 100644 --- a/polymer/eduke32/source/sbar.c +++ b/polymer/eduke32/source/sbar.c @@ -496,17 +496,17 @@ static int32_t G_GetInvAmount(const DukePlayer_t *p) case ICON_FIRSTAID: return p->inv_amount[GET_FIRSTAID]; case ICON_STEROIDS: - return ((p->inv_amount[GET_STEROIDS]+3)>>2); + return (p->inv_amount[GET_STEROIDS]+3)>>2; case ICON_HOLODUKE: - return ((p->inv_amount[GET_HOLODUKE]+15)/24); + return (p->inv_amount[GET_HOLODUKE]+15)/24; case ICON_JETPACK: - return ((p->inv_amount[GET_JETPACK]+15)>>4); + return (p->inv_amount[GET_JETPACK]+15)>>4; case ICON_HEATS: return p->inv_amount[GET_HEATS]/12; case ICON_SCUBA: - return ((p->inv_amount[GET_SCUBA]+63)>>6); + return (p->inv_amount[GET_SCUBA]+63)>>6; case ICON_BOOTS: - return (p->inv_amount[GET_BOOTS]>>1); + return p->inv_amount[GET_BOOTS]>>1; } return -1; @@ -1112,7 +1112,6 @@ void G_DrawBackground(void) rotatesprite(x<<16, y<<16, 65536L, 0, dapicnum, 8, 0, 8+16+64, 0, y2, x2, ydim-1); rotatesprite((xdim-x)<<16, y<<16, 65536L, 0, dapicnum, 8, 0, 8+16+64, xdim-x2-1, y2, xdim-1, ydim-1); } - } if (ud.screen_size > 8) diff --git a/polymer/eduke32/source/sdlmusic.c b/polymer/eduke32/source/sdlmusic.c index faa66fc30..358edc053 100644 --- a/polymer/eduke32/source/sdlmusic.c +++ b/polymer/eduke32/source/sdlmusic.c @@ -84,50 +84,50 @@ const char *MUSIC_ErrorString(int32_t ErrorNumber) switch (ErrorNumber) { case MUSIC_Warning: - return(warningMessage); + return warningMessage; case MUSIC_Error: - return(errorMessage); + return errorMessage; case MUSIC_Ok: - return("OK; no error."); + return "OK; no error."; case MUSIC_ASSVersion: - return("Incorrect sound library version."); + return "Incorrect sound library version."; case MUSIC_SoundCardError: - return("General sound card error."); + return "General sound card error."; case MUSIC_InvalidCard: - return("Invalid sound card."); + return "Invalid sound card."; case MUSIC_MidiError: - return("MIDI error."); + return "MIDI error."; case MUSIC_MPU401Error: - return("MPU401 error."); + return "MPU401 error."; case MUSIC_TaskManError: - return("Task Manager error."); + return "Task Manager error."; //case MUSIC_FMNotDetected: - // return("FM not detected error."); + // return "FM not detected error."; case MUSIC_DPMI_Error: - return("DPMI error."); + return "DPMI error."; default: - return("Unknown error."); + return "Unknown error."; } // switch - return(NULL); + return NULL; } // MUSIC_ErrorString int32_t MUSIC_Init(int32_t SoundCard, int32_t Address) { #ifdef __ANDROID__ music_initialized = 1; - return(MUSIC_Ok); + return MUSIC_Ok; #endif // Use an external MIDI player if the user has specified to do so char *command = getenv("EDUKE32_MUSIC_CMD"); @@ -139,14 +139,14 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address) if (music_initialized) { setErrorMessage("Music system is already initialized."); - return(MUSIC_Error); + return MUSIC_Error; } // if if (SDL_VERSIONNUM(linked->major,linked->minor,linked->patch) < MIX_REQUIREDVERSION) { // reject running with SDL_Mixer versions older than what is stated in sdl_inc.h initprintf("You need at least v%d.%d.%d of SDL_mixer for music\n",SDL_MIXER_MIN_X,SDL_MIXER_MIN_Y,SDL_MIXER_MIN_Z); - return(MUSIC_Error); + return MUSIC_Error; } external_midi = (command != NULL && command[0] != 0); @@ -232,7 +232,7 @@ int32_t MUSIC_Init(int32_t SoundCard, int32_t Address) # endif #endif music_initialized = 1; - return(MUSIC_Ok); + return MUSIC_Ok; fallback: initprintf("Error setting music command, falling back to timidity.\n"); @@ -253,7 +253,7 @@ fallback: initprintf("Error: couldn't open any of the following files:\n"); for (i = ARRAY_SIZE(s)-1; i>=0; i--) initprintf("%s\n",s[i]); - return(MUSIC_Error); + return MUSIC_Error; } continue; } @@ -263,7 +263,7 @@ fallback: } music_initialized = 1; - return(MUSIC_Ok); + return MUSIC_Ok; } // MUSIC_Init @@ -280,7 +280,7 @@ int32_t MUSIC_Shutdown(void) music_initialized = 0; music_loopflag = MUSIC_PlayOnce; - return(MUSIC_Ok); + return MUSIC_Ok; } // MUSIC_Shutdown @@ -313,7 +313,7 @@ void MUSIC_ResetMidiChannelVolumes(void) int32_t MUSIC_GetVolume(void) { - return(Mix_VolumeMusic(-1) << 1); // convert 0-128 to 0-255. + return (Mix_VolumeMusic(-1) << 1); // convert 0-128 to 0-255. } // MUSIC_GetVolume @@ -325,7 +325,7 @@ void MUSIC_SetLoopFlag(int32_t loopflag) int32_t MUSIC_SongPlaying(void) { - return((Mix_PlayingMusic()) ? TRUE : FALSE); + return ((Mix_PlayingMusic()) ? TRUE : FALSE); } // MUSIC_SongPlaying @@ -378,7 +378,7 @@ int32_t MUSIC_StopSong(void) external_midi_pid = -1; } - return(MUSIC_Ok); + return MUSIC_Ok; } #endif @@ -386,7 +386,7 @@ int32_t MUSIC_StopSong(void) if (!Mix_QuerySpec(NULL, NULL, NULL)) { setErrorMessage("Need FX system initialized, too. Sorry."); - return(MUSIC_Error); + return MUSIC_Error; } // if if ((Mix_PlayingMusic()) || (Mix_PausedMusic())) @@ -397,7 +397,7 @@ int32_t MUSIC_StopSong(void) music_musicchunk = NULL; - return(MUSIC_Ok); + return MUSIC_Ok; } // MUSIC_StopSong #if defined FORK_EXEC_MIDI @@ -513,7 +513,7 @@ void MUSIC_SetContext(int32_t context) int32_t MUSIC_GetContext(void) { - return(music_context); + return music_context; } // MUSIC_GetContext @@ -553,13 +553,13 @@ int32_t MUSIC_FadeVolume(int32_t tovolume, int32_t milliseconds) { UNREFERENCED_PARAMETER(tovolume); Mix_FadeOutMusic(milliseconds); - return(MUSIC_Ok); + return MUSIC_Ok; } // MUSIC_FadeVolume int32_t MUSIC_FadeActive(void) { - return((Mix_FadingMusic() == MIX_FADING_OUT) ? TRUE : FALSE); + return ((Mix_FadingMusic() == MIX_FADING_OUT) ? TRUE : FALSE); } // MUSIC_FadeActive diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index c621a850b..e0dffafc8 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -112,7 +112,7 @@ int32_t G_CheckActivatorMotion(int32_t lotag) for (j = g_animateCount-1; j >= 0; j--) if (s->sectnum == animatesect[j]) - return(1); + return 1; j = headspritestat[STAT_EFFECTOR]; while (j >= 0) @@ -123,14 +123,14 @@ int32_t G_CheckActivatorMotion(int32_t lotag) case SE_11_SWINGING_DOOR: case SE_30_TWO_WAY_TRAIN: if (actor[j].t_data[4]) - return(1); + return 1; break; case SE_20_STRETCH_BRIDGE: case SE_31_FLOOR_RISE_FALL: case SE_32_CEILING_RISE_FALL: case SE_18_INCREMENTAL_SECTOR_RISE_FALL: if (actor[j].t_data[0]) - return(1); + return 1; break; } @@ -139,7 +139,7 @@ int32_t G_CheckActivatorMotion(int32_t lotag) } i = nextspritestat[i]; } - return(0); + return 0; } int32_t CheckDoorTile(int32_t dapic) diff --git a/polymer/eduke32/source/sounds_mapster32.c b/polymer/eduke32/source/sounds_mapster32.c index 166a396e6..36823d5e8 100644 --- a/polymer/eduke32/source/sounds_mapster32.c +++ b/polymer/eduke32/source/sounds_mapster32.c @@ -276,7 +276,7 @@ int32_t S_PlaySound3D(int32_t num, int32_t i, const vec3_t *pos) g_sounds[num].num++; } else g_sounds[num].lock--; - return (voice); + return voice; } void S_PlaySound(int32_t num) @@ -501,7 +501,7 @@ int32_t S_CheckSoundPlaying(int32_t i, int32_t num) return 1; return 0; } - return(g_sounds[num].num); + return g_sounds[num].num; } int32_t S_SoundsPlaying(int32_t i) diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index 44f938563..622261b84 100644 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -84,7 +84,7 @@ static inline int32_t getfilenames(char const *path) { clearfilenames(); finddirs = klistpath(path,"*",CACHE1D_FIND_DIR); - return(0); + return 0; } #define POPULATE_VIDEO 1 diff --git a/polymer/eduke32/source/winbits.c b/polymer/eduke32/source/winbits.c index a36a17a5a..8e04f29f0 100644 --- a/polymer/eduke32/source/winbits.c +++ b/polymer/eduke32/source/winbits.c @@ -54,7 +54,7 @@ int32_t G_GetVersionFromWebsite(char *buffer) if (WSAStartup(0x101,&ws) == SOCKET_ERROR) { // initprintf("update: Winsock error in G_GetVersionFromWebsite() (%d)\n",errno); - return(0); + return 0; } wsainitialized = 1; } @@ -63,7 +63,7 @@ int32_t G_GetVersionFromWebsite(char *buffer) if ((h=gethostbyname(host)) == NULL) { // initprintf("update: gethostbyname() error in G_GetVersionFromWebsite() (%d)\n",h_errno); - return(0); + return 0; } dest_addr.sin_addr.s_addr = ((struct in_addr *)(h->h_addr))->s_addr; @@ -78,20 +78,20 @@ int32_t G_GetVersionFromWebsite(char *buffer) if (mysock == INVALID_SOCKET) { // initprintf("update: socket() error in G_GetVersionFromWebsite() (%d)\n",errno); - return(0); + return 0; } initprintf("Connecting to http://%s\n",host); if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR) { // initprintf("update: connect() error in G_GetVersionFromWebsite() (%d)\n",errno); - return(0); + return 0; } bytes_sent = send(mysock, req, strlen(req), 0); if (bytes_sent == SOCKET_ERROR) { // initprintf("update: send() error in G_GetVersionFromWebsite() (%d)\n",errno); - return(0); + return 0; } // initprintf("sent %d bytes\n",bytes_sent); @@ -135,9 +135,9 @@ int32_t G_GetVersionFromWebsite(char *buffer) if (j) { strcpy(buffer,ver); - return(1); + return 1; } } - return(0); + return 0; } #endif